diff options
author | Eric Anholt <eric@anholt.net> | 2008-04-10 10:33:11 -0700 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2008-04-10 10:35:14 -0700 |
commit | a7e3ad1c6b455bda7c4abb352a20845d1d4574a0 (patch) | |
tree | 55462578bead4c0f75d1d0002317803241b81891 /hw | |
parent | 7909ebe7f163716520f843fae11ac7bdeffcb57c (diff) |
Remove NDEBUG (assert() disable) define from the X Server.
A few pieces of code were abusing this define for other purposes, which are
converted to #ifndef DEBUG instead. There should be no ABI consequences
to this change.
The rationale is that having the define in xorg-server.h also disables
assert() drivers, which is unexpected, and also difficult to avoid since
xorg-server.h is included in their config.h, and you can't put a #undef in
config.h. As for removing it from the server instead of moving it to an
internal header, we probably shouldn't have unnecessary assert()s in
critical server paths anyway, and if we do we could #define NDEBUG in the
specific cases needed.
Diffstat (limited to 'hw')
-rw-r--r-- | hw/kdrive/ephyr/ephyr_draw.c | 1 | ||||
-rw-r--r-- | hw/kdrive/ephyr/ephyrlog.h | 4 | ||||
-rw-r--r-- | hw/kdrive/src/kinput.c | 4 | ||||
-rw-r--r-- | hw/xgl/egl/kinput.c | 4 | ||||
-rw-r--r-- | hw/xquartz/darwinKeyboard.c | 6 | ||||
-rw-r--r-- | hw/xquartz/quartzStartup.c | 6 |
6 files changed, 6 insertions, 19 deletions
diff --git a/hw/kdrive/ephyr/ephyr_draw.c b/hw/kdrive/ephyr/ephyr_draw.c index 422b7c6b6..7b579c24b 100644 --- a/hw/kdrive/ephyr/ephyr_draw.c +++ b/hw/kdrive/ephyr/ephyr_draw.c @@ -28,7 +28,6 @@ #ifdef HAVE_CONFIG_H #include <kdrive-config.h> #endif -#undef NDEBUG /* No, really. The whole point of this module is to crash. */ #include "ephyr.h" #include "exa_priv.h" diff --git a/hw/kdrive/ephyr/ephyrlog.h b/hw/kdrive/ephyr/ephyrlog.h index 71f797777..a07a0a097 100644 --- a/hw/kdrive/ephyr/ephyrlog.h +++ b/hw/kdrive/ephyr/ephyrlog.h @@ -31,11 +31,11 @@ #include <assert.h> #include "os.h" -#ifdef NDEBUG +#ifndef DEBUG /*we are not in debug mode*/ #define EPHYR_LOG(...) #define EPHYR_LOG_ERROR(...) -#endif /*NDEBUG*/ +#endif /*!DEBUG*/ #define ERROR_LOG_LEVEL 3 #define INFO_LOG_LEVEL 4 diff --git a/hw/kdrive/src/kinput.c b/hw/kdrive/src/kinput.c index df73942e7..9e8fd5009 100644 --- a/hw/kdrive/src/kinput.c +++ b/hw/kdrive/src/kinput.c @@ -1744,7 +1744,7 @@ KdClassifyInput (KdPointerInfo *pi, int type, int x, int y, int z, int b) return keyboard; } -#ifndef NDEBUG +#ifdef DEBUG char *kdStateNames[] = { "start", "button_1_pend", @@ -1777,7 +1777,7 @@ char *kdActionNames[] = { "gen_down_2", "gen_up_2", }; -#endif +#endif /* DEBUG */ static void KdQueueEvent (DeviceIntPtr pDev, xEvent *ev) diff --git a/hw/xgl/egl/kinput.c b/hw/xgl/egl/kinput.c index 774e00eb5..f892dc173 100644 --- a/hw/xgl/egl/kinput.c +++ b/hw/xgl/egl/kinput.c @@ -977,7 +977,7 @@ KdClassifyInput (KdMouseInfo *mi, xEvent *ev) return keyboard; } -#ifndef NDEBUG +#ifdef DEBUG char *kdStateNames[] = { "start", "button_1_pend", @@ -1010,7 +1010,7 @@ char *kdActionNames[] = { "gen_down_2", "gen_up_2", }; -#endif +#endif /* DEBUG */ static void KdQueueEvent (xEvent *ev) diff --git a/hw/xquartz/darwinKeyboard.c b/hw/xquartz/darwinKeyboard.c index 6f2758e53..0a8c5c010 100644 --- a/hw/xquartz/darwinKeyboard.c +++ b/hw/xquartz/darwinKeyboard.c @@ -76,13 +76,7 @@ #include "quartzKeyboard.h" #include "quartzAudio.h" -#ifdef NDEBUG -#undef NDEBUG #include <assert.h> -#define NDEBUG 1 -#else -#include <assert.h> -#endif #define AltMask Mod1Mask #define MetaMask Mod2Mask diff --git a/hw/xquartz/quartzStartup.c b/hw/xquartz/quartzStartup.c index e25e15583..5ac3017e1 100644 --- a/hw/xquartz/quartzStartup.c +++ b/hw/xquartz/quartzStartup.c @@ -41,13 +41,7 @@ #include "opaque.h" #include "micmap.h" -#ifdef NDEBUG -#undef NDEBUG #include <assert.h> -#define NDEBUG 1 -#else -#include <assert.h> -#endif char **envpGlobal; // argcGlobal and argvGlobal // are from dix/globals.c |