From 30549addf3b500b433b5f63bc44f3486aea1b439 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Thu, 4 Jan 2018 14:21:20 -0500 Subject: [PATCH 1/3] Undo signed mess --- src/lua_hudlib.c | 2 +- src/lua_infolib.c | 6 +++--- src/m_menu.c | 8 ++++++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/lua_hudlib.c b/src/lua_hudlib.c index 7d0f535fb..68a69cd1d 100644 --- a/src/lua_hudlib.c +++ b/src/lua_hudlib.c @@ -407,7 +407,7 @@ static int libd_getSpritePatch(lua_State *L) static int libd_getSprite2Patch(lua_State *L) { INT32 i; // skin number - INT32 j; // sprite2 prefix + UINT32 j; // sprite2 prefix UINT32 frame = 0; // 'A' UINT8 angle = 0; spritedef_t *sprdef; diff --git a/src/lua_infolib.c b/src/lua_infolib.c index 3f5bdc53b..8f2ce67cd 100644 --- a/src/lua_infolib.c +++ b/src/lua_infolib.c @@ -102,7 +102,7 @@ static int lib_sprnamelen(lua_State *L) // push sprite name static int lib_getSpr2name(lua_State *L) { - INT32 i; + UINT32 i; lua_remove(L, 1); // don't care about spr2names[] dummy userdata. @@ -129,7 +129,7 @@ static int lib_getSpr2name(lua_State *L) static int lib_getSpr2default(lua_State *L) { - INT32 i; + UINT32 i; lua_remove(L, 1); // don't care about spr2defaults[] dummy userdata. @@ -154,7 +154,7 @@ static int lib_getSpr2default(lua_State *L) static int lib_setSpr2default(lua_State *L) { - INT32 i; + UINT32 i; UINT8 j = 0; lua_remove(L, 1); // don't care about spr2defaults[] dummy userdata. diff --git a/src/m_menu.c b/src/m_menu.c index 44386b34a..69cd42365 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -70,6 +70,10 @@ int snprintf(char *str, size_t n, const char *fmt, ...); //int vsnprintf(char *str, size_t n, const char *fmt, va_list ap); #endif +#if defined (__GNUC__) && (__GNUC__ >= 4) +#define FIXUPO0 +#endif + #define SKULLXOFF -32 #define LINEHEIGHT 16 #define STRINGHEIGHT 8 @@ -4953,7 +4957,7 @@ static boolean M_AddonsRefresh(void) #define offs 1 -#ifdef __GNUC__ +#ifdef FIXUPO0 #pragma GCC optimize ("0") #endif @@ -5081,7 +5085,7 @@ static void M_DrawAddons(void) #undef CANSAVE } -#ifdef __GNUC__ +#ifdef FIXUPO0 #pragma GCC reset_options #endif From 82f2f2f2f9965cc79eec8fdd3d885a5b0bed44d2 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Thu, 4 Jan 2018 14:29:29 -0500 Subject: [PATCH 2/3] SDL: disable check for noreturn --- src/sdl/i_main.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/sdl/i_main.c b/src/sdl/i_main.c index 65b7b5ffe..f54f0d7c5 100644 --- a/src/sdl/i_main.c +++ b/src/sdl/i_main.c @@ -103,6 +103,10 @@ static inline VOID MakeCodeWritable(VOID) \return int */ +#if defined (__GNUC__) && (__GNUC__ >= 4) +#pragma GCC diagnostic ignored "-Wmissing-noreturn" +#endif + #ifdef FORCESDLMAIN int SDL_main(int argc, char **argv) #else From f9a0ef517dd13109af8a2a209f0d651d487ad149 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Thu, 4 Jan 2018 14:49:15 -0500 Subject: [PATCH 3/3] Use playersprite_t --- src/lua_hudlib.c | 2 +- src/lua_infolib.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lua_hudlib.c b/src/lua_hudlib.c index 68a69cd1d..97835d845 100644 --- a/src/lua_hudlib.c +++ b/src/lua_hudlib.c @@ -407,7 +407,7 @@ static int libd_getSpritePatch(lua_State *L) static int libd_getSprite2Patch(lua_State *L) { INT32 i; // skin number - UINT32 j; // sprite2 prefix + playersprite_t j; // sprite2 prefix UINT32 frame = 0; // 'A' UINT8 angle = 0; spritedef_t *sprdef; diff --git a/src/lua_infolib.c b/src/lua_infolib.c index 8f2ce67cd..7d7aab750 100644 --- a/src/lua_infolib.c +++ b/src/lua_infolib.c @@ -102,7 +102,7 @@ static int lib_sprnamelen(lua_State *L) // push sprite name static int lib_getSpr2name(lua_State *L) { - UINT32 i; + playersprite_t i; lua_remove(L, 1); // don't care about spr2names[] dummy userdata. @@ -129,7 +129,7 @@ static int lib_getSpr2name(lua_State *L) static int lib_getSpr2default(lua_State *L) { - UINT32 i; + playersprite_t i; lua_remove(L, 1); // don't care about spr2defaults[] dummy userdata. @@ -154,7 +154,7 @@ static int lib_getSpr2default(lua_State *L) static int lib_setSpr2default(lua_State *L) { - UINT32 i; + playersprite_t i; UINT8 j = 0; lua_remove(L, 1); // don't care about spr2defaults[] dummy userdata.