From 4b5dd2ac1b9ddfe4fe3db1cb7831ed7c270a34ae Mon Sep 17 00:00:00 2001
From: Alam Ed Arias <alam@srb2.org>
Date: Tue, 28 Mar 2017 13:46:29 -0400
Subject: [PATCH] basic fixup of warnings

---
 src/blua/liolib.c     | 6 ++++--
 src/d_clisrv.c        | 4 +++-
 src/p_mobj.h          | 2 +-
 src/sdl/i_system.c    | 2 +-
 src/sdl/mixer_sound.c | 2 ++
 src/sounds.c          | 1 -
 src/v_video.c         | 4 ++--
 7 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/src/blua/liolib.c b/src/blua/liolib.c
index 2d20f5292..e3d8a2487 100644
--- a/src/blua/liolib.c
+++ b/src/blua/liolib.c
@@ -166,8 +166,10 @@ static int StartsWith(const char *a, const char *b) // this is wolfs being lazy
 
 
 static int io_open (lua_State *L) {
-	const char *filename = luaL_checkstring(L, 1);
-	int pass = 0; int i;
+	const char *Cfilename = luaL_checkstring(L, 1);
+	char *filename = strdup(Cfilename);
+	int pass = 0;
+	size_t i;
 	int length = strlen(filename) - 1;
 	for (i = 0; i < (sizeof (whitelist) / sizeof(const char *)); i++)
 	{
diff --git a/src/d_clisrv.c b/src/d_clisrv.c
index 2fb021017..cc1b3305e 100644
--- a/src/d_clisrv.c
+++ b/src/d_clisrv.c
@@ -2294,11 +2294,13 @@ static void Command_connect(void)
 			}
 		}
 
-		if (gametype == INT32_MAX)
+#if 0 // gametype will never equal INT32_MAX
+	if (gametype == INT32_MAX)
         {
             CONS_Alert(CONS_ERROR, M_GetText("Invalid gametype %s\n"), COM_Argv(3));
             return;
         }
+#endif
 
         // Goodbye, we're off to host a server
         CV_SetValue(&cv_nextmap, newmapnum);
diff --git a/src/p_mobj.h b/src/p_mobj.h
index c31732b6d..3a00e0043 100644
--- a/src/p_mobj.h
+++ b/src/p_mobj.h
@@ -457,5 +457,5 @@ extern INT32 numstarposts;
 
 boolean camera_motionblur;
 INT32 forward_postimgparam;
-boolean P_CheckMotionBlur();
+boolean P_CheckMotionBlur(void);
 void P_SetActiveMotionBlur(boolean active, INT32 param);
diff --git a/src/sdl/i_system.c b/src/sdl/i_system.c
index 1f614d8c0..71ee3f794 100644
--- a/src/sdl/i_system.c
+++ b/src/sdl/i_system.c
@@ -23,7 +23,7 @@
 #ifdef CMAKECONFIG
 #include "config.h"
 #else
-#include "config.h.in"
+#include "../config.h.in"
 #endif
 
 #ifndef _WIN32_WCE
diff --git a/src/sdl/mixer_sound.c b/src/sdl/mixer_sound.c
index c824ad983..c45d2b583 100644
--- a/src/sdl/mixer_sound.c
+++ b/src/sdl/mixer_sound.c
@@ -472,6 +472,8 @@ static void mixmusic_callback(void *udata, Uint8 *stream, int len)
 		music_pos += len/4;
 		music_pos_time = SDL_GetTicks();
 	}
+	(void)udata;
+	(void)stream;
 	//I_OutputMsg("MusicPos: %.3f", music_pos);
 	//HU_DoCEcho(va("MusicPos: %.3f\\Stream: %d\\Length: %i", music_pos,stream,len));
 }
diff --git a/src/sounds.c b/src/sounds.c
index ecfc75771..f85a70a7d 100644
--- a/src/sounds.c
+++ b/src/sounds.c
@@ -478,7 +478,6 @@ void S_InitRuntimeSounds (void)
 	sfxenum_t i;
 	INT32 value;
 	char soundname[7];
-	char musicname[7];
 
 	for (i = sfx_freeslot0; i <= sfx_lastskinsoundslot; i++)
 	{
diff --git a/src/v_video.c b/src/v_video.c
index 390f212ea..0414f9a1b 100644
--- a/src/v_video.c
+++ b/src/v_video.c
@@ -2037,8 +2037,8 @@ Unoptimized version
 
 		float cosma = cos(f_angle);
 
-		float xst = (INT32)round((cosma * -hwidth - sinma * -hheight) + hwidth);
-		float yst = (INT32)round((sinma * -hwidth + cosma * -hheight) + hheight);
+		float xst = round((cosma * -hwidth - sinma * -hheight) + hwidth);
+		float yst = round((sinma * -hwidth + cosma * -hheight) + hheight);
 
 		// Fills the empty space with a solid color from palette index
 		memset(screens[4], (UINT8)(31), vid.width*vid.height*vid.bpp);
-- 
GitLab