From 5b284c8170801326f0e17058c60ea89f6c4c959c Mon Sep 17 00:00:00 2001 From: mazmazz Date: Sat, 3 Aug 2019 23:00:21 -0400 Subject: [PATCH] gcc7 compile fixes (Fall through; spr2 var comparison) --- src/hardware/hw_draw.c | 2 +- src/hardware/hw_main.h | 2 +- src/lua_infolib.c | 2 +- src/p_mobj.c | 2 ++ src/r_things.c | 1 + 5 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/hardware/hw_draw.c b/src/hardware/hw_draw.c index 1ba357105..f1e53bb28 100644 --- a/src/hardware/hw_draw.c +++ b/src/hardware/hw_draw.c @@ -1080,7 +1080,7 @@ void HWR_drawAMline(const fline_t *fl, INT32 color) // -------------------+ // HWR_DrawConsoleFill : draw flat coloured transparent rectangle because that's cool, and hw sucks less than sw for that. // -------------------+ -void HWR_DrawConsoleFill(INT32 x, INT32 y, INT32 w, INT32 h, UINT32 color, INT32 options) +void HWR_DrawConsoleFill(INT32 x, INT32 y, INT32 w, INT32 h, UINT32 color) { FOutVector v[4]; FSurfaceInfo Surf; diff --git a/src/hardware/hw_main.h b/src/hardware/hw_main.h index fab18e08a..d706aae86 100644 --- a/src/hardware/hw_main.h +++ b/src/hardware/hw_main.h @@ -50,7 +50,7 @@ void HWR_CreateStaticLightmaps(INT32 bspnum); void HWR_PrepLevelCache(size_t pnumtextures); void HWR_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 color); void HWR_DrawFadeFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 color, UINT16 actualcolor, UINT8 strength); -void HWR_DrawConsoleFill(INT32 x, INT32 y, INT32 w, INT32 h, UINT32 color, INT32 options); // Lat: separate flags from color since color needs to be an uint to work right. +void HWR_DrawConsoleFill(INT32 x, INT32 y, INT32 w, INT32 h, UINT32 color); // Lat: separate flags from color since color needs to be an uint to work right. void HWR_DrawPic(INT32 x,INT32 y,lumpnum_t lumpnum); UINT8 *HWR_GetScreenshot(void); diff --git a/src/lua_infolib.c b/src/lua_infolib.c index 8bd4ce9ff..77f37f8ec 100644 --- a/src/lua_infolib.c +++ b/src/lua_infolib.c @@ -207,7 +207,7 @@ static int lib_setSpr2default(lua_State *L) else return luaL_error(L, "spr2defaults[] invalid set"); - if (j < 0 || j >= free_spr2) + if (j >= free_spr2) return luaL_error(L, "spr2defaults[] set %d out of range (%d - %d)", j, 0, free_spr2-1); spr2defaults[i] = j; diff --git a/src/p_mobj.c b/src/p_mobj.c index 8c74fd76e..7ff8aa9f2 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -9717,6 +9717,7 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type) case MT_EGGROBO1: mobj->movecount = P_RandomKey(13); mobj->color = SKINCOLOR_RUBY + P_RandomKey(MAXSKINCOLORS - SKINCOLOR_RUBY); + // fall through case MT_HIVEELEMENTAL: mobj->extravalue1 = 5; break; @@ -11116,6 +11117,7 @@ You should think about modifying the deathmatch starts to take full advantage of mobj->color = SKINCOLOR_GOLD; mobj->colorized = true; } + // fall through case MT_EGGMOBILE3: mobj->cusval = mthing->extrainfo; break; diff --git a/src/r_things.c b/src/r_things.c index 71e4c0214..fdf0e230d 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -2540,6 +2540,7 @@ UINT8 P_GetSkinSprite2(skin_t *skin, UINT8 spr2, player_t *player) ? player->charability : skin->ability) == CA_SWIM) ? SPR2_SWIM : SPR2_FLY; + // fall through // Use the handy list, that's what it's there for! default: