diff options
author | Giovanni Di Sirio <gdisirio@gmail.com> | 2015-03-08 09:17:38 +0000 |
---|---|---|
committer | Giovanni Di Sirio <gdisirio@gmail.com> | 2015-03-08 09:17:38 +0000 |
commit | 0fda3648f96f5fe9b1b14870d1e51375901fc348 (patch) | |
tree | 8e04fa7b971a51814b88c4ab877e9874076ae456 /os/rt/include/chdebug.h | |
parent | f0abafaab1bf40ee24cee1670aef6989690b0135 (diff) | |
download | ChibiOS-0fda3648f96f5fe9b1b14870d1e51375901fc348.tar.gz ChibiOS-0fda3648f96f5fe9b1b14870d1e51375901fc348.tar.bz2 ChibiOS-0fda3648f96f5fe9b1b14870d1e51375901fc348.zip |
Reduced MISRA annoyances.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7735 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/rt/include/chdebug.h')
-rw-r--r-- | os/rt/include/chdebug.h | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/os/rt/include/chdebug.h b/os/rt/include/chdebug.h index a839813d7..893ec26b1 100644 --- a/os/rt/include/chdebug.h +++ b/os/rt/include/chdebug.h @@ -164,15 +164,15 @@ typedef struct { * @api
*/
#if !defined(chDbgCheck)
-#if CH_DBG_ENABLE_CHECKS
#define chDbgCheck(c) do { \
- if (!(c)) { \
- chSysHalt(__func__); \
+ /*lint -save -e506 -e774 [2.1, 14.3] Can be a constant by design.*/ \
+ if (CH_DBG_ENABLE_CHECKS != FALSE) { \
+ if (!(c)) { \
+ /*lint -restore*/ \
+ chSysHalt(__func__); \
+ } \
} \
} while (false)
-#else
-#define chDbgCheck(c)
-#endif
#endif /* !defined(chDbgCheck) */
/**
@@ -190,17 +190,15 @@ typedef struct { * @api
*/
#if !defined(chDbgAssert)
-#if CH_DBG_ENABLE_ASSERTS == TRUE
#define chDbgAssert(c, r) do { \
- /*lint -save -e506 -e774 [2.1, 14.3] Can be a constant.*/ \
- if (!(c)) { \
+ /*lint -save -e506 -e774 [2.1, 14.3] Can be a constant by design.*/ \
+ if (CH_DBG_ENABLE_ASSERTS != FALSE) { \
+ if (!(c)) { \
/*lint -restore*/ \
- chSysHalt(__func__); \
+ chSysHalt(__func__); \
+ } \
} \
} while (false)
-#else
-#define chDbgAssert(c, r)
-#endif
#endif /* !defined(chDbgAssert) */
/** @} */
|