From 12266e0f85c8573995c320be31813e9decd885c0 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Fri, 9 Jun 2017 23:15:41 +0100 Subject: [PATCH 01/12] Set ack and ackreturn to 0 for local packets always This won't really have any in-game effect, this is just so the debugfile doesn't display the ack values of the PREVIOUS sent/got packet --- src/d_net.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/d_net.c b/src/d_net.c index 50b6c8cf6..4b14e1751 100644 --- a/src/d_net.c +++ b/src/d_net.c @@ -1028,6 +1028,7 @@ boolean HSendPacket(INT32 node, boolean reliable, UINT8 acknum, size_t packetlen #endif return false; } + netbuffer->ack = netbuffer->ackreturn = 0; // don't hold over values from last packet sent/received M_Memcpy(&reboundstore[rebound_head], netbuffer, doomcom->datalength); reboundsize[rebound_head] = doomcom->datalength; From b9828f78e8688ac416ba40f008f74d37cb1515a5 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Fri, 9 Jun 2017 23:22:27 +0100 Subject: [PATCH 02/12] Fix stupid lack of newline with this message --- src/d_clisrv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 312a308a1..acaca1f62 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -4077,7 +4077,7 @@ static INT16 Consistancy(void) mobj_t *mo; #endif - DEBFILE(va("TIC %u ", gametic)); + DEBFILE(va("TIC %u\n", gametic)); for (i = 0; i < MAXPLAYERS; i++) { From bae55a3af463f5ce6ecdc9af42aa4762eba25f4c Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sat, 10 Jun 2017 16:36:52 +0100 Subject: [PATCH 03/12] Don't display "x set to y" messages twice in the debugfile for consvars with CV_SHOWMODIFONETIME/CV_SHOWMODIF (can't think offhand when those flags are actually used, but oh well) --- src/command.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/command.c b/src/command.c index a15471c83..f77fb5a4d 100644 --- a/src/command.c +++ b/src/command.c @@ -1180,7 +1180,10 @@ finish: CONS_Printf(M_GetText("%s set to %s\n"), var->name, var->string); var->flags &= ~CV_SHOWMODIFONETIME; } - DEBFILE(va("%s set to %s\n", var->name, var->string)); + else // display message in debug file only + { + DEBFILE(va("%s set to %s\n", var->name, var->string)); + } var->flags |= CV_MODIFIED; // raise 'on change' code #ifdef HAVE_BLUA From 02c098574cc768cbb564c6a239289edaffea35e1 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sat, 10 Jun 2017 17:09:08 +0100 Subject: [PATCH 04/12] ah, turns out the TIC n debugfile print is a remnant of when Doom Legacy printed the consistancy return value... which we'll do here now too, in that case --- src/d_clisrv.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index acaca1f62..706312623 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -4077,7 +4077,7 @@ static INT16 Consistancy(void) mobj_t *mo; #endif - DEBFILE(va("TIC %u\n", gametic)); + DEBFILE(va("TIC %u ", gametic)); for (i = 0; i < MAXPLAYERS; i++) { @@ -4099,7 +4099,10 @@ static INT16 Consistancy(void) #ifdef MOBJCONSISTANCY if (!thinkercap.next) + { + DEBFILE(va("Consistancy = %u\n", ret)); return ret; + } for (th = thinkercap.next; th != &thinkercap; th = th->next) { if (th->function.acp1 != (actionf_p1)P_MobjThinker) @@ -4168,6 +4171,8 @@ static INT16 Consistancy(void) } #endif + DEBFILE(va("Consistancy = %u\n", (ret & 0xFFFF))); + return (INT16)(ret & 0xFFFF); } From 318d5656b51a527309695caf6930726adb94b594 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Mon, 12 Jun 2017 17:55:15 +0100 Subject: [PATCH 05/12] Keeping a total of thinkers saved/loaded and print the total in netplay devmode Not a fix for anything, probably just useful for debugging --- src/p_saveg.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/p_saveg.c b/src/p_saveg.c index 75f7b3e51..d1ec8e5ab 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -1653,12 +1653,18 @@ static inline void SaveWhatThinker(const thinker_t *th, const UINT8 type) static void P_NetArchiveThinkers(void) { const thinker_t *th; + UINT32 numsaved = 0; WRITEUINT32(save_p, ARCHIVEBLOCK_THINKERS); // save off the current thinkers for (th = thinkercap.next; th != &thinkercap; th = th->next) { + if (!(th->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed + || th->function.acp1 == (actionf_p1)P_RainThinker + || th->function.acp1 == (actionf_p1)P_SnowThinker)) + numsaved++; + if (th->function.acp1 == (actionf_p1)P_MobjThinker) { SaveMobjThinker(th, tc_mobj); @@ -1846,6 +1852,8 @@ static void P_NetArchiveThinkers(void) #endif } + CONS_Debug(DBG_NETPLAY, "%u thinkers saved\n", numsaved); + WRITEUINT8(save_p, tc_end); } @@ -2610,6 +2618,7 @@ static void P_NetUnArchiveThinkers(void) UINT8 tclass; UINT8 restoreNum = false; UINT32 i; + UINT32 numloaded = 0; if (READUINT32(save_p) != ARCHIVEBLOCK_THINKERS) I_Error("Bad $$$.sav at archive block Thinkers"); @@ -2643,6 +2652,7 @@ static void P_NetUnArchiveThinkers(void) if (tclass == tc_end) break; // leave the saved thinker reading loop + numloaded++; switch (tclass) { @@ -2794,6 +2804,8 @@ static void P_NetUnArchiveThinkers(void) } } + CONS_Debug(DBG_NETPLAY, "%u thinkers loaded\n", numloaded); + if (restoreNum) { executor_t *delay = NULL; From 8514251ad5c8dda928ca0924a7553429fc183c4f Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sat, 9 Sep 2017 21:19:07 +0100 Subject: [PATCH 06/12] fix savegamename not prepending srb2home to itself for custom mods using their own gamedata files --- src/dehacked.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/dehacked.c b/src/dehacked.c index f03dd73b4..b7e874b16 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -11,6 +11,7 @@ /// \brief Load dehacked file and change tables and text #include "doomdef.h" +#include "d_main.h" // for srb2home #include "g_game.h" #include "sounds.h" #include "info.h" @@ -3070,6 +3071,8 @@ static void readmaincfg(MYFILE *f) strncpy(savegamename, timeattackfolder, sizeof (timeattackfolder)); strlcat(savegamename, "%u.ssg", sizeof(savegamename)); + // can't use sprintf since there is %u in savegamename + strcatbf(savegamename, srb2home, PATHSEP); gamedataadded = true; } From 7e23014d5fab80bd4ee2509aa09e14efed25db1c Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Thu, 28 Sep 2017 09:04:36 -0400 Subject: [PATCH 07/12] Makefile: support GCC 6.4 --- src/Makefile.cfg | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Makefile.cfg b/src/Makefile.cfg index 5bf7f247d..50cc32dd5 100644 --- a/src/Makefile.cfg +++ b/src/Makefile.cfg @@ -8,6 +8,10 @@ # +ifdef GCC64 +GCC64=1 +endif + ifdef GCC63 GCC62=1 endif From bdba212b2a9653734afe6b3b6b4c08fa104980c5 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Thu, 28 Sep 2017 09:13:01 -0400 Subject: [PATCH 08/12] Makefile: add support for GCC 7.1 and 7.2 --- .travis.yml | 15 +++++++++++++++ src/Makefile.cfg | 7 +++++++ 2 files changed, 22 insertions(+) diff --git a/.travis.yml b/.travis.yml index e5dbb58e4..285eebd52 100644 --- a/.travis.yml +++ b/.travis.yml @@ -100,6 +100,21 @@ matrix: compiler: gcc-6 env: WFLAGS="-Wno-tautological-compare" #gcc-6 (Ubuntu 6.1.1-3ubuntu11~14.04.1) 6.1.1 20160511 + - os: linux + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - libsdl2-mixer-dev + - libpng-dev + - libgl1-mesa-dev + - libgme-dev + - p7zip-full + - gcc-7 + compiler: gcc-7 + env: WFLAGS="-Wno-tautological-compare" + #gcc-7 (Ubuntu 7.2.0-1ubuntu1~14.04) 7.2.0 20170802 - os: linux compiler: clang #clang version 3.5.0 (tags/RELEASE_350/final) diff --git a/src/Makefile.cfg b/src/Makefile.cfg index 50cc32dd5..7620a3d68 100644 --- a/src/Makefile.cfg +++ b/src/Makefile.cfg @@ -7,6 +7,13 @@ # and other things # +ifdef GCC72 +GCC71=1 +endif + +ifdef GCC71 +GCC64=1 +endif ifdef GCC64 GCC64=1 From 55f377ba3df6497b7ade878e4c58879c23e50717 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Thu, 28 Sep 2017 09:13:46 -0400 Subject: [PATCH 09/12] Build: kill GCC 7's format-overflow warnings --- src/d_net.c | 2 +- src/f_wipe.c | 2 +- src/g_game.c | 2 +- src/sounds.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/d_net.c b/src/d_net.c index 50b6c8cf6..c335d21ca 100644 --- a/src/d_net.c +++ b/src/d_net.c @@ -1363,7 +1363,7 @@ boolean D_CheckNetGame(void) #else if (M_CheckParm("-debugfile")) { - char filename[20]; + char filename[21]; INT32 k = doomcom->consoleplayer - 1; if (M_IsNextParm()) k = atoi(M_GetNextParm()) - 1; diff --git a/src/f_wipe.c b/src/f_wipe.c index a0b685a32..e45f2e85b 100644 --- a/src/f_wipe.c +++ b/src/f_wipe.c @@ -94,7 +94,7 @@ static fixed_t paldiv; * \return fademask_t for lump */ static fademask_t *F_GetFadeMask(UINT8 masknum, UINT8 scrnnum) { - static char lumpname[9] = "FADEmmss"; + static char lumpname[10] = "FADEmmss"; static fademask_t fm = {NULL,0,0,0,0,0}; lumpnum_t lumpnum; UINT8 *lump, *mask; diff --git a/src/g_game.c b/src/g_game.c index 7499fe7a0..f1b176f2a 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -726,7 +726,7 @@ void G_SetGameModified(boolean silent) */ const char *G_BuildMapName(INT32 map) { - static char mapname[9] = "MAPXX"; // internal map name (wad resource name) + static char mapname[10] = "MAPXX"; // internal map name (wad resource name) I_Assert(map > 0); I_Assert(map <= NUMMAPS); diff --git a/src/sounds.c b/src/sounds.c index 8ad42ac9f..53e3b6187 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -477,7 +477,7 @@ void S_InitRuntimeSounds (void) { sfxenum_t i; INT32 value; - char soundname[7]; + char soundname[10]; for (i = sfx_freeslot0; i <= sfx_lastskinsoundslot; i++) { From 2ccd397d11e8ec97ad46f99c1373ce88d21350c6 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Thu, 28 Sep 2017 09:39:47 -0400 Subject: [PATCH 10/12] Build: kill GCC 7's implicit-fallthrough warning --- src/blua/ldebug.c | 2 +- src/blua/llex.c | 25 +++++++++++++++---------- src/blua/ltable.c | 1 + src/d_clisrv.c | 3 +++ src/d_netcmd.c | 2 +- src/m_menu.c | 5 +++++ src/p_ceilng.c | 5 ++++- src/p_enemy.c | 2 +- src/p_floor.c | 2 ++ src/p_inter.c | 4 +++- src/p_mobj.c | 3 ++- src/p_spec.c | 10 +++++++++- src/sdl/i_video.c | 1 + src/v_video.c | 8 ++++++++ src/y_inter.c | 2 ++ 15 files changed, 58 insertions(+), 17 deletions(-) diff --git a/src/blua/ldebug.c b/src/blua/ldebug.c index 497d54980..542e209a1 100644 --- a/src/blua/ldebug.c +++ b/src/blua/ldebug.c @@ -412,7 +412,7 @@ static Instruction symbexec (const Proto *pt, int lastpc, int reg) { case OP_FORLOOP: case OP_FORPREP: checkreg(pt, a+3); - /* go through */ + /* FALLTHRU */ case OP_JMP: { int dest = pc+1+b; /* not full check and jump is forward and do not skip `lastpc'? */ diff --git a/src/blua/llex.c b/src/blua/llex.c index 0b328dcad..9e3dc2929 100644 --- a/src/blua/llex.c +++ b/src/blua/llex.c @@ -306,11 +306,12 @@ static void read_string (LexState *ls, int del, SemInfo *seminfo) { save_and_next(ls); /* skip $ */ seminfo->ts = luaX_newstring(ls, luaZ_buffer(ls->buff) + 1, luaZ_bufflen(ls->buff) - 2); - ls->refstr++; /* expect '\' anytime soon */ + ls->refstr++; /* expect '\' anytime soon */ lua_assert(ls->lookahead.token == TK_EOS); - ls->lookahead.token = TK_CONCAT; - return; - } + ls->lookahead.token = TK_CONCAT; + return; + } + /* FALLTHRU */ default: { if (!isdigit(ls->current)) save_and_next(ls); /* handles \\, \", \', and \? */ @@ -340,7 +341,8 @@ static void read_string (LexState *ls, int del, SemInfo *seminfo) { }; switch (i) { - case 4: save( ls, (c>>8) & 0xff ); // pass-through.. + case 4: save( ls, (c>>8) & 0xff ); + /* FALLTHRU */ case 2: save( ls, c&0xff ); break; case 5: @@ -350,7 +352,7 @@ static void read_string (LexState *ls, int del, SemInfo *seminfo) { } continue; - // "\u0000".."\x10FFFF": UTF-8 encoded Unicode + // "\u0000".."\x10FFFF": UTF-8 encoded Unicode // // Note that although codes are entered like this (must have min. four digit, // just to tease you!) the actual outcome in the string will vary between @@ -482,20 +484,22 @@ static int llex (LexState *ls, SemInfo *seminfo) { else if (sep == -1) return '['; else luaX_lexerror(ls, "invalid long string delimiter", TK_STRING); } + /* FALLTHRU */ case '=': { next(ls); if (ls->current != '=') return '='; else { next(ls); return TK_EQ; } } + /* FALLTHRU */ case '<': { next(ls); - if (ls->current == '<') { next(ls); return TK_SHL; } + if (ls->current == '<') { next(ls); return TK_SHL; } if (ls->current != '=') return '<'; else { next(ls); return TK_LE; } } case '>': { next(ls); - if (ls->current == '>') { next(ls); return TK_SHR; } + if (ls->current == '>') { next(ls); return TK_SHR; } if (ls->current != '=') return '>'; else { next(ls); return TK_GE; } } @@ -547,9 +551,10 @@ static int llex (LexState *ls, SemInfo *seminfo) { } case '\\': if (ls->refstr) { ls->refstr--; - ls->current = '"'; /* whacky! */ - return TK_CONCAT; + ls->current = '"'; /* whacky! */ + return TK_CONCAT; } + /* FALLTHRU */ default: { if (isspace(ls->current)) { lua_assert(!currIsNewline(ls)); diff --git a/src/blua/ltable.c b/src/blua/ltable.c index 9f4d91ff2..0ddd9ef4f 100644 --- a/src/blua/ltable.c +++ b/src/blua/ltable.c @@ -478,6 +478,7 @@ static TValue *newkey (lua_State *L, Table *t, const TValue *key) { return luaH_getnum(t, k); /* use specialized version */ /* else go through */ } + /* FALLTHRU */ default: { Node *n = mainposition(t, key); do { /* check whether `key' is somewhere in the chain */ diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 7c21d79fc..c1f2f8ed4 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -1883,6 +1883,7 @@ static boolean CL_ServerConnectionTicker(boolean viams, const char *tmpsave, tic break; // exit the case cl_mode = CL_ASKJOIN; // don't break case continue to cljoin request now + /* FALLTHRU */ case CL_ASKJOIN: CL_LoadServerFiles(); @@ -3605,6 +3606,7 @@ static void HandlePacketFromAwayNode(SINT8 node) // Do not remove my own server (we have just get a out of order packet) if (node == servernode) break; + /* FALLTHRU */ default: DEBFILE(va("unknown packet received (%d) from unknown host\n",netbuffer->packettype)); @@ -3761,6 +3763,7 @@ FILESTAMP break; case PT_TEXTCMD2: // splitscreen special netconsole = nodetoplayer2[node]; + /* FALLTHRU */ case PT_TEXTCMD: if (client) break; diff --git a/src/d_netcmd.c b/src/d_netcmd.c index b5563f4e8..83bbc7aad 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -2453,7 +2453,7 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum) error = true; break; } - //fall down + /* FALLTHRU */ case GT_TAG: switch (NetPacket.packet.newteam) { diff --git a/src/m_menu.c b/src/m_menu.c index 45b3d7e57..5b699dcb4 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -3022,6 +3022,7 @@ static void M_DrawGenericMenu(void) W_CachePatchName(currentMenu->menuitems[i].patch, PU_CACHE)); } } + /* FALLTHRU */ case IT_NOTHING: case IT_DYBIGSPACE: y += LINEHEIGHT; @@ -3073,6 +3074,7 @@ static void M_DrawGenericMenu(void) break; case IT_STRING2: V_DrawString(x, y, 0, currentMenu->menuitems[i].text); + /* FALLTHRU */ case IT_DYLITLSPACE: y += SMALLLINEHEIGHT; break; @@ -3085,6 +3087,7 @@ static void M_DrawGenericMenu(void) case IT_TRANSTEXT: if (currentMenu->menuitems[i].alphaKey) y = currentMenu->y+currentMenu->menuitems[i].alphaKey; + /* FALLTHRU */ case IT_TRANSTEXT2: V_DrawString(x, y, V_TRANSLUCENT, currentMenu->menuitems[i].text); y += SMALLLINEHEIGHT; @@ -3297,6 +3300,7 @@ static void M_DrawCenteredMenu(void) W_CachePatchName(currentMenu->menuitems[i].patch, PU_CACHE)); } } + /* FALLTHRU */ case IT_NOTHING: case IT_DYBIGSPACE: y += LINEHEIGHT; @@ -3347,6 +3351,7 @@ static void M_DrawCenteredMenu(void) break; case IT_STRING2: V_DrawCenteredString(x, y, 0, currentMenu->menuitems[i].text); + /* FALLTHRU */ case IT_DYLITLSPACE: y += SMALLLINEHEIGHT; break; diff --git a/src/p_ceilng.c b/src/p_ceilng.c index db30b5cac..27d739414 100644 --- a/src/p_ceilng.c +++ b/src/p_ceilng.c @@ -79,7 +79,7 @@ void T_MoveCeiling(ceiling_t *ceiling) P_LinedefExecute((INT16)(ceiling->texture + INT16_MAX + 2), NULL, NULL); if (ceiling->texture > -1) // flat changing ceiling->sector->ceilingpic = ceiling->texture; - // don't break + /* FALLTHRU */ case raiseToHighest: // case raiseCeilingByLine: case moveCeilingByFrontTexture: @@ -182,6 +182,7 @@ void T_MoveCeiling(ceiling_t *ceiling) // except generalized ones, reset speed, start back up case crushAndRaise: ceiling->speed = CEILSPEED; + /* FALLTHRU */ case fastCrushAndRaise: ceiling->direction = 1; break; @@ -200,6 +201,7 @@ void T_MoveCeiling(ceiling_t *ceiling) if (ceiling->texture > -1) // flat changing ceiling->sector->ceilingpic = ceiling->texture; // don't break + /* FALLTHRU */ // in all other cases, just remove the active ceiling case lowerAndCrush: @@ -427,6 +429,7 @@ INT32 EV_DoCeiling(line_t *line, ceiling_e type) case crushAndRaise: ceiling->crush = true; ceiling->topheight = sec->ceilingheight; + /* FALLTHRU */ case lowerAndCrush: ceiling->bottomheight = sec->floorheight; ceiling->bottomheight += 4*FRACUNIT; diff --git a/src/p_enemy.c b/src/p_enemy.c index 649c78838..9de735edc 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -6169,7 +6169,7 @@ void A_Boss7Chase(mobj_t *actor) break; } actor->threshold++; - // fall into... + /* FALLTHRU */ case 1: // Chaingun Goop A_FaceTarget(actor); P_SetMobjState(actor, S_BLACKEGG_SHOOT1); diff --git a/src/p_floor.c b/src/p_floor.c index 911213014..8438050fa 100644 --- a/src/p_floor.c +++ b/src/p_floor.c @@ -312,6 +312,7 @@ void T_MoveFloor(floormove_t *movefloor) case moveFloorByFrontSector: if (movefloor->texture < -1) // chained linedef executing P_LinedefExecute((INT16)(movefloor->texture + INT16_MAX + 2), NULL, NULL); + /* FALLTHRU */ case instantMoveFloorByFrontSector: if (movefloor->texture > -1) // flat changing movefloor->sector->floorpic = movefloor->texture; @@ -360,6 +361,7 @@ void T_MoveFloor(floormove_t *movefloor) case moveFloorByFrontSector: if (movefloor->texture < -1) // chained linedef executing P_LinedefExecute((INT16)(movefloor->texture + INT16_MAX + 2), NULL, NULL); + /* FALLTHRU */ case instantMoveFloorByFrontSector: if (movefloor->texture > -1) // flat changing movefloor->sector->floorpic = movefloor->texture; diff --git a/src/p_inter.c b/src/p_inter.c index 4892d9775..407e091fa 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -383,9 +383,11 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) case MT_REDTEAMRING: if (player->ctfteam != 1) return; + /* FALLTHRU */ case MT_BLUETEAMRING: // Yes, I'm lazy. Oh well, deal with it. if (special->type == MT_BLUETEAMRING && player->ctfteam != 2) return; + /* FALLTHRU */ case MT_RING: case MT_FLINGRING: if (!(P_CanPickupItem(player, false))) @@ -3127,7 +3129,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da P_SetMobjState(target, target->info->meleestate); // go to pinch pain state break; } - // fallthrough + /* FALLTHRU */ default: P_SetMobjState(target, target->info->painstate); break; diff --git a/src/p_mobj.c b/src/p_mobj.c index 9fdbc37fb..f52011517 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -7138,7 +7138,7 @@ void P_MobjThinker(mobj_t *mobj) mobj->z = mobj->ceilingz - mobj->height; else mobj->z = mobj->floorz; - // THERE IS NO BREAK HERE ON PURPOSE + /* FALLTHRU */ default: // check mobj against possible water content, before movement code P_MobjCheckWater(mobj); @@ -8185,6 +8185,7 @@ void P_PrecipitationEffects(void) { case PRECIP_RAIN: // no lightning or thunder whatsoever sounds_thunder = false; + /* FALLTHRU */ case PRECIP_STORM_NOSTRIKES: // no lightning strikes specifically effects_lightning = false; break; diff --git a/src/p_spec.c b/src/p_spec.c index 48c0f58b3..ad8d7337b 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -3625,6 +3625,7 @@ void P_ProcessSpecialSector(player_t *player, sector_t *sector, sector_t *rovers goto DoneSection2; } } + /* FALLTHRU */ case 4: // Linedef executor that doesn't require touching floor case 5: // Linedef executor case 6: // Linedef executor (7 Emeralds) @@ -4632,6 +4633,8 @@ static void P_RunSpecialSectorCheck(player_t *player, sector_t *sector) // requires touching floor. break; } + /* FALLTHRU */ + case 1: // Starpost activator case 5: // Fan sector case 6: // Super Sonic Transform @@ -5711,6 +5714,8 @@ void P_SpawnSpecials(INT32 fromnetsave) EV_DoFloor(&lines[i], bounceFloor); if (lines[i].special == 54) break; + /* FALLTHRU */ + case 55: // New super cool and awesome moving ceiling type if (lines[i].backsector) EV_DoCeiling(&lines[i], bounceCeiling); @@ -5722,7 +5727,8 @@ void P_SpawnSpecials(INT32 fromnetsave) EV_DoFloor(&lines[i], bounceFloorCrush); if (lines[i].special == 57) - break; //only move the floor + break; //only move the floor + /* FALLTHRU */ case 58: // New super cool and awesome moving ceiling crush type if (lines[i].backsector) @@ -6828,6 +6834,7 @@ static void P_SpawnScrollers(void) Add_Scroller(sc_ceiling, -dx, dy, control, s, accel, l->flags & ML_NOCLIMB); if (special != 533) break; + /* FALLTHRU */ case 523: // carry objects on ceiling dx = FixedMul(dx, CARRYFACTOR); @@ -6842,6 +6849,7 @@ static void P_SpawnScrollers(void) Add_Scroller(sc_floor, -dx, dy, control, s, accel, l->flags & ML_NOCLIMB); if (special != 530) break; + /* FALLTHRU */ case 520: // carry objects on floor dx = FixedMul(dx, CARRYFACTOR); diff --git a/src/sdl/i_video.c b/src/sdl/i_video.c index 9cebe4945..707c66dd6 100644 --- a/src/sdl/i_video.c +++ b/src/sdl/i_video.c @@ -941,6 +941,7 @@ static inline boolean I_SkipFrame(void) case GS_LEVEL: if (!paused) return false; + /* FALLTHRU */ case GS_TIMEATTACK: case GS_WAITINGPLAYERS: return skip; // Skip odd frames diff --git a/src/v_video.c b/src/v_video.c index 64bb3214e..cc81cedbc 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -1083,6 +1083,7 @@ char *V_WordWrap(INT32 x, INT32 w, INT32 option, const char *string) { case V_MONOSPACE: spacewidth = 8; + /* FALLTHRU */ case V_OLDSPACING: charwidth = 8; break; @@ -1160,6 +1161,7 @@ void V_DrawString(INT32 x, INT32 y, INT32 option, const char *string) { case V_MONOSPACE: spacewidth = 8; + /* FALLTHRU */ case V_OLDSPACING: charwidth = 8; break; @@ -1269,6 +1271,7 @@ void V_DrawSmallString(INT32 x, INT32 y, INT32 option, const char *string) { case V_MONOSPACE: spacewidth = 4; + /* FALLTHRU */ case V_OLDSPACING: charwidth = 4; break; @@ -1370,6 +1373,7 @@ void V_DrawThinString(INT32 x, INT32 y, INT32 option, const char *string) { case V_MONOSPACE: spacewidth = 5; + /* FALLTHRU */ case V_OLDSPACING: charwidth = 5; break; @@ -1463,6 +1467,7 @@ void V_DrawStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *string) { case V_MONOSPACE: spacewidth = 8; + /* FALLTHRU */ case V_OLDSPACING: charwidth = 8; break; @@ -1747,6 +1752,7 @@ INT32 V_StringWidth(const char *string, INT32 option) { case V_MONOSPACE: spacewidth = 8; + /* FALLTHRU */ case V_OLDSPACING: charwidth = 8; break; @@ -1785,6 +1791,7 @@ INT32 V_SmallStringWidth(const char *string, INT32 option) { case V_MONOSPACE: spacewidth = 4; + /* FALLTHRU */ case V_OLDSPACING: charwidth = 4; break; @@ -1823,6 +1830,7 @@ INT32 V_ThinStringWidth(const char *string, INT32 option) { case V_MONOSPACE: spacewidth = 5; + /* FALLTHRU */ case V_OLDSPACING: charwidth = 5; break; diff --git a/src/y_inter.c b/src/y_inter.c index 42f1e2235..cfdc2a080 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -1004,6 +1004,7 @@ void Y_StartIntermission(void) // fall back into the coop intermission for now intertype = int_coop; + /* FALLTHRU */ case int_coop: // coop or single player, normal level { // award time and ring bonuses @@ -1117,6 +1118,7 @@ void Y_StartIntermission(void) // fall back into the special stage intermission for now intertype = int_spec; + /* FALLTHRU */ case int_spec: // coop or single player, special stage { // Update visitation flags? From 7f98c5c8044611b036d94e723375a3c142f1260e Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Thu, 28 Sep 2017 10:02:08 -0400 Subject: [PATCH 11/12] Build: do not error on fallthrough --- .travis.yml | 2 +- src/m_misc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 285eebd52..9c82909bc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -113,7 +113,7 @@ matrix: - p7zip-full - gcc-7 compiler: gcc-7 - env: WFLAGS="-Wno-tautological-compare" + env: WFLAGS="-Wno-error=implicit-fallthrough" #gcc-7 (Ubuntu 7.2.0-1ubuntu1~14.04) 7.2.0 20170802 - os: linux compiler: clang diff --git a/src/m_misc.c b/src/m_misc.c index d88643ec4..8193571e8 100644 --- a/src/m_misc.c +++ b/src/m_misc.c @@ -1079,7 +1079,7 @@ void M_StartMovie(void) moviemode = M_StartMovieGIF(pathname); break; } - // fall thru + /* FALLTHRU */ case MM_APNG: moviemode = M_StartMovieAPNG(pathname); break; From 1ffdd2e945321ca235892100be3b51b532d6e91c Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Thu, 28 Sep 2017 10:15:10 -0400 Subject: [PATCH 12/12] Travis: still need to keep -Wno-tautological-compare for GCC 7 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 9c82909bc..afb04758b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -113,7 +113,7 @@ matrix: - p7zip-full - gcc-7 compiler: gcc-7 - env: WFLAGS="-Wno-error=implicit-fallthrough" + env: WFLAGS="-Wno-tautological-compare -Wno-error=implicit-fallthrough" #gcc-7 (Ubuntu 7.2.0-1ubuntu1~14.04) 7.2.0 20170802 - os: linux compiler: clang