From 2c96410b3924d11cce1cdaaf09419e9ed295995a Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Mon, 26 Dec 2016 06:02:06 +0000 Subject: [PATCH] Address a number of harmless instances of "code never reached" identified by Xcode. git-svn-id: https://svn.eduke32.com/eduke32@5961 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/src/build.c | 8 ++------ polymer/eduke32/build/src/defs.c | 4 ++-- polymer/eduke32/build/src/polymost.c | 5 +++-- polymer/eduke32/build/src/sdlayer.c | 3 ++- polymer/eduke32/source/game.c | 1 - polymer/eduke32/source/gamedef.c | 2 +- polymer/eduke32/source/gameexec.c | 1 - polymer/eduke32/source/m32exec.c | 5 ----- polymer/eduke32/source/menus.c | 6 ++++-- 9 files changed, 14 insertions(+), 21 deletions(-) diff --git a/polymer/eduke32/build/src/build.c b/polymer/eduke32/build/src/build.c index 274d76765..c8b400758 100644 --- a/polymer/eduke32/build/src/build.c +++ b/polymer/eduke32/build/src/build.c @@ -8007,9 +8007,7 @@ CANCEL: { bad = 0; - if (!ask_if_sure("Are you sure you want to start a new board? (Y/N)", 0)) - break; - else + if (ask_if_sure("Are you sure you want to start a new board? (Y/N)", 0)) { int32_t bakstat=-1; mapinfofull_t bakmap; @@ -8051,11 +8049,9 @@ CANCEL: CheckMapCorruption(4, 0); - break; } - // printmessage16(""); - showframe(1); + break; } else if (ch == 'l' || ch == 'L') //L { diff --git a/polymer/eduke32/build/src/defs.c b/polymer/eduke32/build/src/defs.c index 414be6d06..39f5bbf94 100644 --- a/polymer/eduke32/build/src/defs.c +++ b/polymer/eduke32/build/src/defs.c @@ -2446,7 +2446,7 @@ static int32_t defsparser(scriptfile *script) case T_UNDEFMODELOF: { int32_t r0; -#ifdef USE_OPENGL +#if defined USE_OPENGL && 0 int32_t mid; #endif @@ -2459,7 +2459,7 @@ static int32_t defsparser(scriptfile *script) initprintf("Warning: undefmodelof: currently non-functional.\n"); break; -#ifdef USE_OPENGL +#if defined USE_OPENGL && 0 mid = md_tilehasmodel(r0,0); if (mid < 0) break; diff --git a/polymer/eduke32/build/src/polymost.c b/polymer/eduke32/build/src/polymost.c index 57ce737df..03e8f099b 100644 --- a/polymer/eduke32/build/src/polymost.c +++ b/polymer/eduke32/build/src/polymost.c @@ -974,8 +974,9 @@ static int32_t tile_is_sky(int32_t tilenum) { return return (tilenum >= 78 /*CLOUDYOCEAN*/ && tilenum <= 99 /*REDSKY2*/); } +# define clamp_if_tile_is_sky(x, y) (tile_is_sky(x) ? (y) : GL_REPEAT) #else -# define tile_is_sky(x) (0) +# define clamp_if_tile_is_sky(x, y) (GL_REPEAT) #endif static void polymost_setuptexture(const int32_t dameth, int filter) @@ -1004,7 +1005,7 @@ static void polymost_setuptexture(const int32_t dameth, int filter) if (!(dameth & DAMETH_CLAMPED)) { - bglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, !tile_is_sky(dapic) ? GL_REPEAT : clamp_mode); + bglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, clamp_if_tile_is_sky(dapic, clamp_mode)); bglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); } else diff --git a/polymer/eduke32/build/src/sdlayer.c b/polymer/eduke32/build/src/sdlayer.c index ec0681c51..f2e57c818 100644 --- a/polymer/eduke32/build/src/sdlayer.c +++ b/polymer/eduke32/build/src/sdlayer.c @@ -193,12 +193,13 @@ int32_t wm_msgbox(const char *name, const char *fmt, ...) #elif defined GEKKO puts(buf); return 0; -#endif +#else puts(buf); puts(" (press Return or Enter to continue)"); getchar(); return 0; +#endif } #if SDL_MAJOR_VERSION != 1 diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index ac21771e3..e3c8cf288 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -6705,7 +6705,6 @@ skipframe: } while (1); - G_GameExit(" "); return 0; // not reached (duh) } diff --git a/polymer/eduke32/source/gamedef.c b/polymer/eduke32/source/gamedef.c index 3ff24faac..97fd66122 100644 --- a/polymer/eduke32/source/gamedef.c +++ b/polymer/eduke32/source/gamedef.c @@ -1470,7 +1470,7 @@ static int32_t C_SkipComments(void) g_errorCnt++; continue; } - continue; + break; default: if (ispecial(*textptr)) diff --git a/polymer/eduke32/source/gameexec.c b/polymer/eduke32/source/gameexec.c index f41e76da9..d28afa3f0 100644 --- a/polymer/eduke32/source/gameexec.c +++ b/polymer/eduke32/source/gameexec.c @@ -2804,7 +2804,6 @@ nullquote: P_SetGamePalette(pPlayer, tw, 2 + 16); continue; } - continue; case CON_GUNIQHUDID: insptr++; diff --git a/polymer/eduke32/source/m32exec.c b/polymer/eduke32/source/m32exec.c index 4e642ca64..d4f00b8b8 100644 --- a/polymer/eduke32/source/m32exec.c +++ b/polymer/eduke32/source/m32exec.c @@ -2416,11 +2416,6 @@ badindex: continue; } - insptr++; - X_ERROR_INVALIDQUOTE(*insptr, apStrings); - OSD_Printf("%s", apStrings[*insptr++]); - continue; - case CON_GETNUMBER16: /* deprecated */ case CON_GETNUMBER256: /* deprecated */ case CON_GETNUMBERFROMUSER: diff --git a/polymer/eduke32/source/menus.c b/polymer/eduke32/source/menus.c index 07cb31b33..ccd6a3b22 100644 --- a/polymer/eduke32/source/menus.c +++ b/polymer/eduke32/source/menus.c @@ -4694,11 +4694,10 @@ static int32_t Menu_RunInput_MouseAdvance(void) static int32_t Menu_RunInput_MouseReturn_status; +#if !defined EDUKE32_TOUCH_DEVICES static void Menu_Run_MouseReturn(Menu_t *cm, const vec2_t origin) { -#if !defined EDUKE32_TOUCH_DEVICES if (!MOUSEACTIVECONDITION) -#endif return; if (cm->menuID == MENU_MAIN) @@ -4709,6 +4708,7 @@ static void Menu_Run_MouseReturn(Menu_t *cm, const vec2_t origin) 2 | 8 | 16 | RS_ALIGN_L, MOUSEALPHA, 0, xdim_from_320_16(origin.x + x_widescreen_left()), 0, xdim_from_320_16(origin.x + x_widescreen_left() + (tilesiz[SELECTDIR].y << 15)), ydim - 1); } +#endif static int32_t Menu_RunInput_MouseReturn(void) { @@ -5029,7 +5029,9 @@ static void Menu_Run(Menu_t *cm, const vec2_t origin) } } +#if !defined EDUKE32_TOUCH_DEVICES Menu_Run_MouseReturn(cm, origin); +#endif } /*