kernel: Using boolean types for boolean constants
Make boolean expressions use boolean types. MISRA-C rule 14.4 Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
This commit is contained in:
parent
2c924119a3
commit
6fdc56d286
19 changed files with 64 additions and 46 deletions
|
@ -17,6 +17,8 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
/**
|
||||
* @brief Networking
|
||||
* @defgroup networking Networking
|
||||
|
@ -53,12 +55,12 @@ extern "C" {
|
|||
#define NET_ASSERT(cond) do { \
|
||||
if (!(cond)) { \
|
||||
NET_ERR("{assert: '" #cond "' failed}"); \
|
||||
} } while (0)
|
||||
} } while (false)
|
||||
#define NET_ASSERT_INFO(cond, fmt, ...) do { \
|
||||
if (!(cond)) { \
|
||||
NET_ERR("{assert: '" #cond "' failed} " fmt, \
|
||||
##__VA_ARGS__); \
|
||||
} } while (0)
|
||||
} } while (false)
|
||||
#else /* NET_LOG_ENABLED */
|
||||
#define NET_DBG(...)
|
||||
#define NET_ERR(...)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue