From e257bef5da940f8b0bbd2c5e8d26540fd15764bf Mon Sep 17 00:00:00 2001 From: Ykkrosh Date: Mon, 5 Oct 2009 16:15:51 +0000 Subject: [PATCH] Fix even more 64-bit warnings This was SVN commit r7152. --- source/graphics/Model.cpp | 4 +-- source/gui/GUIRenderer.cpp | 2 +- source/lib/file/common/file_stats.cpp | 44 ++++++++++++------------- source/lib/file/common/trace.cpp | 2 +- source/lib/file/vfs/vfs_tree.cpp | 4 +-- source/lib/res/h_mgr.cpp | 2 +- source/network/Network.cpp | 2 +- source/network/SocketBase.cpp | 14 ++++---- source/ps/Game.cpp | 2 +- source/ps/GameAttributes.cpp | 4 +-- source/renderer/VertexBufferManager.cpp | 2 +- source/sound/SoundGroupMgr.cpp | 2 +- 12 files changed, 42 insertions(+), 42 deletions(-) diff --git a/source/graphics/Model.cpp b/source/graphics/Model.cpp index 332702d5cd..9118fe326e 100644 --- a/source/graphics/Model.cpp +++ b/source/graphics/Model.cpp @@ -395,8 +395,8 @@ bool CModel::SetAnimation(CSkeletonAnim* anim, bool once, float speed, CSkeleton if (anim->m_AnimDef && anim->m_AnimDef->GetNumKeys() != m_pModelDef->GetNumBones()) { // mismatch between model's skeleton and animation's skeleton - LOG(CLogger::Error, LOG_CATEGORY, "Mismatch between model's skeleton and animation's skeleton (%d model bones != %d animation keys)", - m_pModelDef->GetNumBones(), anim->m_AnimDef->GetNumKeys()); + LOG(CLogger::Error, LOG_CATEGORY, "Mismatch between model's skeleton and animation's skeleton (%lu model bones != %lu animation keys)", + (unsigned long)m_pModelDef->GetNumBones(), (unsigned long)anim->m_AnimDef->GetNumKeys()); return false; } diff --git a/source/gui/GUIRenderer.cpp b/source/gui/GUIRenderer.cpp index bea43c8f00..f52b9e4f21 100644 --- a/source/gui/GUIRenderer.cpp +++ b/source/gui/GUIRenderer.cpp @@ -414,7 +414,7 @@ void GUIRenderer::UpdateDrawCallCache(DrawCalls &Calls, const CStr& SpriteName, Handle h = ogl_tex_load(cit->m_TextureName); if (h <= 0) { - LOG(CLogger::Error, LOG_CATEGORY, "Error reading texture '%s': %lld", (const char*)cit->m_TextureName, h); + LOG(CLogger::Error, LOG_CATEGORY, "Error reading texture '%s': %ld", (const char*)cit->m_TextureName, (long)h); return; } diff --git a/source/lib/file/common/file_stats.cpp b/source/lib/file/common/file_stats.cpp index ac944e466c..6923a019e5 100644 --- a/source/lib/file/common/file_stats.cpp +++ b/source/lib/file/common/file_stats.cpp @@ -281,59 +281,59 @@ void file_stats_dump() debug_printf( "\nvfs:\n" - "Total files: %u (%g MB)\n" + "Total files: %lu (%g MB)\n" "Init/mount time: %g ms\n", - vfs_files, vfs_size_total/MB, + (unsigned long)vfs_files, vfs_size_total/MB, vfs_init_elapsed_time/ms ); debug_printf( "\nfile:\n" - "Total names: %u (%u KB)\n" - "Max. concurrent: %u; leaked: %u.\n", - unique_names, unique_name_len_total/1000, - open_files_max, open_files_cur + "Total names: %lu (%lu KB)\n" + "Max. concurrent: %lu; leaked: %lu.\n", + (unsigned long)unique_names, (unsigned long)(unique_name_len_total/1000), + (unsigned long)open_files_max, (unsigned long)open_files_cur ); debug_printf( "\nfile_buf:\n" - "Total buffers used: %u (%g MB)\n" - "Max concurrent: %u; leaked: %u\n" + "Total buffers used: %lu (%g MB)\n" + "Max concurrent: %lu; leaked: %lu\n" "Internal fragmentation: %d%%\n", - extant_bufs_total, buf_size_total/MB, - extant_bufs_max, extant_bufs_cur, + (unsigned long)extant_bufs_total, buf_size_total/MB, + (unsigned long)extant_bufs_max, (unsigned long)extant_bufs_cur, percent(buf_aligned_size_total-buf_size_total, buf_size_total) ); debug_printf( "\nfile_io:\n" - "Total user load requests: %u (%g MB)\n" + "Total user load requests: %lu (%g MB)\n" "IO thoughput [MB/s; 0=never happened]:\n" " lowio: R=%.3g, W=%.3g\n" " aio: R=%.3g, W=%.3g\n" - "Average size = %g KB; seeks: %u; total callback time: %g ms\n" + "Average size = %g KB; seeks: %lu; total callback time: %g ms\n" "Total data actually read from disk = %g MB\n", - user_ios, user_io_size_total/MB, + (unsigned long)user_ios, user_io_size_total/MB, #define THROUGHPUT(impl, op) (io_elapsed_time[impl][op] == 0.0)? 0.0 : (io_actual_size_total[impl][op] / io_elapsed_time[impl][op] / MB) THROUGHPUT(FI_LOWIO, FO_READ), THROUGHPUT(FI_LOWIO, FO_WRITE), THROUGHPUT(FI_AIO , FO_READ), THROUGHPUT(FI_AIO , FO_WRITE), - user_io_size_total/user_ios/KB, io_seeks, io_process_time_total/ms, + user_io_size_total/user_ios/KB, (unsigned long)io_seeks, io_process_time_total/ms, (io_actual_size_total[FI_LOWIO][FO_READ]+io_actual_size_total[FI_AIO][FO_READ])/MB ); debug_printf( "\nfile_cache:\n" - "Hits: %u (%g MB); misses %u (%g MB); ratio: %u%%\n" - "Percent of requested bytes satisfied by cache: %u%%; non-compulsory misses: %u (%u%% of misses)\n" - "Block hits: %u; misses: %u; ratio: %u%%\n", - cache_count[CR_HIT], cache_size_total[CR_HIT]/MB, cache_count[CR_MISS], cache_size_total[CR_MISS]/MB, percent(cache_count[CR_HIT], cache_count[CR_HIT]+cache_count[CR_MISS]), - percent(cache_size_total[CR_HIT], cache_size_total[CR_HIT]+cache_size_total[CR_MISS]), conflict_misses, percent(conflict_misses, cache_count[CR_MISS]), - block_cache_count[CR_HIT], block_cache_count[CR_MISS], percent(block_cache_count[CR_HIT], block_cache_count[CR_HIT]+block_cache_count[CR_MISS]) + "Hits: %lu (%g MB); misses %lu (%g MB); ratio: %u%%\n" + "Percent of requested bytes satisfied by cache: %u%%; non-compulsory misses: %lu (%u%% of misses)\n" + "Block hits: %lu; misses: %lu; ratio: %u%%\n", + (unsigned long)cache_count[CR_HIT], cache_size_total[CR_HIT]/MB, (unsigned long)cache_count[CR_MISS], cache_size_total[CR_MISS]/MB, percent(cache_count[CR_HIT], cache_count[CR_HIT]+cache_count[CR_MISS]), + percent(cache_size_total[CR_HIT], cache_size_total[CR_HIT]+cache_size_total[CR_MISS]), (unsigned long)conflict_misses, percent(conflict_misses, cache_count[CR_MISS]), + (unsigned long)block_cache_count[CR_HIT], (unsigned long)block_cache_count[CR_MISS], percent(block_cache_count[CR_HIT], block_cache_count[CR_HIT]+block_cache_count[CR_MISS]) ); debug_printf( "\nvfs_optimizer:\n" - "Total trace entries: %u; repeated connections: %u; unique files: %u\n", - ab_connection_attempts, ab_repeated_connections, ab_connection_attempts-ab_repeated_connections + "Total trace entries: %lu; repeated connections: %lu; unique files: %lu\n", + (unsigned long)ab_connection_attempts, (unsigned long)ab_repeated_connections, (unsigned long)(ab_connection_attempts-ab_repeated_connections) ); } diff --git a/source/lib/file/common/trace.cpp b/source/lib/file/common/trace.cpp index 2d94d6c518..47419027e3 100644 --- a/source/lib/file/common/trace.cpp +++ b/source/lib/file/common/trace.cpp @@ -71,7 +71,7 @@ TraceEntry::~TraceEntry() void TraceEntry::EncodeAsText(char* text, size_t maxTextChars) const { const char action = (char)m_action; - sprintf_s(text, maxTextChars, "%#010f: %c \"%s\" %d\n", m_timestamp, action, m_pathname, m_size); + sprintf_s(text, maxTextChars, "%#010f: %c \"%s\" %lu\n", m_timestamp, action, m_pathname, (unsigned long)m_size); } diff --git a/source/lib/file/vfs/vfs_tree.cpp b/source/lib/file/vfs/vfs_tree.cpp index e083342a58..64e14e857a 100644 --- a/source/lib/file/vfs/vfs_tree.cpp +++ b/source/lib/file/vfs/vfs_tree.cpp @@ -67,7 +67,7 @@ void VfsFile::GenerateDescription(char* text, size_t maxChars) const char timestamp[25]; const time_t mtime = MTime(); strftime(timestamp, ARRAY_SIZE(timestamp), "%a %b %d %H:%M:%S %Y", localtime(&mtime)); - sprintf_s(text, maxChars, "(%c; %6d; %s)\n", m_loader->LocationCode(), Size(), timestamp); + sprintf_s(text, maxChars, "(%c; %6lu; %s)\n", m_loader->LocationCode(), (unsigned long)Size(), timestamp); } @@ -157,7 +157,7 @@ void VfsDirectory::DisplayR(size_t depth) const const size_t maxNameChars = 80 - depth*(sizeof(indent)-1); char fmt[20]; - sprintf_s(fmt, ARRAY_SIZE(fmt), "%%-%d.%ds %%s", maxNameChars, maxNameChars); + sprintf_s(fmt, ARRAY_SIZE(fmt), "%%-%lu.%lus %%s", (unsigned long)maxNameChars, (unsigned long)maxNameChars); for(VfsFiles::const_iterator it = m_files.begin(); it != m_files.end(); ++it) { diff --git a/source/lib/res/h_mgr.cpp b/source/lib/res/h_mgr.cpp index 554551e014..6a085e3095 100644 --- a/source/lib/res/h_mgr.cpp +++ b/source/lib/res/h_mgr.cpp @@ -618,7 +618,7 @@ static LibError h_free_idx(ssize_t idx, HDATA* hd) char buf[H_STRING_LEN]; if(vtbl->to_string(hd->user, buf) < 0) strcpy(buf, "(error)"); // safe - debug_printf("H_MGR| free %s %s accesses=%d %s\n", hd->type->name, hd->pathname.string().c_str(), hd->num_derefs, buf); + debug_printf("H_MGR| free %s %s accesses=%lu %s\n", hd->type->name, hd->pathname.string().c_str(), (unsigned long)hd->num_derefs, buf); } #endif diff --git a/source/network/Network.cpp b/source/network/Network.cpp index d0107938a1..fcbd23a27f 100644 --- a/source/network/Network.cpp +++ b/source/network/Network.cpp @@ -369,7 +369,7 @@ void CMessageSocket::OnMessage(CNetMessage *pMsg) m_InQ.Lock(); m_InQ.push_back(pMsg); NET_LOG2( "CMessageSocket::OnMessage(): %s", pMsg->ToString().c_str() ); - NET_LOG2( "CMessageSocket::OnMessage(): Queue size now %u", m_InQ.size() ); + NET_LOG2( "CMessageSocket::OnMessage(): Queue size now %lu", (unsigned long)m_InQ.size() ); m_InQ.Unlock(); } diff --git a/source/network/SocketBase.cpp b/source/network/SocketBase.cpp index 271b692fdd..44c98655c0 100644 --- a/source/network/SocketBase.cpp +++ b/source/network/SocketBase.cpp @@ -203,10 +203,10 @@ CSocketBase::CSocketBase(CSocketInternal *pInt) CSocketBase::~CSocketBase() { NET_LOG4( "CSocketBase::~CSocketBase(): fd is %d. " - "Received: %lld bytes. Sent: %lld bytes.", + "Received: %lu bytes. Sent: %lu bytes.", m_pInternal->m_fd, - m_pInternal->m_RecvBytes, - m_pInternal->m_SentBytes ); + (unsigned long)m_pInternal->m_RecvBytes, + (unsigned long)m_pInternal->m_SentBytes ); Destroy(); delete m_pInternal; @@ -218,14 +218,14 @@ void CSocketBase::Shutdown() if (g_SocketSetInternal.m_NumSockets) { - NET_LOG2( "CSocketBase::Shutdown(): %d sockets still open! (forcing network shutdown)", g_SocketSetInternal.m_NumSockets ); + NET_LOG2( "CSocketBase::Shutdown(): %lu sockets still open! (forcing network shutdown)", (unsigned long)g_SocketSetInternal.m_NumSockets ); } #if RECORD_GLOBAL_STATS NET_LOG3( "GLOBAL SOCKET STATISTICS: " - "Received: %lld bytes. Sent: %lld bytes.", - g_SocketSetInternal.m_GlobalRecvBytes, - g_SocketSetInternal.m_GlobalSentBytes); + "Received: %lu bytes. Sent: %lu bytes.", + (unsigned long)g_SocketSetInternal.m_GlobalRecvBytes, + (unsigned long)g_SocketSetInternal.m_GlobalSentBytes); #endif GLOBAL_UNLOCK(); diff --git a/source/ps/Game.cpp b/source/ps/Game.cpp index 6f4e886eb4..fab6d5dbd8 100644 --- a/source/ps/Game.cpp +++ b/source/ps/Game.cpp @@ -331,7 +331,7 @@ CPlayer *CGame::GetPlayer(size_t idx) else if (idx >= m_Players.size()) { debug_warn("Invalid player ID"); - LOG(CLogger::Error, "", "Invalid player ID %d (not <=%d - internal error?)", idx, m_Players.size()); + LOG(CLogger::Error, "", "Invalid player ID %lu (not <=%lu - internal error?)", (unsigned long)idx, (unsigned long)m_Players.size()); if (m_Players.size() != 0) return m_Players[0]; diff --git a/source/ps/GameAttributes.cpp b/source/ps/GameAttributes.cpp index 26d67d498c..edb90e1e13 100644 --- a/source/ps/GameAttributes.cpp +++ b/source/ps/GameAttributes.cpp @@ -369,7 +369,7 @@ CPlayer *CGameAttributes::GetPlayer(size_t id) return m_Players[id]; else { - LOG(CLogger::Error, "", "CGameAttributes::GetPlayer(): Attempt to get player %d (while there only are %d players)", id, m_Players.size()); + LOG(CLogger::Error, "", "CGameAttributes::GetPlayer(): Attempt to get player %lu (while there only are %lu players)", (unsigned long)id, (unsigned long)m_Players.size()); return m_Players[0]; } } @@ -380,7 +380,7 @@ CPlayerSlot *CGameAttributes::GetSlot(size_t index) return m_PlayerSlots[index]; else { - LOG(CLogger::Error, "", "CGameAttributes::GetSlot(): Attempt to get slot %d (while there only are %d slots)", index, m_PlayerSlots.size()); + LOG(CLogger::Error, "", "CGameAttributes::GetSlot(): Attempt to get slot %lu (while there only are %lu slots)", (unsigned long)index, (unsigned long)m_PlayerSlots.size()); return m_PlayerSlots[0]; } } diff --git a/source/renderer/VertexBufferManager.cpp b/source/renderer/VertexBufferManager.cpp index 632a73ed70..e65f754e9f 100644 --- a/source/renderer/VertexBufferManager.cpp +++ b/source/renderer/VertexBufferManager.cpp @@ -74,7 +74,7 @@ CVertexBuffer::VBChunk* CVertexBufferManager::Allocate(size_t vertexSize, size_t if (!result) { - LOG(CLogger::Error, LOG_CATEGORY, "Failed to create VBOs (%d*%d)", vertexSize, numVertices); + LOG(CLogger::Error, LOG_CATEGORY, "Failed to create VBOs (%lu*%lu)", (unsigned long)vertexSize, (unsigned long)numVertices); } return result; diff --git a/source/sound/SoundGroupMgr.cpp b/source/sound/SoundGroupMgr.cpp index 2ca6b94861..c8347ae408 100644 --- a/source/sound/SoundGroupMgr.cpp +++ b/source/sound/SoundGroupMgr.cpp @@ -157,5 +157,5 @@ void CSoundGroupMgr::PlayNext(size_t index, const CVector3D& position) if(index < m_Groups.size()) m_Groups[index]->PlayNext(position); else - debug_printf("SND: PlayNext(%d) invalid, %d groups defined\n", index, m_Groups.size()); + debug_printf("SND: PlayNext(%lu) invalid, %lu groups defined\n", (unsigned long)index, (unsigned long)m_Groups.size()); }