diff -r bab491c70e0d src/astar.cpp
--- a/src/astar.cpp	Wed Jun 11 01:42:14 2014 +0300
+++ b/src/astar.cpp	Sat Jun 21 21:07:23 2014 +0200
@@ -620,14 +620,14 @@
 		do
 		{
 			lXIdx = g_RandomRoamSeed.Random( ) % g_lNumHorizontalNodes;
-		} while ( abs( lXNode - lXIdx ) > 8 );
+		} while ( labs( lXNode - lXIdx ) > 8 );
 	}
 	else
 	{
 		do
 		{
 			lXIdx = g_RandomRoamSeed.Random( ) % g_lNumHorizontalNodes;
-		} while (( abs( lXNode - lXIdx ) > 8 ) || ( abs( lXNode - lXIdx ) < 2 ));
+		} while (( labs( lXNode - lXIdx ) > 8 ) || ( labs( lXNode - lXIdx ) < 2 ));
 	}
 
 	if ( g_lNumVerticalNodes <= 3 )
@@ -635,14 +635,14 @@
 		do
 		{
 			lYIdx = g_RandomRoamSeed.Random( ) % g_lNumVerticalNodes;
-		} while ( abs( lYNode - lYIdx ) > 8 );
+		} while ( labs( lYNode - lYIdx ) > 8 );
 	}
 	else
 	{
 		do
 		{
 			lYIdx = g_RandomRoamSeed.Random( ) % g_lNumVerticalNodes;
-		} while (( abs( lYNode - lYIdx ) > 8 ) || ( abs( lYNode - lYIdx ) < 2 ));
+		} while (( labs( lYNode - lYIdx ) > 8 ) || ( labs( lYNode - lYIdx ) < 2 ));
 	}
 
 	*pPos = ASTAR_GetPositionFromIndex( lXIdx, lYIdx );
@@ -798,7 +798,7 @@
 
 	return ( P_AproxDistance( PosNode.x - PosGoal.x, PosNode.y - PosGoal.y ));
 
-//	return (( abs( pPath->pGoalNode->lXNodeIdx - pNode->lXNodeIdx ) + ( abs( pPath->pGoalNode->lYNodeIdx - pNode->lYNodeIdx ))) * 64 );
+//	return (( labs( pPath->pGoalNode->lXNodeIdx - pNode->lXNodeIdx ) + ( labs( pPath->pGoalNode->lYNodeIdx - pNode->lYNodeIdx ))) * 64 );
 
 	LONG	lXDiff;
 	LONG	lYDiff;
@@ -814,10 +814,10 @@
 
 	return ( (LONG)sqrt(((( pPath->pGoalNode->lXNodeIdx - pNode->lXNodeIdx ) * 64 ) ^ 2 ) + ((( pPath->pGoalNode->lYNodeIdx - pNode->lYNodeIdx ) * 64 ) ^ 2 )));
 
-//	return (( abs( pPath->pGoalNode->lXNodeIdx - pNode->lXNodeIdx ) + abs( pPath->pGoalNode->lYNodeIdx - pNode->lYNodeIdx )) * 15 );
+//	return (( labs( pPath->pGoalNode->lXNodeIdx - pNode->lXNodeIdx ) + labs( pPath->pGoalNode->lYNodeIdx - pNode->lYNodeIdx )) * 15 );
 
-	return (( abs( pPath->pGoalNode->lXNodeIdx - pNode->lXNodeIdx ) * abs( pPath->pGoalNode->lXNodeIdx - pNode->lXNodeIdx )) + 
-			( abs( pPath->pGoalNode->lYNodeIdx - pNode->lYNodeIdx ) * abs( pPath->pGoalNode->lYNodeIdx - pNode->lYNodeIdx )));
+	return (( labs( pPath->pGoalNode->lXNodeIdx - pNode->lXNodeIdx ) * labs( pPath->pGoalNode->lXNodeIdx - pNode->lXNodeIdx )) + 
+			( labs( pPath->pGoalNode->lYNodeIdx - pNode->lYNodeIdx ) * labs( pPath->pGoalNode->lYNodeIdx - pNode->lYNodeIdx )));
 */
 }
 
diff -r bab491c70e0d src/botcommands.cpp
--- a/src/botcommands.cpp	Wed Jun 11 01:42:14 2014 +0300
+++ b/src/botcommands.cpp	Sat Jun 21 21:07:23 2014 +0200
@@ -1318,7 +1318,7 @@
 
 	lAngle *= ANGLE_1;
 	if ( lAngle < 0 )
-		lAngle = ANGLE_MAX - abs( lAngle );
+		lAngle = ANGLE_MAX - labs( lAngle );
 
 	Angle = pBot->GetPlayer( )->mo->angle;
 	Angle += lAngle;
@@ -1875,7 +1875,7 @@
 
 	// Adjust the bot's angle.
 	if ( lBuffer < 0 )
-		pBot->GetPlayer( )->mo->angle -= ANGLE_1 * abs( lBuffer );
+		pBot->GetPlayer( )->mo->angle -= ANGLE_1 * labs( lBuffer );
 	else
 		pBot->GetPlayer( )->mo->angle += ANGLE_1 * lBuffer;
 }
@@ -1960,7 +1960,7 @@
 {
 	APowerInvulnerable		*pInvulnerability;
 
-	if (( pBot->m_ulPlayerEnemy >= MAXPLAYERS ) || ( pBot->m_ulPlayerEnemy < 0 ) || ( playeringame[pBot->m_ulPlayerEnemy] == false ))
+	if (( pBot->m_ulPlayerEnemy >= MAXPLAYERS ) || ( playeringame[pBot->m_ulPlayerEnemy] == false ))
 		g_iReturnInt = -1;
 	else
 	{
diff -r bab491c70e0d src/bots.cpp
--- a/src/bots.cpp	Wed Jun 11 01:42:14 2014 +0300
+++ b/src/bots.cpp	Sat Jun 21 21:07:23 2014 +0200
@@ -1252,7 +1252,7 @@
 			else if ( stricmp( szKey, "chatfrequency" ) == 0 )
 			{
 				BotInfo.ulChatFrequency = atoi( szValue );
-				if (( BotInfo.ulChatFrequency < 0 ) || ( BotInfo.ulChatFrequency > 100 ))
+				if ( BotInfo.ulChatFrequency > 100 )
 					I_Error( "BOTS_ParseBotInfo: Expected value from 0-100 for field \"chatfrequency\"!" );
 			}
 			else if ( stricmp( szKey, "revealed" ) == 0 )
@@ -1720,7 +1720,7 @@
 
 	V_ColorizeString( m_pPlayer->userinfo.netname );
 	m_pPlayer->userinfo.color = V_GetColorFromString( NULL, g_BotInfo[m_ulBotInfoIdx]->szColor );
-	if ( g_BotInfo[m_ulBotInfoIdx]->szSkinName )
+	if ( g_BotInfo[m_ulBotInfoIdx]->szSkinName[0] )
 	{
 		LONG	lSkin;
 
@@ -1740,7 +1740,7 @@
 		}
 	}
 
-	if ( g_BotInfo[m_ulBotInfoIdx]->szClassName )
+	if ( g_BotInfo[m_ulBotInfoIdx]->szClassName[0] )
 	{
 		// See if the given class name matches one in the global list.
 		for ( ulIdx = 0; ulIdx < PlayerClasses.Size( ); ulIdx++ )
diff -r bab491c70e0d src/chat.cpp
--- a/src/chat.cpp	Wed Jun 11 01:42:14 2014 +0300
+++ b/src/chat.cpp	Sat Jun 21 21:07:23 2014 +0200
@@ -837,10 +837,13 @@
 	}
 	
 	LONG	lTicks = -1;
+	LONG	lArgv2 = -1;
 	
 	// Did the user specify a set duration?
-	if ( argv.argc( ) >= 3 && ( atoi( argv[2] ) > 0 ) && ( atoi( argv[2] ) < LONG_MAX / ( TICRATE * MINUTE )))
-		lTicks = atoi( argv[2] ) * TICRATE * MINUTE;
+	if ( argv.argc( ) >= 3 )
+		lArgv2 = atoi( argv[2] );
+		if (( lArgv2 > 0 ) && ( lArgv2 < LONG_MAX / ( TICRATE * MINUTE )))
+			lTicks = lArgv2 * TICRATE * MINUTE;
 
 	if ( ulPlayer == MAXPLAYERS )
 		Printf( "There isn't a player named %s\\c-.\n", argv[1] );
@@ -854,7 +857,7 @@
 		players[ulPlayer].lIgnoreChatTicks = lTicks;
 		Printf( "%s\\c- will now be ignored", players[ulPlayer].userinfo.netname );
 		if ( lTicks > 0 )
-			Printf( ", for %d minutes", atoi( argv[2] ));
+			Printf( ", for %d minutes", static_cast<int>(lArgv2));
 		Printf( ".\n" );
 
 		// Add a helpful note about bots.
diff -r bab491c70e0d src/g_shared/hudmessages.cpp
--- a/src/g_shared/hudmessages.cpp	Wed Jun 11 01:42:14 2014 +0300
+++ b/src/g_shared/hudmessages.cpp	Sat Jun 21 21:07:23 2014 +0200
@@ -284,7 +284,7 @@
 	UCVarValue	ValHeight;
 	float		fXScale;
 	float		fYScale;
-	ULONG		lBottomDelta;
+	LONG		lBottomDelta;
 
 	// [BC] Initialization.
 	ValWidth = con_virtualwidth.GetGenericRep( CVAR_Int );
diff -r bab491c70e0d src/m_options.cpp
--- a/src/m_options.cpp	Wed Jun 11 01:42:14 2014 +0300
+++ b/src/m_options.cpp	Sat Jun 21 21:07:23 2014 +0200
@@ -5332,7 +5332,7 @@
 						}
 						// [BB] We still need to increment the pointer, otherwise the while loop never ends.
 						else
-							*clip++;
+							++clip;
 					}
 				}
 			}
diff -r bab491c70e0d src/network.cpp
--- a/src/network.cpp	Wed Jun 11 01:42:14 2014 +0300
+++ b/src/network.cpp	Sat Jun 21 21:07:23 2014 +0200
@@ -1225,7 +1225,7 @@
 	g_PWADs.clear( );
 
 	// Find the IWAD index.
-	ULONG ulNumPWADs = 0, ulRealIWADIdx;
+	ULONG ulNumPWADs = 0, ulRealIWADIdx = 0;
 	for ( ULONG ulIdx = 0; Wads.GetWadName( ulIdx ) != NULL; ulIdx++ )
 	{
 		if ( strchr( Wads.GetWadName( ulIdx ), ':' ) == NULL ) // Since WADs can now be loaded within pk3 files, we have to skip over all the ones automatically loaded. To my knowledge, the only way to do this is to skip wads that have a colon in them.
diff -r bab491c70e0d src/network/cl_auth.cpp
--- a/src/network/cl_auth.cpp	Wed Jun 11 01:42:14 2014 +0300
+++ b/src/network/cl_auth.cpp	Sat Jun 21 21:07:23 2014 +0200
@@ -144,7 +144,7 @@
 		break;
 
 	default:
-		Printf ( "Error: Received unknown SRP command '%d' from client %d.\n", lCommand, SERVER_GetCurrentClient() );
+		Printf ( "Error: Received unknown SRP command '%d' from client %d.\n", static_cast<int>(lCommand), static_cast<int>(SERVER_GetCurrentClient()) );
 		break;
 	}
 }
diff -r bab491c70e0d src/network/sv_auth.cpp
--- a/src/network/sv_auth.cpp	Wed Jun 11 01:42:14 2014 +0300
+++ b/src/network/sv_auth.cpp	Sat Jun 21 21:07:23 2014 +0200
@@ -497,7 +497,7 @@
 		break;
 
 	default:
-		Printf ( "Error: Received unknown SRP command '%d' from client %d.\n", lCommand, SERVER_GetCurrentClient() );
+		Printf ( "Error: Received unknown SRP command '%d' from client %d.\n", static_cast<int>(lCommand), static_cast<int>(SERVER_GetCurrentClient()) );
 		break;
 	}
 	return ( false );
diff -r bab491c70e0d src/networkshared.cpp
--- a/src/networkshared.cpp	Wed Jun 11 01:42:14 2014 +0300
+++ b/src/networkshared.cpp	Sat Jun 21 21:07:23 2014 +0200
@@ -921,7 +921,7 @@
 			sprintf( szMessage, "Temporary ban for %s.%s.%s.%s", _ipVector[ulIdx].szIP[0], _ipVector[ulIdx].szIP[1], _ipVector[ulIdx].szIP[2], _ipVector[ulIdx].szIP[3] );
 			
 			// Add the ban reason.
-			if ( _ipVector[ulIdx].szComment && strlen( _ipVector[ulIdx].szComment ))
+			if ( _ipVector[ulIdx].szComment[0] )
 				sprintf( szMessage, "%s (%s)", szMessage,  _ipVector[ulIdx].szComment );
 
 			sprintf( szMessage, "%s has expired", szMessage );
@@ -1134,10 +1134,10 @@
 	}
 
 	szOutString[0] = 0;
-	if ( pszPlayerName && strlen( pszPlayerName ))
+	if ( pszPlayerName && pszPlayerName[0] )
 	{
 		sprintf( szOutString, "%s", szOutString );
-		if ( pszComment && strlen( pszComment ))
+		if ( pszComment && pszComment[0] )
 			sprintf( szOutString, "%s:", szOutString );
 	}
 	if ( pszComment )
@@ -1189,9 +1189,9 @@
 			sprintf( szOutString, "%s<%s>", szOutString, szDate );
 		}
 
-		if ( pszPlayerName && strlen( pszPlayerName ))
+		if ( pszPlayerName && pszPlayerName[0] )
 			sprintf( szOutString, "%s:%s", szOutString, pszPlayerName );
-		if ( pszComment && strlen( pszComment ))
+		if ( pszComment && pszComment[0] )
 			sprintf( szOutString, "%s:%s", szOutString, pszComment );
 		fputs( szOutString, pFile );
 		fclose( pFile );
diff -r bab491c70e0d src/p_acs.cpp
--- a/src/p_acs.cpp	Wed Jun 11 01:42:14 2014 +0300
+++ b/src/p_acs.cpp	Sat Jun 21 21:07:23 2014 +0200
@@ -3802,7 +3802,7 @@
 						work = SERVER_GetClient ( ulPlayer )->username;
 					// Anonymous players get an account name based on their player slot.
 					else
-						work.AppendFormat ( "%d@localhost", ulPlayer );
+						work.AppendFormat ( "%d@localhost", static_cast<int>(ulPlayer) );
 				}
 				return ACS_PushAndReturnDynamicString ( work );
 			}
diff -r bab491c70e0d src/sv_main.cpp
--- a/src/sv_main.cpp	Wed Jun 11 01:42:14 2014 +0300
+++ b/src/sv_main.cpp	Sat Jun 21 21:07:23 2014 +0200
@@ -2801,7 +2801,7 @@
 	{
 		// [BB] Only broadcast disconnects if we already announced the connect
 		// (which we do when the player is spawned in SERVER_ConnectNewPlayer)
-		if ( players[ulClient].userinfo.netname && ( SERVER_GetClient( ulClient )->State >= CLS_SPAWNED_BUT_NEEDS_AUTHENTICATION ) )
+		if ( players[ulClient].userinfo.netname[0] && ( SERVER_GetClient( ulClient )->State >= CLS_SPAWNED_BUT_NEEDS_AUTHENTICATION ) )
 		{
 			if ( ( gametic - g_aClients[ulClient].ulLastCommandTic ) == ( CLIENT_TIMEOUT * 35 ) )
 				SERVER_Printf( PRINT_HIGH, "%s \\c-timed out.\n", players[ulClient].userinfo.netname );
@@ -4984,7 +4984,7 @@
 	const ULONG ticLength = 1000 / TICRATE;
 	player_t *p = &players[g_lCurrentClient];
 	// [BB] Lag spike, reset the averaging.
-	if ( labs (currentPing - p->ulPing) > 3.5 * ticLength )
+	if ( currentPing - p->ulPing > 3.5 * ticLength )
 	{
 		p->ulPing = currentPing;
 		p->ulPingAverages = 0;
diff -r bab491c70e0d src/sv_save.cpp
--- a/src/sv_save.cpp	Wed Jun 11 01:42:14 2014 +0300
+++ b/src/sv_save.cpp	Sat Jun 21 21:07:23 2014 +0200
@@ -154,7 +154,7 @@
 //
 void server_save_UpdateSlotWithInfo( ULONG ulSlot, PLAYERSAVEDINFO_t *pInfo )
 {
-	if (( ulSlot < 0 ) || ( ulSlot >= MAXPLAYERS ))
+	if ( ulSlot >= MAXPLAYERS )
 		return;
 
 	g_SavedPlayerInfo[ulSlot].bInitialized		= true;
diff -r bab491c70e0d src/team.cpp
--- a/src/team.cpp	Wed Jun 11 01:42:14 2014 +0300
+++ b/src/team.cpp	Sat Jun 21 21:07:23 2014 +0200
@@ -896,7 +896,7 @@
 //
 bool TEAM_CheckIfValid( ULONG ulTeamIdx )
 {
-	if ( ulTeamIdx < 0 || ulTeamIdx >= TEAM_GetNumAvailableTeams( ))
+	if ( ulTeamIdx >= TEAM_GetNumAvailableTeams( ))
 		return ( false );
 
 	return ( true );
@@ -1795,7 +1795,7 @@
 bool TEAM_IsActorAllowedForTeam( AActor *pActor, ULONG ulTeam )
 {
 	// [BB] Safety checks.
-	if ( (pActor == NULL) )
+	if ( pActor == NULL )
 		return false;
 
 	return TEAM_CheckTeamRestriction( ulTeam, pActor->ulLimitedToTeam );
diff -r bab491c70e0d src/za_database.cpp
--- a/src/za_database.cpp	Wed Jun 11 01:42:14 2014 +0300
+++ b/src/za_database.cpp	Sat Jun 21 21:07:23 2014 +0200
@@ -427,7 +427,7 @@
 	{
 		// [BB] Try to make the get/set pair atomic.
 		database_ExecuteCommand ( "BEGIN EXCLUSIVE TRANSACTION" );
-		newVal.AppendFormat ( "%d", DATABASE_GetEntry ( Namespace, EntryName ).ToLong() + Increment );
+		newVal.AppendFormat ( "%d", static_cast<int>(DATABASE_GetEntry ( Namespace, EntryName ).ToLong() + Increment) );
 		DATABASE_SetEntry ( Namespace, EntryName, newVal.GetChars() );
 		database_ExecuteCommand ( "COMMIT TRANSACTION" );
 	}
@@ -444,4 +444,4 @@
 CCMD ( dumpdb )
 {
 	DATABASE_DumpTable();
-}
\ No newline at end of file
+}
