summaryrefslogtreecommitdiff
path: root/src/common/include
diff options
context:
space:
mode:
authorglisse <glisse@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2017-12-02 13:34:29 +0000
committerglisse <glisse@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2017-12-02 13:34:29 +0000
commit4cf2e2232a2046590909d78c887a2b96a2af8177 (patch)
tree117041e56b61e67afbb37423b8d1b48835d54830 /src/common/include
parente61d980d093403aecd996ad829d97c2c9207e150 (diff)
Cleanup checks in Simplex_tree
Rewrite GUDHi_CHECK so we don't get nasty surprises with: if(cond) GUDHI_CHECK(...) else ... where the else would have been matched with the if in GUDHI_CHECK. git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/ST-glisse@3010 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: a1385540710d0079567b7e4566766bd0da53c584
Diffstat (limited to 'src/common/include')
-rw-r--r--src/common/include/gudhi/Debug_utils.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/common/include/gudhi/Debug_utils.h b/src/common/include/gudhi/Debug_utils.h
index 8ed3b7b3..e8bd7660 100644
--- a/src/common/include/gudhi/Debug_utils.h
+++ b/src/common/include/gudhi/Debug_utils.h
@@ -32,7 +32,7 @@
// GUDHI_CHECK throw an exception if expression is false in debug mode, but does nothing in release mode
// Could assert in release mode, but cmake sets NDEBUG (for "NO DEBUG") in this mode, means assert does nothing.
#ifdef GUDHI_DEBUG
- #define GUDHI_CHECK(expression, excpt) if ((expression) == 0) throw excpt
+ #define GUDHI_CHECK(expression, excpt) ((expression) ? (void) 0 : (throw excpt))
#define GUDHI_CHECK_code(CODE) CODE
#else
#define GUDHI_CHECK(expression, excpt) (void) 0