From da987a28ddcb5515558e55ca464a692e7bded916 Mon Sep 17 00:00:00 2001 From: Giel van Schijndel Date: Mon, 14 Apr 2008 00:25:48 +0000 Subject: [PATCH] Don't use DEBUG-only member variables in an NDEBUG build git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4593 4a71c877-e1ca-e34f-864e-861f7616d084 --- src/droid.c | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/src/droid.c b/src/droid.c index b7a948773..d44eb0d87 100644 --- a/src/droid.c +++ b/src/droid.c @@ -231,8 +231,12 @@ BOOL droidCheckReferences(DROID *psVictimDroid) { if ((DROID *)psStruct->psTarget[i] == psVictimDroid) { - ASSERT(!"Illegal reference to droid", "Illegal reference to droid from %s line %d", - psStruct->targetFunc[i], psStruct->targetLine[i]); + ASSERT(!"Illegal reference to droid", "Illegal reference to droid" +#ifdef DEBUG + " from %s line %d", psStruct->targetFunc[i], psStruct->targetLine[i]); +#else + ); +#endif return false; } } @@ -241,16 +245,24 @@ BOOL droidCheckReferences(DROID *psVictimDroid) { if ((DROID *)psDroid->psTarget == psVictimDroid && psVictimDroid != psDroid) { - ASSERT(!"Illegal reference to droid", "Illegal reference to droid from %s line %d", - psDroid->targetFunc, psDroid->targetLine); + ASSERT(!"Illegal reference to droid", "Illegal reference to droid" +#ifdef DEBUG + " from %s line %d", psDroid->targetFunc, psDroid->targetLine); +#else + ); +#endif return false; } for (i = 0; i < psDroid->numWeaps; i++) { if ((DROID *)psDroid->psActionTarget[i] == psVictimDroid && psVictimDroid != psDroid) { - ASSERT(!"Illegal reference to droid", "Illegal action reference to droid from %s line %d", - psDroid->actionTargetFunc[i], psDroid->actionTargetLine[i]); + ASSERT(!"Illegal reference to droid", "Illegal action reference to droid" +#ifdef DEBUG + " from %s line %d", psDroid->actionTargetFunc[i], psDroid->actionTargetLine[i]); +#else + ); +#endif return false; } }