Skip to content

Commit fd7ce68

Browse files
committed
Use DEBUG macro instead of hijacking _DEBUG or NDEBUG
1 parent c496af2 commit fd7ce68

22 files changed

+54
-54
lines changed

src/client/FxSystem.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class SFxHelper
5959
bool mTimeFrozen;
6060
refdef_t refdef;
6161

62-
#ifdef _DEBUG
62+
#ifdef DEBUG
6363
int mMainRefs;
6464
int mMiniRefs;
6565
#endif
@@ -128,14 +128,14 @@ class SFxHelper
128128

129129
inline void AddFxToScene( refEntity_t *ent )
130130
{
131-
#ifdef _DEBUG
131+
#ifdef DEBUG
132132
mMainRefs++;
133133
#endif
134134
re.AddRefEntityToScene( ent, qtrue );
135135
}
136136
inline void AddFxToScene( miniRefEntity_t *ent )
137137
{
138-
#ifdef _DEBUG
138+
#ifdef DEBUG
139139
mMiniRefs++;
140140
#endif
141141
re.AddMiniRefEntityToScene( ent );

src/client/FxUtil.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ void FX_Add( void )
207207

208208
drawnFx = 0;
209209

210-
#ifdef _DEBUG
210+
#ifdef DEBUG
211211
theFxHelper.mMainRefs = theFxHelper.mMiniRefs = 0;
212212
#endif
213213

@@ -248,7 +248,7 @@ void FX_Add( void )
248248
}
249249
}
250250

251-
#ifdef _DEBUG
251+
#ifdef DEBUG
252252
/* if (theFxHelper.mMainRefs || theFxHelper.mMiniRefs)
253253
{
254254
cgi.OPrintf("Main Refs: %d Mini Refs: %d\n", theFxHelper.mMainRefs, theFxHelper.mMiniRefs);

src/client/cl_cgame.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ void CL_ConfigstringModified( void ) {
439439

440440
gCLTotalClientNum = clientCount;
441441

442-
#ifdef _DEBUG
442+
#ifdef DEBUG
443443
Com_DPrintf("%i clients\n", gCLTotalClientNum);
444444
#endif
445445

@@ -1616,7 +1616,7 @@ void CL_SetCGameTime( void ) {
16161616
int tn;
16171617

16181618
tn = cl_timeNudge->integer;
1619-
#ifdef _DEBUG
1619+
#ifdef DEBUG
16201620
if (tn<-900) {
16211621
tn = -900;
16221622
} else if (tn>900) {

src/client/cl_keys.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ EDIT FIELDS
367367
*/
368368

369369
static void Key_CheckRep( void ) {
370-
#ifndef NDEBUG
370+
#ifdef DEBUG
371371
assert( kg.killTail >= 0 && kg.killTail < KILL_RING_SIZE );
372372
assert( kg.killHead >= 0 && kg.killHead < KILL_RING_SIZE );
373373

@@ -383,7 +383,7 @@ static void Key_CheckRep( void ) {
383383
}
384384

385385
Field_CheckRep( &kg.g_consoleField );
386-
#endif // NDEBUG
386+
#endif // DEBUG
387387
}
388388

389389
/*

src/client/snd_dma.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2756,7 +2756,7 @@ void UpdateLoopingSounds()
27562756
float pos[3];
27572757
float fVolume = 0.003922f; // 1.f / 255.f
27582758

2759-
#ifdef _DEBUG
2759+
#ifdef DEBUG
27602760
// Clear AL Error State
27612761
alGetError();
27622762
#endif
@@ -2826,7 +2826,7 @@ void UpdateRawSamples()
28262826
int i,j,src;
28272827

28282828

2829-
#ifdef _DEBUG
2829+
#ifdef DEBUG
28302830
// Clear Open AL Error
28312831
alGetError();
28322832
#endif

src/client/snd_mem.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ static qboolean S_LoadSound_Actual( sfx_t *sfx )
480480
FS_FreeFile (data);
481481
return qfalse;
482482
}
483-
#ifdef _DEBUG
483+
#ifdef DEBUG
484484
if ( info.width == 1 ) {
485485
Com_Printf(S_COLOR_YELLOW "WARNING: %s is an 8 bit wav file\n", sfx->sSoundName);
486486
}

src/game/bg_misc.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1733,7 +1733,7 @@ qboolean BG_CanItemBeGrabbed( int gametype, const entityState_t *ent, const play
17331733
Com_Error( ERR_DROP, "BG_CanItemBeGrabbed: IT_BAD" );
17341734
default:
17351735
#ifndef Q3_VM
1736-
#ifndef NDEBUG // bk0001204
1736+
#ifdef DEBUG // bk0001204
17371737
Com_Printf("BG_CanItemBeGrabbed: unknown enum %d\n", item->giType );
17381738
#endif
17391739
#endif
@@ -1837,7 +1837,7 @@ void BG_EvaluateTrajectoryDelta( const trajectory_t *tr, int atTime, vec3_t resu
18371837
}
18381838
}
18391839

1840-
#ifdef _DEBUG
1840+
#ifdef DEBUG
18411841
static const char * const eventnames[] = {
18421842
"EV_NONE",
18431843

@@ -2002,7 +2002,7 @@ void trap_Cvar_VariableStringBuffer( const char *var_name, char *buffer, int buf
20022002

20032003
void BG_AddPredictableEventToPlayerstate( int newEvent, int eventParm, playerState_t *ps ) {
20042004

2005-
#ifdef _DEBUG
2005+
#ifdef DEBUG
20062006
{
20072007
char buf[256];
20082008
trap_Cvar_VariableStringBuffer("showevents", buf, sizeof(buf));

src/qcommon/RoffSystem.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ int CROFFSystem::Cache( const char *file, qboolean isClient )
304304

305305
if ( id )
306306
{
307-
#ifdef _DEBUG
307+
#ifdef DEBUG
308308
Com_Printf( S_COLOR_YELLOW"Ignoring. File '%s' already cached.\n", file );
309309
#endif
310310
}
@@ -409,7 +409,7 @@ qboolean CROFFSystem::Unload( int id )
409409

410410
itr = mROFFList.erase( itr );
411411

412-
#ifdef _DEBUG
412+
#ifdef DEBUG
413413
Com_Printf( S_COLOR_GREEN"roff unloaded\n" );
414414
#endif
415415

@@ -418,7 +418,7 @@ qboolean CROFFSystem::Unload( int id )
418418
else
419419
{ // not found
420420

421-
#ifdef _DEBUG
421+
#ifdef DEBUG
422422
Com_Printf( S_COLOR_RED"unload failed: roff <%i> does not exist\n", id );
423423
#endif
424424
return qfalse;

src/qcommon/chash.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@ class CHash
4949
// Destructor
5050
~CHash(void)
5151
{
52-
#ifdef _DEBUG
52+
#ifdef DEBUG
5353
// Com_OPrintf("Shutting down %s hash table .....", typeid(T).name());
5454
#endif
5555
clear();
56-
#ifdef _DEBUG
56+
#ifdef DEBUG
5757
Com_OPrintf(" done\n");
5858
#endif
5959
}

src/qcommon/common.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ static void Com_Puts_Ext( qboolean extendedColors, qboolean skipNotify, const ch
196196
}
197197
}
198198

199-
#if defined(_WIN32) && defined(_DEBUG)
199+
#if defined(_WIN32) && defined(DEBUG)
200200
if ( *msg )
201201
{
202202
OutputDebugStringA ( Q_CleanStr((char *)msg, (qboolean)MV_USE102COLOR) );
@@ -1226,7 +1226,7 @@ void *S_Malloc( int iSize ) {
12261226
}
12271227

12281228

1229-
#ifdef _DEBUG
1229+
#ifdef DEBUG
12301230
static void Z_MemRecoverTest_f(void)
12311231
{
12321232
// needs to be in _DEBUG only, not good for final game!
@@ -1325,7 +1325,7 @@ void Com_InitZoneMemory( void )
13251325
memset(&TheZone, 0, sizeof(TheZone));
13261326
TheZone.Header.iMagic = ZONE_MAGIC;
13271327

1328-
#ifdef _DEBUG
1328+
#ifdef DEBUG
13291329
com_validateZone = Cvar_Get("com_validateZone", "1", 0);
13301330
#else
13311331
com_validateZone = Cvar_Get("com_validateZone", "0", 0);
@@ -1334,7 +1334,7 @@ void Com_InitZoneMemory( void )
13341334
Cmd_AddCommand("zone_stats", Z_Stats_f);
13351335
Cmd_AddCommand("zone_details", Z_Details_f);
13361336

1337-
#ifdef _DEBUG
1337+
#ifdef DEBUG
13381338
Cmd_AddCommand("zone_memrecovertest", Z_MemRecoverTest_f);
13391339
#endif
13401340
}
@@ -2108,7 +2108,7 @@ void Hunk_Trash( void ) {
21082108
if ( s_hunkData == NULL )
21092109
return;
21102110

2111-
#ifdef _DEBUG
2111+
#ifdef DEBUG
21122112
Com_Error(ERR_DROP, "hunk trashed");
21132113
return;
21142114
#endif
@@ -3340,7 +3340,7 @@ Field_CheckRep
33403340
==================
33413341
*/
33423342
void Field_CheckRep( field_t *edit ) {
3343-
#ifndef NDEBUG
3343+
#ifdef DEBUG
33443344
int len = strlen(edit->buffer);
33453345

33463346
assert( len < MAX_EDIT_LINE );
@@ -3361,7 +3361,7 @@ void Field_CheckRep( field_t *edit ) {
33613361
assert( edit->currentTail <= edit->historyTail || edit->historyHead <= edit->currentTail );
33623362

33633363
assert( edit->buffer == edit->bufferHistory[edit->currentTail] );
3364-
#endif // NDEBUG
3364+
#endif // DEBUG
33653365
}
33663366

33673367
/*

0 commit comments

Comments
 (0)