From de344ba221989b80438fa36e49aade1520fc323c Mon Sep 17 00:00:00 2001 From: heinrich5991 Date: Sun, 3 Feb 2019 01:46:03 +0100 Subject: [PATCH] Fix incorrect format strings --- src/engine/client/client.cpp | 4 ++-- src/engine/shared/datafile.cpp | 6 +++--- src/engine/shared/kernel.cpp | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/engine/client/client.cpp b/src/engine/client/client.cpp index 97b585fb0..e8f708c14 100644 --- a/src/engine/client/client.cpp +++ b/src/engine/client/client.cpp @@ -1811,8 +1811,8 @@ bool CClient::LimitFps() (Now - DbgLastSkippedDbgMsg) / (double)time_freq() > 5.0) { char aBuf[128]; - str_format(aBuf, sizeof(aBuf), "LimitFps: FramesSkippedCount=%d TimeWaited=%.3f (per sec)", - DbgFramesSkippedCount/5, + str_format(aBuf, sizeof(aBuf), "LimitFps: FramesSkippedCount=%lu TimeWaited=%.3f (per sec)", + (unsigned long)(DbgFramesSkippedCount/5), DbgTimeWaited/5.0); m_pConsole->Print(IConsole::OUTPUT_LEVEL_DEBUG, "client", aBuf); DbgFramesSkippedCount = 0; diff --git a/src/engine/shared/datafile.cpp b/src/engine/shared/datafile.cpp index 3fe222224..aaa6e9f39 100644 --- a/src/engine/shared/datafile.cpp +++ b/src/engine/shared/datafile.cpp @@ -260,7 +260,7 @@ void *CDataFileReader::GetDataImpl(int Index, int Swap) unsigned long UncompressedSize = m_pDataFile->m_Info.m_pDataSizes[Index]; unsigned long s; - dbg_msg("datafile", "loading data index=%d size=%d uncompressed=%d", Index, DataSize, UncompressedSize); + dbg_msg("datafile", "loading data index=%d size=%d uncompressed=%lu", Index, DataSize, UncompressedSize); m_pDataFile->m_ppDataPtrs[Index] = (char *)mem_alloc(UncompressedSize, 1); // read the compressed data @@ -544,7 +544,7 @@ int CDataFileWriter::Finish() for(int i = 0; i < m_NumItems; i++) { if(DEBUG) - dbg_msg("datafile", "item=%d size=%d (%d)", i, m_pItems[i].m_Size, m_pItems[i].m_Size+sizeof(CDatafileItem)); + dbg_msg("datafile", "item=%d size=%d (%d)", i, m_pItems[i].m_Size, (int)(m_pItems[i].m_Size+sizeof(CDatafileItem))); ItemSize += m_pItems[i].m_Size + sizeof(CDatafileItem); } @@ -581,7 +581,7 @@ int CDataFileWriter::Finish() // write Header if(DEBUG) - dbg_msg("datafile", "HeaderSize=%d", sizeof(Header)); + dbg_msg("datafile", "HeaderSize=%d", (int)sizeof(Header)); #if defined(CONF_ARCH_ENDIAN_BIG) swap_endian(&Header, sizeof(int), sizeof(Header)/sizeof(int)); #endif diff --git a/src/engine/shared/kernel.cpp b/src/engine/shared/kernel.cpp index b422b591a..95ecddbd0 100644 --- a/src/engine/shared/kernel.cpp +++ b/src/engine/shared/kernel.cpp @@ -77,7 +77,7 @@ public: { if(FindInterfaceInfo(pName) == 0) { - dbg_msg("kernel", "ERROR: couldn't reregister interface '%s'. interface doesn't exist"); + dbg_msg("kernel", "ERROR: couldn't reregister interface '%s'. interface doesn't exist", pName); return false; }