From: <web...@pr...> - 2018-12-18 20:42:22
|
Author: entryway Date: Tue Dec 18 20:42:07 2018 New Revision: 4536 Log: gcc warnings (Fabian Greffrath) Modified: branches/prboom-plus-24/prboom2/src/MUSIC/dbopl.c branches/prboom-plus-24/prboom2/src/MUSIC/flplayer.c branches/prboom-plus-24/prboom2/src/d_deh.c branches/prboom-plus-24/prboom2/src/d_main.c branches/prboom-plus-24/prboom2/src/d_server.c branches/prboom-plus-24/prboom2/src/e6y.c branches/prboom-plus-24/prboom2/src/g_game.c branches/prboom-plus-24/prboom2/src/m_menu.c branches/prboom-plus-24/prboom2/src/p_ceilng.c branches/prboom-plus-24/prboom2/src/p_doors.c branches/prboom-plus-24/prboom2/src/p_floor.c branches/prboom-plus-24/prboom2/src/p_inter.c branches/prboom-plus-24/prboom2/src/p_lights.c branches/prboom-plus-24/prboom2/src/p_map.c branches/prboom-plus-24/prboom2/src/p_pspr.c branches/prboom-plus-24/prboom2/src/p_setup.c branches/prboom-plus-24/prboom2/src/p_sight.c branches/prboom-plus-24/prboom2/src/p_spec.c branches/prboom-plus-24/prboom2/src/st_stuff.c branches/prboom-plus-24/prboom2/src/wi_stuff.c Modified: branches/prboom-plus-24/prboom2/src/MUSIC/dbopl.c ============================================================================== --- branches/prboom-plus-24/prboom2/src/MUSIC/dbopl.c Mon Dec 17 19:47:41 2018 (r4535) +++ branches/prboom-plus-24/prboom2/src/MUSIC/dbopl.c Tue Dec 18 20:42:07 2018 (r4536) @@ -457,6 +457,7 @@ if ( self->reg20 & MASK_SUSTAIN ) { return vol; } + // fallthrough //In sustain phase, but not sustaining, do regular release case RELEASE: vol += Operator__RateForward( self, self->releaseAdd );; Modified: branches/prboom-plus-24/prboom2/src/MUSIC/flplayer.c ============================================================================== --- branches/prboom-plus-24/prboom2/src/MUSIC/flplayer.c Mon Dec 17 19:47:41 2018 (r4535) +++ branches/prboom-plus-24/prboom2/src/MUSIC/flplayer.c Tue Dec 18 20:42:07 2018 (r4536) @@ -109,10 +109,6 @@ { const char *filename; #ifdef _WIN32 - #ifndef _MSC_VER - DWORD WINAPI GetVersion (void); - #endif // _MSC_VER - if ((int)GetVersion() < 0) // win9x { lprintf (LO_INFO, "Fluidplayer: Win9x is not supported\n"); Modified: branches/prboom-plus-24/prboom2/src/d_deh.c ============================================================================== --- branches/prboom-plus-24/prboom2/src/d_deh.c Mon Dec 17 19:47:41 2018 (r4535) +++ branches/prboom-plus-24/prboom2/src/d_deh.c Tue Dec 18 20:42:07 2018 (r4536) @@ -1989,25 +1989,25 @@ } if (!deh_strcasecmp(key,deh_state[0])) // Sprite number { - if (fpout) fprintf(fpout," - sprite = %lld\n",value); + if (fpout) fprintf(fpout," - sprite = %I64d\n",value); states[indexnum].sprite = (spritenum_t)value; } else if (!deh_strcasecmp(key,deh_state[1])) // Sprite subnumber { - if (fpout) fprintf(fpout," - frame = %lld\n",value); + if (fpout) fprintf(fpout," - frame = %I64d\n",value); states[indexnum].frame = (long)value; // long } else if (!deh_strcasecmp(key,deh_state[2])) // Duration { - if (fpout) fprintf(fpout," - tics = %lld\n",value); + if (fpout) fprintf(fpout," - tics = %I64d\n",value); states[indexnum].tics = (long)value; // long } else if (!deh_strcasecmp(key,deh_state[3])) // Next frame { - if (fpout) fprintf(fpout," - nextstate = %lld\n",value); + if (fpout) fprintf(fpout," - nextstate = %I64d\n",value); states[indexnum].nextstate = (statenum_t)value; } else @@ -2019,13 +2019,13 @@ else if (!deh_strcasecmp(key,deh_state[5])) // Unknown 1 { - if (fpout) fprintf(fpout," - misc1 = %lld\n",value); + if (fpout) fprintf(fpout," - misc1 = %I64d\n",value); states[indexnum].misc1 = (long)value; // long } else if (!deh_strcasecmp(key,deh_state[6])) // Unknown 2 { - if (fpout) fprintf(fpout," - misc2 = %lld\n",value); + if (fpout) fprintf(fpout," - misc2 = %I64d\n",value); states[indexnum].misc2 = (long)value; // long } else @@ -2082,14 +2082,14 @@ if (value >= NUMSTATES) { if (fpout) - fprintf(fpout,"Bad pointer number %lld of %d\n",value, NUMSTATES); + fprintf(fpout,"Bad pointer number %I64d of %d\n",value, NUMSTATES); return; } if (!deh_strcasecmp(key,deh_state[4])) // Codep frame (not set in Frame deh block) { states[indexnum].action = deh_codeptr[value]; - if (fpout) fprintf(fpout," - applied from codeptr[%lld] to states[%d]\n", + if (fpout) fprintf(fpout," - applied from codeptr[%I64d] to states[%d]\n", value,indexnum); // Write BEX-oriented line to match: // for (i=0;i<NUMSTATES;i++) could go past the end of the array @@ -2106,7 +2106,7 @@ } } else - if (fpout) fprintf(fpout,"Invalid frame pointer index for '%s' at %lld\n", + if (fpout) fprintf(fpout,"Invalid frame pointer index for '%s' at %I64d\n", key, value); } return; Modified: branches/prboom-plus-24/prboom2/src/d_main.c ============================================================================== --- branches/prboom-plus-24/prboom2/src/d_main.c Mon Dec 17 19:47:41 2018 (r4535) +++ branches/prboom-plus-24/prboom2/src/d_main.c Tue Dec 18 20:42:07 2018 (r4536) @@ -2003,7 +2003,7 @@ { for (i=1;!done && i<33;i++) // Ty 09/13/98 - add use of !done { - sprintf(test,"MAP%02d",i); + snprintf(test,sizeof(test),"MAP%02d",i); ix = W_CheckNumForName(test); if (ix != -1) // Ty 10/04/98 avoid -1 subscript { @@ -2029,7 +2029,7 @@ { for (j=1;!done && j<10;j++) // Ty 09/13/98 - add use of !done { - sprintf(test,"E%dM%d",i,j); + snprintf(test,sizeof(test),"E%dM%d",i,j); ix = W_CheckNumForName(test); if (ix != -1) // Ty 10/04/98 avoid -1 subscript { Modified: branches/prboom-plus-24/prboom2/src/d_server.c ============================================================================== --- branches/prboom-plus-24/prboom2/src/d_server.c Mon Dec 17 19:47:41 2018 (r4535) +++ branches/prboom-plus-24/prboom2/src/d_server.c Tue Dec 18 20:42:07 2018 (r4536) @@ -583,7 +583,8 @@ if (ingame && !curplayers) exit(0); // All players have exited } } - // Fall through and broadcast it + // fallthrough + // and broadcast it case PKT_EXTRA: BroadcastPacket(packet, len); if (packet->type == PKT_EXTRA) { Modified: branches/prboom-plus-24/prboom2/src/e6y.c ============================================================================== --- branches/prboom-plus-24/prboom2/src/e6y.c Mon Dec 17 19:47:41 2018 (r4535) +++ branches/prboom-plus-24/prboom2/src/e6y.c Tue Dec 18 20:42:07 2018 (r4536) @@ -1265,7 +1265,9 @@ #ifdef _WIN32 #include <Mmsystem.h> +#ifndef __GNUC__ #pragma comment( lib, "winmm.lib" ) +#endif int mus_extend_volume; void I_midiOutSetVolumes(int volume) { Modified: branches/prboom-plus-24/prboom2/src/g_game.c ============================================================================== --- branches/prboom-plus-24/prboom2/src/g_game.c Mon Dec 17 19:47:41 2018 (r4535) +++ branches/prboom-plus-24/prboom2/src/g_game.c Tue Dec 18 20:42:07 2018 (r4536) @@ -1612,11 +1612,12 @@ wminfo.next = 2; break; } + // fallthrough default: wminfo.next = gamemap; } - if (gamemission == pack_nerve && singleplayer && gamemap == 9) - wminfo.next = 4; + if (gamemission == pack_nerve && singleplayer && gamemap == 9) + wminfo.next = 4; } else { @@ -1718,6 +1719,7 @@ case 31: if (!secretexit) break; + // fallthrough case 6: case 11: case 20: @@ -3504,7 +3506,7 @@ compatibility_level = boom_201_compatibility; else compatibility_level = boom_compatibility_compatibility; - break; + break; case 202: //e6y: check for overrun if (CheckForOverrun(header_p, demo_p, size, 1, failonerror)) @@ -3514,7 +3516,7 @@ compatibility_level = boom_202_compatibility; else compatibility_level = boom_compatibility_compatibility; - break; + break; case 203: /* LxDoom or MBF - determine from signature * cph - load compatibility level */ Modified: branches/prboom-plus-24/prboom2/src/m_menu.c ============================================================================== --- branches/prboom-plus-24/prboom2/src/m_menu.c Mon Dec 17 19:47:41 2018 (r4535) +++ branches/prboom-plus-24/prboom2/src/m_menu.c Tue Dec 18 20:42:07 2018 (r4536) @@ -6071,6 +6071,7 @@ // killough 2/21/98: Fix registered Doom help screen // killough 10/98: moved to second screen, moved up to the top ReadDef2.y = 15; + // fallthrough case shareware: // We need to remove the fourth episode. Modified: branches/prboom-plus-24/prboom2/src/p_ceilng.c ============================================================================== --- branches/prboom-plus-24/prboom2/src/p_ceilng.c Mon Dec 17 19:47:41 2018 (r4535) +++ branches/prboom-plus-24/prboom2/src/p_ceilng.c Tue Dec 18 20:42:07 2018 (r4536) @@ -112,6 +112,7 @@ ceiling->sector->special = ceiling->newspecial; //jff 3/14/98 transfer old special field as well ceiling->sector->oldspecial = ceiling->oldspecial; + // fallthrough case genCeilingChg: ceiling->sector->ceilingpic = ceiling->texture; P_RemoveActiveCeiling(ceiling); @@ -120,6 +121,7 @@ // crushers reverse direction at the top case silentCrushAndRaise: S_StartSound((mobj_t *)&ceiling->sector->soundorg,sfx_pstop); + // fallthrough case genSilentCrusher: case genCrusher: case fastCrushAndRaise: @@ -176,8 +178,10 @@ // except generalized ones, reset speed, start back up case silentCrushAndRaise: S_StartSound((mobj_t *)&ceiling->sector->soundorg,sfx_pstop); + // fallthrough case crushAndRaise: ceiling->speed = CEILSPEED; + // fallthrough case fastCrushAndRaise: ceiling->direction = 1; break; @@ -189,6 +193,7 @@ ceiling->sector->special = ceiling->newspecial; //jff add to fix bug in special transfers from changes ceiling->sector->oldspecial = ceiling->oldspecial; + // fallthrough case genCeilingChg: ceiling->sector->ceilingpic = ceiling->texture; P_RemoveActiveCeiling(ceiling); @@ -305,6 +310,7 @@ case crushAndRaise: ceiling->crush = true; ceiling->topheight = sec->ceilingheight; + // fallthrough case lowerAndCrush: case lowerToFloor: ceiling->bottomheight = sec->floorheight; Modified: branches/prboom-plus-24/prboom2/src/p_doors.c ============================================================================== --- branches/prboom-plus-24/prboom2/src/p_doors.c Mon Dec 17 19:47:41 2018 (r4535) +++ branches/prboom-plus-24/prboom2/src/p_doors.c Tue Dec 18 20:42:07 2018 (r4536) @@ -206,6 +206,7 @@ S_StartSound((mobj_t *)&door->sector->soundorg,sfx_bdopn); break; } + // fallthrough default: // other types bounce off the obstruction door->direction = 1; Modified: branches/prboom-plus-24/prboom2/src/p_floor.c ============================================================================== --- branches/prboom-plus-24/prboom2/src/p_floor.c Mon Dec 17 19:47:41 2018 (r4535) +++ branches/prboom-plus-24/prboom2/src/p_floor.c Tue Dec 18 20:42:07 2018 (r4536) @@ -530,6 +530,7 @@ case raiseFloorCrush: floor->crush = true; + // fallthrough case raiseFloor: floor->direction = 1; floor->sector = sec; Modified: branches/prboom-plus-24/prboom2/src/p_inter.c ============================================================================== --- branches/prboom-plus-24/prboom2/src/p_inter.c Mon Dec 17 19:47:41 2018 (r4535) +++ branches/prboom-plus-24/prboom2/src/p_inter.c Tue Dec 18 20:42:07 2018 (r4536) @@ -148,7 +148,7 @@ if (player->readyweapon == wp_fist || player->readyweapon == wp_pistol) if (player->weaponowned[wp_shotgun]) player->pendingweapon = wp_shotgun; - break; + break; case am_cell: if (player->readyweapon == wp_fist || player->readyweapon == wp_pistol) Modified: branches/prboom-plus-24/prboom2/src/p_lights.c ============================================================================== --- branches/prboom-plus-24/prboom2/src/p_lights.c Mon Dec 17 19:47:41 2018 (r4535) +++ branches/prboom-plus-24/prboom2/src/p_lights.c Tue Dec 18 20:42:07 2018 (r4536) @@ -388,7 +388,7 @@ temp->lightlevel > tbright) tbright = temp->lightlevel; - sector->lightlevel = tbright; + sector->lightlevel = tbright; //jff 5/17/98 unless compatibility optioned //then maximum near ANY tagged sector Modified: branches/prboom-plus-24/prboom2/src/p_map.c ============================================================================== --- branches/prboom-plus-24/prboom2/src/p_map.c Mon Dec 17 19:47:41 2018 (r4535) +++ branches/prboom-plus-24/prboom2/src/p_map.c Tue Dec 18 20:42:07 2018 (r4536) @@ -1587,7 +1587,7 @@ if (li->special) P_ShootSpecialLine (shootthing, li); - if (li->flags & ML_TWOSIDED) + if (li->flags & ML_TWOSIDED) { // crosses a two sided (really 2s) line P_LineOpening (li); dist = FixedMul(attackrange, in->frac); Modified: branches/prboom-plus-24/prboom2/src/p_pspr.c ============================================================================== --- branches/prboom-plus-24/prboom2/src/p_pspr.c Mon Dec 17 19:47:41 2018 (r4535) +++ branches/prboom-plus-24/prboom2/src/p_pspr.c Tue Dec 18 20:42:07 2018 (r4536) @@ -190,6 +190,7 @@ case 1: if (!player->powers[pw_strength]) // allow chainsaw override break; + // fallthrough case 0: newweapon = wp_fist; break; Modified: branches/prboom-plus-24/prboom2/src/p_setup.c ============================================================================== --- branches/prboom-plus-24/prboom2/src/p_setup.c Mon Dec 17 19:47:41 2018 (r4535) +++ branches/prboom-plus-24/prboom2/src/p_setup.c Tue Dec 18 20:42:07 2018 (r4536) @@ -1573,6 +1573,7 @@ { sd->skybox_index = R_BoxSkyboxNumForName(msd->toptexture); } + // fallthrough #endif default: // normal cases Modified: branches/prboom-plus-24/prboom2/src/p_sight.c ============================================================================== --- branches/prboom-plus-24/prboom2/src/p_sight.c Mon Dec 17 19:47:41 2018 (r4535) +++ branches/prboom-plus-24/prboom2/src/p_sight.c Tue Dec 18 20:42:07 2018 (r4536) @@ -196,7 +196,7 @@ in = scan; } - if (!PTR_SightTraverse(in)) + if (!PTR_SightTraverse(in)) return false; // don't bother going farther in->frac = INT_MAX; } Modified: branches/prboom-plus-24/prboom2/src/p_spec.c ============================================================================== --- branches/prboom-plus-24/prboom2/src/p_spec.c Mon Dec 17 19:47:41 2018 (r4535) +++ branches/prboom-plus-24/prboom2/src/p_spec.c Tue Dec 18 20:42:07 2018 (r4536) @@ -2949,6 +2949,7 @@ Add_Scroller(sc_floor, -dx, dy, control, s, accel); if (special != 253) break; + // fallthrough case 252: // carry objects on floor dx = FixedMul(dx,CARRYFACTOR); Modified: branches/prboom-plus-24/prboom2/src/st_stuff.c ============================================================================== --- branches/prboom-plus-24/prboom2/src/st_stuff.c Mon Dec 17 19:47:41 2018 (r4535) +++ branches/prboom-plus-24/prboom2/src/st_stuff.c Tue Dec 18 20:42:07 2018 (r4536) @@ -928,7 +928,7 @@ { sprintf(namebuf, "STTNUM%d", i); R_SetPatchNum(&tallnum[i],namebuf); - sprintf(namebuf, "STYSNUM%d", i); + snprintf(namebuf, sizeof(namebuf), "STYSNUM%d", i); R_SetPatchNum(&shortnum[i],namebuf); } Modified: branches/prboom-plus-24/prboom2/src/wi_stuff.c ============================================================================== --- branches/prboom-plus-24/prboom2/src/wi_stuff.c Mon Dec 17 19:47:41 2018 (r4535) +++ branches/prboom-plus-24/prboom2/src/wi_stuff.c Tue Dec 18 20:42:07 2018 (r4536) @@ -1897,7 +1897,7 @@ if (wbs->epsd != 1 || j != 8) { // animations - sprintf(name, "WIA%d%.2d%.2d", wbs->epsd, j, i); + snprintf(name, sizeof(name), "WIA%d%.2d%.2d", wbs->epsd, j, i); R_SetPatchNum(&a->p[i], name); } else |