diff options
author | Tavian Barnes <tavianator@gmail.com> | 2010-04-29 16:53:52 -0600 |
---|---|---|
committer | Tavian Barnes <tavianator@gmail.com> | 2010-04-30 09:52:34 -0600 |
commit | 5fa471d6842b46ca7c20ebc454065cdaf7488bdb (patch) | |
tree | 7a56e30232165fbffd8bbf993373548263205f27 /libdimension/dimension/error.h | |
parent | aeaa9a4e80244a5c66b1afe7e6ee1bcf48e70766 (diff) | |
download | dimension-5fa471d6842b46ca7c20ebc454065cdaf7488bdb.tar.xz |
Use dmnsn_assert() for array and list range checks.
Diffstat (limited to 'libdimension/dimension/error.h')
-rw-r--r-- | libdimension/dimension/error.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/libdimension/dimension/error.h b/libdimension/dimension/error.h index 37b8d66..7abfb90 100644 --- a/libdimension/dimension/error.h +++ b/libdimension/dimension/error.h @@ -52,10 +52,12 @@ typedef enum { #ifdef NDEBUG #define dmnsn_assert(expr, str) ((void)0) #else - #define dmnsn_assert(expr, str) \ - if (!(expr)) { \ - dmnsn_error(DMNSN_SEVERITY_HIGH, (str)); \ - } + #define dmnsn_assert(expr, str) \ + do { \ + if (!(expr)) { \ + dmnsn_error(DMNSN_SEVERITY_HIGH, (str)); \ + } \ + } while (0) #endif /* Called by dmnsn_error() - don't call directly */ |