Skip to content

Commit e2ab822

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

3 files changed

Lines changed: 15 additions & 8 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: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,15 +173,15 @@ static inline uint8_t bitarithm_clzb(uint8_t x)
173173
{
174174
#if defined(BITARITHM_HAS_CLZ)
175175
/* clz operates on `unsigned int`, so `x` will be promoted to the size
176-
of an `unsigned int` */
176+
* 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: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,19 @@ enum {
8686
*/
8787
#ifdef __clang__ /* following pragmas required for clang 3.8.0 */
8888
#define LOG(level, ...) do { \
89-
_Pragma("clang diagnostic push") \
90-
_Pragma("clang diagnostic ignored \"-Wtautological-compare\"") \
91-
if ((level) <= LOG_LEVEL) LOG_WRITE((level), __VA_ARGS__); } while (0U) \
89+
_Pragma("clang diagnostic push") \
90+
_Pragma("clang diagnostic ignored \"-Wtautological-compare\"") \
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)