From c5c4c5d5f5034ce3300e99f9a3a745acc5fa1649 Mon Sep 17 00:00:00 2001 From: gtsoul-tech Date: Thu, 30 May 2024 16:40:55 +0300 Subject: [PATCH] clang-analyzer-cplusplus.NewDelete --- src/util/pack_bits.h | 3 +-- src/util/partial_store.h | 4 ++-- src/util/unaligned.h | 6 +++--- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/util/pack_bits.h b/src/util/pack_bits.h index 800ce25e..9c1ee157 100644 --- a/src/util/pack_bits.h +++ b/src/util/pack_bits.h @@ -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) { diff --git a/src/util/partial_store.h b/src/util/partial_store.h index efe357cc..a75a1be6 100644 --- a/src/util/partial_store.h +++ b/src/util/partial_store.h @@ -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; diff --git a/src/util/unaligned.h b/src/util/unaligned.h index e4c77900..661750a7 100644 --- a/src/util/unaligned.h +++ b/src/util/unaligned.h @@ -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