Bug fix/clang tidy warnings part2 (#296)

* core.StackAddressEscape

* cplusplus.VirtualCall

* clang-analyzer-deadcode.DeadStores

* clang-analyzer-core.NullDereference

* clang-analyzer-core.NonNullParamChecker

* change to nolint

---------

Co-authored-by: gtsoul-tech <gtsoulkanakis@gmail.com>
This commit is contained in:
gtsoul-tech
2024-06-04 16:18:17 +03:00
committed by GitHub
parent 79443a96f4
commit 999263d140
10 changed files with 34 additions and 26 deletions

View File

@@ -345,9 +345,10 @@ void mmbit_clear(u8 *bits, u32 total_bits) {
/** \brief Specialisation of \ref mmbit_set for flat models. */
static really_inline
char mmbit_set_flat(u8 *bits, u32 total_bits, u32 key) {
assert(bits);
bits += mmbit_flat_select_byte(key, total_bits);
u8 mask = 1U << (key % 8);
char was_set = !!(*bits & mask);
char was_set = !!(*bits & mask); //NOLINT (clang-analyzer-core.NullDereference)
*bits |= mask;
return was_set;
}