summaryrefslogtreecommitdiff
path: root/src/common/nullpo.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/nullpo.hpp')
-rw-r--r--src/common/nullpo.hpp19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/common/nullpo.hpp b/src/common/nullpo.hpp
index ad1084a..2d8644f 100644
--- a/src/common/nullpo.hpp
+++ b/src/common/nullpo.hpp
@@ -1,22 +1,22 @@
/// return wrappers for unexpected NULL pointers
#ifndef NULLPO_HPP
#define NULLPO_HPP
-/// Comment this out to live dangerously
-# define NULLPO_CHECK
+/// Uncomment this to live dangerously
+/// (really exist to detect mostly-unused variables)
+//# define BUG_FREE
/// All functions print to standard error (was: standard output)
/// nullpo_ret(cond) - return 0 if given pointer is NULL
/// nullpo_retv(cond) - just return (function returns void)
/// nullpo_retr(rv, cond) - return given value instead
-# ifdef NULLPO_CHECK
-# define NLP_MARK __FILE__, __LINE__, __func__
+# ifndef BUG_FREE
# define nullpo_retr(ret, t) \
- if (nullpo_chk(NLP_MARK, t)) \
+ if (nullpo_chk(__FILE__, __LINE__, __func__, t)) \
return ret;
-# else // NULLPO_CHECK
-# define nullpo_retr(ret, t) t;
-# endif // NULLPO_CHECK
+# else // BUG_FREE
+# define nullpo_retr(ret, t) /*t*/
+# endif // BUG_FREE
# define nullpo_ret(t) nullpo_retr(0, t)
# define nullpo_retv(t) nullpo_retr(, t)
@@ -27,7 +27,4 @@
bool nullpo_chk(const char *file, int line, const char *func,
const void *target);
-/// Used only by map/battle.c
-void nullpo_info(const char *file, int line, const char *func);
-
#endif // NULLPO_HPP