static really_inline
const void *hs_get_bytecode(const struct hs_database *db) {
+ // cppcheck-suppress cstyleCast
return ((const char *)db + db->bytecode);
}
static really_inline
const u32 *getConfirmLitIndex(const struct FDRConfirm *fdrc) {
+ // cppcheck-suppress cstyleCast
const u8 *base = (const u8 *)fdrc;
- const u32 *litIndex =
- (const u32 *)(base + ROUNDUP_N(sizeof(*fdrc), alignof(u32)));
+ // cppcheck-suppress cstyleCast
+ const u32 *litIndex =(const u32 *)(base + ROUNDUP_N(sizeof(*fdrc), alignof(u32)));
assert(ISALIGNED(litIndex));
return litIndex;
}
static really_inline
const struct gough_info *get_gough(const struct mcclellan *m) {
assert(m->haig_offset);
+ // cppcheck-suppress cstyleCast
const char *n = (const char *)m - sizeof(struct NFA);
return (const struct gough_info *)(n + m->haig_offset);
}
if (!g->top_prog_offset) {
return NULL;
}
+ // cppcheck-suppress cstyleCast
const char *n = (const char *)m - sizeof(struct NFA);
return (const u32 *)(n + g->top_prog_offset);
}
static really_inline
const struct mpv_puffette *get_puff_array(const struct mpv *m,
const struct mpv_kilopuff *kp) {
+ // cppcheck-suppress cstyleCast
return (const struct mpv_puffette *)((const char *)m + kp->puffette_offset);
}
static really_inline
const struct mpv_counter_info *get_counter_info(const struct mpv *m) {
+ // cppcheck-suppress cstyleCast
return (const struct mpv_counter_info *)((const char *)(m + 1)
+ m->kilo_count * sizeof(struct mpv_kilopuff));
}
}
void write_bytes(RoseEngine *engine) {
+ // cppcheck-suppress cstyleCast
copy_bytes((char *)engine + base_offset, blob);
}
if (!t->amatcherOffset) {
return NULL;
}
-
+ // cppcheck-suppress cstyleCast
const char *lt = (const char *)t + t->amatcherOffset;
assert(ISALIGNED_CL(lt));
+ // cppcheck-suppress cstyleCast
return (const struct anchored_matcher_info *)lt;
}
if (!t->fmatcherOffset) {
return NULL;
}
-
+ // cppcheck-suppress cstyleCast
const char *lt = (const char *)t + t->fmatcherOffset;
assert(ISALIGNED_CL(lt));
+ // cppcheck-suppress cstyleCast
return (const struct HWLM *)lt;
}
if (!t->sbmatcherOffset) {
return NULL;
}
-
+ // cppcheck-suppress cstyleCast
const char *matcher = (const char *)t + t->sbmatcherOffset;
assert(ISALIGNED_N(matcher, 8));
return matcher;
static really_inline
const struct LeftNfaInfo *getLeftTable(const struct RoseEngine *t) {
- const struct LeftNfaInfo *r
- = (const struct LeftNfaInfo *)((const char *)t + t->leftOffset);
+ // cppcheck-suppress cstyleCast
+ const struct LeftNfaInfo *r = (const struct LeftNfaInfo *)((const char *)t + t->leftOffset);
assert(ISALIGNED_N(r, 4));
return r;
}
static really_inline
const struct mmbit_sparse_iter *getActiveLeftIter(const struct RoseEngine *t) {
assert(t->activeLeftIterOffset);
- const struct mmbit_sparse_iter *it = (const struct mmbit_sparse_iter *)
- ((const char *)t + t->activeLeftIterOffset);
+ // cppcheck-suppress cstyleCast
+ const struct mmbit_sparse_iter *it = (const struct mmbit_sparse_iter *)((const char *)t + t->activeLeftIterOffset);
assert(ISALIGNED_N(it, 4));
return it;
}
static really_inline
const struct NfaInfo *getNfaInfoByQueue(const struct RoseEngine *t, u32 qi) {
- const struct NfaInfo *infos
- = (const struct NfaInfo *)((const char *)t + t->nfaInfoOffset);
+ // cppcheck-suppress cstyleCast
+ const struct NfaInfo *infos= (const struct NfaInfo *)((const char *)t + t->nfaInfoOffset);
assert(ISALIGNED_N(infos, sizeof(u32)));
return &infos[qi];
static really_inline
const struct NFA *getNfaByInfo(const struct RoseEngine *t,
const struct NfaInfo *info) {
+ // cppcheck-suppress cstyleCast
return (const struct NFA *)((const char *)t + info->nfaOffset);
}
if (!t->smallWriteOffset) {
return NULL;
}
-
- const struct SmallWriteEngine *smwr =
- (const struct SmallWriteEngine *)((const char *)t + t->smallWriteOffset);
+ // cppcheck-suppress cstyleCast
+ const struct SmallWriteEngine *smwr =(const struct SmallWriteEngine *)((const char *)t + t->smallWriteOffset);
return smwr;
}
static really_inline
const struct NFA *getSmwrNfa(const struct SmallWriteEngine *smwr) {
assert(smwr);
- const struct NFA *n
- = (const struct NFA *)((const char *)smwr + sizeof(*smwr));
+ // cppcheck-suppress cstyleCast
+ const struct NFA *n= (const struct NFA *)((const char *)smwr + sizeof(*smwr));
assert(ISALIGNED_CL(n));
return n;
}
// aligned load
static really_inline m256 load256(const void *ptr) {
assert(ISALIGNED_N(ptr, alignof(m256)));
+ // cppcheck-suppress cstyleCast
m256 rv = { load128(ptr), load128((const char *)ptr + 16) };
return rv;
}
static really_inline void store256(void *ptr, m256 a) {
assert(ISALIGNED_N(ptr, alignof(m256)));
ptr = vectorscan_assume_aligned(ptr, 16);
+ // cppcheck-suppress cstyleCast
*(m256 *)ptr = a;
}
// unaligned load
static really_inline m256 loadu256(const void *ptr) {
+ // cppcheck-suppress cstyleCast
m256 rv = { loadu128(ptr), loadu128((const char *)ptr + 16) };
return rv;
}
// unaligned store
static really_inline void storeu256(void *ptr, m256 a) {
storeu128(ptr, a.lo);
+ // cppcheck-suppress cstyleCast
storeu128((char *)ptr + 16, a.hi);
}
// aligned load
static really_inline m384 load384(const void *ptr) {
assert(ISALIGNED_16(ptr));
- m384 rv = { load128(ptr), load128((const char *)ptr + 16),
- load128((const char *)ptr + 32) };
+ // cppcheck-suppress cstyleCast
+ m384 rv = { load128(ptr), load128((const char *)ptr + 16),load128((const char *)ptr + 32) };
return rv;
}
static really_inline void store384(void *ptr, m384 a) {
assert(ISALIGNED_16(ptr));
ptr = vectorscan_assume_aligned(ptr, 16);
+ // cppcheck-suppress cstyleCast
*(m384 *)ptr = a;
}
// unaligned load
static really_inline m384 loadu384(const void *ptr) {
- m384 rv = { loadu128(ptr), loadu128((const char *)ptr + 16),
- loadu128((const char *)ptr + 32)};
+ // cppcheck-suppress cstyleCast
+ m384 rv = { loadu128(ptr), loadu128((const char *)ptr + 16),loadu128((const char *)ptr + 32)};
return rv;
}
static really_inline
m512 load512(const void *ptr) {
assert(ISALIGNED_N(ptr, alignof(m256)));
+ // cppcheck-suppress cstyleCast
m512 rv = { load256(ptr), load256((const char *)ptr + 32) };
return rv;
}
static really_inline
void store512(void *ptr, m512 a) {
assert(ISALIGNED_N(ptr, alignof(m512)));
+ // cppcheck-suppress cstyleCast
m512 *x = (m512 *)ptr;
store256(&x->lo, a.lo);
store256(&x->hi, a.hi);
// unaligned load
static really_inline
m512 loadu512(const void *ptr) {
+ // cppcheck-suppress cstyleCast
m512 rv = { loadu256(ptr), loadu256((const char *)ptr + 32) };
return rv;
}
static really_inline m128 load128(const void *ptr) {
assert(ISALIGNED_N(ptr, alignof(m128)));
ptr = vectorscan_assume_aligned(ptr, 16);
+ // cppcheck-suppress cstyleCast
return _mm_load_si128((const m128 *)ptr);
}
static really_inline void store128(void *ptr, m128 a) {
assert(ISALIGNED_N(ptr, alignof(m128)));
ptr = vectorscan_assume_aligned(ptr, 16);
+ // cppcheck-suppress cstyleCast
*(m128 *)ptr = a;
}
// unaligned load
static really_inline m128 loadu128(const void *ptr) {
+ // cppcheck-suppress cstyleCast
return _mm_loadu_si128((const m128 *)ptr);
}
// unaligned store
static really_inline void storeu128(void *ptr, m128 a) {
+ // cppcheck-suppress cstyleCast
_mm_storeu_si128 ((m128 *)ptr, a);
}
break;
case 3:
unaligned_store_u16(ptr, (u16)value);
+ // cppcheck-suppress cstyleCast
*((u8 *)ptr + 2) = (u8)(value >> 16);
break;
case 2:
unaligned_store_u16(ptr, (u16)value);
break;
case 1:
+ // cppcheck-suppress cstyleCast
*(u8 *)ptr = (u8)value;
break;
case 0:
return value;
case 3:
value = unaligned_load_u16(ptr);
+ // cppcheck-suppress cstyleCast
value |= ((u32)(*((const u8 *)ptr + 2)) << 16);
return value;
case 2:
value = unaligned_load_u16(ptr);
return value;
case 1:
+ // cppcheck-suppress cstyleCast
value = *(const u8 *)ptr;
return value;
case 0:
break;
case 7:
unaligned_store_u32(ptr, (u32)value);
+ // cppcheck-suppress cstyleCast
unaligned_store_u16((u8 *)ptr + 4, (u16)(value >> 32));
+ // cppcheck-suppress cstyleCast
*((u8 *)ptr + 6) = (u8)(value >> 48);
break;
case 6:
unaligned_store_u32(ptr, (u32)value);
+ // cppcheck-suppress cstyleCast
unaligned_store_u16((u8 *)ptr + 4, (u16)(value >> 32));
break;
case 5:
unaligned_store_u32(ptr, (u32)value);
+ // cppcheck-suppress cstyleCast
*((u8 *)ptr + 4) = (u8)(value >> 32);
break;
case 4:
break;
case 3:
unaligned_store_u16(ptr, (u16)value);
+ // cppcheck-suppress cstyleCast
*((u8 *)ptr + 2) = (u8)(value >> 16);
break;
case 2:
unaligned_store_u16(ptr, (u16)value);
break;
case 1:
+ // cppcheck-suppress cstyleCast
*(u8 *)ptr = (u8)value;
break;
case 0:
return value;
case 7:
value = unaligned_load_u32(ptr);
+ // cppcheck-suppress cstyleCast
value |= (u64a)unaligned_load_u16((const u8 *)ptr + 4) << 32;
+ // cppcheck-suppress cstyleCast
value |= (u64a)(*((const u8 *)ptr + 6)) << 48;
return value;
case 6:
value = unaligned_load_u32(ptr);
+ // cppcheck-suppress cstyleCast
value |= (u64a)unaligned_load_u16((const u8 *)ptr + 4) << 32;
return value;
case 5:
value = unaligned_load_u32(ptr);
+ // cppcheck-suppress cstyleCast
value |= (u64a)(*((const u8 *)ptr + 4)) << 32;
return value;
case 4:
return value;
case 3:
value = unaligned_load_u16(ptr);
+ // cppcheck-suppress cstyleCast
value |= (u64a)(*((const u8 *)ptr + 2)) << 16;
return value;
case 2:
value = unaligned_load_u16(ptr);
return value;
case 1:
+ // cppcheck-suppress cstyleCast
value = *(const u8 *)ptr;
return value;
case 0:
static really_inline
u16 unaligned_load_u16(const void *ptr) {
struct unaligned { u16 u; } PACKED__MAY_ALIAS;
+ // cppcheck-suppress cstyleCast
const struct unaligned *uptr = (const struct unaligned *)ptr;
return uptr->u;
}
static really_inline
u32 unaligned_load_u32(const void *ptr) {
struct unaligned { u32 u; } PACKED__MAY_ALIAS;
+ // cppcheck-suppress cstyleCast
const struct unaligned *uptr = (const struct unaligned *)ptr;
return uptr->u;
}
static really_inline
u64a unaligned_load_u64a(const void *ptr) {
struct unaligned { u64a u; } PACKED__MAY_ALIAS;
+ // cppcheck-suppress cstyleCast
const struct unaligned *uptr = (const struct unaligned *)ptr;
return uptr->u;
}
static really_inline
void unaligned_store_u16(void *ptr, u16 val) {
struct unaligned { u16 u; } PACKED__MAY_ALIAS;
+ // cppcheck-suppress cstyleCast
struct unaligned *uptr = (struct unaligned *)ptr;
uptr->u = val;
}
static really_inline
void unaligned_store_u32(void *ptr, u32 val) {
struct unaligned { u32 u; } PACKED__MAY_ALIAS;
+ // cppcheck-suppress cstyleCast
struct unaligned *uptr = (struct unaligned *)ptr;
uptr->u = val;
}
static really_inline
void unaligned_store_u64a(void *ptr, u64a val) {
struct unaligned { u64a u; } PACKED__MAY_ALIAS;
+ // cppcheck-suppress cstyleCast
struct unaligned *uptr = (struct unaligned *)ptr;
uptr->u = val;
}