1
0
forked from 0ad/0ad

Fix even more 64-bit warnings

This was SVN commit r7152.
This commit is contained in:
Ykkrosh 2009-10-05 16:15:51 +00:00
parent 6f9eaf769c
commit e257bef5da
12 changed files with 42 additions and 42 deletions

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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)
);
}

View File

@ -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);
}

View File

@ -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)
{

View File

@ -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

View File

@ -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();
}

View File

@ -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();

View File

@ -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];

View File

@ -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];
}
}

View File

@ -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;

View File

@ -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());
}