Skip to content

Commit

Permalink
Fix some compile warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
jushar committed Aug 13, 2016
1 parent fdfe470 commit adcb212
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 17 deletions.
14 changes: 7 additions & 7 deletions Client/core/CServerBrowser.cpp
Expand Up @@ -249,9 +249,9 @@ CServerBrowser::CServerBrowser ( void )
{ 25, iBase + iGap * 1 + 5, 16, 16, "cgui\\images\\serverbrowser\\favorite.png", },
{ 20, iBase + iGap * 2, 26, 26, "cgui\\images\\serverbrowser\\connect.png", },
{ 20, iBase + iGap * 3, 26, 26, "cgui\\images\\serverbrowser\\info.png", },
{ 80 + fMaxLeft, iBase + iGap * 0 + 5, 29, 16, "cgui\\images\\serverbrowser\\search-servers.png", },
{ 80 + fMaxLeft, iBase + iGap * 1 + 5, 29, 16, "cgui\\images\\serverbrowser\\search-players.png", },
{ 80 + fMaxLeft, iBase + iGap * 2 + 5, 16, 16, "cgui\\images\\serverbrowser\\search.png", },
{ 80 + static_cast<int>(fMaxLeft), iBase + iGap * 0 + 5, 29, 16, "cgui\\images\\serverbrowser\\search-servers.png", },
{ 80 + static_cast<int>(fMaxLeft), iBase + iGap * 1 + 5, 29, 16, "cgui\\images\\serverbrowser\\search-players.png", },
{ 80 + static_cast<int>(fMaxLeft), iBase + iGap * 2 + 5, 16, 16, "cgui\\images\\serverbrowser\\search.png", },
};

for ( uint i = 0 ; i < NUMELMS( iconInfoList ) ; i++ )
Expand All @@ -271,9 +271,9 @@ CServerBrowser::CServerBrowser ( void )
{ 20, iBase + iGap * 1, _("Add Favorite") },
{ 20, iBase + iGap * 2, _("Connect") },
{ 20, iBase + iGap * 3, _("Server information") },
{ 80 + fMaxLeft, iBase + iGap * 0, _("Search servers") },
{ 80 + fMaxLeft, iBase + iGap * 1, _("Search players") },
{ 80 + fMaxLeft, iBase + iGap * 2, _("Start search") },
{ 80 + static_cast<int>(fMaxLeft), iBase + iGap * 0, _("Search servers") },
{ 80 + static_cast<int>(fMaxLeft), iBase + iGap * 1, _("Search players") },
{ 80 + static_cast<int>(fMaxLeft), iBase + iGap * 2, _("Start search") },
};

for ( uint i = 0 ; i < NUMELMS( helpInfoList ) ; i++ )
Expand Down Expand Up @@ -2305,4 +2305,4 @@ bool CServerBrowser::IsActive ( void )
{
return ( m_pFrame && m_pFrame->IsActive ( ) )
|| ( m_pPanel && m_pPanel->IsActive ( ) );
}
}
2 changes: 1 addition & 1 deletion Client/core/CVideoModeManager.cpp
Expand Up @@ -241,7 +241,7 @@ void CVideoModeManager::PostReset ( D3DPRESENT_PARAMETERS* pp )
SetWindowLong ( m_hDeviceWindow, GWL_EXSTYLE, ExStyle );

// Ensure client area of window is correct size
RECT ClientRect = { 0, 0, pp->BackBufferWidth, pp->BackBufferHeight };
RECT ClientRect = { 0, 0, static_cast<LONG>(pp->BackBufferWidth), static_cast<LONG>(pp->BackBufferHeight) };
AdjustWindowRect( &ClientRect, GetWindowLong(m_hDeviceWindow,GWL_STYLE), FALSE );

int SizeX = ClientRect.right - ClientRect.left;
Expand Down
4 changes: 2 additions & 2 deletions Client/mods/deathmatch/ClientCommands.cpp
Expand Up @@ -961,8 +961,8 @@ void COMMAND_Modules ( const char *szCmdLine )
// Print it
fprintf ( pFile, "** MODULE **\n"
"Name: %s\n"
"Base: 0x%P\n"
"Size: 0x%P\n"
"Base: 0x%p\n"
"Size: 0x%x\n"
"\n",
ModuleEntry.szModule,
ModuleEntry.modBaseAddr,
Expand Down
4 changes: 2 additions & 2 deletions Client/multiplayer_sa/CPopulationSA.cpp
Expand Up @@ -73,14 +73,14 @@ VOID CPopulationSA::AddPed ( CPedSAInterface * ped )

char szDebug[255] = {'\0'};
DWORD dwPedInterface = (DWORD)pedSA->GetInterface();
sprintf ( szDebug, "Civ ped added (%d) (0x%X -> 0x%X)\n", dwPedCount+1, ped, dwPedInterface);
sprintf ( szDebug, "Civ ped added (%d) (0x%p -> 0x%X)\n", dwPedCount+1, ped, dwPedInterface);
//OutputDebugString ( szDebug );

if ( m_pCivilianAddHandler )
m_pCivilianAddHandler ( pedSA );

peds.push_back (pedSA);
dwPedCount ++;
++dwPedCount;
}

VOID CPopulationSA::RemovePed ( CCivilianPed * ped )
Expand Down
2 changes: 1 addition & 1 deletion Server/mods/deathmatch/logic/CCustomData.cpp
Expand Up @@ -160,5 +160,5 @@ CXMLNode * CCustomData::OutputToXML ( CXMLNode * pNode )

unsigned short CCustomData::CountOnlySynchronized ( void )
{
return m_SyncedData.size ( );
return static_cast<unsigned short>(m_SyncedData.size ());
}
2 changes: 1 addition & 1 deletion Server/mods/deathmatch/logic/CResource.h
Expand Up @@ -363,7 +363,7 @@ class CResource : public EHS

inline list < CResourceFile* >::iterator IterBegin ( void ) { return m_resourceFiles.begin(); }
inline list < CResourceFile* >::iterator IterEnd ( void ) { return m_resourceFiles.end(); }
inline unsigned short IterCount ( void ) { return m_resourceFiles.size(); }
inline size_t IterCount ( void ) { return m_resourceFiles.size(); }

inline list < CExportedFunction >::iterator IterBeginExportedFunctions ( void ) { return m_exportedFunctions.begin(); }
inline list < CExportedFunction >::iterator IterEndExportedFunctions ( void ) { return m_exportedFunctions.end(); }
Expand Down
Expand Up @@ -28,7 +28,7 @@ bool CResourceClientScriptsPacket::Write ( NetBitStreamInterface& BitStream ) co

BitStream.Write ( m_pResource->GetNetID() );

unsigned short usItemCount = m_vecItems.size();
auto usItemCount = static_cast<unsigned short>(m_vecItems.size());
BitStream.Write ( usItemCount );

for ( std::vector<CResourceClientScriptItem*>::const_iterator iter = m_vecItems.begin ();
Expand Down
Expand Up @@ -41,7 +41,7 @@ bool CSyncSettingsPacket::Read ( NetBitStreamInterface& BitStream )

bool CSyncSettingsPacket::Write ( NetBitStreamInterface& BitStream ) const
{
uchar ucNumWeapons = m_weaponTypesUsingBulletSync.size ();
uchar ucNumWeapons = static_cast<uchar>(m_weaponTypesUsingBulletSync.size ());
BitStream.Write ( ucNumWeapons );

for ( std::set < eWeaponType >::const_iterator iter = m_weaponTypesUsingBulletSync.begin () ; iter != m_weaponTypesUsingBulletSync.end () ; ++iter )
Expand Down
2 changes: 1 addition & 1 deletion Shared/sdk/net/bitstream.h
Expand Up @@ -240,7 +240,7 @@ class NetBitStreamInterfaceNoVersion : public CRefCountable
void WriteString ( const std::string& value )
{
// Write the length
unsigned short usLength = value.length ();
auto usLength = static_cast<unsigned short>(value.length ());
Write ( usLength );

// Write the characters
Expand Down

0 comments on commit adcb212

Please sign in to comment.