diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 31ecc92ca..0bc66b4d0 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -1585,7 +1585,7 @@ static boolean CL_FinishedFileList(void) "You may load server addons (if any), and wait for a slot.\n" "\n" "Press ACCEL to continue or BRAKE to cancel.\n\n" - ), M_ConfirmConnect, MM_EVENTHANDLER); + ), FUNCPTRCAST (M_ConfirmConnect), MM_EVENTHANDLER); cl_mode = CL_CONFIRMCONNECT; } else @@ -1652,13 +1652,13 @@ static boolean CL_FinishedFileList(void) "You may download, load server addons, and wait for a slot.\n" "\n" "Press ACCEL to continue or BRAKE to cancel.\n\n" - ), downloadsize), M_ConfirmConnect, MM_EVENTHANDLER); + ), downloadsize), FUNCPTRCAST(M_ConfirmConnect), MM_EVENTHANDLER); else M_StartMessage(va(M_GetText( "Download of %s additional content is required to join.\n" "\n" "Press ACCEL to continue or BRAKE to cancel.\n\n" - ), downloadsize), M_ConfirmConnect, MM_EVENTHANDLER); + ), downloadsize), FUNCPTRCAST(M_ConfirmConnect), MM_EVENTHANDLER); Z_Free(downloadsize); cl_mode = CL_CONFIRMCONNECT; diff --git a/src/d_main.c b/src/d_main.c index c95621a05..44e481108 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -819,7 +819,7 @@ void D_SRB2Loop(void) // Update display, next frame, with current state. // (Only display if not already done for frame interp) - cv_frameinterpolation.value == 0 ? D_Display() : 0; + cv_frameinterpolation.value == 0 ? D_Display() : (void)0; if (moviemode) M_SaveFrame(); @@ -829,7 +829,7 @@ void D_SRB2Loop(void) else if (rendertimeout < entertic) // in case the server hang or netsplit { // (Only display if not already done for frame interp) - cv_frameinterpolation.value == 0 ? D_Display() : 0; + cv_frameinterpolation.value == 0 ? D_Display() : (void)0; if (moviemode) M_SaveFrame(); diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 416aeb86a..24d2912ae 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -415,14 +415,13 @@ static CV_PossibleValue_t kartdebugitem_cons_t[] = consvar_t cv_kartdebugitem = CVAR_INIT ("kartdebugitem", "0", CV_NETVAR|CV_CHEAT|CV_NOSHOWHELP, kartdebugitem_cons_t, NULL); static CV_PossibleValue_t kartdebugamount_cons_t[] = {{1, "MIN"}, {255, "MAX"}, {0, NULL}}; consvar_t cv_kartdebugamount = CVAR_INIT ("kartdebugamount", "1", CV_NETVAR|CV_CHEAT|CV_NOSHOWHELP, kartdebugamount_cons_t, NULL); -consvar_t cv_kartallowgiveitem = CVAR_INIT ("kartallowgiveitem", #ifdef DEVELOP - "Yes", +#define VALUE "Yes" #else - "No", +#define VALUE "No" #endif - CV_NETVAR|CV_CHEAT|CV_NOSHOWHELP, CV_YesNo, NULL -); +consvar_t cv_kartallowgiveitem = CVAR_INIT ("kartallowgiveitem", VALUE, CV_NETVAR|CV_CHEAT|CV_NOSHOWHELP, CV_YesNo, NULL); +#undef VALUE consvar_t cv_kartdebugdistribution = CVAR_INIT ("kartdebugdistribution", "Off", CV_NETVAR|CV_CHEAT|CV_NOSHOWHELP, CV_OnOff, NULL); consvar_t cv_kartdebughuddrop = CVAR_INIT ("kartdebughuddrop", "Off", CV_NETVAR|CV_CHEAT|CV_NOSHOWHELP, CV_OnOff, NULL); diff --git a/src/deh_lua.c b/src/deh_lua.c index 52fd4b83e..00897103a 100644 --- a/src/deh_lua.c +++ b/src/deh_lua.c @@ -673,7 +673,7 @@ void LUA_SetActionByName(void *state, const char *actiontocompare) } } -enum actionnum LUA_GetActionNumByName(const char *actiontocompare) +size_t LUA_GetActionNumByName(const char *actiontocompare) { size_t z; for (z = 0; actionpointers[z].name; z++) diff --git a/src/deh_lua.h b/src/deh_lua.h index cd927b9fd..0912907f2 100644 --- a/src/deh_lua.h +++ b/src/deh_lua.h @@ -16,6 +16,6 @@ boolean LUA_SetLuaAction(void *state, const char *actiontocompare); const char *LUA_GetActionName(void *action); void LUA_SetActionByName(void *state, const char *actiontocompare); -enum actionnum LUA_GetActionNumByName(const char *actiontocompare); +size_t LUA_GetActionNumByName(const char *actiontocompare); #endif diff --git a/src/dehacked.c b/src/dehacked.c index 9b81a7c13..57cf8ac6a 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -51,7 +51,7 @@ void deh_strlcpy(char *dst, const char *src, size_t size, const char *warntext) strlcpy(dst, src, size); } -ATTRINLINE static FUNCINLINE char myfget_color(MYFILE *f) +ATTRINLINE static FUNCINLINE unsigned char myfget_color(MYFILE *f) { char c = *f->curpos++; if (c == '^') // oh, nevermind then. diff --git a/src/m_cheat.c b/src/m_cheat.c index 384edbba2..ce925e931 100644 --- a/src/m_cheat.c +++ b/src/m_cheat.c @@ -50,7 +50,7 @@ typedef struct { UINT8 *p; UINT8 (*func)(void); // called when cheat confirmed. - UINT8 sequence[]; + UINT8 *sequence; } cheatseq_t; // ========================================================================== @@ -149,7 +149,7 @@ static UINT8 cheatf_devmode(void) static cheatseq_t cheat_warp = { 0, cheatf_warp, //{ SCRAMBLE('r'), SCRAMBLE('e'), SCRAMBLE('d'), SCRAMBLE('x'), SCRAMBLE('v'), SCRAMBLE('i'), 0xff } - { SCRAMBLE('b'), SCRAMBLE('a'), SCRAMBLE('n'), SCRAMBLE('a'), SCRAMBLE('n'), SCRAMBLE('a'), 0xff } + (UINT8[]){ SCRAMBLE('b'), SCRAMBLE('a'), SCRAMBLE('n'), SCRAMBLE('a'), SCRAMBLE('n'), SCRAMBLE('a'), 0xff } }; static cheatseq_t cheat_warp_joy = { @@ -158,7 +158,7 @@ static cheatseq_t cheat_warp_joy = { SCRAMBLE(KEY_RIGHTARROW), SCRAMBLE(KEY_RIGHTARROW), SCRAMBLE(KEY_UPARROW), SCRAMBLE(KEY_LEFTARROW), SCRAMBLE(KEY_UPARROW), SCRAMBLE(KEY_ENTER), 0xff }*/ - { SCRAMBLE(KEY_LEFTARROW), SCRAMBLE(KEY_UPARROW), SCRAMBLE(KEY_RIGHTARROW), + (UINT8[]){ SCRAMBLE(KEY_LEFTARROW), SCRAMBLE(KEY_UPARROW), SCRAMBLE(KEY_RIGHTARROW), SCRAMBLE(KEY_RIGHTARROW), SCRAMBLE(KEY_UPARROW), SCRAMBLE(KEY_LEFTARROW), SCRAMBLE(KEY_DOWNARROW), SCRAMBLE(KEY_RIGHTARROW), SCRAMBLE(KEY_ENTER), 0xff } @@ -167,7 +167,7 @@ static cheatseq_t cheat_warp_joy = { #ifdef DEVELOP static cheatseq_t cheat_devmode = { 0, cheatf_devmode, - { SCRAMBLE('d'), SCRAMBLE('e'), SCRAMBLE('v'), SCRAMBLE('m'), SCRAMBLE('o'), SCRAMBLE('d'), SCRAMBLE('e'), 0xff } + (UINT8[]){ SCRAMBLE('d'), SCRAMBLE('e'), SCRAMBLE('v'), SCRAMBLE('m'), SCRAMBLE('o'), SCRAMBLE('d'), SCRAMBLE('e'), 0xff } }; #endif diff --git a/src/p_mobj.c b/src/p_mobj.c index 2164038be..35f59e9b1 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -3919,7 +3919,7 @@ static void P_RingThinker(mobj_t *mobj) spark = P_SpawnMobj(mobj->x, mobj->y, mobj->z, MT_SIGNSPARKLE); // Spawn a fancy sparkle K_MatchGenericExtraFlags(spark, mobj); spark->colorized = true; - spark->color = mobj->color ? : SKINCOLOR_YELLOW; // Use yellow if the ring doesn't use a skin color. (It should be red for SPB rings, but let normal rings look fancy too!) + spark->color = mobj->color ? mobj->color : SKINCOLOR_YELLOW; // Use yellow if the ring doesn't use a skin color. (It should be red for SPB rings, but let normal rings look fancy too!) P_RemoveMobj(mobj); // Adieu, monde cruel! return; } @@ -9053,7 +9053,7 @@ void P_MobjThinker(mobj_t *mobj) } else { - INT32 dur = (mobj->flags2 & MF2_BOSSNOTRAP) + UINT32 dur = (mobj->flags2 & MF2_BOSSNOTRAP) ? (2*mobj->fuse)/3 : mobj->fuse/2; if (((mobj->renderflags & RF_TRANSMASK) >> RF_TRANSSHIFT) < ((NUMTRANSMAPS-1) - dur)) @@ -12766,7 +12766,7 @@ static void P_SpawnItemRow(mapthing_t *mthing, mobjtype_t* itemtypes, UINT8 numi static void P_SpawnSingularItemRow(mapthing_t* mthing, mobjtype_t itemtype, INT32 numitems, fixed_t horizontalspacing, fixed_t verticalspacing, INT16 fixedangle) { mobjtype_t itemtypes[1] = { itemtype }; - return P_SpawnItemRow(mthing, itemtypes, 1, numitems, horizontalspacing, verticalspacing, fixedangle); + P_SpawnItemRow(mthing, itemtypes, 1, numitems, horizontalspacing, verticalspacing, fixedangle); } static void P_SpawnItemCircle(mapthing_t *mthing, mobjtype_t *itemtypes, UINT8 numitemtypes, INT32 numitems, fixed_t size) diff --git a/src/p_setup.c b/src/p_setup.c index 1a1583a0a..901807424 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -2465,7 +2465,7 @@ static boolean P_LoadExtendedSubsectorsAndSegs(UINT8 **data, nodetype_t nodetype segs[k - 1 + ((m == 0) ? subsectors[i].numlines : 0)].v2 = segs[k].v1 = &vertexes[vertexnum]; - READUINT32((*data)); // partner, can be ignored by software renderer + *data += sizeof (UINT32); // partner, can be ignored by software renderer linenum = (nodetype == NT_XGL3) ? READUINT32((*data)) : READUINT16((*data)); if (linenum != 0xFFFF && linenum >= numlines) diff --git a/src/r_main.h b/src/r_main.h index a2acf60d9..8a2feca97 100644 --- a/src/r_main.h +++ b/src/r_main.h @@ -36,7 +36,7 @@ extern size_t validcount, linecount, loopcount, framecount; // The fraction of a tic being drawn (for interpolation between two tics) extern fixed_t rendertimefrac; // Evaluated delta tics for this frame (how many tics since the last frame) -extern fixed_t renderdeltatics;; +extern fixed_t renderdeltatics; // // Lighting LUT. diff --git a/src/r_things.c b/src/r_things.c index 95482bc38..e67455f99 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -1793,7 +1793,11 @@ static void R_ProjectSprite(mobj_t *thing) range++; // fencepost problem - scalestep = ((yscale2 - yscale)/range) ?: 1; + scalestep = ((yscale2 - yscale)/range); + + if (scalestep == 0) + scalestep = 1; + xscale = FixedDiv(range<