gnugo-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [gnugo-devel] DEBUG simplification


From: Arend Bayer
Subject: Re: [gnugo-devel] DEBUG simplification
Date: Wed, 4 Dec 2002 18:55:25 +0100 (CET)

Trevor wrote:

> - simplifies VERBOSE macro definitions


>From the patch:

+#define TRACE  (!(verbose)) ? (void)0 : (void)gprintf^M
+#define RTRACE (!(verbose >= 3)) ? (void)0 : (void)gprintf^M
+#define VTRACE (!(verbose >= 4)) ? (void)0 : (void)gprintf^M

 #ifdef HAVE_VARIADIC_DEFINE

 #define DEBUG(level, fmt, args...) \
     do { if ((debug & (level))) gprintf(fmt, ##args); } while (0)

[snip]

 #else /*HAVE_VARIADIC_DEFINE*/
[snip]
+#define DEBUG  (!(debug)) ? (void)0 : (void)DEBUG_func
 int DEBUG_func(int level, const char *fmt, ...);

 #endif  /*HAVE_VARIADIC_DEFINE*/


Hmm, it seems to me we could do
#define DEBUG(level) (!(verbose & level)) ? (void)0 : (void)gprintf

then use
        DEBUG(DEUB_MOVE_REASONS)("%1m: 0.0 - value already counted", pos)

and do away with the variadic macros. Or is this too ugyl?

Arend







reply via email to

[Prev in Thread] Current Thread [Next in Thread]