From e74f8cada18dde21bbde09954006f0d9ee1658d1 Mon Sep 17 00:00:00 2001 From: helixhorned Date: Mon, 26 Mar 2012 22:04:44 +0000 Subject: [PATCH] Replace all occurences of assert in our code with Bassert. git-svn-id: https://svn.eduke32.com/eduke32@2547 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/src/engine.c | 14 +++++++------- polymer/eduke32/source/astub.c | 4 ++-- polymer/eduke32/source/demo.c | 2 +- polymer/eduke32/source/savegame.c | 6 +++--- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/polymer/eduke32/build/src/engine.c b/polymer/eduke32/build/src/engine.c index d9c669dca..8cb9155c4 100644 --- a/polymer/eduke32/build/src/engine.c +++ b/polymer/eduke32/build/src/engine.c @@ -708,7 +708,7 @@ void yax_tweakpicnums(int32_t bunchnum, int32_t cf, int32_t restore) static uint8_t expect_restore[2][YAX_MAXBUNCHES]; // must call this with restore == 0, 1, 0, 1, 0, 1, ... - assert(expect_restore[cf][bunchnum] == restore); + Bassert(expect_restore[cf][bunchnum] == restore); expect_restore[cf][bunchnum] = !expect_restore[cf][bunchnum]; #endif @@ -2380,7 +2380,7 @@ void fade_screen_black(int32_t moreopaquep) } else { - assert(!offscreenrendering); + Bassert(!offscreenrendering); begindrawing(); { @@ -7538,7 +7538,7 @@ int32_t insertsprite(int16_t sectnum, int16_t statnum) if (newspritenum >= 0) { - assert((unsigned)sectnum < MAXSECTORS); + Bassert((unsigned)sectnum < MAXSECTORS); do_insertsprite_at_headofsect(newspritenum, sectnum); Numsprites++; @@ -7553,8 +7553,8 @@ int32_t insertsprite(int16_t sectnum, int16_t statnum) // int32_t deletesprite(int16_t spritenum) { - assert((sprite[spritenum].statnum == MAXSTATUS) - == (sprite[spritenum].sectnum == MAXSECTORS)); + Bassert((sprite[spritenum].statnum == MAXSTATUS) + == (sprite[spritenum].sectnum == MAXSECTORS)); if (sprite[spritenum].statnum == MAXSTATUS) return(-1); // already not in the world @@ -9981,7 +9981,7 @@ int32_t saveboard(const char *filename, int32_t *daposx, int32_t *daposy, int32_ numsprites++; } - assert(numsprites == Numsprites); + Bassert(numsprites == Numsprites); #ifdef YAX_ENABLE if (numyaxbunches > 0) @@ -13500,7 +13500,7 @@ void setbrightness(char dabrightness, uint8_t dapalid, uint8_t flags) const uint8_t *dapal; // uint32_t lastbright = curbrightness; - assert((flags&(1+4))==0); + Bassert((flags&(1+4))==0); if (dapalid >= basepalcount) dapalid = 0; diff --git a/polymer/eduke32/source/astub.c b/polymer/eduke32/source/astub.c index 2ce86cc21..485d34b93 100644 --- a/polymer/eduke32/source/astub.c +++ b/polymer/eduke32/source/astub.c @@ -611,12 +611,12 @@ int32_t map_undoredo(int32_t dir) for (i=0; inum[2]; i++) { if ((sprite[i].cstat & 48) == 48) sprite[i].cstat &= ~48; - assert((unsigned)sprite[i].sectnum < (unsigned)numsectors + Bassert((unsigned)sprite[i].sectnum < (unsigned)numsectors && (unsigned)sprite[i].statnum < MAXSTATUS); insertsprite(sprite[i].sectnum, sprite[i].statnum); } - assert(Numsprites == mapstate->num[2]); + Bassert(Numsprites == mapstate->num[2]); #ifdef POLYMER if (qsetmode == 200 && rendmode == 4) diff --git a/polymer/eduke32/source/demo.c b/polymer/eduke32/source/demo.c index c38d69534..2a60a8adb 100644 --- a/polymer/eduke32/source/demo.c +++ b/polymer/eduke32/source/demo.c @@ -90,7 +90,7 @@ static int32_t G_OpenDemoRead(int32_t g_whichDemo) // 0 = mine } else if ((g_demo_recFilePtr = kopen4loadfrommod(d,g_loadFromGroupOnly)) == -1) return(0); - assert(g_whichDemo >= 1); + Bassert(g_whichDemo >= 1); i = sv_loadsnapshot(g_demo_recFilePtr, -g_whichDemo, &saveh); if (i) { diff --git a/polymer/eduke32/source/savegame.c b/polymer/eduke32/source/savegame.c index 7e1cba074..a7dd5e7e5 100644 --- a/polymer/eduke32/source/savegame.c +++ b/polymer/eduke32/source/savegame.c @@ -1076,7 +1076,7 @@ int32_t sv_saveandmakesnapshot(FILE *fil, int8_t spot, int8_t recdiffsp, int8_t { savehead_t h; - assert(sizeof(savehead_t) == 310); + Bassert(sizeof(savehead_t) == 310); // set a few savegame system globals savegame_comprthres = SV_DEFAULTCOMPRTHRES; @@ -1186,7 +1186,7 @@ int32_t sv_loadheader(int32_t fil, int32_t spot, savehead_t *h) { int32_t havedemo = (spot < 0); - assert(sizeof(savehead_t) == 310); + Bassert(sizeof(savehead_t) == 310); if (kread(fil, h, sizeof(savehead_t)) != sizeof(savehead_t)) { @@ -1579,7 +1579,7 @@ static void sv_restsave() } #endif - assert((savegame_restdata+SVARDATALEN)-mem >= 0); + Bassert((savegame_restdata+SVARDATALEN)-mem >= 0); Bmemset(mem, 0, (savegame_restdata+SVARDATALEN)-mem); #undef CPDAT