clang-analyzer-cplusplus.NewDelete

This commit is contained in:
gtsoul-tech 2024-05-30 16:40:55 +03:00
parent 9c0beb57f8
commit c5c4c5d5f5
3 changed files with 6 additions and 7 deletions

View File

@ -190,7 +190,6 @@ static really_inline
void unpack_bits_64(u64a *v, const u8 *in, const u32 *bits,
const unsigned int elements) {
u32 used = 0; // bits used from *in
for (unsigned int i = 0; i < elements; i++) {
assert(bits[i] <= 64);
u64a v_out = 0; // accumulator for v[i]
@ -198,7 +197,7 @@ void unpack_bits_64(u64a *v, const u8 *in, const u32 *bits,
u32 vidx = 0; // bits written to v[i]
while (b) {
u64a read = *in >> used;
u64a read = *in >> used; //NOLINT (clang-analyzer-cplusplus.NewDelete)
u32 bits_read = 8 - used;
if (b <= bits_read) {

View File

@ -122,7 +122,7 @@ void partial_store_u64a(void *ptr, u64a value, u32 numBytes) {
break;
case 1:
// cppcheck-suppress cstyleCast
*(u8 *)ptr = (u8)value;
*(u8 *)ptr = (u8)value; //NOLINT (clang-analyzer-cplusplus.NewDelete)
break;
case 0:
break;
@ -167,7 +167,7 @@ u64a partial_load_u64a(const void *ptr, u32 numBytes) {
return value;
case 1:
// cppcheck-suppress cstyleCast
value = *(const u8 *)ptr;
value = *(const u8 *)ptr;
return value;
case 0:
break;

View File

@ -73,7 +73,7 @@ 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;
uptr->u = val; //NOLINT (clang-analyzer-cplusplus.NewDelete)
}
/// Perform an unaligned 32-bit store
@ -82,7 +82,7 @@ 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;
uptr->u = val; //NOLINT (clang-analyzer-cplusplus.NewDelete)
}
/// Perform an unaligned 64-bit store
@ -91,7 +91,7 @@ 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;
uptr->u = val; //NOLINT (clang-analyzer-cplusplus.NewDelete)
}
#undef PACKED__MAY_ALIAS