Attached Files | GCC481warningsZandronumLinux.zip [^] (50,135 bytes) 2013-07-03 23:55
warningfixes-1.3.diff [^] (9,687 bytes) 2014-01-06 17:38 [Show Content] [Hide Content]diff -r 7aeebcf2ea3c src/c_console.cpp
--- a/src/c_console.cpp Sat Jan 04 13:48:46 2014 +0100
+++ b/src/c_console.cpp Mon Jan 06 18:05:57 2014 +0100
@@ -662,7 +662,7 @@
{
if (addtype == NEWLINE)
{
- for (int j = 0; j < NUMNOTIFIES-1; ++j)
+ for (unsigned int j = 0; j < NUMNOTIFIES-1; ++j)
{
NotifyStrings[j] = NotifyStrings[j+1];
}
@@ -1093,7 +1093,7 @@
void C_FlushDisplay ()
{
- int i;
+ unsigned int i;
for (i = 0; i < NUMNOTIFIES; i++)
NotifyStrings[i].TimeOut = 0;
@@ -1190,7 +1190,8 @@
return;
bool center = (con_centernotify != 0.f);
- int i, line, lineadv, color, j, skip;
+ unsigned int i;
+ int line, lineadv, color, j, skip;
bool canskip;
if (gamestate == GS_FULLCONSOLE || gamestate == GS_DEMOSCREEN/* || menuactive != MENU_Off*/)
diff -r 7aeebcf2ea3c src/cl_demo.cpp
--- a/src/cl_demo.cpp Sat Jan 04 13:48:46 2014 +0100
+++ b/src/cl_demo.cpp Mon Jan 06 18:05:57 2014 +0100
@@ -820,7 +820,7 @@
error.AppendFormat( "\\cc- %s%s\\c-\n",
WadNames[i].GetChars( ), (!i) ? " (IWAD)" : "");
- I_Error( error );
+ I_Error( "%s", error.GetChars() );
}
else
{
diff -r 7aeebcf2ea3c src/cl_main.cpp
--- a/src/cl_main.cpp Sat Jan 04 13:48:46 2014 +0100
+++ b/src/cl_main.cpp Mon Jan 06 18:05:57 2014 +0100
@@ -1479,7 +1479,7 @@
Printf ( "The server reports %d pwad(s):\n", numServerPWADs );
for( std::list<std::pair<FString, FString> >::iterator i = serverPWADs.begin( ); i != serverPWADs.end( ); ++i )
Printf( "PWAD: %s - %s\n", i->first.GetChars(), i->second.GetChars() );
- Printf ( "You have loaded %d pwad(s):\n", NETWORK_GetPWADList( )->size() );
+ Printf ( "You have loaded %zd pwad(s):\n", NETWORK_GetPWADList( )->size() );
for( std::list<std::pair<FString, FString> >::iterator i = NETWORK_GetPWADList( )->begin( ); i != NETWORK_GetPWADList( )->end( ); ++i )
Printf( "PWAD: %s - %s\n", i->first.GetChars(), i->second.GetChars() );
@@ -3004,7 +3004,7 @@
#ifdef _DEBUG
if ( pActor == players[consoleplayer].mo )
{
- Printf( "CLIENT_SpawnThing: WARNING! Tried to delete console player's body! lNetID = %d\n", lNetID );
+ Printf( "CLIENT_SpawnThing: WARNING! Tried to delete console player's body! lNetID = %d\n", static_cast<int>(lNetID) );
return NULL;
}
#endif
diff -r 7aeebcf2ea3c src/d_net.cpp
--- a/src/d_net.cpp Sat Jan 04 13:48:46 2014 +0100
+++ b/src/d_net.cpp Mon Jan 06 18:05:57 2014 +0100
@@ -2648,7 +2648,7 @@
for (i = 0; i < MAXPLAYERS; i++)
if (playeringame[i])
- Printf ("% 4d %s\n", /*[BB] currrecvtime[i] - lastrecvtime[i]*/ players[i].ulPing,
+ Printf ("% 4d %s\n", /*[BB] currrecvtime[i] - lastrecvtime[i]*/ static_cast<int>(players[i].ulPing),
players[i].userinfo.netname);
}
/* [BB] ST has no need for this.
diff -r 7aeebcf2ea3c src/m_options.cpp
--- a/src/m_options.cpp Sat Jan 04 13:48:46 2014 +0100
+++ b/src/m_options.cpp Mon Jan 06 18:05:57 2014 +0100
@@ -3318,7 +3318,7 @@
countof(SkirmishItems),
0,
SkirmishItems,
- NULL,
+ 0,
0,
0,
NULL,
@@ -3598,7 +3598,7 @@
countof(BotSetupItems),
0,
BotSetupItems,
- NULL,
+ 0,
0,
0,
NULL,
@@ -3657,7 +3657,7 @@
countof(TeamBotSetupItems),
0,
TeamBotSetupItems,
- NULL,
+ 0,
0,
0,
NULL,
diff -r 7aeebcf2ea3c src/networkshared.h
--- a/src/networkshared.h Sat Jan 04 13:48:46 2014 +0100
+++ b/src/networkshared.h Mon Jan 06 18:05:57 2014 +0100
@@ -455,7 +455,7 @@
void put ( DataType Entry )
{
_data[_position] = Entry;
- _position = ( ++_position % Length );
+ _position = (_position+1) % Length;
}
DataType getOldestEntry ( unsigned int Offset = 0 ) const
{
diff -r 7aeebcf2ea3c src/p_acs.cpp
--- a/src/p_acs.cpp Sat Jan 04 13:48:46 2014 +0100
+++ b/src/p_acs.cpp Mon Jan 06 18:05:57 2014 +0100
@@ -1987,7 +1987,7 @@
if (( NETWORK_GetState( ) == NETSTATE_SERVER ) &&
ACS_IsScriptClientSide( ptr ))
{
- SERVERCOMMANDS_ACSScriptExecute( ptr->Number, activator, NULL, level.mapname, 0, arg1, 0, 0, always );
+ SERVERCOMMANDS_ACSScriptExecute( ptr->Number, activator, 0, level.mapname, 0, arg1, 0, 0, always );
continue;
}
diff -r 7aeebcf2ea3c src/p_interaction.cpp
--- a/src/p_interaction.cpp Sat Jan 04 13:48:46 2014 +0100
+++ b/src/p_interaction.cpp Mon Jan 06 18:05:57 2014 +0100
@@ -2540,7 +2540,7 @@
// [BB] If the spectator used the chasecam or noclip cheat (which is always allowed for spectators)
// remove it now that he joins the game.
- if ( pPlayer->cheats & CF_CHASECAM|CF_NOCLIP )
+ if ( pPlayer->cheats & (CF_CHASECAM|CF_NOCLIP) )
{
pPlayer->cheats &= ~(CF_CHASECAM|CF_NOCLIP);
if ( NETWORK_GetState() == NETSTATE_SERVER )
diff -r 7aeebcf2ea3c src/sv_ban.cpp
--- a/src/sv_ban.cpp Sat Jan 04 13:48:46 2014 +0100
+++ b/src/sv_ban.cpp Mon Jan 06 18:05:57 2014 +0100
@@ -203,7 +203,7 @@
const char *pszBan = NETWORK_ReadString( pByteStream );
std::string Message;
- g_MasterServerBans.addEntry( pszBan, "", "", Message, NULL );
+ g_MasterServerBans.addEntry( pszBan, "", "", Message, 0 );
}
// Read the list of exemptions.
@@ -212,7 +212,7 @@
const char *pszBan = NETWORK_ReadString( pByteStream );
std::string Message;
- g_MasterServerBanExemptions.addEntry( pszBan, "", "", Message, NULL );
+ g_MasterServerBanExemptions.addEntry( pszBan, "", "", Message, 0 );
}
// [BB] If we are enforcing the master bans, make sure newly master bannded players are kicked now.
@@ -255,9 +255,9 @@
std::string Message;
if ( lCommand == MSB_BAN )
- g_MasterServerBans.addEntry( pszBan, "", "", Message, NULL );
+ g_MasterServerBans.addEntry( pszBan, "", "", Message, 0 );
else
- g_MasterServerBanExemptions.addEntry( pszBan, "", "", Message, NULL );
+ g_MasterServerBanExemptions.addEntry( pszBan, "", "", Message, 0 );
}
break;
@@ -289,11 +289,11 @@
// If the ban is permanent, use NULL.
if ( stricmp( szLengthString, "perm" ) == 0 )
- return NULL;
+ return 0;
else
{
time( &tNow );
- tExpiration = NULL;
+ tExpiration = 0;
// Now we check for patterns in the string.
@@ -482,7 +482,7 @@
// Not found, or bad format.
else
- return NULL;
+ return 0;
}
//--------------------------------------------------------------------------------------------------------------------------------------------------
@@ -648,7 +648,7 @@
}
std::string message;
- g_ServerBanExemptions.addEntry( argv[1], NULL, (argv.argc( ) >= 3) ? argv[2] : NULL, message, NULL );
+ g_ServerBanExemptions.addEntry( argv[1], NULL, (argv.argc( ) >= 3) ? argv[2] : NULL, message, 0 );
Printf( "addbanexemption: %s", message.c_str() );
}
diff -r 7aeebcf2ea3c src/team.cpp
--- a/src/team.cpp Sat Jan 04 13:48:46 2014 +0100
+++ b/src/team.cpp Mon Jan 06 18:05:57 2014 +0100
@@ -114,9 +114,9 @@
TEAM_SetAnnouncedLeadState( i, false );
TEAM_SetAssistPlayer( i, MAXPLAYERS );
- teams[i].g_Origin.x = NULL;
- teams[i].g_Origin.y = NULL;
- teams[i].g_Origin.z = NULL;
+ teams[i].g_Origin.x = 0;
+ teams[i].g_Origin.y = 0;
+ teams[i].g_Origin.z = 0;
switch ( i )
{
@@ -178,9 +178,9 @@
TEAM_SetAnnouncedLeadState( i, false );
TEAM_SetAssistPlayer( i, MAXPLAYERS );
- teams[i].g_Origin.x = NULL;
- teams[i].g_Origin.y = NULL;
- teams[i].g_Origin.z = NULL;
+ teams[i].g_Origin.x = 0;
+ teams[i].g_Origin.y = 0;
+ teams[i].g_Origin.z = 0;
switch ( i )
{
@@ -932,7 +932,7 @@
if ( TEAM_CheckIfValid( ulTeamIdx ))
return ( teams[ulTeamIdx].lPlayerColor );
else
- return ( NULL );
+ return ( 0 );
}
//*****************************************************************************
@@ -991,7 +991,7 @@
if ( TEAM_CheckIfValid( ulTeamIdx ))
return ( teams[ulTeamIdx].lRailColor );
else
- return ( NULL );
+ return ( 0 );
}
//*****************************************************************************
@@ -1009,7 +1009,7 @@
if ( TEAM_CheckIfValid( ulTeamIdx ))
return ( teams[ulTeamIdx].lScore );
else
- return ( NULL );
+ return ( 0 );
}
//*****************************************************************************
@@ -1251,7 +1251,7 @@
else if ( ulTeamIdx == teams.Size( ) )
return ( g_ulWhiteFlagReturnTicks );
else
- return ( NULL );
+ return ( 0 );
}
//*****************************************************************************
@@ -1275,7 +1275,7 @@
if ( TEAM_CheckIfValid( ulTeamIdx ))
return ( teams[ulTeamIdx].lFragCount );
else
- return ( NULL );
+ return ( 0 );
}
//*****************************************************************************
@@ -1314,7 +1314,7 @@
if ( TEAM_CheckIfValid( ulTeamIdx ))
return ( teams[ulTeamIdx].lDeathCount );
else
- return ( NULL );
+ return ( 0 );
}
//*****************************************************************************
@@ -1335,7 +1335,7 @@
if ( TEAM_CheckIfValid( ulTeamIdx ))
return ( teams[ulTeamIdx].lWinCount );
else
- return ( NULL );
+ return ( 0 );
}
//*****************************************************************************
diff -r 7aeebcf2ea3c upnpnat/upnpnat.cpp
--- a/upnpnat/upnpnat.cpp Sat Jan 04 13:48:46 2014 +0100
+++ b/upnpnat/upnpnat.cpp Mon Jan 06 18:05:57 2014 +0100
@@ -106,7 +106,7 @@
*******************************************************************/
#define HTTP_HEADER_ACTION "POST %s HTTP/1.1\r\n" \
"HOST: %s:%u\r\n" \
- "Content-Length: %d \r\n" \
+ "Content-Length: %zu \r\n" \
"CONTENT-TYPE: text/xml\r\n" \
"SOAPACTION:\"%s#%s\"\r\n" \
"\r\n"
warningfixes-2.0.diff [^] (835 bytes) 2014-01-06 17:38 [Show Content] [Hide Content]diff -r 7aeebcf2ea3c src/m_menu.cpp
--- a/src/m_menu.cpp Sat Jan 04 13:48:46 2014 +0100
+++ b/src/m_menu.cpp Mon Jan 06 18:05:57 2014 +0100
@@ -695,7 +695,7 @@
value.value = -1;
value.name = "None";
Announcers.Push(value);
- for ( int i = 0; i < ANNOUNCER_GetNumProfiles( ); ++i )
+ for ( unsigned int i = 0; i < ANNOUNCER_GetNumProfiles( ); ++i )
{
value.value = float(i);
value.name = ANNOUNCER_GetName( i );
diff -r 7aeebcf2ea3c src/m_options.cpp
--- a/src/m_options.cpp Sat Jan 04 13:48:46 2014 +0100
+++ b/src/m_options.cpp Mon Jan 06 18:05:57 2014 +0100
@@ -3236,7 +3236,7 @@
{
SkirmishLevels.Clear();
valuestring_t value;
- for ( int i = 0; i < wadlevelinfos.Size( ); ++i )
+ for ( unsigned int i = 0; i < wadlevelinfos.Size( ); ++i )
{
value.value = float(i);
level_info_t *info = &wadlevelinfos[i];
strict-aliasing-warns.txt [^] (14,841 bytes) 2014-01-06 17:40 [Show Content] [Hide Content]src/invasion.cpp: In member function ‘virtual void ABaseMonsterInvasionSpot::Serialize(FArchive&)’:
src/invasion.cpp:218:18: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
arc << (DWORD &)lNextSpawnTick << (DWORD &)lNumLeftThisWave;
^
src/invasion.cpp:218:45: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
arc << (DWORD &)lNextSpawnTick << (DWORD &)lNumLeftThisWave;
^
src/invasion.cpp: In member function ‘virtual void ABasePickupInvasionSpot::Serialize(FArchive&)’:
src/invasion.cpp:388:18: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
arc << (DWORD &)lNextSpawnTick << (DWORD &)lNumLeftThisWave;
^
src/invasion.cpp:388:45: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
arc << (DWORD &)lNextSpawnTick << (DWORD &)lNumLeftThisWave;
^
src/invasion.cpp: In member function ‘virtual void ABaseWeaponInvasionSpot::Serialize(FArchive&)’:
src/invasion.cpp:557:18: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
arc << (DWORD &)lNextSpawnTick;
^
src/invasion.cpp: In function ‘void INVASION_WriteSaveInfo(FILE*)’:
src/invasion.cpp:1368:18: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
arc << (DWORD &)g_ulNumMonstersLeft << (DWORD &)g_ulInvasionCountdownTicks << (DWORD &)g_ulCurrentWave << (DWORD &)ulInvasionState << (DWORD &)g_ulNumBossMonsters << (DWORD &) g_ulNumArchVilesLeft;
^
src/invasion.cpp:1368:50: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
arc << (DWORD &)g_ulNumMonstersLeft << (DWORD &)g_ulInvasionCountdownTicks << (DWORD &)g_ulCurrentWave << (DWORD &)ulInvasionState << (DWORD &)g_ulNumBossMonsters << (DWORD &) g_ulNumArchVilesLeft;
^
src/invasion.cpp:1368:89: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
arc << (DWORD &)g_ulNumMonstersLeft << (DWORD &)g_ulInvasionCountdownTicks << (DWORD &)g_ulCurrentWave << (DWORD &)ulInvasionState << (DWORD &)g_ulNumBossMonsters << (DWORD &) g_ulNumArchVilesLeft;
^
src/invasion.cpp:1368:117: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
arc << (DWORD &)g_ulNumMonstersLeft << (DWORD &)g_ulInvasionCountdownTicks << (DWORD &)g_ulCurrentWave << (DWORD &)ulInvasionState << (DWORD &)g_ulNumBossMonsters << (DWORD &) g_ulNumArchVilesLeft;
^
src/invasion.cpp:1368:145: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
arc << (DWORD &)g_ulNumMonstersLeft << (DWORD &)g_ulInvasionCountdownTicks << (DWORD &)g_ulCurrentWave << (DWORD &)ulInvasionState << (DWORD &)g_ulNumBossMonsters << (DWORD &) g_ulNumArchVilesLeft;
^
src/invasion.cpp:1368:178: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
arc << (DWORD &)g_ulNumMonstersLeft << (DWORD &)g_ulInvasionCountdownTicks << (DWORD &)g_ulCurrentWave << (DWORD &)ulInvasionState << (DWORD &)g_ulNumBossMonsters << (DWORD &) g_ulNumArchVilesLeft;
^
src/invasion.cpp: In function ‘void INVASION_ReadSaveInfo(PNGHandle*)’:
src/invasion.cpp:1383:19: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
arc << (DWORD &)g_ulNumMonstersLeft << (DWORD &)g_ulInvasionCountdownTicks << (DWORD &)g_ulCurrentWave << (DWORD &)ulInvasionState << (DWORD &)g_ulNumBossMonsters << (DWORD &) g_ulNumArchVilesLeft;
^
src/invasion.cpp:1383:51: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
arc << (DWORD &)g_ulNumMonstersLeft << (DWORD &)g_ulInvasionCountdownTicks << (DWORD &)g_ulCurrentWave << (DWORD &)ulInvasionState << (DWORD &)g_ulNumBossMonsters << (DWORD &) g_ulNumArchVilesLeft;
^
src/invasion.cpp:1383:90: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
arc << (DWORD &)g_ulNumMonstersLeft << (DWORD &)g_ulInvasionCountdownTicks << (DWORD &)g_ulCurrentWave << (DWORD &)ulInvasionState << (DWORD &)g_ulNumBossMonsters << (DWORD &) g_ulNumArchVilesLeft;
^
src/invasion.cpp:1383:118: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
arc << (DWORD &)g_ulNumMonstersLeft << (DWORD &)g_ulInvasionCountdownTicks << (DWORD &)g_ulCurrentWave << (DWORD &)ulInvasionState << (DWORD &)g_ulNumBossMonsters << (DWORD &) g_ulNumArchVilesLeft;
^
src/invasion.cpp:1383:146: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
arc << (DWORD &)g_ulNumMonstersLeft << (DWORD &)g_ulInvasionCountdownTicks << (DWORD &)g_ulCurrentWave << (DWORD &)ulInvasionState << (DWORD &)g_ulNumBossMonsters << (DWORD &) g_ulNumArchVilesLeft;
^
src/invasion.cpp:1383:179: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
arc << (DWORD &)g_ulNumMonstersLeft << (DWORD &)g_ulInvasionCountdownTicks << (DWORD &)g_ulCurrentWave << (DWORD &)ulInvasionState << (DWORD &)g_ulNumBossMonsters << (DWORD &) g_ulNumArchVilesLeft;
^
src/network.cpp: In function ‘NETADDRESS_s NETWORK_GetLocalAddress()’:
src/network.cpp:56:67: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
#define inaddrr(x) (*(struct in_addr *) &ifr->x[sizeof sa.sin_port])
^
src/network.cpp:789:47: note: in expansion of macro ‘inaddrr’
Printf(" with IP address: %s\n", inet_ntoa(inaddrr(ifr_addr.sa_data)));
^
src/network.cpp:789:72: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
Printf(" with IP address: %s\n", inet_ntoa(inaddrr(ifr_addr.sa_data)));
^
src/network.cpp:790:21: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
*(int *)&Address.abIP = *(int *)&inaddrr(ifr_addr.sa_data);
^
src/network.cpp:56:67: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
#define inaddrr(x) (*(struct in_addr *) &ifr->x[sizeof sa.sin_port])
^
src/network.cpp:790:37: note: in expansion of macro ‘inaddrr’
*(int *)&Address.abIP = *(int *)&inaddrr(ifr_addr.sa_data);
^
src/network.cpp:56:68: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
#define inaddrr(x) (*(struct in_addr *) &ifr->x[sizeof sa.sin_port])
^
src/network.cpp:790:37: note: in expansion of macro ‘inaddrr’
*(int *)&Address.abIP = *(int *)&inaddrr(ifr_addr.sa_data);
^
src/networkshared.cpp: In function ‘void NETWORK_SocketAddressToNetAddress(sockaddr_in*, NETADDRESS_s*)’:
src/networkshared.cpp:415:18: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
*(int *)&a->abIP = *(int *)&s->sin_addr;
^
src/networkshared.cpp: In function ‘void NETWORK_NetAddressToSocketAddress(NETADDRESS_s&, sockaddr_in&)’:
src/networkshared.cpp:427:53: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
*(int *)&SocketAddress.sin_addr = *(int *)&Address.abIP;
^
src/p_ceiling.cpp: In member function ‘virtual void DCeiling::Serialize(FArchive&)’:
src/p_ceiling.cpp:64:15: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
<< (DWORD &)m_lCeilingID;
^
src/p_doors.cpp: In member function ‘virtual void DDoor::Serialize(FArchive&)’:
src/p_doors.cpp:61:15: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
<< (DWORD &)m_lDoorID;
^
src/p_floor.cpp: In member function ‘virtual void DFloor::Serialize(FArchive&)’:
src/p_floor.cpp:92:15: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
<< (DWORD &)m_lFloorID;
^
src/p_floor.cpp: In member function ‘virtual void DElevator::Serialize(FArchive&)’:
src/p_floor.cpp:1207:15: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
<< (DWORD &)m_lElevatorID;
^
src/p_floor.cpp: In member function ‘virtual void DWaggleBase::Serialize(FArchive&)’:
src/p_floor.cpp:1553:15: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
<< (DWORD &)m_lWaggleID;
^
src/p_mobj.cpp: In member function ‘virtual void AActor::Serialize(FArchive&)’:
src/p_mobj.cpp:345:15: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
<< (DWORD &)ulLimitedToTeam // [BB]
^
src/p_mobj.cpp:346:15: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
<< (DWORD &)ulVisibleToTeam // [BB]
^
src/p_mobj.cpp:347:15: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
<< (DWORD &)lFixedColormap // [BB]
^
src/p_mobj.cpp:348:15: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
<< (DWORD &)lNetID // [BC] We need to archive this so that it's restored properly when going between maps in a hub.
^
src/p_mobj.cpp:349:15: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
<< (DWORD &)ulSTFlags
^
src/p_mobj.cpp:350:15: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
<< (DWORD &)ulNetworkFlags
^
src/p_mobj.cpp:351:15: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
<< (DWORD &)ulInvasionWave
^
src/p_pillar.cpp: In member function ‘virtual void DPillar::Serialize(FArchive&)’:
src/p_pillar.cpp:93:15: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
<< (DWORD &)m_lPillarID;
^
src/p_plats.cpp: In member function ‘virtual void DPlat::Serialize(FArchive&)’:
src/p_plats.cpp:59:15: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
<< (DWORD &)m_lPlatID;
^
src/p_saveg.cpp: In function ‘void P_SerializeWorld(FArchive&)’:
src/p_saveg.cpp:440:23: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
arc << (DWORD &)li->ulTexChangeFlags
^
src/p_user.cpp: In member function ‘void player_t::Serialize(FArchive&)’:
src/p_user.cpp:3824:15: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
<< (DWORD &)ulTeam
^
src/p_user.cpp:3827:15: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
<< (DWORD &)ulRailgunShots
^
src/p_user.cpp:3828:15: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
<< (DWORD &)lMaxHealthBonus
^
src/sv_commands.cpp: In member function ‘void NetCommand::addFloat(float)’:
src/sv_commands.cpp:197:73: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
addInteger<SDWORD> ( *(reinterpret_cast<const SDWORD*> ( &FloatValue )) );
^
src/g_doom/a_doomartifacts.cpp: In member function ‘virtual void ARandomPowerup::Serialize(FArchive&)’:
src/g_doom/a_doomartifacts.cpp:171:18: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
arc << (DWORD &)ulCurrentFrame << (DWORD &)ulPowerupFlags;
^
src/g_doom/a_doomartifacts.cpp:171:45: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
arc << (DWORD &)ulCurrentFrame << (DWORD &)ulPowerupFlags;
^
src/g_shared/a_movingcamera.cpp: In member function ‘virtual void APathFollower::Serialize(FArchive&)’:
src/g_shared/a_movingcamera.cpp:203:80: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
arc << bPostBeginPlayCalled << bActivateCalledBeforePostBeginPlay << (DWORD &)lServerPrevNodeId << (DWORD &)lServerCurrNodeId << fServerTime;
^
src/g_shared/a_movingcamera.cpp:203:110: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
arc << bPostBeginPlayCalled << bActivateCalledBeforePostBeginPlay << (DWORD &)lServerPrevNodeId << (DWORD &)lServerCurrNodeId << fServerTime;
^
warningfixes-1.3-2.diff [^] (4,915 bytes) 2014-04-06 20:41 [Show Content] [Hide Content]diff -r 7aeebcf2ea3c src/m_options.cpp
--- a/src/m_options.cpp Sat Jan 04 13:48:46 2014 +0100
+++ b/src/m_options.cpp Mon Jan 06 18:05:57 2014 +0100
@@ -3318,7 +3318,7 @@
countof(SkirmishItems),
0,
SkirmishItems,
- NULL,
+ 0,
0,
0,
NULL,
@@ -3598,7 +3598,7 @@
countof(BotSetupItems),
0,
BotSetupItems,
- NULL,
+ 0,
0,
0,
NULL,
@@ -3657,7 +3657,7 @@
countof(TeamBotSetupItems),
0,
TeamBotSetupItems,
- NULL,
+ 0,
0,
0,
NULL,
diff -r 7aeebcf2ea3c src/networkshared.h
--- a/src/networkshared.h Sat Jan 04 13:48:46 2014 +0100
+++ b/src/networkshared.h Mon Jan 06 18:05:57 2014 +0100
@@ -455,7 +455,7 @@
void put ( DataType Entry )
{
_data[_position] = Entry;
- _position = ( ++_position % Length );
+ _position = (_position+1) % Length;
}
DataType getOldestEntry ( unsigned int Offset = 0 ) const
{
diff -r 7aeebcf2ea3c src/p_acs.cpp
--- a/src/p_acs.cpp Sat Jan 04 13:48:46 2014 +0100
+++ b/src/p_acs.cpp Mon Jan 06 18:05:57 2014 +0100
@@ -1987,7 +1987,7 @@
if (( NETWORK_GetState( ) == NETSTATE_SERVER ) &&
ACS_IsScriptClientSide( ptr ))
{
- SERVERCOMMANDS_ACSScriptExecute( ptr->Number, activator, NULL, level.mapname, 0, arg1, 0, 0, always );
+ SERVERCOMMANDS_ACSScriptExecute( ptr->Number, activator, 0, level.mapname, 0, arg1, 0, 0, always );
continue;
}
diff -r 7aeebcf2ea3c src/team.cpp
--- a/src/team.cpp Sat Jan 04 13:48:46 2014 +0100
+++ b/src/team.cpp Mon Jan 06 18:05:57 2014 +0100
@@ -114,9 +114,9 @@
TEAM_SetAnnouncedLeadState( i, false );
TEAM_SetAssistPlayer( i, MAXPLAYERS );
- teams[i].g_Origin.x = NULL;
- teams[i].g_Origin.y = NULL;
- teams[i].g_Origin.z = NULL;
+ teams[i].g_Origin.x = 0;
+ teams[i].g_Origin.y = 0;
+ teams[i].g_Origin.z = 0;
switch ( i )
{
@@ -178,9 +178,9 @@
TEAM_SetAnnouncedLeadState( i, false );
TEAM_SetAssistPlayer( i, MAXPLAYERS );
- teams[i].g_Origin.x = NULL;
- teams[i].g_Origin.y = NULL;
- teams[i].g_Origin.z = NULL;
+ teams[i].g_Origin.x = 0;
+ teams[i].g_Origin.y = 0;
+ teams[i].g_Origin.z = 0;
switch ( i )
{
@@ -932,7 +932,7 @@
if ( TEAM_CheckIfValid( ulTeamIdx ))
return ( teams[ulTeamIdx].lPlayerColor );
else
- return ( NULL );
+ return ( 0 );
}
//*****************************************************************************
@@ -991,7 +991,7 @@
if ( TEAM_CheckIfValid( ulTeamIdx ))
return ( teams[ulTeamIdx].lRailColor );
else
- return ( NULL );
+ return ( 0 );
}
//*****************************************************************************
@@ -1009,7 +1009,7 @@
if ( TEAM_CheckIfValid( ulTeamIdx ))
return ( teams[ulTeamIdx].lScore );
else
- return ( NULL );
+ return ( 0 );
}
//*****************************************************************************
@@ -1251,7 +1251,7 @@
else if ( ulTeamIdx == teams.Size( ) )
return ( g_ulWhiteFlagReturnTicks );
else
- return ( NULL );
+ return ( 0 );
}
//*****************************************************************************
@@ -1275,7 +1275,7 @@
if ( TEAM_CheckIfValid( ulTeamIdx ))
return ( teams[ulTeamIdx].lFragCount );
else
- return ( NULL );
+ return ( 0 );
}
//*****************************************************************************
@@ -1314,7 +1314,7 @@
if ( TEAM_CheckIfValid( ulTeamIdx ))
return ( teams[ulTeamIdx].lDeathCount );
else
- return ( NULL );
+ return ( 0 );
}
//*****************************************************************************
@@ -1335,7 +1335,7 @@
if ( TEAM_CheckIfValid( ulTeamIdx ))
return ( teams[ulTeamIdx].lWinCount );
else
- return ( NULL );
+ return ( 0 );
}
//*****************************************************************************
diff -r 2ffa89ccc8d0 upnpnat/upnpnat.cpp
--- a/upnpnat/upnpnat.cpp Fri Apr 04 01:28:30 2014 +0300
+++ b/upnpnat/upnpnat.cpp Sun Apr 06 22:36:46 2014 +0200
@@ -106,7 +106,7 @@
*******************************************************************/
#define HTTP_HEADER_ACTION "POST %s HTTP/1.1\r\n" \
"HOST: %s:%u\r\n" \
- "Content-Length: %d \r\n" \
+ "Content-Length: %ud \r\n" \
"CONTENT-TYPE: text/xml\r\n" \
"SOAPACTION:\"%s#%s\"\r\n" \
"\r\n"
@@ -478,7 +478,7 @@
std::string soap_message=buff;
const char *pathString = ( ( path.c_str()[0] == '/' ) && ( path.c_str()[1] == '/' ) ) ? ( path.c_str() + 1 ) : path.c_str();
- sprintf(buff,HTTP_HEADER_ACTION,pathString,host.c_str(),port,soap_message.size(),service_type.c_str(),ACTION_ADD);
+ sprintf(buff,HTTP_HEADER_ACTION,pathString,host.c_str(),port,static_cast<unsigned int>(soap_message.size()),service_type.c_str(),ACTION_ADD);
std::string action_message=buff;
std::string http_request=action_message+soap_message;
clang_warns.txt [^] (13,356 bytes) 2014-06-15 13:44 [Show Content] [Hide Content]/home/edward-san/zdoom/zandronum/stable/src/astar.cpp:623:13: warning: absolute value function 'abs' given an argument of type 'long' but has parameter of type 'int' which may cause truncation of value [-Wabsolute-value]
} while ( abs( lXNode - lXIdx ) > 8 );
^
/home/edward-san/zdoom/zandronum/stable/src/astar.cpp:623:13: note: use function 'std::abs' instead
} while ( abs( lXNode - lXIdx ) > 8 );
^~~
std::abs
/home/edward-san/zdoom/zandronum/stable/src/astar.cpp:623:13: note: please include the header <cstdlib> or explicitly provide a declaration for 'std::abs'
/home/edward-san/zdoom/zandronum/stable/src/astar.cpp:630:14: warning: absolute value function 'abs' given an argument of type 'long' but has parameter of type 'int' which may cause truncation of value [-Wabsolute-value]
} while (( abs( lXNode - lXIdx ) > 8 ) || ( abs( lXNode - lXIdx ) < 2 ));
^
/home/edward-san/zdoom/zandronum/stable/src/astar.cpp:630:14: note: use function 'std::abs' instead
} while (( abs( lXNode - lXIdx ) > 8 ) || ( abs( lXNode - lXIdx ) < 2 ));
^~~
std::abs
/home/edward-san/zdoom/zandronum/stable/src/astar.cpp:630:14: note: please include the header <cstdlib> or explicitly provide a declaration for 'std::abs'
/home/edward-san/zdoom/zandronum/stable/src/astar.cpp:630:47: warning: absolute value function 'abs' given an argument of type 'long' but has parameter of type 'int' which may cause truncation of value [-Wabsolute-value]
} while (( abs( lXNode - lXIdx ) > 8 ) || ( abs( lXNode - lXIdx ) < 2 ));
^
/home/edward-san/zdoom/zandronum/stable/src/astar.cpp:630:47: note: use function 'std::abs' instead
} while (( abs( lXNode - lXIdx ) > 8 ) || ( abs( lXNode - lXIdx ) < 2 ));
^~~
std::abs
/home/edward-san/zdoom/zandronum/stable/src/astar.cpp:630:47: note: please include the header <cstdlib> or explicitly provide a declaration for 'std::abs'
/home/edward-san/zdoom/zandronum/stable/src/astar.cpp:638:13: warning: absolute value function 'abs' given an argument of type 'long' but has parameter of type 'int' which may cause truncation of value [-Wabsolute-value]
} while ( abs( lYNode - lYIdx ) > 8 );
^
/home/edward-san/zdoom/zandronum/stable/src/astar.cpp:638:13: note: use function 'std::abs' instead
} while ( abs( lYNode - lYIdx ) > 8 );
^~~
std::abs
/home/edward-san/zdoom/zandronum/stable/src/astar.cpp:638:13: note: please include the header <cstdlib> or explicitly provide a declaration for 'std::abs'
/home/edward-san/zdoom/zandronum/stable/src/astar.cpp:645:14: warning: absolute value function 'abs' given an argument of type 'long' but has parameter of type 'int' which may cause truncation of value [-Wabsolute-value]
} while (( abs( lYNode - lYIdx ) > 8 ) || ( abs( lYNode - lYIdx ) < 2 ));
^
/home/edward-san/zdoom/zandronum/stable/src/astar.cpp:645:14: note: use function 'std::abs' instead
} while (( abs( lYNode - lYIdx ) > 8 ) || ( abs( lYNode - lYIdx ) < 2 ));
^~~
std::abs
/home/edward-san/zdoom/zandronum/stable/src/astar.cpp:645:14: note: please include the header <cstdlib> or explicitly provide a declaration for 'std::abs'
/home/edward-san/zdoom/zandronum/stable/src/astar.cpp:645:47: warning: absolute value function 'abs' given an argument of type 'long' but has parameter of type 'int' which may cause truncation of value [-Wabsolute-value]
} while (( abs( lYNode - lYIdx ) > 8 ) || ( abs( lYNode - lYIdx ) < 2 ));
^
/home/edward-san/zdoom/zandronum/stable/src/astar.cpp:645:47: note: use function 'std::abs' instead
} while (( abs( lYNode - lYIdx ) > 8 ) || ( abs( lYNode - lYIdx ) < 2 ));
^~~
std::abs
/home/edward-san/zdoom/zandronum/stable/src/astar.cpp:645:47: note: please include the header <cstdlib> or explicitly provide a declaration for 'std::abs'
6 warnings generated.
/home/edward-san/zdoom/zandronum/stable/src/botcommands.cpp:1323:24: warning: absolute value function 'abs' given an argument of type 'LONG' (aka 'long') but has parameter of type 'int' which may cause truncation of value [-Wabsolute-value]
lAngle = ANGLE_MAX - abs( lAngle );
^
/home/edward-san/zdoom/zandronum/stable/src/botcommands.cpp:1323:24: note: use function 'std::abs' instead
lAngle = ANGLE_MAX - abs( lAngle );
^~~
std::abs
/home/edward-san/zdoom/zandronum/stable/src/botcommands.cpp:1880:46: warning: absolute value function 'abs' given an argument of type 'LONG' (aka 'long') but has parameter of type 'int' which may cause truncation of value [-Wabsolute-value]
pBot->GetPlayer( )->mo->angle -= ANGLE_1 * abs( lBuffer );
^
/home/edward-san/zdoom/zandronum/stable/src/botcommands.cpp:1880:46: note: use function 'std::abs' instead
pBot->GetPlayer( )->mo->angle -= ANGLE_1 * abs( lBuffer );
^~~
std::abs
/home/edward-san/zdoom/zandronum/stable/src/botcommands.cpp:1965:73: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare]
if (( pBot->m_ulPlayerEnemy >= MAXPLAYERS ) || ( pBot->m_ulPlayerEnemy < 0 ) || ( playeringame[pBot->m_ulPlayerEnemy] == false ))
~~~~~~~~~~~~~~~~~~~~~ ^ ~
3 warnings generated.
/home/edward-san/zdoom/zandronum/stable/src/bots.cpp:1255:35: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare]
if (( BotInfo.ulChatFrequency < 0 ) || ( BotInfo.ulChatFrequency > 100 ))
~~~~~~~~~~~~~~~~~~~~~~~ ^ ~
/home/edward-san/zdoom/zandronum/stable/src/bots.cpp:1723:34: warning: address of array 'g_BotInfo[this->m_ulBotInfoIdx]->szSkinName' will always evaluate to 'true' [-Wpointer-bool-conversion]
if ( g_BotInfo[m_ulBotInfoIdx]->szSkinName )
~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
/home/edward-san/zdoom/zandronum/stable/src/bots.cpp:1743:34: warning: address of array 'g_BotInfo[this->m_ulBotInfoIdx]->szClassName' will always evaluate to 'true' [-Wpointer-bool-conversion]
if ( g_BotInfo[m_ulBotInfoIdx]->szClassName )
~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
3 warnings generated.
/home/edward-san/zdoom/zandronum/stable/src/chat.cpp:842:73: warning: comparison of constant 4392081922311798 with expression of type 'int' is always true [-Wtautological-constant-out-of-range-compare]
if ( argv.argc( ) >= 3 && ( atoi( argv[2] ) > 0 ) && ( atoi( argv[2] ) < LONG_MAX / ( TICRATE * MINUTE )))
~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
/home/edward-san/zdoom/zandronum/stable/src/m_options.cpp:5335:8: warning: expression result unused [-Wunused-value]
*clip++;
^~~~~~~
2 warnings generated.
/home/edward-san/zdoom/zandronum/stable/src/networkshared.cpp:923:26: warning: address of array 'this->_ipVector[ulIdx].szComment' will always evaluate to 'true' [-Wpointer-bool-conversion]
if ( _ipVector[ulIdx].szComment && strlen( _ipVector[ulIdx].szComment ))
~~~~~~~~~~~~~~~~~^~~~~~~~~ ~~
1 warning generated.
/home/edward-san/zdoom/zandronum/stable/src/network/cl_auth.cpp:147:74: warning: format specifies type 'int' but the argument has type 'LONG' (aka 'long') [-Wformat]
Printf ( "Error: Received unknown SRP command '%d' from client %d.\n", lCommand, SERVER_GetCurrentClient() );
~~ ^~~~~~~~
%ld
/home/edward-san/zdoom/zandronum/stable/src/network/cl_auth.cpp:147:84: warning: format specifies type 'int' but the argument has type 'LONG' (aka 'long') [-Wformat]
Printf ( "Error: Received unknown SRP command '%d' from client %d.\n", lCommand, SERVER_GetCurrentClient() );
~~ ^~~~~~~~~~~~~~~~~~~~~~~~~
%ld
2 warnings generated.
/home/edward-san/zdoom/zandronum/stable/src/network/sv_auth.cpp:500:74: warning: format specifies type 'int' but the argument has type 'LONG' (aka 'long') [-Wformat]
Printf ( "Error: Received unknown SRP command '%d' from client %d.\n", lCommand, SERVER_GetCurrentClient() );
~~ ^~~~~~~~
%ld
/home/edward-san/zdoom/zandronum/stable/src/network/sv_auth.cpp:500:84: warning: format specifies type 'int' but the argument has type 'LONG' (aka 'long') [-Wformat]
Printf ( "Error: Received unknown SRP command '%d' from client %d.\n", lCommand, SERVER_GetCurrentClient() );
~~ ^~~~~~~~~~~~~~~~~~~~~~~~~
%ld
2 warnings generated.
/home/edward-san/zdoom/zandronum/stable/src/p_acs.cpp:3805:43: warning: format specifies type 'int' but the argument has type 'ULONG' (aka 'unsigned long') [-Wformat]
work.AppendFormat ( "%d@localhost", ulPlayer );
~~ ^~~~~~~~
%lu
/home/edward-san/zdoom/zandronum/stable/src/sv_main.cpp:2806:35: warning: address of array 'players[ulClient].userinfo.netname' will always evaluate to 'true' [-Wpointer-bool-conversion]
if ( players[ulClient].userinfo.netname && ( SERVER_GetClient( ulClient )->State >= CLS_SPAWNED_BUT_NEEDS_AUTHENTICATION ) )
~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~ ~~
/home/edward-san/zdoom/zandronum/stable/src/sv_main.cpp:4991:7: warning: taking the absolute value of unsigned type 'unsigned long' has no effect [-Wabsolute-value]
if ( labs (currentPing - p->ulPing) > 3.5 * ticLength )
^
/home/edward-san/zdoom/zandronum/stable/src/sv_main.cpp:4991:7: note: remove the call to 'labs' since unsigned values cannot be negative
if ( labs (currentPing - p->ulPing) > 3.5 * ticLength )
^~~~~
2 warnings generated.
/home/edward-san/zdoom/zandronum/stable/src/sv_save.cpp:157:15: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare]
if (( ulSlot < 0 ) || ( ulSlot >= MAXPLAYERS ))
~~~~~~ ^ ~
1 warning generated.
/home/edward-san/zdoom/zandronum/stable/src/team.cpp:899:17: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare]
if ( ulTeamIdx < 0 || ulTeamIdx >= TEAM_GetNumAvailableTeams( ))
~~~~~~~~~ ^ ~
/home/edward-san/zdoom/zandronum/stable/src/team.cpp:1798:15: warning: equality comparison with extraneous parentheses [-Wparentheses-equality]
if ( (pActor == NULL) )
~~~~~~~^~~~~~~
/home/edward-san/zdoom/zandronum/stable/src/team.cpp:1798:15: note: remove extraneous parentheses around the comparison to silence this warning
if ( (pActor == NULL) )
~ ^ ~
/home/edward-san/zdoom/zandronum/stable/src/team.cpp:1798:15: note: use '=' to turn this equality comparison into an assignment
if ( (pActor == NULL) )
^~
=
2 warnings generated.
/home/edward-san/zdoom/zandronum/stable/src/za_database.cpp:430:31: warning: format specifies type 'int' but the argument has type 'long' [-Wformat]
newVal.AppendFormat ( "%d", DATABASE_GetEntry ( Namespace, EntryName ).ToLong() + Increment );
~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
%ld
1 warning generated.
/home/edward-san/zdoom/zandronum/stable/src/g_shared/hudmessages.cpp:312:20: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare]
if ( lBottomDelta < 0 )
~~~~~~~~~~~~ ^ ~
1 warning generated.
warningfixes-1.3-clang.diff [^] (12,572 bytes) 2014-06-22 10:43 [Show Content] [Hide Content]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
+}
warningfixes-2.0-clang.diff [^] (12,572 bytes) 2014-06-22 10:43 [Show Content] [Hide Content]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 ccd53b108e06 src/m_menu.cpp
--- a/src/m_menu.cpp Mon Jun 09 11:28:26 2014 +0200
+++ b/src/m_menu.cpp Sun Jun 22 12:35:30 2014 +0200
@@ -3417,7 +3417,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
@@ -1245,7 +1245,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
@@ -4162,7 +4162,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
@@ -2819,7 +2819,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 );
@@ -5010,7 +5010,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
+}
scaletext.diff [^] (2,714 bytes) 2014-06-22 21:38 [Show Content] [Hide Content]diff -r 92e650f40305 src/c_console.cpp
--- a/src/c_console.cpp Sun Jun 22 21:32:02 2014 +0200
+++ b/src/c_console.cpp Sun Jun 22 23:36:11 2014 +0200
@@ -164,8 +164,11 @@
CVAR (Float, con_notifytime, 3.f, CVAR_ARCHIVE)
CVAR (Bool, con_centernotify, false, CVAR_ARCHIVE)
-// [BC] con_scaletext is back to being a bool.
-CVAR (Bool, con_scaletext, 0, CVAR_ARCHIVE) // Scale text at high resolutions?
+CUSTOM_CVAR (Int, con_scaletext, 0, CVAR_ARCHIVE) // Scale notify text at high resolutions?
+{
+ if (self < 0) self = 0;
+ if (self > 2) self = 2;
+}
CUSTOM_CVAR(Float, con_alpha, 0.75f, CVAR_ARCHIVE)
{
diff -r 92e650f40305 src/chat.h
--- a/src/chat.h Sun Jun 22 21:32:02 2014 +0200
+++ b/src/chat.h Sun Jun 22 23:36:11 2014 +0200
@@ -84,7 +84,7 @@
//*****************************************************************************
// EXTERNAL CONSOLE VARIABLES
-EXTERN_CVAR( Bool, con_scaletext )
+EXTERN_CVAR( Int, con_scaletext )
EXTERN_CVAR( Int, con_virtualwidth )
EXTERN_CVAR( Int, con_virtualheight )
EXTERN_CVAR( Bool, con_scaletext_usescreenratio ) // [BB]
diff -r 92e650f40305 src/g_shared/hudmessages.cpp
--- a/src/g_shared/hudmessages.cpp Sun Jun 22 21:32:02 2014 +0200
+++ b/src/g_shared/hudmessages.cpp Sun Jun 22 23:36:11 2014 +0200
@@ -43,8 +43,7 @@
#include "deathmatch.h"
#include "chat.h"
-// [BC] This is just a boolean now.
-EXTERN_CVAR (Bool, con_scaletext)
+EXTERN_CVAR (Int, con_scaletext)
IMPLEMENT_POINTY_CLASS (DHUDMessage)
DECLARE_POINTER(Next)
diff -r 92e650f40305 src/g_shared/shared_hud.cpp
--- a/src/g_shared/shared_hud.cpp Sun Jun 22 21:32:02 2014 +0200
+++ b/src/g_shared/shared_hud.cpp Sun Jun 22 23:36:11 2014 +0200
@@ -56,7 +56,7 @@
#define HUMETA_AltIcon 0x10f000
EXTERN_CVAR(Bool,am_follow)
-EXTERN_CVAR (Bool, con_scaletext)
+EXTERN_CVAR (Int, con_scaletext)
EXTERN_CVAR (Bool, idmypos)
EXTERN_CVAR (Bool, am_showtime)
diff -r 92e650f40305 src/g_shared/shared_sbar.cpp
--- a/src/g_shared/shared_sbar.cpp Sun Jun 22 21:32:02 2014 +0200
+++ b/src/g_shared/shared_sbar.cpp Sun Jun 22 23:36:11 2014 +0200
@@ -80,7 +80,7 @@
EXTERN_CVAR (Bool, am_showtotaltime)
EXTERN_CVAR (Bool, noisedebug)
EXTERN_CVAR (Bool, hud_scale)
-EXTERN_CVAR (Bool, con_scaletext)
+EXTERN_CVAR (Int, con_scaletext)
DBaseStatusBar *StatusBar;
diff -r 92e650f40305 src/m_options.cpp
--- a/src/m_options.cpp Sun Jun 22 21:32:02 2014 +0200
+++ b/src/m_options.cpp Sun Jun 22 23:36:11 2014 +0200
@@ -1120,7 +1120,7 @@
*=======================================*/
void SetupTextScalingMenu( void );
-EXTERN_CVAR (Bool, con_scaletext)
+EXTERN_CVAR (Int, con_scaletext)
EXTERN_CVAR (Bool, con_centernotify)
EXTERN_CVAR (Int, msg0color)
EXTERN_CVAR (Int, msg1color)
|