From 07011a7044765d51e6c2c814936d271d4b2df8d2 Mon Sep 17 00:00:00 2001
From: Jaime Ita Passos <jp6781615@gmail.com>
Date: Thu, 11 Aug 2022 04:21:31 -0300
Subject: [PATCH] Stop -Waddress warnings

---
 src/blua/ldump.c |  2 +-
 src/d_netcmd.c   |  2 +-
 src/m_menu.c     | 15 +++++----------
 src/m_misc.c     |  2 +-
 4 files changed, 8 insertions(+), 13 deletions(-)

diff --git a/src/blua/ldump.c b/src/blua/ldump.c
index c9d3d4870f..b69a127290 100644
--- a/src/blua/ldump.c
+++ b/src/blua/ldump.c
@@ -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)
 {
- if (s==NULL || getstr(s)==NULL)
+ if (s==NULL)
  {
   size_t size=0;
   DumpVar(size,D);
diff --git a/src/d_netcmd.c b/src/d_netcmd.c
index d9080d342a..7417b8bf76 100644
--- a/src/d_netcmd.c
+++ b/src/d_netcmd.c
@@ -4575,7 +4575,7 @@ void Command_Retry_f(void)
 		CONS_Printf(M_GetText("You must be in a level to use this.\n"));
 	else if (netgame || multiplayer)
 		CONS_Printf(M_GetText("This only works in single player.\n"));
-	else if (!&players[consoleplayer] || players[consoleplayer].lives <= 1)
+	else if (players[consoleplayer].lives <= 1)
 		CONS_Printf(M_GetText("You can't retry without any lives remaining!\n"));
 	else if (G_IsSpecialStage(gamemap))
 		CONS_Printf(M_GetText("You can't retry special stages!\n"));
diff --git a/src/m_menu.c b/src/m_menu.c
index 5b85f65df0..06e9b7cb05 100644
--- a/src/m_menu.c
+++ b/src/m_menu.c
@@ -3686,17 +3686,12 @@ void M_StartControlPanel(void)
 		}
 		else
 		{
-			INT32 numlives = 2;
+			INT32 numlives = players[consoleplayer].lives;
+			if (players[consoleplayer].playerstate != PST_LIVE)
+				++numlives;
 
 			SPauseMenu[spause_pandora].status = (M_SecretUnlocked(SECRET_PANDORA) && !marathonmode) ? (IT_STRING | IT_CALL) : (IT_DISABLED);
 
-			if (&players[consoleplayer])
-			{
-				numlives = players[consoleplayer].lives;
-				if (players[consoleplayer].playerstate != PST_LIVE)
-					++numlives;
-			}
-
 			// The list of things that can disable retrying is (was?) a little too complex
 			// for me to want to use the short if statement syntax
 			if (numlives <= 1 || G_IsSpecialStage(gamemap))
@@ -3754,7 +3749,7 @@ void M_StartControlPanel(void)
 			if (G_GametypeHasTeams())
 				MPauseMenu[mpause_switchteam].status = IT_STRING | IT_SUBMENU;
 			else if (G_GametypeHasSpectators())
-				MPauseMenu[((&players[consoleplayer] && players[consoleplayer].spectator) ? mpause_entergame : mpause_spectate)].status = IT_STRING | IT_CALL;
+				MPauseMenu[players[consoleplayer].spectator ? mpause_entergame : mpause_spectate].status = IT_STRING | IT_CALL;
 			else // in this odd case, we still want something to be on the menu even if it's useless
 				MPauseMenu[mpause_spectate].status = IT_GRAYEDOUT;
 		}
@@ -7012,7 +7007,7 @@ static void M_RetryResponse(INT32 ch)
 	if (ch != 'y' && ch != KEY_ENTER)
 		return;
 
-	if (!&players[consoleplayer] || netgame || multiplayer) // Should never happen!
+	if (netgame || multiplayer) // Should never happen!
 		return;
 
 	M_ClearMenus(true);
diff --git a/src/m_misc.c b/src/m_misc.c
index d7d6d6bbb6..145f457f1f 100644
--- a/src/m_misc.c
+++ b/src/m_misc.c
@@ -833,7 +833,7 @@ static void M_PNGText(png_structp png_ptr, png_infop png_info_ptr, PNG_CONST png
 	else
 		snprintf(lvlttltext, 48, "Unknown");
 
-	if (gamestate == GS_LEVEL && &players[displayplayer] && players[displayplayer].mo)
+	if (gamestate == GS_LEVEL && players[displayplayer].mo)
 		snprintf(locationtxt, 40, "X:%d Y:%d Z:%d A:%d",
 			players[displayplayer].mo->x>>FRACBITS,
 			players[displayplayer].mo->y>>FRACBITS,
-- 
GitLab