From 3786604203da671b36d772ad471fd2b9eaf947c3 Mon Sep 17 00:00:00 2001 From: MascaraSnake Date: Tue, 6 Aug 2019 23:18:53 +0200 Subject: [PATCH 01/23] Don't zero out momz when landing on slopes. This fixes Fang's bounce on slopes and doesn't seem to make a difference otherwise, but there's still a non-zero chance this broke something. --- src/p_slopes.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/p_slopes.c b/src/p_slopes.c index d6080c15d..f89dd3c96 100644 --- a/src/p_slopes.c +++ b/src/p_slopes.c @@ -717,7 +717,7 @@ void P_HandleSlopeLanding(mobj_t *thing, pslope_t *slope) if (slope->flags & SL_NOPHYSICS) { // No physics, no need to make anything complicated. if (P_MobjFlip(thing)*(thing->momz) < 0) { // falling, land on slope - thing->momz = -P_MobjFlip(thing); + //thing->momz = -P_MobjFlip(thing); thing->standingslope = slope; } return; @@ -732,7 +732,7 @@ void P_HandleSlopeLanding(mobj_t *thing, pslope_t *slope) if (P_MobjFlip(thing)*mom.z < 0) { // falling, land on slope thing->momx = mom.x; thing->momy = mom.y; - thing->momz = -P_MobjFlip(thing); + //thing->momz = -P_MobjFlip(thing); thing->standingslope = slope; } From c6b49391c9daf404debea011672f14307d400c90 Mon Sep 17 00:00:00 2001 From: MascaraSnake Date: Tue, 6 Aug 2019 23:35:20 +0200 Subject: [PATCH 02/23] Set Fang's minimum bounce strength to 1.5 times jump strength --- src/p_user.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/p_user.c b/src/p_user.c index 0a338a6e7..0861398d6 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -4730,6 +4730,7 @@ void P_DoAbilityBounce(player_t *player, boolean changemomz) return; if (changemomz) { + fixed_t minmomz; prevmomz = player->mo->momz; if (P_MobjFlip(player->mo)*prevmomz < 0) prevmomz = 0; @@ -4737,7 +4738,8 @@ void P_DoAbilityBounce(player_t *player, boolean changemomz) prevmomz /= 2; P_DoJump(player, false); player->pflags &= ~(PF_STARTJUMP|PF_JUMPED); - player->mo->momz = (FixedMul(player->mo->momz, 3*FRACUNIT/2) + prevmomz)/2; + minmomz = FixedMul(player->mo->momz, 3*FRACUNIT/2); + player->mo->momz = max(minmomz, (minmomz + prevmomz)/2); } S_StartSound(player->mo, sfx_boingf); P_SetPlayerMobjState(player->mo, S_PLAY_BOUNCE_LANDING); From 0d38d7087b16439f5768e165605145ccf78f4382 Mon Sep 17 00:00:00 2001 From: mazmazz Date: Wed, 7 Aug 2019 01:29:05 -0400 Subject: [PATCH 03/23] Use strtok instead of strtok_r --- src/sdl/mixer_sound.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/sdl/mixer_sound.c b/src/sdl/mixer_sound.c index 64b7cc722..d94010d9a 100644 --- a/src/sdl/mixer_sound.c +++ b/src/sdl/mixer_sound.c @@ -163,7 +163,10 @@ static void MidiSoundfontPath_Onchange(void) boolean proceed = true; // check if file exists; menu calls this method at every keystroke - while ((miditoken = strtok_r(source, ";", &source))) + // get first token + miditoken = strtok(source, ";"); + + while (miditoken != NULL) { SDL_RWops *rw = SDL_RWFromFile(miditoken, "r"); if (rw != NULL) @@ -173,6 +176,7 @@ static void MidiSoundfontPath_Onchange(void) proceed = false; break; } + miditoken = strtok(NULL, ";"); } free(source); From 88445e72c4b48b56f27b7ba1269271cc57497e90 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Wed, 7 Aug 2019 12:39:04 -0400 Subject: [PATCH 04/23] fix PARANOIA builds --- src/p_saveg.c | 2 +- src/p_tick.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/p_saveg.c b/src/p_saveg.c index 0bfb81f4e..ea998b445 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -2404,7 +2404,7 @@ static void P_NetArchiveThinkers(void) } #endif // ESLOPE #ifdef PARANOIA - else if (th->function.acp1 != P_RemoveThinkerDelayed) // wait garbage collection + else if (th->function.acp1 != (actionf_p1)P_RemoveThinkerDelayed) // wait garbage collection I_Error("unknown thinker type %p", th->function.acp1); #endif } diff --git a/src/p_tick.c b/src/p_tick.c index 5ec0fb048..7606510fe 100644 --- a/src/p_tick.c +++ b/src/p_tick.c @@ -197,7 +197,7 @@ void P_InitThinkers(void) void P_AddThinker(const thinklistnum_t n, thinker_t *thinker) { #ifdef PARANOIA - I_Assert(n >= 0 && n < NUM_THINKERLISTS); + I_Assert(n < NUM_THINKERLISTS); #endif thlist[n].prev->next = thinker; @@ -326,7 +326,7 @@ static inline void P_RunThinkers(void) for (currentthinker = thlist[i].next; currentthinker != &thlist[i]; currentthinker = currentthinker->next) { #ifdef PARANOIA - I_Assert(currentthinker->function.acp1 != NULL) + I_Assert(currentthinker->function.acp1 != NULL); #endif currentthinker->function.acp1(currentthinker); } From f546dced924b4cd3a64bf3255ac6cd8c5419d6d0 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Wed, 7 Aug 2019 12:39:51 -0400 Subject: [PATCH 05/23] All C files should a newline at the end --- src/p_enemy.c | 2 +- src/p_spec.c | 2 +- src/s_sound.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/p_enemy.c b/src/p_enemy.c index 9f1b15d53..4126d0716 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -13715,4 +13715,4 @@ void A_ModuloToState(mobj_t *actor) if ((modulothing % locvar1 == 0)) P_SetMobjState(actor, (locvar2)); modulothing++; -} \ No newline at end of file +} diff --git a/src/p_spec.c b/src/p_spec.c index 23ab04fc7..5e06a18a7 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -9265,4 +9265,4 @@ static void P_SpawnPushers(void) Add_Pusher(p_downwind, l->dx, l->dy, NULL, s, -1, l->flags & ML_NOCLIMB, l->flags & ML_EFFECT4); break; } -} \ No newline at end of file +} diff --git a/src/s_sound.c b/src/s_sound.c index 2c6faf041..1c6cd5ef1 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -2304,4 +2304,4 @@ void ModFilter_OnChange(void) if (openmpt_mhandle) openmpt_module_set_render_param(openmpt_mhandle, OPENMPT_MODULE_RENDER_INTERPOLATIONFILTER_LENGTH, cv_modfilter.value); } -#endif \ No newline at end of file +#endif From 58a074db268f93f69557d3f82e4b2db547371c8b Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Wed, 7 Aug 2019 12:41:22 -0400 Subject: [PATCH 06/23] Fix signed vs unsigned comapre --- src/hardware/hw_md2.c | 2 +- src/r_things.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hardware/hw_md2.c b/src/hardware/hw_md2.c index 86097822e..d4728315a 100644 --- a/src/hardware/hw_md2.c +++ b/src/hardware/hw_md2.c @@ -1198,7 +1198,7 @@ static UINT8 P_GetModelSprite2(md2_t *md2, skin_t *skin, UINT8 spr2, player_t *p if (!md2 || !skin) return 0; - if ((spr2 & ~FF_SPR2SUPER) >= free_spr2) + if ((unsigned)(spr2 & ~FF_SPR2SUPER) >= free_spr2) return 0; while (!(md2->model->spr2frames[spr2*2 + 1]) diff --git a/src/r_things.c b/src/r_things.c index 645d10015..92f2b9460 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -2511,7 +2511,7 @@ UINT8 P_GetSkinSprite2(skin_t *skin, UINT8 spr2, player_t *player) if (!skin) return 0; - if ((spr2 & ~FF_SPR2SUPER) >= free_spr2) + if ((unsigned)(spr2 & ~FF_SPR2SUPER) >= free_spr2) return 0; while (!(skin->sprites[spr2].numframes) From 9d5abfcee0c105daaf26bf6b36bfbf7455304636 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Wed, 7 Aug 2019 12:42:07 -0400 Subject: [PATCH 07/23] Fix compiling without MixerX support --- src/m_menu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index a3e986fdf..5147077e0 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -1309,12 +1309,12 @@ static menuitem_t OP_SoundOptionsMenu[] = {IT_STRING | IT_CVAR, NULL, "Closed Captioning", &cv_closedcaptioning, 115}, // 56 {IT_STRING | IT_CVAR, NULL, "Reset Music Upon Dying", &cv_resetmusic, 125}, // 62 -#if defined(HAVE_OPENMPT) || defined(HAVE_MIXERX) +#ifdef HAVE_MIXERX {IT_STRING | IT_SUBMENU, NULL, "Advanced Settings...", &OP_SoundAdvancedDef, 143}, #endif }; -#if defined(HAVE_OPENMPT) || defined(HAVE_MIXERX) +#ifdef HAVE_MIXERX #ifdef HAVE_OPENMPT #define OPENMPT_MENUOFFSET 32 From 7940edd1fc370f74d71f6cd368c5393d93d8d4f7 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Wed, 7 Aug 2019 23:27:26 +0100 Subject: [PATCH 08/23] P_LineOpening: set int32 max/min as defaults for opentop, openbottom etc if a linedef you touched belongs to a polyobjetc. the only thing that really matters in this scenario is the polyobject itself after all! (This is an untested fix for VAda's apparent collision with thin air below a polyobject in ACZ2 in beta 5) --- src/p_maputl.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/p_maputl.c b/src/p_maputl.c index 740797fb0..7779a119d 100644 --- a/src/p_maputl.c +++ b/src/p_maputl.c @@ -519,7 +519,20 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj) I_Assert(back != NULL); openfloorrover = openceilingrover = NULL; - +#ifdef POLYOBJECTS + if (linedef->polyobj) + { + // set these defaults so that polyobjects don't interfere with collision above or below them + opentop = INT32_MAX; + openbottom = INT32_MIN; + highceiling = INT32_MIN; + lowfloor = INT32_MAX; +#ifdef ESLOPE + opentopslope = openbottomslope = NULL; +#endif + } + else +#endif { // Set open and high/low values here fixed_t frontheight, backheight; From d9a78308feb1ca959ed356ad72e22f52b17466c4 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Thu, 8 Aug 2019 16:37:09 +0100 Subject: [PATCH 09/23] Edit a lot of the rest of the polyobject-related code in P_LineOpening to make more sense and be more optimised. * If you collide with a line belonging to a polyobject, you should NEVER have to care about any FOFs that might be present in either sector of the linedef. This could lead to colliding with ghostly FOFs that aren't actually there or something dumb, if someone decided to give either of the polyobject's control sectors FOFs for some reason. We don't want that, obviously. * Polyobjects without POF_CLIPPLANE apparently are supposed to have a top and bottom "physical" height of value INT32_MAX and _MIN respectively, according to P_CheckPosition ...let's be consistent with this. * Finally, there is no more need for that back = front nonsense hack anymore with my changes made. --- src/p_maputl.c | 87 +++++++++++++++++++++++--------------------------- 1 file changed, 40 insertions(+), 47 deletions(-) diff --git a/src/p_maputl.c b/src/p_maputl.c index 7779a119d..00effad7f 100644 --- a/src/p_maputl.c +++ b/src/p_maputl.c @@ -501,19 +501,8 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj) return; } - // Treat polyobjects kind of like 3D Floors -#ifdef POLYOBJECTS - if (linedef->polyobj && (linedef->polyobj->flags & POF_TESTHEIGHT)) - { - front = linedef->frontsector; - back = linedef->frontsector; - } - else -#endif - { - front = linedef->frontsector; - back = linedef->backsector; - } + front = linedef->frontsector; + back = linedef->backsector; I_Assert(front != NULL); I_Assert(back != NULL); @@ -638,13 +627,46 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj) } } } - - // Check for fake floors in the sector. - if (front->ffloors || back->ffloors #ifdef POLYOBJECTS - || linedef->polyobj + if (linedef->polyobj) + { + // Treat polyobj's backsector like a 3D Floor + if (linedef->polyobj->flags & POF_TESTHEIGHT) + { + const sector_t *polysec = linedef->backsector; + fixed_t polytop, polybottom; + fixed_t delta1, delta2; + + if (linedef->polyobj->flags & POF_CLIPPLANES) + { + polytop = polysec->ceilingheight; + polybottom = polysec->floorheight; + } + else + { + polytop = INT32_MAX; + polybottom = INT32_MIN; + } + + delta1 = abs(mobj->z - (polybottom + ((polytop - polybottom)/2))); + delta2 = abs(thingtop - (polybottom + ((polytop - polybottom)/2))); + + if (polybottom < opentop && delta1 >= delta2) + opentop = polybottom; + else if (polybottom < highceiling && delta1 >= delta2) + highceiling = polybottom; + + if (polytop > openbottom && delta1 < delta2) + openbottom = polytop; + else if (polytop > lowfloor && delta1 < delta2) + lowfloor = polytop; + } + // otherwise don't do anything special, pretend there's nothing else there + } + else #endif - ) + // Check for fake floors in the sector. + if (front->ffloors || back->ffloors) { ffloor_t *rover; @@ -752,35 +774,6 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj) } } -#ifdef POLYOBJECTS - // Treat polyobj's backsector like a 3D Floor - if (linedef->polyobj && (linedef->polyobj->flags & POF_TESTHEIGHT)) - { - const sector_t *polysec = linedef->backsector; - - delta1 = abs(mobj->z - (polysec->floorheight + ((polysec->ceilingheight - polysec->floorheight)/2))); - delta2 = abs(thingtop - (polysec->floorheight + ((polysec->ceilingheight - polysec->floorheight)/2))); - if (polysec->floorheight < lowestceiling && delta1 >= delta2) { - lowestceiling = polysec->floorheight; -#ifdef ESLOPE - ceilingslope = NULL; -#endif - ceilingrover = NULL; - } - else if (polysec->floorheight < highestceiling && delta1 >= delta2) - highestceiling = polysec->floorheight; - - if (polysec->ceilingheight > highestfloor && delta1 < delta2) { - highestfloor = polysec->ceilingheight; -#ifdef ESLOPE - floorslope = NULL; -#endif - floorrover = NULL; - } - else if (polysec->ceilingheight > lowestfloor && delta1 < delta2) - lowestfloor = polysec->ceilingheight; - } -#endif if (highestceiling < highceiling) highceiling = highestceiling; From 816d67c9ff7c2ef1b6b329dfe8ab4fde3d2a0e8b Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Thu, 8 Aug 2019 23:04:47 +0100 Subject: [PATCH 10/23] After looking at the FOF part of P_LineOpening for a while I now realise many of these variables aren't even necessary, so I removed them all. (Naturally I did the same to the camera equivalent) --- src/p_maputl.c | 129 +++++++++++++++---------------------------------- 1 file changed, 40 insertions(+), 89 deletions(-) diff --git a/src/p_maputl.c b/src/p_maputl.c index 00effad7f..45fc82fbf 100644 --- a/src/p_maputl.c +++ b/src/p_maputl.c @@ -419,10 +419,6 @@ void P_CameraLineOpening(line_t *linedef) if (front->ffloors || back->ffloors) { ffloor_t *rover; - fixed_t highestceiling = highceiling; - fixed_t lowestceiling = opentop; - fixed_t highestfloor = openbottom; - fixed_t lowestfloor = lowfloor; fixed_t delta1, delta2; // Check for frontsector's fake floors @@ -438,15 +434,15 @@ void P_CameraLineOpening(line_t *linedef) delta1 = abs(mapcampointer->z - (bottomheight + ((topheight - bottomheight)/2))); delta2 = abs(thingtop - (bottomheight + ((topheight - bottomheight)/2))); - if (bottomheight < lowestceiling && delta1 >= delta2) - lowestceiling = bottomheight; - else if (bottomheight < highestceiling && delta1 >= delta2) - highestceiling = bottomheight; + if (bottomheight < opentop && delta1 >= delta2) + opentop = bottomheight; + else if (bottomheight < highceiling && delta1 >= delta2) + highceiling = bottomheight; - if (topheight > highestfloor && delta1 < delta2) - highestfloor = topheight; - else if (topheight > lowestfloor && delta1 < delta2) - lowestfloor = topheight; + if (topheight > openbottom && delta1 < delta2) + openbottom = topheight; + else if (topheight > lowfloor && delta1 < delta2) + lowfloor = topheight; } // Check for backsectors fake floors @@ -462,28 +458,16 @@ void P_CameraLineOpening(line_t *linedef) delta1 = abs(mapcampointer->z - (bottomheight + ((topheight - bottomheight)/2))); delta2 = abs(thingtop - (bottomheight + ((topheight - bottomheight)/2))); - if (bottomheight < lowestceiling && delta1 >= delta2) - lowestceiling = bottomheight; - else if (bottomheight < highestceiling && delta1 >= delta2) - highestceiling = bottomheight; + if (bottomheight < opentop && delta1 >= delta2) + opentop = bottomheight; + else if (bottomheight < highceiling && delta1 >= delta2) + highceiling = bottomheight; - if (topheight > highestfloor && delta1 < delta2) - highestfloor = topheight; - else if (topheight > lowestfloor && delta1 < delta2) - lowestfloor = topheight; + if (topheight > openbottom && delta1 < delta2) + openbottom = topheight; + else if (topheight > lowfloor && delta1 < delta2) + lowfloor = topheight; } - - if (highestceiling < highceiling) - highceiling = highestceiling; - - if (highestfloor > openbottom) - openbottom = highestfloor; - - if (lowestceiling < opentop) - opentop = lowestceiling; - - if (lowestfloor > lowfloor) - lowfloor = lowestfloor; } openrange = opentop - openbottom; return; @@ -669,18 +653,7 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj) if (front->ffloors || back->ffloors) { ffloor_t *rover; - - fixed_t highestceiling = highceiling; - fixed_t lowestceiling = opentop; - fixed_t highestfloor = openbottom; - fixed_t lowestfloor = lowfloor; fixed_t delta1, delta2; -#ifdef ESLOPE - pslope_t *ceilingslope = opentopslope; - pslope_t *floorslope = openbottomslope; -#endif - ffloor_t *floorrover = NULL; - ffloor_t *ceilingrover = NULL; // Check for frontsector's fake floors for (rover = front->ffloors; rover; rover = rover->next) @@ -703,28 +676,28 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj) if (delta1 >= delta2 && !(rover->flags & FF_PLATFORM)) // thing is below FOF { - if (bottomheight < lowestceiling) { - lowestceiling = bottomheight; + if (bottomheight < opentop) { + opentop = bottomheight; #ifdef ESLOPE - ceilingslope = *rover->b_slope; + opentopslope = *rover->b_slope; #endif - ceilingrover = rover; + openceilingrover = rover; } - else if (bottomheight < highestceiling) - highestceiling = bottomheight; + else if (bottomheight < highceiling) + highceiling = bottomheight; } if (delta1 < delta2 && !(rover->flags & FF_REVERSEPLATFORM)) // thing is above FOF { - if (topheight > highestfloor) { - highestfloor = topheight; + if (topheight > openbottom) { + openbottom = topheight; #ifdef ESLOPE - floorslope = *rover->t_slope; + openbottomslope = *rover->t_slope; #endif - floorrover = rover; + openfloorrover = rover; } - else if (topheight > lowestfloor) - lowestfloor = topheight; + else if (topheight > lowfloor) + lowfloor = topheight; } } @@ -749,52 +722,30 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj) if (delta1 >= delta2 && !(rover->flags & FF_PLATFORM)) // thing is below FOF { - if (bottomheight < lowestceiling) { - lowestceiling = bottomheight; + if (bottomheight < opentop) { + opentop = bottomheight; #ifdef ESLOPE - ceilingslope = *rover->b_slope; + opentopslope = *rover->b_slope; #endif - ceilingrover = rover; + openceilingrover = rover; } - else if (bottomheight < highestceiling) - highestceiling = bottomheight; + else if (bottomheight < highceiling) + highceiling = bottomheight; } if (delta1 < delta2 && !(rover->flags & FF_REVERSEPLATFORM)) // thing is above FOF { - if (topheight > highestfloor) { - highestfloor = topheight; + if (topheight > openbottom) { + openbottom = topheight; #ifdef ESLOPE - floorslope = *rover->t_slope; + openbottomslope = *rover->t_slope; #endif - floorrover = rover; + openfloorrover = rover; } - else if (topheight > lowestfloor) - lowestfloor = topheight; + else if (topheight > lowfloor) + lowfloor = topheight; } } - - if (highestceiling < highceiling) - highceiling = highestceiling; - - if (highestfloor > openbottom) { - openbottom = highestfloor; -#ifdef ESLOPE - openbottomslope = floorslope; -#endif - openfloorrover = floorrover; - } - - if (lowestceiling < opentop) { - opentop = lowestceiling; -#ifdef ESLOPE - opentopslope = ceilingslope; -#endif - openceilingrover = ceilingrover; - } - - if (lowestfloor > lowfloor) - lowfloor = lowestfloor; } } From 2c7fbe20874dbfa579fd3fa655c531774e2bf2b6 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Thu, 8 Aug 2019 18:43:42 -0400 Subject: [PATCH 11/23] Makefile: stop building with DWARF v2 debugging info --- src/win32/Makefile.cfg | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/win32/Makefile.cfg b/src/win32/Makefile.cfg index 1880abf18..73d236604 100644 --- a/src/win32/Makefile.cfg +++ b/src/win32/Makefile.cfg @@ -36,10 +36,6 @@ ifndef GCC44 #OPTS+=-mms-bitfields endif -ifndef MINGW64 - OPTS+=-gdwarf-2 -endif - ifndef SDL OPTS+=-D_WINDOWS endif From e2927ffe2c2c45d955561ec0d6357af0306de3c0 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Thu, 8 Aug 2019 20:27:57 -0400 Subject: [PATCH 12/23] Makefile: support GCC 9.1 --- src/Makefile.cfg | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/Makefile.cfg b/src/Makefile.cfg index a0398154a..5fdc53298 100644 --- a/src/Makefile.cfg +++ b/src/Makefile.cfg @@ -7,11 +7,19 @@ # and other things # -ifdef GCC81 -GCC80=1 +ifdef GCC91 +GCC83=1 endif -ifdef GCC80 +ifdef GCC83 +GCC82=1 +endif + +ifdef GCC82 +GCC81=1 +endif + +ifdef GCC81 GCC72=1 endif From 5c0912bab13f86c5e03eb8c76ca014888b7daa8a Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Thu, 8 Aug 2019 21:25:46 -0400 Subject: [PATCH 13/23] Tested to be compile with Mingw64 9.1.0 --- appveyor.yml | 2 +- src/Makefile.cfg | 3 +++ src/i_addrinfo.c | 12 ++++++------ src/m_misc.c | 2 +- src/sdl/i_system.c | 16 ++++++++-------- src/win32/fabdxlib.c | 2 +- src/win32/win_sys.c | 12 ++++++------ 7 files changed, 26 insertions(+), 23 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 98da61dbf..75442145a 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -92,7 +92,7 @@ before_build: - ccache -V - ccache -s - if [%NOUPX%] == [1] ( set "NOUPX=NOUPX=1" ) else ( set "NOUPX=" ) -- set "SRB2_MFLAGS=-C src WARNINGMODE=1 CCACHE=1 GCC72=1 NOOBJDUMP=1 %NOUPX%" +- set "SRB2_MFLAGS=-C src WARNINGMODE=1 CCACHE=1 GCC91=1 NOOBJDUMP=1 %NOUPX%" - if [%X86_64%] == [1] ( set "MINGW_FLAGS=MINGW64=1 X86_64=1" ) else ( set "MINGW_FLAGS=MINGW=1" ) - set "SRB2_MFLAGS=%SRB2_MFLAGS% %MINGW_FLAGS% %CONFIGURATION%=1" diff --git a/src/Makefile.cfg b/src/Makefile.cfg index 5fdc53298..738b05330 100644 --- a/src/Makefile.cfg +++ b/src/Makefile.cfg @@ -194,6 +194,9 @@ ifndef GCC295 endif endif WFLAGS+=-Wformat-y2k +ifdef GCC71 +WFLAGS+=-Wno-error=format-overflow=2 +endif WFLAGS+=-Wformat-security ifndef GCC29 #WFLAGS+=-Winit-self diff --git a/src/i_addrinfo.c b/src/i_addrinfo.c index 03edf732d..42d4b8924 100644 --- a/src/i_addrinfo.c +++ b/src/i_addrinfo.c @@ -74,10 +74,10 @@ static int inet_aton(const char *cp, struct in_addr *addr) #ifdef USE_WINSOCK2 static HMODULE ipv6dll = NULL; -typedef int (WSAAPI *p_getaddrinfo) (const char *node, const char *service, - const struct my_addrinfo *hints, - struct my_addrinfo **res); -typedef void (WSAAPI *p_freeaddrinfo) (struct my_addrinfo *res); +typedef int (WSAAPI *p_getaddrinfo) (const char *, const char *, + const struct my_addrinfo *, + struct my_addrinfo **); +typedef void (WSAAPI *p_freeaddrinfo) (struct my_addrinfo *); static p_getaddrinfo WS_getaddrinfo = NULL; static p_freeaddrinfo WS_freeaddrinfo = NULL; @@ -86,10 +86,10 @@ static HMODULE WS_getfunctions(HMODULE tmp) { if (tmp != NULL) { - WS_getaddrinfo = (p_getaddrinfo)GetProcAddress(tmp, "getaddrinfo"); + WS_getaddrinfo = (p_getaddrinfo)(LPVOID)GetProcAddress(tmp, "getaddrinfo"); if (WS_getaddrinfo == NULL) return NULL; - WS_freeaddrinfo = (p_freeaddrinfo)GetProcAddress(tmp, "freeaddrinfo"); + WS_freeaddrinfo = (p_freeaddrinfo)(LPVOID)GetProcAddress(tmp, "freeaddrinfo"); if (WS_freeaddrinfo == NULL) { WS_getaddrinfo = NULL; diff --git a/src/m_misc.c b/src/m_misc.c index 0445136fe..c5e4fa21c 100644 --- a/src/m_misc.c +++ b/src/m_misc.c @@ -58,7 +58,7 @@ typedef off_t off64_t; #endif #endif -#if defined(__MINGW32__) && ((__GNUC__ > 7) || (__GNUC__ == 6 && __GNUC_MINOR__ >= 3)) +#if defined(__MINGW32__) && ((__GNUC__ > 7) || (__GNUC__ == 6 && __GNUC_MINOR__ >= 3)) && (__GNUC__ < 8) #define PRIdS "u" #elif defined (_WIN32) #define PRIdS "Iu" diff --git a/src/sdl/i_system.c b/src/sdl/i_system.c index 517c183ee..a18443c52 100644 --- a/src/sdl/i_system.c +++ b/src/sdl/i_system.c @@ -1480,7 +1480,7 @@ const char *I_GetJoyName(INT32 joyindex) { tempname = SDL_JoystickNameForIndex(joyindex); if (tempname) - strncpy(joyname, tempname, 255); + strncpy(joyname, tempname, 254); } SDL_QuitSubSystem(SDL_INIT_JOYSTICK); } @@ -1488,7 +1488,7 @@ const char *I_GetJoyName(INT32 joyindex) { tempname = SDL_JoystickNameForIndex(joyindex); if (tempname) - strncpy(joyname, tempname, 255); + strncpy(joyname, tempname, 254); } return joyname; } @@ -2043,7 +2043,7 @@ static void I_ShutdownTimer(void) pfntimeGetTime = NULL; if (winmm) { - p_timeEndPeriod pfntimeEndPeriod = (p_timeEndPeriod)GetProcAddress(winmm, "timeEndPeriod"); + p_timeEndPeriod pfntimeEndPeriod = (p_timeEndPeriod)(LPVOID)GetProcAddress(winmm, "timeEndPeriod"); if (pfntimeEndPeriod) pfntimeEndPeriod(1); FreeLibrary(winmm); @@ -2088,10 +2088,10 @@ void I_StartupTimer(void) winmm = LoadLibraryA("winmm.dll"); if (winmm) { - p_timeEndPeriod pfntimeBeginPeriod = (p_timeEndPeriod)GetProcAddress(winmm, "timeBeginPeriod"); + p_timeEndPeriod pfntimeBeginPeriod = (p_timeEndPeriod)(LPVOID)GetProcAddress(winmm, "timeBeginPeriod"); if (pfntimeBeginPeriod) pfntimeBeginPeriod(1); - pfntimeGetTime = (p_timeGetTime)GetProcAddress(winmm, "timeGetTime"); + pfntimeGetTime = (p_timeGetTime)(LPVOID)GetProcAddress(winmm, "timeGetTime"); } I_AddExitFunc(I_ShutdownTimer); #endif @@ -2390,7 +2390,7 @@ void I_GetDiskFreeSpace(INT64 *freespace) if (!testwin95) { - pfnGetDiskFreeSpaceEx = (p_GetDiskFreeSpaceExA)GetProcAddress(GetModuleHandleA("kernel32.dll"), "GetDiskFreeSpaceExA"); + pfnGetDiskFreeSpaceEx = (p_GetDiskFreeSpaceExA)(LPVOID)GetProcAddress(GetModuleHandleA("kernel32.dll"), "GetDiskFreeSpaceExA"); testwin95 = true; } if (pfnGetDiskFreeSpaceEx) @@ -2414,7 +2414,7 @@ void I_GetDiskFreeSpace(INT64 *freespace) char *I_GetUserName(void) { - static char username[MAXPLAYERNAME]; + static char username[MAXPLAYERNAME+1]; char *p; #ifdef _WIN32 DWORD i = MAXPLAYERNAME; @@ -2910,7 +2910,7 @@ const CPUInfoFlags *I_CPUInfo(void) #if defined (_WIN32) static CPUInfoFlags WIN_CPUInfo; SYSTEM_INFO SI; - p_IsProcessorFeaturePresent pfnCPUID = (p_IsProcessorFeaturePresent)GetProcAddress(GetModuleHandleA("kernel32.dll"), "IsProcessorFeaturePresent"); + p_IsProcessorFeaturePresent pfnCPUID = (p_IsProcessorFeaturePresent)(LPVOID)GetProcAddress(GetModuleHandleA("kernel32.dll"), "IsProcessorFeaturePresent"); ZeroMemory(&WIN_CPUInfo,sizeof (WIN_CPUInfo)); if (pfnCPUID) diff --git a/src/win32/fabdxlib.c b/src/win32/fabdxlib.c index c19b036a0..45ec5d0d3 100644 --- a/src/win32/fabdxlib.c +++ b/src/win32/fabdxlib.c @@ -147,7 +147,7 @@ static inline BOOL LoadDirectDraw(VOID) DDrawDLL = LoadLibraryA("DDRAW.DLL"); if (DDrawDLL == NULL) return false; - pfnDirectDrawCreate = (DDCreate)GetProcAddress(DDrawDLL, "DirectDrawCreate"); + pfnDirectDrawCreate = (DDCreate)(LPVOID)GetProcAddress(DDrawDLL, "DirectDrawCreate"); if (pfnDirectDrawCreate == NULL) return false; return true; diff --git a/src/win32/win_sys.c b/src/win32/win_sys.c index 8b7adf7c6..d10f73b58 100644 --- a/src/win32/win_sys.c +++ b/src/win32/win_sys.c @@ -3395,7 +3395,7 @@ BOOL LoadDirectInput(VOID) DInputDLL = LoadLibraryA("DINPUT.DLL"); if (DInputDLL == NULL) return false; - pfnDirectInputCreateA = (DICreateA)GetProcAddress(DInputDLL, "DirectInputCreateA"); + pfnDirectInputCreateA = (DICreateA)(LPVOID)GetProcAddress(DInputDLL, "DirectInputCreateA"); if (pfnDirectInputCreateA == NULL) return false; return true; @@ -3529,7 +3529,7 @@ void I_GetDiskFreeSpace(INT64* freespace) if (!testwin95) { - pfnGetDiskFreeSpaceEx = (p_GetDiskFreeSpaceExA)GetProcAddress(GetModuleHandleA("kernel32.dll"), "GetDiskFreeSpaceExA"); + pfnGetDiskFreeSpaceEx = (p_GetDiskFreeSpaceExA)(LPVOID)GetProcAddress(GetModuleHandleA("kernel32.dll"), "GetDiskFreeSpaceExA"); testwin95 = true; } if (pfnGetDiskFreeSpaceEx) @@ -3615,7 +3615,7 @@ const CPUInfoFlags *I_CPUInfo(void) { static CPUInfoFlags WIN_CPUInfo; SYSTEM_INFO SI; - p_IsProcessorFeaturePresent pfnCPUID = (p_IsProcessorFeaturePresent)GetProcAddress(GetModuleHandleA("kernel32.dll"), "IsProcessorFeaturePresent"); + p_IsProcessorFeaturePresent pfnCPUID = (p_IsProcessorFeaturePresent)(LPVOID)GetProcAddress(GetModuleHandleA("kernel32.dll"), "IsProcessorFeaturePresent"); ZeroMemory(&WIN_CPUInfo,sizeof (WIN_CPUInfo)); if (pfnCPUID) @@ -3658,9 +3658,9 @@ static p_SetProcessAffinityMask pfnSetProcessAffinityMask = NULL; static inline VOID GetAffinityFuncs(VOID) { HMODULE h = GetModuleHandleA("kernel32.dll"); - pfnGetCurrentProcess = (p_GetCurrentProcess)GetProcAddress(h, "GetCurrentProcess"); - pfnGetProcessAffinityMask = (p_GetProcessAffinityMask)GetProcAddress(h, "GetProcessAffinityMask"); - pfnSetProcessAffinityMask = (p_SetProcessAffinityMask)GetProcAddress(h, "SetProcessAffinityMask"); + pfnGetCurrentProcess = (p_GetCurrentProcess)(LPVOID)GetProcAddress(h, "GetCurrentProcess"); + pfnGetProcessAffinityMask = (p_GetProcessAffinityMask)(LPVOID)GetProcAddress(h, "GetProcessAffinityMask"); + pfnSetProcessAffinityMask = (p_SetProcessAffinityMask)(LPVOID)GetProcAddress(h, "SetProcessAffinityMask"); } static void CPUAffinity_OnChange(void) From 9fc6c3b1366db9be7d7b1da01a9275d0154e4cb6 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Thu, 8 Aug 2019 22:19:22 -0400 Subject: [PATCH 14/23] Try to compile with AppVeyor's GCC 9.1.0 --- src/Makefile.cfg | 6 ++++++ src/d_clisrv.c | 2 +- src/dehacked.c | 8 ++++---- src/hu_stuff.c | 2 +- src/p_spec.c | 2 +- src/v_video.c | 2 +- 6 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/Makefile.cfg b/src/Makefile.cfg index 738b05330..d9fee7559 100644 --- a/src/Makefile.cfg +++ b/src/Makefile.cfg @@ -154,6 +154,9 @@ ifdef GCC43 endif endif WFLAGS+=-Wsign-compare +ifdef GCC91 + WFLAGS+=-Wno-error=address-of-packed-member +endif ifdef GCC45 WFLAGS+=-Wlogical-op endif @@ -238,6 +241,9 @@ ifdef GCC80 WFLAGS+=-Wno-error=format-overflow WFLAGS+=-Wno-error=stringop-truncation WFLAGS+=-Wno-error=stringop-overflow +ifdef GCC91 + WFLAGS+=-Werror=-Wstringop-overflow=2 +endif WFLAGS+=-Wno-format-overflow WFLAGS+=-Wno-stringop-truncation WFLAGS+=-Wno-stringop-overflow diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 274fe398a..6c5b56f81 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -1242,7 +1242,7 @@ static void SV_SendServerInfo(INT32 node, tic_t servertime) netbuffer->u.serverinfo.cheatsenabled = CV_CheatsEnabled(); netbuffer->u.serverinfo.isdedicated = (UINT8)dedicated; strncpy(netbuffer->u.serverinfo.servername, cv_servername.string, - MAXSERVERNAME); + MAXSERVERNAME-1); strncpy(netbuffer->u.serverinfo.mapname, G_BuildMapName(gamemap), 7); M_Memcpy(netbuffer->u.serverinfo.mapmd5, mapmd5, 16); diff --git a/src/dehacked.c b/src/dehacked.c index bda0c38f7..d506ef910 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -1186,9 +1186,9 @@ static void readlevelheader(MYFILE *f, INT32 num) { i = get_mus(word2, true); if (i && i <= 1035) - snprintf(mapheaderinfo[num-1]->musname, 7, "%sM", G_BuildMapName(i)); + snprintf(mapheaderinfo[num-1]->musname, 6, "%sM", G_BuildMapName(i)); else if (i && i <= 1050) - strncpy(mapheaderinfo[num-1]->musname, compat_special_music_slots[i - 1036], 7); + strncpy(mapheaderinfo[num-1]->musname, compat_special_music_slots[i - 1036], 6); else mapheaderinfo[num-1]->musname[0] = 0; // becomes empty string mapheaderinfo[num-1]->musname[6] = 0; @@ -1213,7 +1213,7 @@ static void readlevelheader(MYFILE *f, INT32 num) else if (fastcmp(word, "SKYNUM")) mapheaderinfo[num-1]->skynum = (INT16)i; else if (fastcmp(word, "INTERSCREEN")) - strncpy(mapheaderinfo[num-1]->interscreen, word2, 8); + strncpy(mapheaderinfo[num-1]->interscreen, word2, 7); else if (fastcmp(word, "PRECUTSCENENUM")) mapheaderinfo[num-1]->precutscenenum = (UINT8)i; else if (fastcmp(word, "CUTSCENENUM")) @@ -3101,7 +3101,7 @@ static void readmaincfg(MYFILE *f) // Also save a time attack folder filenamelen = strlen(gamedatafilename)-4; // Strip off the extension - strncpy(timeattackfolder, gamedatafilename, min(filenamelen, sizeof (timeattackfolder))); + strncpy(timeattackfolder, gamedatafilename, min(filenamelen, sizeof (timeattackfolder)-1)); timeattackfolder[min(filenamelen, sizeof (timeattackfolder) - 1)] = '\0'; strcpy(savegamename, timeattackfolder); diff --git a/src/hu_stuff.c b/src/hu_stuff.c index a9a2b7504..13272a748 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -3072,7 +3072,7 @@ void HU_DoCEcho(const char *msg) { I_OutputMsg("%s\n", msg); // print to log - strncpy(cechotext, msg, sizeof(cechotext)); + strncpy(cechotext, msg, sizeof(cechotext)-1); strncat(cechotext, "\\", sizeof(cechotext) - strlen(cechotext) - 1); cechotext[sizeof(cechotext) - 1] = '\0'; cechotimer = cechoduration; diff --git a/src/p_spec.c b/src/p_spec.c index f3be86ee1..9b46d4b3b 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -469,7 +469,7 @@ void P_ParseAnimationDefintion(SINT8 istexture) // Increase the size to make room for the new animation definition maxanims++; animdefs = (animdef_t *)Z_Realloc(animdefs, sizeof(animdef_t)*(maxanims + 1), PU_STATIC, NULL); - strncpy(animdefs[i].startname, animdefsToken, 9); + strncpy(animdefs[i].startname, animdefsToken, 8); } // animdefs[i].startname is now set to animdefsToken either way. diff --git a/src/v_video.c b/src/v_video.c index c3b29e157..5f16bd916 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -196,7 +196,7 @@ static void LoadPalette(const char *lumpname) const char *R_GetPalname(UINT16 num) { static char palname[9]; - char newpal[9] = "PLAYPAL"; + char newpal[9] = "PLAYPAL\0"; if (num > 0 && num <= 10000) snprintf(newpal, 8, "PAL%04u", num-1); From 64159d55cfebfe590b4ecc5b7f085f2c1ba79931 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Thu, 8 Aug 2019 22:31:18 -0400 Subject: [PATCH 15/23] Revert "Try to compile with AppVeyor's GCC 9.1.0" This reverts commit 9fc6c3b1366db9be7d7b1da01a9275d0154e4cb6. --- src/Makefile.cfg | 6 ------ src/d_clisrv.c | 2 +- src/dehacked.c | 8 ++++---- src/hu_stuff.c | 2 +- src/p_spec.c | 2 +- src/v_video.c | 2 +- 6 files changed, 8 insertions(+), 14 deletions(-) diff --git a/src/Makefile.cfg b/src/Makefile.cfg index d9fee7559..738b05330 100644 --- a/src/Makefile.cfg +++ b/src/Makefile.cfg @@ -154,9 +154,6 @@ ifdef GCC43 endif endif WFLAGS+=-Wsign-compare -ifdef GCC91 - WFLAGS+=-Wno-error=address-of-packed-member -endif ifdef GCC45 WFLAGS+=-Wlogical-op endif @@ -241,9 +238,6 @@ ifdef GCC80 WFLAGS+=-Wno-error=format-overflow WFLAGS+=-Wno-error=stringop-truncation WFLAGS+=-Wno-error=stringop-overflow -ifdef GCC91 - WFLAGS+=-Werror=-Wstringop-overflow=2 -endif WFLAGS+=-Wno-format-overflow WFLAGS+=-Wno-stringop-truncation WFLAGS+=-Wno-stringop-overflow diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 6c5b56f81..274fe398a 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -1242,7 +1242,7 @@ static void SV_SendServerInfo(INT32 node, tic_t servertime) netbuffer->u.serverinfo.cheatsenabled = CV_CheatsEnabled(); netbuffer->u.serverinfo.isdedicated = (UINT8)dedicated; strncpy(netbuffer->u.serverinfo.servername, cv_servername.string, - MAXSERVERNAME-1); + MAXSERVERNAME); strncpy(netbuffer->u.serverinfo.mapname, G_BuildMapName(gamemap), 7); M_Memcpy(netbuffer->u.serverinfo.mapmd5, mapmd5, 16); diff --git a/src/dehacked.c b/src/dehacked.c index d506ef910..bda0c38f7 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -1186,9 +1186,9 @@ static void readlevelheader(MYFILE *f, INT32 num) { i = get_mus(word2, true); if (i && i <= 1035) - snprintf(mapheaderinfo[num-1]->musname, 6, "%sM", G_BuildMapName(i)); + snprintf(mapheaderinfo[num-1]->musname, 7, "%sM", G_BuildMapName(i)); else if (i && i <= 1050) - strncpy(mapheaderinfo[num-1]->musname, compat_special_music_slots[i - 1036], 6); + strncpy(mapheaderinfo[num-1]->musname, compat_special_music_slots[i - 1036], 7); else mapheaderinfo[num-1]->musname[0] = 0; // becomes empty string mapheaderinfo[num-1]->musname[6] = 0; @@ -1213,7 +1213,7 @@ static void readlevelheader(MYFILE *f, INT32 num) else if (fastcmp(word, "SKYNUM")) mapheaderinfo[num-1]->skynum = (INT16)i; else if (fastcmp(word, "INTERSCREEN")) - strncpy(mapheaderinfo[num-1]->interscreen, word2, 7); + strncpy(mapheaderinfo[num-1]->interscreen, word2, 8); else if (fastcmp(word, "PRECUTSCENENUM")) mapheaderinfo[num-1]->precutscenenum = (UINT8)i; else if (fastcmp(word, "CUTSCENENUM")) @@ -3101,7 +3101,7 @@ static void readmaincfg(MYFILE *f) // Also save a time attack folder filenamelen = strlen(gamedatafilename)-4; // Strip off the extension - strncpy(timeattackfolder, gamedatafilename, min(filenamelen, sizeof (timeattackfolder)-1)); + strncpy(timeattackfolder, gamedatafilename, min(filenamelen, sizeof (timeattackfolder))); timeattackfolder[min(filenamelen, sizeof (timeattackfolder) - 1)] = '\0'; strcpy(savegamename, timeattackfolder); diff --git a/src/hu_stuff.c b/src/hu_stuff.c index 13272a748..a9a2b7504 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -3072,7 +3072,7 @@ void HU_DoCEcho(const char *msg) { I_OutputMsg("%s\n", msg); // print to log - strncpy(cechotext, msg, sizeof(cechotext)-1); + strncpy(cechotext, msg, sizeof(cechotext)); strncat(cechotext, "\\", sizeof(cechotext) - strlen(cechotext) - 1); cechotext[sizeof(cechotext) - 1] = '\0'; cechotimer = cechoduration; diff --git a/src/p_spec.c b/src/p_spec.c index 9b46d4b3b..f3be86ee1 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -469,7 +469,7 @@ void P_ParseAnimationDefintion(SINT8 istexture) // Increase the size to make room for the new animation definition maxanims++; animdefs = (animdef_t *)Z_Realloc(animdefs, sizeof(animdef_t)*(maxanims + 1), PU_STATIC, NULL); - strncpy(animdefs[i].startname, animdefsToken, 8); + strncpy(animdefs[i].startname, animdefsToken, 9); } // animdefs[i].startname is now set to animdefsToken either way. diff --git a/src/v_video.c b/src/v_video.c index 5f16bd916..c3b29e157 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -196,7 +196,7 @@ static void LoadPalette(const char *lumpname) const char *R_GetPalname(UINT16 num) { static char palname[9]; - char newpal[9] = "PLAYPAL\0"; + char newpal[9] = "PLAYPAL"; if (num > 0 && num <= 10000) snprintf(newpal, 8, "PAL%04u", num-1); From 5b692acc6c2071eff374b85c45c9ac840392ae6f Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Thu, 8 Aug 2019 22:34:09 -0400 Subject: [PATCH 16/23] Makefile: GCC80 does not exist --- src/Makefile.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Makefile.cfg b/src/Makefile.cfg index 738b05330..6142e9ecf 100644 --- a/src/Makefile.cfg +++ b/src/Makefile.cfg @@ -234,7 +234,7 @@ ifdef GCC71 WFLAGS+=-Wno-error=implicit-fallthrough WFLAGS+=-Wno-implicit-fallthrough endif -ifdef GCC80 +ifdef GCC81 WFLAGS+=-Wno-error=format-overflow WFLAGS+=-Wno-error=stringop-truncation WFLAGS+=-Wno-error=stringop-overflow From abe1d9809f5c18351d14076308e0aff771c09e8d Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Thu, 8 Aug 2019 22:47:33 -0400 Subject: [PATCH 17/23] Disable address-of-packed-member warning --- src/Makefile.cfg | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Makefile.cfg b/src/Makefile.cfg index 6142e9ecf..c69fcd57d 100644 --- a/src/Makefile.cfg +++ b/src/Makefile.cfg @@ -154,6 +154,9 @@ ifdef GCC43 endif endif WFLAGS+=-Wsign-compare +ifdef GCC91 + WFLAGS+=-Wno-error=address-of-packed-member +endif ifdef GCC45 WFLAGS+=-Wlogical-op endif From 4d1c2b4de0ddc18e979d50e448377e2612530fec Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Thu, 8 Aug 2019 23:02:03 -0400 Subject: [PATCH 18/23] Appveyor: the Mingw64 is 9.1, the Mingw32 is still 7.3 --- appveyor.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 75442145a..3b55aa5b5 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -92,8 +92,8 @@ before_build: - ccache -V - ccache -s - if [%NOUPX%] == [1] ( set "NOUPX=NOUPX=1" ) else ( set "NOUPX=" ) -- set "SRB2_MFLAGS=-C src WARNINGMODE=1 CCACHE=1 GCC91=1 NOOBJDUMP=1 %NOUPX%" -- if [%X86_64%] == [1] ( set "MINGW_FLAGS=MINGW64=1 X86_64=1" ) else ( set "MINGW_FLAGS=MINGW=1" ) +- set "SRB2_MFLAGS=-C src WARNINGMODE=1 CCACHE=1 GCC73=1 NOOBJDUMP=1 %NOUPX%" +- if [%X86_64%] == [1] ( set "MINGW_FLAGS=MINGW64=1 X86_64=1 GCC91=1" ) else ( set "MINGW_FLAGS=MINGW=1" ) - set "SRB2_MFLAGS=%SRB2_MFLAGS% %MINGW_FLAGS% %CONFIGURATION%=1" build_script: From cb5b7a555588eaf7306243976f51f5d8ecfd770d Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Thu, 8 Aug 2019 23:05:24 -0400 Subject: [PATCH 19/23] Appveyor: other way around, the Mingw32 is at 9.1 --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 3b55aa5b5..b37bd1a65 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -93,7 +93,7 @@ before_build: - ccache -s - if [%NOUPX%] == [1] ( set "NOUPX=NOUPX=1" ) else ( set "NOUPX=" ) - set "SRB2_MFLAGS=-C src WARNINGMODE=1 CCACHE=1 GCC73=1 NOOBJDUMP=1 %NOUPX%" -- if [%X86_64%] == [1] ( set "MINGW_FLAGS=MINGW64=1 X86_64=1 GCC91=1" ) else ( set "MINGW_FLAGS=MINGW=1" ) +- if [%X86_64%] == [1] ( set "MINGW_FLAGS=MINGW64=1 X86_64=1" ) else ( set "MINGW_FLAGS=MINGW=1 GCC91=1" ) - set "SRB2_MFLAGS=%SRB2_MFLAGS% %MINGW_FLAGS% %CONFIGURATION%=1" build_script: From 06b339f6ae66a7f500c92f3b98bc72112eed1ea1 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Thu, 8 Aug 2019 23:44:28 -0400 Subject: [PATCH 20/23] curbgname need one more byte to hold the NULL --- src/f_finale.c | 4 ++-- src/f_finale.h | 2 +- src/m_menu.c | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/f_finale.c b/src/f_finale.c index 3d1b2ab83..f3ab235b8 100644 --- a/src/f_finale.c +++ b/src/f_finale.c @@ -68,7 +68,7 @@ static INT32 menuanimtimer; // Title screen: background animation timing mobj_t *titlemapcameraref = NULL; // menu presentation state -char curbgname[8]; +char curbgname[9]; SINT8 curfadevalue; boolean curhidepics; INT32 curbgcolor; @@ -2093,7 +2093,7 @@ void F_InitMenuPresValues(void) activeMenuId = MainDef.menuid; // Set defaults for presentation values - strncpy(curbgname, "TITLESKY", 8); + strncpy(curbgname, "TITLESKY", 9); curfadevalue = 16; curhidepics = hidetitlepics; curbgcolor = -1; diff --git a/src/f_finale.h b/src/f_finale.h index 1149e1d5b..d640abc8a 100644 --- a/src/f_finale.h +++ b/src/f_finale.h @@ -87,7 +87,7 @@ typedef enum // Current menu parameters extern mobj_t *titlemapcameraref; -extern char curbgname[8]; +extern char curbgname[9]; extern SINT8 curfadevalue; extern boolean curhidepics; extern INT32 curbgcolor; diff --git a/src/m_menu.c b/src/m_menu.c index 5147077e0..ca389a94d 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -2336,7 +2336,7 @@ static boolean MIT_SetCurBackground(UINT32 menutype, INT32 level, INT32 *retval, } else if (menupres[menutype].bgname[0]) { - strncpy(curbgname, menupres[menutype].bgname, 8); + strncpy(curbgname, menupres[menutype].bgname, 9); curbgxspeed = menupres[menutype].titlescrollxspeed != INT32_MAX ? menupres[menutype].titlescrollxspeed : titlescrollxspeed; curbgyspeed = menupres[menutype].titlescrollyspeed != INT32_MAX ? menupres[menutype].titlescrollyspeed : titlescrollyspeed; return true; @@ -2349,7 +2349,7 @@ static boolean MIT_SetCurBackground(UINT32 menutype, INT32 level, INT32 *retval, curbghide = true; else { - strncpy(curbgname, defaultname, 8); + strncpy(curbgname, defaultname, 9); curbgxspeed = (gamestate == GS_TIMEATTACK) ? 0 : titlescrollxspeed; curbgyspeed = (gamestate == GS_TIMEATTACK) ? 0 : titlescrollyspeed; } @@ -2508,7 +2508,7 @@ static void M_HandleMenuPresState(menu_t *newMenu) activeMenuId = newMenu ? newMenu->menuid : 0; // Set defaults for presentation values - strncpy(curbgname, "TITLESKY", 8); + strncpy(curbgname, "TITLESKY", 9); curfadevalue = 16; curhidepics = hidetitlepics; curbgcolor = -1; From 400cc8124ad7ea26b989cd0221588d98da521f6a Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sun, 11 Aug 2019 20:24:14 +0100 Subject: [PATCH 21/23] Disable patch.dta at Rob's request, since we don't really use it anymore --- src/doomdef.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/doomdef.h b/src/doomdef.h index 7bcc533c2..c948d7805 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -148,7 +148,7 @@ extern FILE *logstream; // Does this version require an added patch file? // Comment or uncomment this as necessary. -#define USE_PATCH_DTA +//#define USE_PATCH_DTA // Use .kart extension addons //#define USE_KART From 33277fbbd3e598f02397dc08486f8eaad725266b Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sun, 11 Aug 2019 22:14:50 +0100 Subject: [PATCH 22/23] Fix uninitialised variable error toaster found in P_MinecartThink --- src/p_user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_user.c b/src/p_user.c index 0861398d6..b74cafd21 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -10391,7 +10391,7 @@ static void P_MinecartThink(player_t *player) if (P_IsObjectOnGround(minecart)) { sector_t *sec; - INT32 lnum; + INT32 lnum = -1; fixed_t dummy; // Just hit floor. From fac04cf853b01f7271147071ba936ee25dc7ece8 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sun, 11 Aug 2019 22:28:32 +0100 Subject: [PATCH 23/23] tweak the defaults for titlescrollxspeed and numDemos --- src/f_finale.c | 2 +- src/g_game.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/f_finale.c b/src/f_finale.c index f3ab235b8..da042abeb 100644 --- a/src/f_finale.c +++ b/src/f_finale.c @@ -46,7 +46,7 @@ // Stage of animation: // 0 = text, 1 = art screen static INT32 finalecount; -INT32 titlescrollxspeed = 80; +INT32 titlescrollxspeed = 20; INT32 titlescrollyspeed = 0; UINT8 titlemapinaction = TITLEMAP_OFF; diff --git a/src/g_game.c b/src/g_game.c index dad873fe7..c96b0805c 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -97,7 +97,7 @@ boolean runemeraldmanager = false; UINT16 emeraldspawndelay = 60*TICRATE; // menu demo things -UINT8 numDemos = 3; +UINT8 numDemos = 0; UINT32 demoDelayTime = 15*TICRATE; UINT32 demoIdleTime = 3*TICRATE;