cstylecasts suppress,fixes

This commit is contained in:
gtsoul-tech
2024-05-20 17:09:30 +03:00
parent cb8808619e
commit d7dc3ec916
11 changed files with 63 additions and 20 deletions

View File

@@ -92,6 +92,7 @@ struct gough_info {
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);
}
@@ -102,6 +103,7 @@ const u32 *get_gough_top_offsets(const struct mcclellan *m) {
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);
}

View File

@@ -188,11 +188,13 @@ struct mpv_pq_item {
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));
}