[refNN] Simplify DCHECK macros (#1621)
author박종현/동작제어Lab(SR)/Staff Engineer/삼성전자 <jh1302.park@samsung.com>
Fri, 21 Sep 2018 05:30:15 +0000 (14:30 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Fri, 21 Sep 2018 05:30:15 +0000 (14:30 +0900)
This commit simplifies DCHECK macros using assert itself.

Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
contrib/ann/runtimes/ref/src/ops/internal/Macro.h

index d3130af..b80a748 100644 (file)
 #include <cstdint>
 
 #ifndef DCHECK
-#define DCHECK(condition) (condition) ? (void)0 : assert(false)
+#define DCHECK(condition) assert((condition))
 #endif
 
 #ifndef DCHECK_EQ
-#define DCHECK_EQ(x, y) ((x) == (y)) ? (void)0 : assert(false)
+#define DCHECK_EQ(x, y) assert((x) == (y))
 #endif
 
 #ifndef DCHECK_GE
-#define DCHECK_GE(x, y) ((x) >= (y)) ? (void)0 : assert(false)
+#define DCHECK_GE(x, y) assert((x) >= (y))
 #endif
 
 #ifndef DCHECK_GT
-#define DCHECK_GT(x, y) ((x) > (y)) ? (void)0 : assert(false)
+#define DCHECK_GT(x, y) assert((x) > (y))
 #endif
 
 #ifndef DCHECK_LE
-#define DCHECK_LE(x, y) ((x) <= (y)) ? (void)0 : assert(false)
+#define DCHECK_LE(x, y) assert((x) <= (y))
 #endif
 
 #ifndef DCHECK_LT
-#define DCHECK_LT(x, y) ((x) < (y)) ? (void)0 : assert(false)
+#define DCHECK_LT(x, y) assert((x) < (y))
 #endif
 
 #ifndef CHECK_EQ
-#define CHECK_EQ(x, y) ((x) == (y)) ? (void)0 : assert(false)
+#define CHECK_EQ(x, y) assert((x) == (y))
 #endif
 
 using uint8 = std::uint8_t;