mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-12-19 22:42:46 +00:00
Merge branch 'fix-asserts' into 'master'
Fix PARANOIA compile See merge request KartKrew/Kart!924
This commit is contained in:
commit
e4459933cb
10 changed files with 38 additions and 18 deletions
11
src/d_main.c
11
src/d_main.c
|
|
@ -1196,6 +1196,15 @@ const char *D_GetFancyBranchName(void)
|
|||
return compbranch;
|
||||
}
|
||||
|
||||
static void Command_assert(void)
|
||||
{
|
||||
#if !defined(NDEBUG) || defined(PARANOIA)
|
||||
CONS_Printf("Yes, assertions are enabled.\n");
|
||||
#else
|
||||
CONS_Printf("No, ssertions are NOT enabled.\n");
|
||||
#endif
|
||||
}
|
||||
|
||||
//
|
||||
// D_SRB2Main
|
||||
//
|
||||
|
|
@ -1387,6 +1396,8 @@ void D_SRB2Main(void)
|
|||
// Do this up here so that WADs loaded through the command line can use ExecCfg
|
||||
COM_Init();
|
||||
|
||||
COM_AddCommand("assert", Command_assert);
|
||||
|
||||
#ifndef TESTERS
|
||||
// add any files specified on the command line with -file wadfile
|
||||
// to the wad list
|
||||
|
|
|
|||
|
|
@ -103,6 +103,14 @@ extern "C" {
|
|||
|
||||
//#define NOMD5
|
||||
|
||||
// If you don't disable ALL debug first, you get ALL debug enabled
|
||||
#if !defined (NDEBUG)
|
||||
#define PACKETDROP
|
||||
#define PARANOIA
|
||||
#define RANGECHECK
|
||||
#define ZDEBUG
|
||||
#endif
|
||||
|
||||
// Uncheck this to compile debugging code
|
||||
//#define RANGECHECK
|
||||
//#ifndef PARANOIA
|
||||
|
|
|
|||
|
|
@ -4236,7 +4236,7 @@ static void G_DoContinued(void)
|
|||
{
|
||||
player_t *pl = &players[consoleplayer];
|
||||
I_Assert(!netgame && !multiplayer);
|
||||
I_Assert(pl->continues > 0);
|
||||
//I_Assert(pl->continues > 0);
|
||||
|
||||
/*if (pl->continues)
|
||||
pl->continues--;*/
|
||||
|
|
|
|||
|
|
@ -537,8 +537,6 @@ static int pivotlist_get(lua_State *L)
|
|||
spriteinfo_t *sprinfo = *((spriteinfo_t **)luaL_checkudata(L, 1, META_PIVOTLIST));
|
||||
UINT8 frame = GetPivotFrame(L, 2);
|
||||
|
||||
I_Assert(framepivot != NULL);
|
||||
|
||||
// bypass LUA_PushUserdata
|
||||
container = lua_newuserdata(L, sizeof *container);
|
||||
container->sprinfo = sprinfo;
|
||||
|
|
@ -563,8 +561,6 @@ static int pivotlist_set(lua_State *L)
|
|||
if (hook_cmd_running)
|
||||
return luaL_error(L, "Do not alter spriteframepivot_t in CMD building code!");
|
||||
|
||||
I_Assert(pivotlist != NULL);
|
||||
|
||||
frame = GetPivotFrame(L, 2);
|
||||
|
||||
// pivot[] is a table
|
||||
|
|
|
|||
|
|
@ -429,7 +429,7 @@ void M_AddRawCondition(UINT8 set, UINT8 id, conditiontype_t c, INT32 r, INT16 x1
|
|||
condition_t *cond;
|
||||
UINT32 num, wnum;
|
||||
|
||||
I_Assert(set && set <= MAXCONDITIONSETS);
|
||||
I_Assert(set < MAXCONDITIONSETS);
|
||||
|
||||
wnum = conditionSets[set].numconditions;
|
||||
num = ++conditionSets[set].numconditions;
|
||||
|
|
|
|||
12
src/p_mobj.c
12
src/p_mobj.c
|
|
@ -11190,12 +11190,6 @@ void P_RemoveMobj(mobj_t *mobj)
|
|||
|
||||
P_SetTarget(&mobj->itnext, NULL);
|
||||
|
||||
// DBG: set everything in mobj_t to 0xFF instead of leaving it. debug memory error.
|
||||
#ifdef SCRAMBLE_REMOVED
|
||||
// Invalidate mobj_t data to cause crashes if accessed!
|
||||
memset((UINT8 *)mobj + sizeof(thinker_t), 0xff, sizeof(mobj_t) - sizeof(thinker_t));
|
||||
#endif
|
||||
|
||||
P_RemoveThingTID(mobj);
|
||||
R_RemoveMobjInterpolator(mobj);
|
||||
|
||||
|
|
@ -11215,6 +11209,12 @@ void P_RemoveMobj(mobj_t *mobj)
|
|||
}
|
||||
|
||||
P_RemoveThinker((thinker_t *)mobj);
|
||||
|
||||
// DBG: set everything in mobj_t to 0xFF instead of leaving it. debug memory error.
|
||||
#ifdef SCRAMBLE_REMOVED
|
||||
// Invalidate mobj_t data to cause crashes if accessed!
|
||||
memset((UINT8 *)mobj + sizeof(thinker_t), 0xff, sizeof(mobj_t) - sizeof(thinker_t));
|
||||
#endif
|
||||
}
|
||||
|
||||
// This does not need to be added to Lua.
|
||||
|
|
|
|||
|
|
@ -3135,8 +3135,8 @@ static void P_NetArchiveThinkers(savebuffer_t *save)
|
|||
continue;
|
||||
}
|
||||
#ifdef PARANOIA
|
||||
else if (th->function.acp1 != (actionf_p1)P_RemoveThinkerDelayed) // wait garbage collection
|
||||
I_Error("unknown thinker type %p", th->function.acp1);
|
||||
else
|
||||
I_Assert(th->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed); // wait garbage collection
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -234,7 +234,7 @@ void R_SetColumnFunc(size_t id, boolean brightmapped)
|
|||
|
||||
void R_SetSpanFunc(size_t id, boolean npo2, boolean brightmapped)
|
||||
{
|
||||
I_Assert(id < COLDRAWFUNC_MAX);
|
||||
I_Assert(id < SPANDRAWFUNC_MAX);
|
||||
|
||||
if (spanfuncs_npo2[id] != NULL && npo2 == true)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1700,6 +1700,9 @@ INT32 I_StartupSystem(void)
|
|||
#endif
|
||||
I_StartupConsole();
|
||||
#ifdef NEWSIGNALHANDLER
|
||||
// This is useful when debugging. It lets GDB attach to
|
||||
// the correct process easily.
|
||||
if (!M_CheckParm("-nofork"))
|
||||
I_Fork();
|
||||
#endif
|
||||
I_RegisterSignals();
|
||||
|
|
@ -1993,9 +1996,10 @@ void I_ShutdownSystem(void)
|
|||
{
|
||||
INT32 c;
|
||||
|
||||
#ifndef NEWSIGNALHANDLER
|
||||
I_ShutdownConsole();
|
||||
#ifdef NEWSIGNALHANDLER
|
||||
if (M_CheckParm("-nofork"))
|
||||
#endif
|
||||
I_ShutdownConsole();
|
||||
|
||||
for (c = MAX_QUIT_FUNCS-1; c >= 0; c--)
|
||||
if (quit_funcs[c])
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@
|
|||
#define __Z_ZONE__
|
||||
|
||||
#include <stdio.h>
|
||||
#include "doomdef.h"
|
||||
#include "doomtype.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue