From 7e21f448663ba518ee803907f0a0ca1731ea63be Mon Sep 17 00:00:00 2001 From: Roman Fomin Date: Wed, 18 Dec 2024 23:25:34 +0700 Subject: [PATCH] fix clang-tidy warnings --- src/f_finale.c | 2 +- src/g_umapinfo.c | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/f_finale.c b/src/f_finale.c index cd86f1c6a..cb5d53cce 100644 --- a/src/f_finale.c +++ b/src/f_finale.c @@ -233,7 +233,7 @@ static boolean MapInfo_Drawer(void) // void F_StartFinale (void) { - musicenum_t music_id = -1; + musicenum_t music_id = mus_None; gameaction = ga_nothing; gamestate = GS_FINALE; diff --git a/src/g_umapinfo.c b/src/g_umapinfo.c index 931388e31..400a7f24a 100644 --- a/src/g_umapinfo.c +++ b/src/g_umapinfo.c @@ -609,8 +609,10 @@ void G_ParseMapInfo(int lumpnum) else { int ep, map; - G_ValidateMapName(parsed.mapname, &ep, &map); - strcpy(parsed.nextmap, MapName(ep, map + 1)); + if (G_ValidateMapName(parsed.mapname, &ep, &map)) + { + strcpy(parsed.nextmap, MapName(ep, map + 1)); + } } } @@ -673,7 +675,7 @@ boolean G_ValidateMapName(const char *mapname, int *episode, int *map) { if (sscanf(mapuname, "E%dM%d", &e, &m) != 2) { - return 0; + return false; } strcpy(lumpname, MapName(e, m)); } @@ -681,7 +683,7 @@ boolean G_ValidateMapName(const char *mapname, int *episode, int *map) { if (sscanf(mapuname, "MAP%d", &m) != 1) { - return 0; + return false; } strcpy(lumpname, MapName(e = 1, m)); } @@ -695,7 +697,7 @@ boolean G_ValidateMapName(const char *mapname, int *episode, int *map) *map = m; } - return !strcmp(mapuname, lumpname); + return strcmp(mapuname, lumpname) == 0; } boolean G_IsSecretMap(int episode, int map)