diff options
author | 2007-12-31 02:04:39 +0000 | |
---|---|---|
committer | 2007-12-31 02:04:39 +0000 | |
commit | 460437f8d13a49302d5ce11cf5ba613083e4780a (patch) | |
tree | fcc6a7819ef6078d7ba6925e368438e33d62d06e /src/emu/machine/pit8253.c | |
parent | 3f6e8e1abfc478371e1e6f1a9cd317fbf5460424 (diff) |
(From Atari Ace)
The attached patch adjusts most conditional logging in MAME to use the
idiom "do { if (VERBOSE) logerror x; } while (0)". This has the
benefit that the compiler checks the syntax of the logging even in the
case it will be eliminated, and in fact a number of cases here needed
adjustments to compile because of this.
Diffstat (limited to 'src/emu/machine/pit8253.c')
-rw-r--r-- | src/emu/machine/pit8253.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/src/emu/machine/pit8253.c b/src/emu/machine/pit8253.c index dd0967dc626..189be768589 100644 --- a/src/emu/machine/pit8253.c +++ b/src/emu/machine/pit8253.c @@ -33,16 +33,8 @@ #define MAX_TIMER 3 #define VERBOSE 0 -#if (VERBOSE == 2) -#define LOG1(msg) logerror msg -#define LOG2(msg) logerror msg -#elif (VERBOSE == 1) -#define LOG1(msg) logerror msg -#define LOG2(msg) (void)(0) -#else -#define LOG1(msg) (void)(0) -#define LOG2(msg) (void)(0) -#endif +#define LOG1(msg) do { if (VERBOSE >= 1) logerror msg; } while (0) +#define LOG2(msg) do { if (VERBOSE >= 2) logerror msg; } while (0) #define TIMER_TIME_NEVER ((UINT64) -1) |