[Freeciv-Dev] more warnings when compiling with NDEBUG (PR#1216)
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
The attached patch fixes the remaining warnings in sanitycheck.c.
I've just changed #ifdef DEBUG to #ifndef NDEBUG - this is the same
check that assert() uses, so behaviour should be unchanged (though the
new code may be faster since it skips empty loops and function calls).
jason
Index: server/sanitycheck.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/sanitycheck.c,v
retrieving revision 1.13
diff -u -r1.13 sanitycheck.c
--- server/sanitycheck.c 2001/10/14 21:02:17 1.13
+++ server/sanitycheck.c 2002/02/05 02:04:56
@@ -24,6 +24,8 @@
#include "sanitycheck.h"
+#ifndef NDEBUG
+
/**************************************************************************
...
**************************************************************************/
@@ -265,11 +267,14 @@
} players_iterate_end;
}
+#endif /* !NDEBUG */
+
/**************************************************************************
...
**************************************************************************/
void sanity_check(void)
{
+#ifndef NDEBUG
check_specials();
check_fow();
check_misc();
@@ -277,4 +282,5 @@
check_cities();
check_units();
check_players();
+#endif /* !NDEBUG */
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Freeciv-Dev] more warnings when compiling with NDEBUG (PR#1216),
jdorje <=
|
|