From 1108a52959780c51201c2808d8ec35ee5e204bfe Mon Sep 17 00:00:00 2001
From: Monster Iestyn <iestynjealous@ntlworld.com>
Date: Tue, 29 Mar 2016 22:44:16 +0100
Subject: [PATCH 1/8] Check change in ceilinglightsec for markceiling code, not
 floorlightsec

---
 src/r_segs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/r_segs.c b/src/r_segs.c
index 04873b29c..2820262e0 100644
--- a/src/r_segs.c
+++ b/src/r_segs.c
@@ -1922,7 +1922,7 @@ void R_StoreWallRange(INT32 start, INT32 stop)
 		    || backsector->ceilingpic_angle != frontsector->ceilingpic_angle
 		    //SoM: 3/22/2000: Prevents bleeding.
 		    || (frontsector->heightsec != -1 && frontsector->ceilingpic != skyflatnum)
-		    || backsector->floorlightsec != frontsector->floorlightsec
+		    || backsector->ceilinglightsec != frontsector->ceilinglightsec
 		    //SoM: 4/3/2000: Check for colormaps
 		    || frontsector->extra_colormap != backsector->extra_colormap
 		    || (frontsector->ffloors != backsector->ffloors && frontsector->tag != backsector->tag))

From 0fe6ee533990adbd50da7abef36e54d76e9bf70d Mon Sep 17 00:00:00 2001
From: Alam Ed Arias <alam@srb2.org>
Date: Wed, 30 Mar 2016 00:22:12 -0400
Subject: [PATCH 2/8] cleanup abs warnings

---
 src/b_bot.c      | 2 +-
 src/lua_hudlib.c | 2 +-
 src/p_map.c      | 4 ++--
 src/p_user.c     | 4 ++--
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/b_bot.c b/src/b_bot.c
index 3072b1d75..5e128bff1 100644
--- a/src/b_bot.c
+++ b/src/b_bot.c
@@ -49,7 +49,7 @@ static inline void B_BuildTailsTiccmd(mobj_t *sonic, mobj_t *tails, ticcmd_t *cm
 		if (sonic->player->pflags & (PF_MACESPIN|PF_ITEMHANG))
 		{
 			cmd->forwardmove = sonic->player->cmd.forwardmove;
-			cmd->angleturn = abs((tails->angle - sonic->angle))>>16;
+			cmd->angleturn = (angle_t)((tails->angle - sonic->angle))>>16;
 			if (sonic->angle < tails->angle)
 				cmd->angleturn = -cmd->angleturn;
 		} else if (dist > FixedMul(512*FRACUNIT, tails->scale))
diff --git a/src/lua_hudlib.c b/src/lua_hudlib.c
index 19390d50d..d5947489a 100644
--- a/src/lua_hudlib.c
+++ b/src/lua_hudlib.c
@@ -408,7 +408,7 @@ static int libd_drawPaddedNum(lua_State *L)
 	HUDONLY
 	x = luaL_checkinteger(L, 1);
 	y = luaL_checkinteger(L, 2);
-	num = abs(luaL_checkinteger(L, 3));
+	num = labs(luaL_checkinteger(L, 3));
 	digits = luaL_optinteger(L, 4, 2);
 	flags = luaL_optinteger(L, 5, 0);
 	flags &= ~V_PARAMMASK; // Don't let crashes happen.
diff --git a/src/p_map.c b/src/p_map.c
index 1aa8bc391..09f49423b 100644
--- a/src/p_map.c
+++ b/src/p_map.c
@@ -2507,8 +2507,8 @@ isblocking:
 
 			climbangle += (ANGLE_90 * (whichside ? -1 : 1));
 
-			if (((!slidemo->player->climbing && abs((slidemo->angle - ANGLE_90 - climbline)) < ANGLE_45)
-			|| (slidemo->player->climbing == 1 && abs((slidemo->angle - climbline)) < ANGLE_135))
+			if (((!slidemo->player->climbing && (angle_t)((slidemo->angle - ANGLE_90 - climbline)) < ANGLE_45)
+			|| (slidemo->player->climbing == 1 && (angle_t)((slidemo->angle - climbline)) < ANGLE_135))
 			&& P_IsClimbingValid(slidemo->player, climbangle))
 			{
 				slidemo->angle = climbangle;
diff --git a/src/p_user.c b/src/p_user.c
index ce68e2d61..34d2d4bae 100644
--- a/src/p_user.c
+++ b/src/p_user.c
@@ -7899,9 +7899,9 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
 		if (player == &players[consoleplayer])
 		{
 			if (focusangle >= localangle)
-				localangle += abs((focusangle - localangle))>>5;
+				localangle += (angle_t)((focusangle - localangle))>>5;
 			else
-				localangle -= abs((focusangle - localangle))>>5;
+				localangle -= (angle_t)((focusangle - localangle))>>5;
 		}
 	}
 	else if (P_AnalogMove(player)) // Analog

From 7e07d2d77a660139244a3dea823cf4d020dc0672 Mon Sep 17 00:00:00 2001
From: Alam Ed Arias <alam@srb2.org>
Date: Wed, 30 Mar 2016 00:23:28 -0400
Subject: [PATCH 3/8] travis-ci: reenable -Werror

---
 .travis.yml | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/.travis.yml b/.travis.yml
index df89593c4..c15cc6795 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -2,6 +2,9 @@ language: c
 sudo: required
 dist: trusty
 
+env:
+- CFLAGS=-Werror
+
 os:
   - linux
   - osx

From b169529dfde93925add91bd6b4dd0486a327492d Mon Sep 17 00:00:00 2001
From: Alam Ed Arias <alam@srb2.org>
Date: Wed, 30 Mar 2016 11:47:27 -0400
Subject: [PATCH 4/8] switich to do the angle math in signed, then run it thur
 abs()

---
 src/b_bot.c  | 2 +-
 src/p_map.c  | 4 ++--
 src/p_user.c | 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/b_bot.c b/src/b_bot.c
index 5e128bff1..e9b00497e 100644
--- a/src/b_bot.c
+++ b/src/b_bot.c
@@ -49,7 +49,7 @@ static inline void B_BuildTailsTiccmd(mobj_t *sonic, mobj_t *tails, ticcmd_t *cm
 		if (sonic->player->pflags & (PF_MACESPIN|PF_ITEMHANG))
 		{
 			cmd->forwardmove = sonic->player->cmd.forwardmove;
-			cmd->angleturn = (angle_t)((tails->angle - sonic->angle))>>16;
+			cmd->angleturn = abs((signed)(tails->angle - sonic->angle))>>16;
 			if (sonic->angle < tails->angle)
 				cmd->angleturn = -cmd->angleturn;
 		} else if (dist > FixedMul(512*FRACUNIT, tails->scale))
diff --git a/src/p_map.c b/src/p_map.c
index 09f49423b..bcb3c08a9 100644
--- a/src/p_map.c
+++ b/src/p_map.c
@@ -2507,8 +2507,8 @@ isblocking:
 
 			climbangle += (ANGLE_90 * (whichside ? -1 : 1));
 
-			if (((!slidemo->player->climbing && (angle_t)((slidemo->angle - ANGLE_90 - climbline)) < ANGLE_45)
-			|| (slidemo->player->climbing == 1 && (angle_t)((slidemo->angle - climbline)) < ANGLE_135))
+			if (((!slidemo->player->climbing && abs((signed)(slidemo->angle - ANGLE_90 - climbline)) < ANGLE_45)
+			|| (slidemo->player->climbing == 1 && abs((signed)(slidemo->angle - climbline)) < ANGLE_135))
 			&& P_IsClimbingValid(slidemo->player, climbangle))
 			{
 				slidemo->angle = climbangle;
diff --git a/src/p_user.c b/src/p_user.c
index 34d2d4bae..6053ad1e5 100644
--- a/src/p_user.c
+++ b/src/p_user.c
@@ -7899,9 +7899,9 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
 		if (player == &players[consoleplayer])
 		{
 			if (focusangle >= localangle)
-				localangle += (angle_t)((focusangle - localangle))>>5;
+				localangle += abs((signed)(focusangle - localangle))>>5;
 			else
-				localangle -= (angle_t)((focusangle - localangle))>>5;
+				localangle -= abs((signed)(focusangle - localangle))>>5;
 		}
 	}
 	else if (P_AnalogMove(player)) // Analog

From 10cc421fae6095dc6151700b9cd9006164cc0d3c Mon Sep 17 00:00:00 2001
From: Alam Ed Arias <alam@srb2.org>
Date: Wed, 30 Mar 2016 12:58:00 -0400
Subject: [PATCH 5/8] travis: add all/extra warnings

---
 .travis.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.travis.yml b/.travis.yml
index c15cc6795..54c5901d0 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -3,7 +3,7 @@ sudo: required
 dist: trusty
 
 env:
-- CFLAGS=-Werror
+- CFLAGS=-Wall -W -Werror
 
 os:
   - linux

From d90536967d6cd05b1e454f45d252723909bf3d10 Mon Sep 17 00:00:00 2001
From: Alam Ed Arias <alam@srb2.org>
Date: Wed, 30 Mar 2016 14:05:07 -0400
Subject: [PATCH 6/8] removed/remline ununsed code

---
 src/am_map.c           |  33 --------
 src/hardware/hw_main.c |   6 --
 src/hardware/hw_md2.c  | 185 -----------------------------------------
 src/m_cheat.c          |  20 -----
 src/mserv.c            |  27 ------
 src/p_maputl.c         |  15 ----
 src/p_spec.c           |   6 +-
 src/r_things.c         |   5 --
 src/sdl/i_video.c      |  13 ---
 9 files changed, 5 insertions(+), 305 deletions(-)

diff --git a/src/am_map.c b/src/am_map.c
index 70714facb..97b7c5164 100644
--- a/src/am_map.c
+++ b/src/am_map.c
@@ -30,9 +30,7 @@ static const UINT8 REDRANGE    = 16;
 static const UINT8 GRAYS       = (1*16);
 static const UINT8 GRAYSRANGE  = 16;
 static const UINT8 BROWNS      = (3*16);
-static const UINT8 BROWNRANGE  = 16;
 static const UINT8 YELLOWS     = (7*16);
-static const UINT8 YELLOWRANGE = 8;
 static const UINT8 GREENS      = (10*16);
 static const UINT8 GREENRANGE  = 16;
 static const UINT8 DBLACK      = 31;
@@ -41,11 +39,8 @@ static const UINT8 DWHITE      = 0;
 static const UINT8 NOCLIMBREDS        = 248;
 static const UINT8 NOCLIMBREDRANGE    = 8;
 static const UINT8 NOCLIMBGRAYS       = 204;
-static const UINT8 NOCLIMBGRAYSRANGE  = 4;
 static const UINT8 NOCLIMBBROWNS      = (2*16);
-static const UINT8 NOCLIMBBROWNRANGE  = 16;
 static const UINT8 NOCLIMBYELLOWS     = (11*16);
-static const UINT8 NOCLIMBYELLOWRANGE = 8;
 
 
 #ifdef _NDS
@@ -67,15 +62,10 @@ static const UINT8 NOCLIMBYELLOWRANGE = 8;
 #define TSWALLCOLORS          GRAYS
 #define TSWALLRANGE           GRAYSRANGE
 #define NOCLIMBTSWALLCOLORS   NOCLIMBGRAYS
-#define NOCLIMBTSWALLRANGE    NOCLIMBGRAYSRANGE
 #define FDWALLCOLORS          BROWNS
-#define FDWALLRANGE           BROWNRANGE
 #define NOCLIMBFDWALLCOLORS   NOCLIMBBROWNS
-#define NOCLIMBFDWALLRANGE    NOCLIMBBROWNRANGE
 #define CDWALLCOLORS          YELLOWS
-#define CDWALLRANGE           YELLOWRANGE
 #define NOCLIMBCDWALLCOLORS   NOCLIMBYELLOWS
-#define NOCLIMBCDWALLRANGE    NOCLIMBYELLOWRANGE
 #define THINGCOLORS           GREENS
 #define THINGRANGE            GREENRANGE
 #define SECRETWALLCOLORS      WALLCOLORS
@@ -255,29 +245,6 @@ static AMDRAWFLINEFUNC AM_drawFline;
 
 static void AM_drawFline_soft(const fline_t *fl, INT32 color);
 
-/** Calculates the slope and slope according to the x-axis of a line
-  * segment in map coordinates (with the upright y-axis and all) so
-  * that it can be used with the braindead drawing stuff.
-  *
-  * \param ml The line segment.
-  * \param is Holds the result.
-  */
-static inline void AM_getIslope(const mline_t *ml, islope_t *is)
-{
-	INT32 dx, dy;
-
-	dy = ml->a.y - ml->b.y;
-	dx = ml->b.x - ml->a.x;
-	if (!dy)
-		is->islp = (dx < 0 ? -INT32_MAX : INT32_MAX);
-	else
-		is->islp = FixedDiv(dx, dy);
-	if (!dx)
-		is->slp = (dy < 0 ? -INT32_MAX : INT32_MAX);
-	else
-		is->slp = FixedDiv(dy, dx);
-}
-
 static void AM_activateNewScale(void)
 {
 	m_x += m_w/2;
diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c
index b0186049a..ae26b8deb 100644
--- a/src/hardware/hw_main.c
+++ b/src/hardware/hw_main.c
@@ -3404,12 +3404,6 @@ static void HWR_ClearSprites(void)
 	gr_visspritecount = 0;
 }
 
-static inline void HWR_ResetVisSpriteChunks(void)
-{
-	memset(gr_visspritechunks, 0, sizeof(gr_visspritechunks));
-}
-
-
 // --------------------------------------------------------------------------
 // HWR_NewVisSprite
 // --------------------------------------------------------------------------
diff --git a/src/hardware/hw_md2.c b/src/hardware/hw_md2.c
index 0745b9a00..a160be67b 100644
--- a/src/hardware/hw_md2.c
+++ b/src/hardware/hw_md2.c
@@ -406,191 +406,6 @@ static md2_model_t *md2_readModel(const char *filename)
 	return model;
 }
 
-/*
- * center model
- */
-static inline void md2_getBoundingBox (md2_model_t *model, float *minmax)
-{
-	size_t i;
-	float minx, maxx;
-	float miny, maxy;
-	float minz, maxz;
-
-	minx = miny = minz = 999999.0f;
-	maxx = maxy = maxz = -999999.0f;
-
-	/* get bounding box */
-	for (i = 0; i < model->header.numVertices; i++)
-	{
-		md2_triangleVertex_t *v = &model->frames[0].vertices[i];
-
-		if (v->vertex[0] < minx)
-			minx = v->vertex[0];
-		else if (v->vertex[0] > maxx)
-			maxx = v->vertex[0];
-
-		if (v->vertex[1] < miny)
-			miny = v->vertex[1];
-		else if (v->vertex[1] > maxy)
-			maxy = v->vertex[1];
-
-		if (v->vertex[2] < minz)
-			minz = v->vertex[2];
-		else if (v->vertex[2] > maxz)
-			maxz = v->vertex[2];
-	}
-
-	minmax[0] = minx;
-	minmax[1] = maxx;
-	minmax[2] = miny;
-	minmax[3] = maxy;
-	minmax[4] = minz;
-	minmax[5] = maxz;
-}
-
-static inline INT32 md2_getAnimationCount(md2_model_t *model)
-{
-	size_t i, pos;
-	INT32 j = 0, count;
-	char name[16], last[16];
-
-	strcpy(last, model->frames[0].name);
-	pos = strlen(last) - 1;
-	while (last[pos] >= '0' && last[pos] <= '9' && j < 2)
-	{
-		pos--;
-		j++;
-	}
-	last[pos + 1] = '\0';
-
-	count = 0;
-
-	for (i = 0; i <= model->header.numFrames; i++)
-	{
-		if (i == model->header.numFrames)
-			strcpy(name, ""); // some kind of a sentinel
-		else
-			strcpy(name, model->frames[i].name);
-		pos = strlen(name) - 1;
-		j = 0;
-		while (name[pos] >= '0' && name[pos] <= '9' && j < 2)
-		{
-			pos--;
-			j++;
-		}
-		name[pos + 1] = '\0';
-
-		if (strcmp(last, name))
-		{
-			strcpy(last, name);
-			count++;
-		}
-	}
-
-	return count;
-}
-
-static inline const char * md2_getAnimationName (md2_model_t *model, INT32 animation)
-{
-	size_t i, pos;
-	INT32 j = 0, count;
-	static char last[32];
-	char name[32];
-
-	strcpy(last, model->frames[0].name);
-	pos = strlen(last) - 1;
-	while (last[pos] >= '0' && last[pos] <= '9' && j < 2)
-	{
-		pos--;
-		j++;
-	}
-	last[pos + 1] = '\0';
-
-	count = 0;
-
-	for (i = 0; i <= model->header.numFrames; i++)
-	{
-		if (i == model->header.numFrames)
-			strcpy(name, ""); // some kind of a sentinel
-		else
-			strcpy(name, model->frames[i].name);
-		pos = strlen(name) - 1;
-		j = 0;
-		while (name[pos] >= '0' && name[pos] <= '9' && j < 2)
-		{
-			pos--;
-			j++;
-		}
-		name[pos + 1] = '\0';
-
-		if (strcmp(last, name))
-		{
-			if (count == animation)
-				return last;
-
-			strcpy(last, name);
-			count++;
-		}
-	}
-
-	return 0;
-}
-
-static inline void md2_getAnimationFrames(md2_model_t *model,
-	INT32 animation, INT32 *startFrame, INT32 *endFrame)
-{
-	size_t i, pos;
-	INT32 j = 0, count, numFrames, frameCount;
-	char name[16], last[16];
-
-	strcpy(last, model->frames[0].name);
-	pos = strlen(last) - 1;
-	while (last[pos] >= '0' && last[pos] <= '9' && j < 2)
-	{
-		pos--;
-		j++;
-	}
-	last[pos + 1] = '\0';
-
-	count = 0;
-	numFrames = 0;
-	frameCount = 0;
-
-	for (i = 0; i <= model->header.numFrames; i++)
-	{
-		if (i == model->header.numFrames)
-			strcpy(name, ""); // some kind of a sentinel
-		else
-			strcpy(name, model->frames[i].name);
-		pos = strlen(name) - 1;
-		j = 0;
-		while (name[pos] >= '0' && name[pos] <= '9' && j < 2)
-		{
-			pos--;
-			j++;
-		}
-		name[pos + 1] = '\0';
-
-		if (strcmp(last, name))
-		{
-			strcpy(last, name);
-
-			if (count == animation)
-			{
-				*startFrame = frameCount - numFrames;
-				*endFrame = frameCount - 1;
-				return;
-			}
-
-			count++;
-			numFrames = 0;
-		}
-		frameCount++;
-		numFrames++;
-	}
-	*startFrame = *endFrame = 0;
-}
-
 static inline void md2_printModelInfo (md2_model_t *model)
 {
 #if 0
diff --git a/src/m_cheat.c b/src/m_cheat.c
index 8cea4c6ae..c8a19666b 100644
--- a/src/m_cheat.c
+++ b/src/m_cheat.c
@@ -161,26 +161,6 @@ static UINT8 cht_CheckCheat(cheatseq_t *cht, char key)
 	return rc;
 }
 
-static inline void cht_GetParam(cheatseq_t *cht, char *buffer)
-{
-	UINT8 *p;
-	UINT8 c;
-
-	p = cht->sequence;
-	while (*(p++) != 1)
-		;
-
-	do
-	{
-		c = *p;
-		*(buffer++) = c;
-		*(p++) = 0;
-	} while (c && *p != 0xff);
-
-	if (*p == 0xff)
-		*buffer = 0;
-}
-
 boolean cht_Responder(event_t *ev)
 {
 	UINT8 ret = 0, ch = 0;
diff --git a/src/mserv.c b/src/mserv.c
index 568474d73..c47d149ee 100644
--- a/src/mserv.c
+++ b/src/mserv.c
@@ -351,33 +351,6 @@ static INT32 GetServersList(void)
 }
 #endif
 
-/** Get the MOTD from the master server.
-  */
-static inline INT32 GetMSMOTD(void)
-{
-	msg_t msg;
-	INT32 count = 0;
-
-	msg.type = GET_MOTD_MSG;
-	msg.length = 0;
-	if (MS_Write(&msg) < 0)
-		return MS_WRITE_ERROR;
-
-	while (MS_Read(&msg) >= 0)
-	{
-		if (!msg.length)
-		{
-			if (!count)
-				CONS_Alert(CONS_NOTICE, M_GetText("No servers currently running.\n"));
-			return MS_NO_ERROR;
-		}
-		count++;
-		CONS_Printf("%s",msg.buffer);
-	}
-
-	return MS_READ_ERROR;
-}
-
 //
 // MS_Connect()
 //
diff --git a/src/p_maputl.c b/src/p_maputl.c
index 48dd54e8d..2aa667811 100644
--- a/src/p_maputl.c
+++ b/src/p_maputl.c
@@ -34,21 +34,6 @@ fixed_t P_AproxDistance(fixed_t dx, fixed_t dy)
 	return dx + dy - (dy>>1);
 }
 
-//
-// P_PartialDistance
-// Useful only for iterations finding the 'closest point'
-//
-FUNCMATH static inline fixed_t P_PartialDistance(fixed_t dx, fixed_t dy)
-{
-	dx >>= FRACBITS;
-	dy >>= FRACBITS;
-
-	dx *= dx;
-	dy *= dy;
-
-	return dx + dy;
-}
-
 //
 // P_ClosestPointOnLine
 // Finds the closest point on a given line to the supplied point
diff --git a/src/p_spec.c b/src/p_spec.c
index 8228c60b3..a292a8bb0 100644
--- a/src/p_spec.c
+++ b/src/p_spec.c
@@ -102,7 +102,7 @@ static void Add_Pusher(pushertype_e type, fixed_t x_mag, fixed_t y_mag, mobj_t *
 static void Add_MasterDisappearer(tic_t appeartime, tic_t disappeartime, tic_t offset, INT32 line, INT32 sourceline);
 static void P_AddBlockThinker(sector_t *sec, line_t *sourceline);
 static void P_AddFloatThinker(sector_t *sec, INT32 tag, line_t *sourceline);
-static void P_AddBridgeThinker(line_t *sourceline, sector_t *sec);
+//static void P_AddBridgeThinker(line_t *sourceline, sector_t *sec);
 static void P_AddFakeFloorsByLine(size_t line, ffloortype_e ffloorflags, thinkerlist_t *secthinkers);
 static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec);
 static void Add_Friction(INT32 friction, INT32 movefactor, INT32 affectee, INT32 referrer);
@@ -593,6 +593,7 @@ void P_SetupLevelFlatAnims(void)
 // UTILITIES
 //
 
+#if 0
 /** Gets a side from a sector line.
   *
   * \param currentSector Sector the line is in.
@@ -632,6 +633,7 @@ static inline boolean twoSided(INT32 sector, INT32 line)
 {
 	return (sectors[sector].lines[line])->sidenum[1] != 0xffff;
 }
+#endif
 
 /** Finds sector next to current.
   *
@@ -5050,6 +5052,7 @@ static void P_AddFloatThinker(sector_t *sec, INT32 tag, line_t *sourceline)
   * \sa P_SpawnSpecials, T_BridgeThinker
   * \author SSNTails <http://www.ssntails.org>
   */
+/*
 static inline void P_AddBridgeThinker(line_t *sourceline, sector_t *sec)
 {
 	levelspecthink_t *bridge;
@@ -5072,6 +5075,7 @@ static inline void P_AddBridgeThinker(line_t *sourceline, sector_t *sec)
 	bridge->vars[4] = sourceline->tag; // Start tag
 	bridge->vars[5] = (sides[sourceline->sidenum[0]].textureoffset>>FRACBITS); // End tag
 }
+*/
 
 /** Adds a Mario block thinker, which changes the block's texture between blank
   * and ? depending on whether it has contents.
diff --git a/src/r_things.c b/src/r_things.c
index 9a8b1319b..c5f3c5245 100644
--- a/src/r_things.c
+++ b/src/r_things.c
@@ -550,11 +550,6 @@ void R_ClearSprites(void)
 	visspritecount = clippedvissprites = 0;
 }
 
-static inline void R_ResetVisSpriteChunks(void)
-{
-	memset(visspritechunks, 0, sizeof(visspritechunks));
-}
-
 //
 // R_NewVisSprite
 //
diff --git a/src/sdl/i_video.c b/src/sdl/i_video.c
index 963310a26..0f9fa58a8 100644
--- a/src/sdl/i_video.c
+++ b/src/sdl/i_video.c
@@ -126,8 +126,6 @@ static       Uint8       BitsPerPixel = 16;
 #endif
 Uint16      realwidth = BASEVIDWIDTH;
 Uint16      realheight = BASEVIDHEIGHT;
-static const Uint32      surfaceFlagsW = 0/*|SDL_RESIZABLE*/;
-static const Uint32      surfaceFlagsF = 0;
 static       SDL_bool    mousegrabok = SDL_TRUE;
 #define HalfWarpMouse(x,y) SDL_WarpMouseInWindow(window, (Uint16)(x/2),(Uint16)(y/2))
 static       SDL_bool    videoblitok = SDL_FALSE;
@@ -1252,17 +1250,6 @@ static inline boolean I_SkipFrame(void)
 	}
 }
 
-static inline SDL_bool SDLmatchVideoformat(void)
-{
-	const SDL_PixelFormat *vidformat = vidSurface->format;
-	const INT32 vfBPP = vidformat?vidformat->BitsPerPixel:0;
-	return (((vfBPP == 8 && vid.bpp == 1 &&
-	 !vidformat->Rmask && !vidformat->Gmask && !vidformat->Bmask) ||
-	 (vfBPP == 15 && vid.bpp == 2 && vidformat->Rmask == 0x7C00 &&
-	 vidformat->Gmask == 0x03E0 && vidformat->Bmask == 0x001F )) &&
-	 !vidformat->Amask && (vidSurface->flags & SDL_RLEACCEL) == 0);
-}
-
 //
 // I_FinishUpdate
 //

From 75f65c4d44d07e3b7538cafc65141b0e0c7f6016 Mon Sep 17 00:00:00 2001
From: Alam Ed Arias <alam@srb2.org>
Date: Wed, 30 Mar 2016 20:17:09 -0400
Subject: [PATCH 7/8] using abs() on unsigned have no effect

---
 src/g_game.c | 2 +-
 src/p_user.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/g_game.c b/src/g_game.c
index 3b7ef158f..9ea51ebab 100644
--- a/src/g_game.c
+++ b/src/g_game.c
@@ -4336,7 +4336,7 @@ void G_GhostTicker(void)
 		{
 		case GHC_SUPER: // Super Sonic (P_DoSuperStuff)
 			g->mo->color = SKINCOLOR_SUPER1;
-			g->mo->color += abs( ( ( leveltime >> 1 ) % 9) - 4);
+			g->mo->color += ( ( ( leveltime >> 1 ) % 9) - 4);
 			break;
 		case GHC_INVINCIBLE: // Mario invincibility (P_CheckInvincibilityTimer)
 			g->mo->color = (UINT8)(leveltime % MAXSKINCOLORS);
diff --git a/src/p_user.c b/src/p_user.c
index 45f860115..72b08db9c 100644
--- a/src/p_user.c
+++ b/src/p_user.c
@@ -3449,7 +3449,7 @@ static void P_DoSuperStuff(player_t *player)
 			case 2:  /* Knux     */ player->mo->color = SKINCOLOR_KSUPER1; break;
 			default: /* everyone */ player->mo->color = SKINCOLOR_SUPER1; break;
 		}
-		player->mo->color += abs( ( ( leveltime >> 1 ) % 9) - 4);
+		player->mo->color += ( ( ( leveltime >> 1 ) % 9) - 4);
 
 		if ((cmd->forwardmove != 0 || cmd->sidemove != 0 || player->pflags & (PF_CARRIED|PF_ROPEHANG|PF_ITEMHANG|PF_MACESPIN))
 		&& !(leveltime % TICRATE) && (player->mo->momx || player->mo->momy))

From de630d0c33ed786fe33a0e3fc5b1492812c02c2e Mon Sep 17 00:00:00 2001
From: Alam Ed Arias <alam@srb2.org>
Date: Wed, 30 Mar 2016 20:30:24 -0400
Subject: [PATCH 8/8] appveyor: let check warnings as well

---
 appveyor.yml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/appveyor.yml b/appveyor.yml
index 4edcd7a7f..3ddec6dfb 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -11,6 +11,7 @@ environment:
  SDL2_MIXER_URL: https://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-devel-2.0.1-mingw.tar.gz
  SDL2_MIXER_ARCHIVE: SDL2_mixer-devel-2.0.1-mingw.tar
  SDL2_MIXER_MOVE: SDL2_mixer-2.0.1\i686-w64-mingw32
+ CFLAGS: -Wall -W -Werror
 
 cache:
 - SDL2-devel-2.0.4-mingw.tar.gz