pedantic: fix misc leniencies and GNU-isms

This commit is contained in:
James R 2022-02-20 03:28:22 -08:00
parent 2887385122
commit 82f4364eb4
11 changed files with 26 additions and 23 deletions

View file

@ -1585,7 +1585,7 @@ static boolean CL_FinishedFileList(void)
"You may load server addons (if any), and wait for a slot.\n" "You may load server addons (if any), and wait for a slot.\n"
"\n" "\n"
"Press ACCEL to continue or BRAKE to cancel.\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; cl_mode = CL_CONFIRMCONNECT;
} }
else else
@ -1652,13 +1652,13 @@ static boolean CL_FinishedFileList(void)
"You may download, load server addons, and wait for a slot.\n" "You may download, load server addons, and wait for a slot.\n"
"\n" "\n"
"Press ACCEL to continue or BRAKE to cancel.\n\n" "Press ACCEL to continue or BRAKE to cancel.\n\n"
), downloadsize), M_ConfirmConnect, MM_EVENTHANDLER); ), downloadsize), FUNCPTRCAST(M_ConfirmConnect), MM_EVENTHANDLER);
else else
M_StartMessage(va(M_GetText( M_StartMessage(va(M_GetText(
"Download of %s additional content is required to join.\n" "Download of %s additional content is required to join.\n"
"\n" "\n"
"Press ACCEL to continue or BRAKE to cancel.\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); Z_Free(downloadsize);
cl_mode = CL_CONFIRMCONNECT; cl_mode = CL_CONFIRMCONNECT;

View file

@ -819,7 +819,7 @@ void D_SRB2Loop(void)
// Update display, next frame, with current state. // Update display, next frame, with current state.
// (Only display if not already done for frame interp) // (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) if (moviemode)
M_SaveFrame(); M_SaveFrame();
@ -829,7 +829,7 @@ void D_SRB2Loop(void)
else if (rendertimeout < entertic) // in case the server hang or netsplit else if (rendertimeout < entertic) // in case the server hang or netsplit
{ {
// (Only display if not already done for frame interp) // (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) if (moviemode)
M_SaveFrame(); M_SaveFrame();

View file

@ -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); 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}}; 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_kartdebugamount = CVAR_INIT ("kartdebugamount", "1", CV_NETVAR|CV_CHEAT|CV_NOSHOWHELP, kartdebugamount_cons_t, NULL);
consvar_t cv_kartallowgiveitem = CVAR_INIT ("kartallowgiveitem",
#ifdef DEVELOP #ifdef DEVELOP
"Yes", #define VALUE "Yes"
#else #else
"No", #define VALUE "No"
#endif #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_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); consvar_t cv_kartdebughuddrop = CVAR_INIT ("kartdebughuddrop", "Off", CV_NETVAR|CV_CHEAT|CV_NOSHOWHELP, CV_OnOff, NULL);

View file

@ -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; size_t z;
for (z = 0; actionpointers[z].name; z++) for (z = 0; actionpointers[z].name; z++)

View file

@ -16,6 +16,6 @@
boolean LUA_SetLuaAction(void *state, const char *actiontocompare); boolean LUA_SetLuaAction(void *state, const char *actiontocompare);
const char *LUA_GetActionName(void *action); const char *LUA_GetActionName(void *action);
void LUA_SetActionByName(void *state, const char *actiontocompare); void LUA_SetActionByName(void *state, const char *actiontocompare);
enum actionnum LUA_GetActionNumByName(const char *actiontocompare); size_t LUA_GetActionNumByName(const char *actiontocompare);
#endif #endif

View file

@ -51,7 +51,7 @@ void deh_strlcpy(char *dst, const char *src, size_t size, const char *warntext)
strlcpy(dst, src, size); 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++; char c = *f->curpos++;
if (c == '^') // oh, nevermind then. if (c == '^') // oh, nevermind then.

View file

@ -50,7 +50,7 @@ typedef struct
{ {
UINT8 *p; UINT8 *p;
UINT8 (*func)(void); // called when cheat confirmed. UINT8 (*func)(void); // called when cheat confirmed.
UINT8 sequence[]; UINT8 *sequence;
} cheatseq_t; } cheatseq_t;
// ========================================================================== // ==========================================================================
@ -149,7 +149,7 @@ static UINT8 cheatf_devmode(void)
static cheatseq_t cheat_warp = { static cheatseq_t cheat_warp = {
0, cheatf_warp, 0, cheatf_warp,
//{ SCRAMBLE('r'), SCRAMBLE('e'), SCRAMBLE('d'), SCRAMBLE('x'), SCRAMBLE('v'), SCRAMBLE('i'), 0xff } //{ 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 = { 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_RIGHTARROW), SCRAMBLE(KEY_RIGHTARROW), SCRAMBLE(KEY_UPARROW),
SCRAMBLE(KEY_LEFTARROW), SCRAMBLE(KEY_UPARROW), SCRAMBLE(KEY_LEFTARROW), SCRAMBLE(KEY_UPARROW),
SCRAMBLE(KEY_ENTER), 0xff }*/ 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_RIGHTARROW), SCRAMBLE(KEY_UPARROW), SCRAMBLE(KEY_LEFTARROW),
SCRAMBLE(KEY_DOWNARROW), SCRAMBLE(KEY_RIGHTARROW), SCRAMBLE(KEY_DOWNARROW), SCRAMBLE(KEY_RIGHTARROW),
SCRAMBLE(KEY_ENTER), 0xff } SCRAMBLE(KEY_ENTER), 0xff }
@ -167,7 +167,7 @@ static cheatseq_t cheat_warp_joy = {
#ifdef DEVELOP #ifdef DEVELOP
static cheatseq_t cheat_devmode = { static cheatseq_t cheat_devmode = {
0, cheatf_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 #endif

View file

@ -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 spark = P_SpawnMobj(mobj->x, mobj->y, mobj->z, MT_SIGNSPARKLE); // Spawn a fancy sparkle
K_MatchGenericExtraFlags(spark, mobj); K_MatchGenericExtraFlags(spark, mobj);
spark->colorized = true; 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! P_RemoveMobj(mobj); // Adieu, monde cruel!
return; return;
} }
@ -9053,7 +9053,7 @@ void P_MobjThinker(mobj_t *mobj)
} }
else else
{ {
INT32 dur = (mobj->flags2 & MF2_BOSSNOTRAP) UINT32 dur = (mobj->flags2 & MF2_BOSSNOTRAP)
? (2*mobj->fuse)/3 ? (2*mobj->fuse)/3
: mobj->fuse/2; : mobj->fuse/2;
if (((mobj->renderflags & RF_TRANSMASK) >> RF_TRANSSHIFT) < ((NUMTRANSMAPS-1) - dur)) 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) 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 }; 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) static void P_SpawnItemCircle(mapthing_t *mthing, mobjtype_t *itemtypes, UINT8 numitemtypes, INT32 numitems, fixed_t size)

View file

@ -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]; 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)); linenum = (nodetype == NT_XGL3) ? READUINT32((*data)) : READUINT16((*data));
if (linenum != 0xFFFF && linenum >= numlines) if (linenum != 0xFFFF && linenum >= numlines)

View file

@ -36,7 +36,7 @@ extern size_t validcount, linecount, loopcount, framecount;
// The fraction of a tic being drawn (for interpolation between two tics) // The fraction of a tic being drawn (for interpolation between two tics)
extern fixed_t rendertimefrac; extern fixed_t rendertimefrac;
// Evaluated delta tics for this frame (how many tics since the last frame) // Evaluated delta tics for this frame (how many tics since the last frame)
extern fixed_t renderdeltatics;; extern fixed_t renderdeltatics;
// //
// Lighting LUT. // Lighting LUT.

View file

@ -1793,7 +1793,11 @@ static void R_ProjectSprite(mobj_t *thing)
range++; // fencepost problem range++; // fencepost problem
scalestep = ((yscale2 - yscale)/range) ?: 1; scalestep = ((yscale2 - yscale)/range);
if (scalestep == 0)
scalestep = 1;
xscale = FixedDiv(range<<FRACBITS, abs(offset2)); xscale = FixedDiv(range<<FRACBITS, abs(offset2));
// The following two are alternate sorting methods which might be more applicable in some circumstances. TODO - maybe enable via MF2? // The following two are alternate sorting methods which might be more applicable in some circumstances. TODO - maybe enable via MF2?