From 10a8f2d05ec81ab1f348b139a9452afb27accc27 Mon Sep 17 00:00:00 2001 From: Sally Coolatta Date: Tue, 25 Jul 2023 11:30:55 -0400 Subject: [PATCH] Fix some minor warnings - Fix `lib_getSkinSprite` overshadowing `sprites` global - Rename terrible result_e `ok` so it stops overshadowing crap - Remove inlining from w_wad.c since it reached the inline limit (remember kids, your compiler knows better than you these days whenever or not to inline something) - Remove unused variable in G_PlayerReborn --- src/g_game.c | 1 - src/lua_skinlib.c | 4 ++-- src/p_floor.c | 8 ++++---- src/p_spec.h | 2 +- src/w_wad.c | 10 +++++----- 5 files changed, 12 insertions(+), 13 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index 8264fbe6b..b8c434998 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -2547,7 +2547,6 @@ void G_PlayerReborn(INT32 player, boolean betweenmaps) { player_t *p; INT32 score; - INT32 recordscore; INT32 lives; INT32 continues; fixed_t camerascale; diff --git a/src/lua_skinlib.c b/src/lua_skinlib.c index b7890a6c7..13e0dd987 100644 --- a/src/lua_skinlib.c +++ b/src/lua_skinlib.c @@ -334,13 +334,13 @@ static const char *const sprites_opt[] = { // skin.sprites[i] -> sprites[i] static int lib_getSkinSprite(lua_State *L) { - spritedef_t *sprites = *(spritedef_t **)luaL_checkudata(L, 1, META_SKINSPRITES); + spritedef_t *sksprites = *(spritedef_t **)luaL_checkudata(L, 1, META_SKINSPRITES); playersprite_t i = luaL_checkinteger(L, 2); if (i < 0 || i >= NUMPLAYERSPRITES*2) return luaL_error(L, LUA_QL("skin_t") " field 'sprites' index %d out of range (0 - %d)", i, (NUMPLAYERSPRITES*2)-1); - LUA_PushUserdata(L, &sprites[i], META_SKINSPRITESLIST); + LUA_PushUserdata(L, &sksprites[i], META_SKINSPRITESLIST); return 1; } diff --git a/src/p_floor.c b/src/p_floor.c index 9c24f5851..38f0c5a0f 100644 --- a/src/p_floor.c +++ b/src/p_floor.c @@ -155,7 +155,7 @@ result_e T_MovePlane(sector_t *sector, fixed_t speed, fixed_t dest, boolean crus } } - return ok; + return planeok; } // @@ -1128,7 +1128,7 @@ void T_ThwompSector(thwomp_t *thwomp) thwomp->direction // direction ); - if (res == ok || res == pastdest) + if (res == planeok || res == pastdest) T_MovePlane ( thwomp->sector, // sector @@ -1160,7 +1160,7 @@ void T_ThwompSector(thwomp_t *thwomp) thwomp->direction // direction ); - if (res == ok || res == pastdest) + if (res == planeok || res == pastdest) T_MovePlane ( thwomp->sector, // sector @@ -1465,7 +1465,7 @@ void T_RaiseSector(raise_t *raise) direction // direction ); - if (res == ok || res == pastdest) + if (res == planeok || res == pastdest) T_MovePlane ( raise->sector, // sector diff --git a/src/p_spec.h b/src/p_spec.h index c8701749f..50ab6410f 100644 --- a/src/p_spec.h +++ b/src/p_spec.h @@ -895,7 +895,7 @@ typedef struct typedef enum { - ok, + planeok, crushed, pastdest } result_e; diff --git a/src/w_wad.c b/src/w_wad.c index b13dc8cc1..171eab4f3 100644 --- a/src/w_wad.c +++ b/src/w_wad.c @@ -201,7 +201,7 @@ FILE *W_OpenWadFile(const char **filename, boolean useerrors) } // Look for all DEHACKED and Lua scripts inside a PK3 archive. -static inline void W_LoadDehackedLumpsPK3(UINT16 wadnum, boolean mainfile) +static void W_LoadDehackedLumpsPK3(UINT16 wadnum, boolean mainfile) { UINT16 posStart, posEnd; @@ -241,7 +241,7 @@ static inline void W_LoadDehackedLumpsPK3(UINT16 wadnum, boolean mainfile) } // search for all DEHACKED lump in all wads and load it -static inline void W_LoadDehackedLumps(UINT16 wadnum, boolean mainfile) +static void W_LoadDehackedLumps(UINT16 wadnum, boolean mainfile) { UINT16 lump; @@ -305,7 +305,7 @@ static inline void W_LoadDehackedLumps(UINT16 wadnum, boolean mainfile) * \param resblock resulting MD5 checksum * \return 0 if MD5 checksum was made, and is at resblock, 1 if error was found */ -static inline INT32 W_MakeFileMD5(const char *filename, void *resblock) +static INT32 W_MakeFileMD5(const char *filename, void *resblock) { #ifdef NOMD5 (void)filename; @@ -1956,7 +1956,7 @@ void *W_CacheLumpNumForce(lumpnum_t lumpnum, INT32 tag) // return false. // // no outside code uses the PWAD form, for now -static inline boolean W_IsLumpCachedPWAD(UINT16 wad, UINT16 lump, void *ptr) +static boolean W_IsLumpCachedPWAD(UINT16 wad, UINT16 lump, void *ptr) { void *lcache; @@ -1988,7 +1988,7 @@ boolean W_IsLumpCached(lumpnum_t lumpnum, void *ptr) // return false. // // no outside code uses the PWAD form, for now -static inline boolean W_IsPatchCachedPWAD(UINT16 wad, UINT16 lump, void *ptr) +static boolean W_IsPatchCachedPWAD(UINT16 wad, UINT16 lump, void *ptr) { void *lcache;