Skip to content

Commit 9362f9c

Browse files
core: fix static tests warnings
1 parent bc4a46e commit 9362f9c

3 files changed

Lines changed: 12 additions & 5 deletions

File tree

core/include/cond.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/*
2+
* SPDX-FileCopyrightText: 2018 Sam Kumar
23
* SPDX-License-Identifier: LGPL-2.1-only
34
*/
45

core/lib/include/bitarithm.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,12 +176,12 @@ static inline uint8_t bitarithm_clzb(uint8_t x)
176176
of an `unsigned int` */
177177
return __builtin_clz(x) - 8 * (sizeof(unsigned) - 1);
178178
#else
179-
uint8_t l = 0;
179+
uint8_t number = 0;
180180
while (!(x & 0x80)) {
181-
++l;
181+
++number;
182182
x <<= 1;
183183
}
184-
return l;
184+
return number;
185185
#endif
186186
}
187187

core/lib/include/log.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,17 @@ enum {
8888
#define LOG(level, ...) do { \
8989
_Pragma("clang diagnostic push") \
9090
_Pragma("clang diagnostic ignored \"-Wtautological-compare\"") \
91-
if ((level) <= LOG_LEVEL) LOG_WRITE((level), __VA_ARGS__); } while (0U) \
91+
if ((level) <= LOG_LEVEL) { \
92+
LOG_WRITE((level), __VA_ARGS__); \
93+
} \
94+
} while (0U) \
9295
_Pragma("clang diagnostic pop")
9396
#else
9497
#define LOG(level, ...) do { \
95-
if ((level) <= LOG_LEVEL) LOG_WRITE((level), __VA_ARGS__); } while (0U)
98+
if ((level) <= LOG_LEVEL) { \
99+
LOG_WRITE((level), __VA_ARGS__); \
100+
} \
101+
} while (0U)
96102
#endif /* __clang__ */
97103

98104
/**

0 commit comments

Comments
 (0)