Merge branch 'gcc-12-warnings' into 'master'

Fix GCC 12 warnings

See merge request KartKrew/Kart!584
This commit is contained in:
toaster 2022-05-11 19:24:53 +00:00
commit e28295635c
5 changed files with 6 additions and 6 deletions

View file

@ -60,7 +60,7 @@ static void DumpVector(const void* b, int n, size_t size, DumpState* D)
static void DumpString(const TString* s, DumpState* D) static void DumpString(const TString* s, DumpState* D)
{ {
if (s==NULL || getstr(s)==NULL) if (s==NULL)
{ {
size_t size=0; size_t size=0;
DumpVar(size,D); DumpVar(size,D);

View file

@ -125,7 +125,7 @@ boolean K_GenerateFinishBeamLine(void)
mapthing_t *mt; mapthing_t *mt;
INT64 bounds[4]; INT64 bounds[4];
angle_t angle; angle_t angle = 0;
boolean valid = false; boolean valid = false;
size_t i; size_t i;

View file

@ -6344,7 +6344,7 @@ static void M_RetryResponse(INT32 ch)
if (ch != 'y' && ch != KEY_ENTER) if (ch != 'y' && ch != KEY_ENTER)
return; return;
if (!&players[consoleplayer] || netgame || multiplayer) // Should never happen! if (netgame || multiplayer) // Should never happen!
return; return;
M_ClearMenus(true); M_ClearMenus(true);

View file

@ -851,7 +851,7 @@ static void M_PNGText(png_structp png_ptr, png_infop png_info_ptr, PNG_CONST png
else else
snprintf(lvlttltext, 48, "Unknown"); snprintf(lvlttltext, 48, "Unknown");
if (gamestate == GS_LEVEL && &players[g_localplayers[0]] && players[g_localplayers[0]].mo) if (gamestate == GS_LEVEL && players[g_localplayers[0]].mo)
snprintf(locationtxt, 40, "X:%d Y:%d Z:%d A:%d", snprintf(locationtxt, 40, "X:%d Y:%d Z:%d A:%d",
players[g_localplayers[0]].mo->x>>FRACBITS, players[g_localplayers[0]].mo->x>>FRACBITS,
players[g_localplayers[0]].mo->y>>FRACBITS, players[g_localplayers[0]].mo->y>>FRACBITS,

View file

@ -637,8 +637,6 @@ static lumpinfo_t* ResGetLumpsZip (FILE* handle, UINT16* nlmp)
lump_p->fullname = Z_Calloc(zentry.namelen + 1, PU_STATIC, NULL); lump_p->fullname = Z_Calloc(zentry.namelen + 1, PU_STATIC, NULL);
strncpy(lump_p->fullname, fullname, zentry.namelen); strncpy(lump_p->fullname, fullname, zentry.namelen);
free(fullname);
switch(zentry.compression) switch(zentry.compression)
{ {
case 0: case 0:
@ -658,6 +656,8 @@ static lumpinfo_t* ResGetLumpsZip (FILE* handle, UINT16* nlmp)
break; break;
} }
free(fullname);
// skip and ignore comments/extra fields // skip and ignore comments/extra fields
if (fseek(handle, zentry.xtralen + zentry.commlen, SEEK_CUR) != 0) if (fseek(handle, zentry.xtralen + zentry.commlen, SEEK_CUR) != 0)
{ {