mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-11-18 18:20:35 +03:00
Fix C-style casts
This commit is contained in:
@@ -155,6 +155,7 @@ bytecode_ptr<HWLM> hwlmBuild(const HWLMProto &proto, const CompileContext &cc,
|
||||
auto h = make_zeroed_bytecode_ptr<HWLM>(hwlm_len, 64);
|
||||
|
||||
h->type = proto.engType;
|
||||
// cppcheck-suppress cstyleCast
|
||||
memcpy(HWLM_DATA(h.get()), eng.get(), engSize);
|
||||
|
||||
return h;
|
||||
@@ -218,10 +219,12 @@ size_t hwlmSize(const HWLM *h) {
|
||||
|
||||
switch (h->type) {
|
||||
case HWLM_ENGINE_NOOD:
|
||||
engSize = noodSize((const noodTable *)HWLM_C_DATA(h));
|
||||
// cppcheck-suppress cstyleCast
|
||||
engSize = noodSize(reinterpret_cast<const noodTable *>(HWLM_C_DATA(h)));
|
||||
break;
|
||||
case HWLM_ENGINE_FDR:
|
||||
engSize = fdrSize((const FDR *)HWLM_C_DATA(h));
|
||||
// cppcheck-suppress cstyleCast
|
||||
engSize = fdrSize(reinterpret_cast<const FDR *>(HWLM_C_DATA(h)));
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ u64a make_u64a_mask(const vector<u8> &v) {
|
||||
|
||||
u64a mask = 0;
|
||||
size_t len = v.size();
|
||||
unsigned char *m = (unsigned char *)&mask;
|
||||
u8 *m = reinterpret_cast<u8 *>(&mask);
|
||||
DEBUG_PRINTF("making mask len %zu\n", len);
|
||||
memcpy(m, &v[0], len);
|
||||
return mask;
|
||||
|
||||
Reference in New Issue
Block a user