Fix format string warnings

This commit is contained in:
Tillmann Karras 2013-10-26 11:55:41 +02:00
commit 268bdf19ce
24 changed files with 75 additions and 41 deletions

View file

@ -36,6 +36,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <errno.h> #include <errno.h>
#include <cinttypes>
#ifndef _WIN32 #ifndef _WIN32
#include <unistd.h> // for unlink() #include <unistd.h> // for unlink()
@ -196,7 +197,7 @@ bool SDCardCreate(u64 disk_size /*in MB*/, const char* filename)
disk_size *= 1024 * 1024; disk_size *= 1024 * 1024;
if (disk_size < 0x800000 || disk_size > 0x800000000ULL) { if (disk_size < 0x800000 || disk_size > 0x800000000ULL) {
ERROR_LOG(COMMON, "Trying to create SD Card image of size %lliMB is out of range (8MB-32GB)", disk_size/(1024*1024)); ERROR_LOG(COMMON, "Trying to create SD Card image of size %" PRIu64 "MB is out of range (8MB-32GB)", disk_size/(1024*1024));
return false; return false;
} }

View file

@ -5,6 +5,8 @@
#include "FileUtil.h" #include "FileUtil.h"
#include "SysConf.h" #include "SysConf.h"
#include <cinttypes>
SysConf::SysConf() SysConf::SysConf()
: m_IsValid(false) : m_IsValid(false)
{ {
@ -42,7 +44,7 @@ bool SysConf::LoadFromFile(const char *filename)
u64 size = File::GetSize(filename); u64 size = File::GetSize(filename);
if (size != SYSCONF_SIZE) if (size != SYSCONF_SIZE)
{ {
if (AskYesNoT("Your SYSCONF file is the wrong size.\nIt should be 0x%04x (but is 0x%04llx)\nDo you want to generate a new one?", if (AskYesNoT("Your SYSCONF file is the wrong size.\nIt should be 0x%04x (but is 0x%04" PRIx64 ")\nDo you want to generate a new one?",
SYSCONF_SIZE, size)) SYSCONF_SIZE, size))
{ {
GenerateSysConf(); GenerateSysConf();

View file

@ -7,6 +7,8 @@
#include "x64ABI.h" #include "x64ABI.h"
#include "CPUDetect.h" #include "CPUDetect.h"
#include <cinttypes>
namespace Gen namespace Gen
{ {
@ -176,7 +178,7 @@ void OpArg::WriteRest(XEmitter *emit, int extraBytes, X64Reg _operandReg,
_assert_msg_(DYNA_REC, (distance < 0x80000000LL _assert_msg_(DYNA_REC, (distance < 0x80000000LL
&& distance >= -0x80000000LL) || && distance >= -0x80000000LL) ||
!warn_64bit_offset, !warn_64bit_offset,
"WriteRest: op out of range (0x%llx uses 0x%llx)", "WriteRest: op out of range (0x%" PRIx64 " uses 0x%" PRIx64 ")",
ripAddr, offset); ripAddr, offset);
s32 offs = (s32)distance; s32 offs = (s32)distance;
emit->Write32((u32)offs); emit->Write32((u32)offs);

View file

@ -18,6 +18,8 @@
#include "Core.h" // for bWii #include "Core.h" // for bWii
#include "FifoPlayer/FifoDataFile.h" #include "FifoPlayer/FifoDataFile.h"
#include <cinttypes>
SCoreStartupParameter::SCoreStartupParameter() SCoreStartupParameter::SCoreStartupParameter()
: hInstance(0), : hInstance(0),
bEnableDebugging(false), bAutomaticStart(false), bBootToPause(false), bEnableDebugging(false), bAutomaticStart(false), bBootToPause(false),
@ -278,7 +280,7 @@ bool SCoreStartupParameter::AutoSetup(EBootBS2 _BootBS2)
// Use the TitleIDhex for name and/or unique ID if launching from nand folder // Use the TitleIDhex for name and/or unique ID if launching from nand folder
// or if it is not ascii characters (specifically sysmenu could potentially apply to other things) // or if it is not ascii characters (specifically sysmenu could potentially apply to other things)
char titleidstr[17]; char titleidstr[17];
snprintf(titleidstr, 17, "%016llx", ContentLoader.GetTitleID()); snprintf(titleidstr, 17, "%016" PRIx64, ContentLoader.GetTitleID());
if (!m_strName.length()) if (!m_strName.length())
{ {

View file

@ -3,6 +3,7 @@
// Refer to the license.txt file included. // Refer to the license.txt file included.
#include <vector> #include <vector>
#include <cinttypes>
#include "Thread.h" #include "Thread.h"
#include "PowerPC/PowerPC.h" #include "PowerPC/PowerPC.h"
@ -429,7 +430,7 @@ void LogPendingEvents()
Event *ptr = first; Event *ptr = first;
while (ptr) while (ptr)
{ {
INFO_LOG(POWERPC, "PENDING: Now: %lld Pending: %lld Type: %d", globalTimer, ptr->time, ptr->type); INFO_LOG(POWERPC, "PENDING: Now: %" PRId64 " Pending: %" PRId64 " Type: %d", globalTimer, ptr->time, ptr->type);
ptr = ptr->next; ptr = ptr->next;
} }
} }

View file

@ -6,6 +6,7 @@
#include "FileUtil.h" #include "FileUtil.h"
#include "DSP/DSPCore.h" #include "DSP/DSPCore.h"
#include "DSPLLEGlobals.h" #include "DSPLLEGlobals.h"
#include <cinttypes>
#if PROFILE #if PROFILE
@ -37,12 +38,12 @@ void ProfilerDump(u64 count)
File::IOFile pFile("DSP_Prof.txt", "wt"); File::IOFile pFile("DSP_Prof.txt", "wt");
if (pFile) if (pFile)
{ {
fprintf(pFile.GetHandle(), "Number of DSP steps: %llu\n\n", count); fprintf(pFile.GetHandle(), "Number of DSP steps: %" PRIu64 "\n\n", count);
for (int i=0; i<PROFILE_MAP_SIZE;i++) for (int i=0; i<PROFILE_MAP_SIZE;i++)
{ {
if (g_profileMap[i] > 0) if (g_profileMap[i] > 0)
{ {
fprintf(pFile.GetHandle(), "0x%04X: %llu\n", i, g_profileMap[i]); fprintf(pFile.GetHandle(), "0x%04X: %" PRIu64 "\n", i, g_profileMap[i]);
} }
} }
} }

View file

@ -4,6 +4,9 @@
#include "GCMemcard.h" #include "GCMemcard.h"
#include "ColorUtil.h" #include "ColorUtil.h"
#include <cinttypes>
static void ByteSwap(u8 *valueA, u8 *valueB) static void ByteSwap(u8 *valueA, u8 *valueB)
{ {
u8 tmp = *valueA; u8 tmp = *valueA;
@ -173,7 +176,7 @@ GCMemcard::GCMemcard(const char *filename, bool forceCreation, bool sjis)
} }
else else
{ {
PanicAlertT("Failed to read block %d of the save data\nMemcard may be truncated\nFilePosition:%llx", i, mcdFile.Tell()); PanicAlertT("Failed to read block %d of the save data\nMemcard may be truncated\nFilePosition:%" PRIx64, i, mcdFile.Tell());
m_valid = false; m_valid = false;
break; break;
} }

View file

@ -19,6 +19,8 @@
#include "../../DiscIO/Src/FileMonitor.h" #include "../../DiscIO/Src/FileMonitor.h"
#include <cinttypes>
using namespace DVDInterface; using namespace DVDInterface;
@ -108,7 +110,7 @@ bool CWII_IPC_HLE_Device_di::IOCtlV(u32 _CommandAddress)
// Get TMD offset for requested partition... // Get TMD offset for requested partition...
u64 const TMDOffset = ((u64)Memory::Read_U32(CommandBuffer.InBuffer[0].m_Address + 4) << 2 ) + 0x2c0; u64 const TMDOffset = ((u64)Memory::Read_U32(CommandBuffer.InBuffer[0].m_Address + 4) << 2 ) + 0x2c0;
INFO_LOG(WII_IPC_DVD, "DVDLowOpenPartition: TMDOffset 0x%016llx", TMDOffset); INFO_LOG(WII_IPC_DVD, "DVDLowOpenPartition: TMDOffset 0x%016" PRIx64, TMDOffset);
static u32 const TMDsz = 0x208; //CommandBuffer.PayloadBuffer[0].m_Size; static u32 const TMDsz = 0x208; //CommandBuffer.PayloadBuffer[0].m_Size;
u8 pTMD[TMDsz]; u8 pTMD[TMDsz];
@ -204,13 +206,13 @@ u32 CWII_IPC_HLE_Device_di::ExecuteCommand(u32 _BufferIn, u32 _BufferInSize, u32
pFilename = m_pFileSystem->GetFileName(DVDAddress); pFilename = m_pFileSystem->GetFileName(DVDAddress);
if (pFilename != NULL) if (pFilename != NULL)
{ {
INFO_LOG(WII_IPC_DVD, "DVDLowRead: %s (0x%llx) - (DVDAddr: 0x%llx, Size: 0x%x)", INFO_LOG(WII_IPC_DVD, "DVDLowRead: %s (0x%" PRIx64 ") - (DVDAddr: 0x%" PRIx64 ", Size: 0x%x)",
pFilename, m_pFileSystem->GetFileSize(pFilename), DVDAddress, Size); pFilename, m_pFileSystem->GetFileSize(pFilename), DVDAddress, Size);
FileMon::CheckFile(std::string(pFilename), (int)m_pFileSystem->GetFileSize(pFilename)); FileMon::CheckFile(std::string(pFilename), (int)m_pFileSystem->GetFileSize(pFilename));
} }
else else
{ {
INFO_LOG(WII_IPC_DVD, "DVDLowRead: file unknown - (DVDAddr: 0x%llx, Size: 0x%x)", INFO_LOG(WII_IPC_DVD, "DVDLowRead: file unknown - (DVDAddr: 0x%" PRIx64 ", Size: 0x%x)",
DVDAddress, Size); DVDAddress, Size);
} }
} }
@ -308,7 +310,7 @@ u32 CWII_IPC_HLE_Device_di::ExecuteCommand(u32 _BufferIn, u32 _BufferInSize, u32
u64 DVDAddress = (u64)DVDAddress32 << 2; u64 DVDAddress = (u64)DVDAddress32 << 2;
INFO_LOG(WII_IPC_DVD, "DVDLowUnencryptedRead: DVDAddr: 0x%08llx, Size: 0x%x", DVDAddress, Size); INFO_LOG(WII_IPC_DVD, "DVDLowUnencryptedRead: DVDAddr: 0x%08" PRIx64 ", Size: 0x%x", DVDAddress, Size);
if (Size > _BufferOutSize) if (Size > _BufferOutSize)
{ {
@ -342,12 +344,12 @@ u32 CWII_IPC_HLE_Device_di::ExecuteCommand(u32 _BufferIn, u32 _BufferInSize, u32
pFilename = m_pFileSystem->GetFileName(DVDAddress); pFilename = m_pFileSystem->GetFileName(DVDAddress);
if (pFilename != NULL) if (pFilename != NULL)
{ {
INFO_LOG(WII_IPC_DVD, "DVDLowSeek: %s (0x%llx) - (DVDAddr: 0x%llx)", INFO_LOG(WII_IPC_DVD, "DVDLowSeek: %s (0x%" PRIx64 ") - (DVDAddr: 0x%" PRIx64 ")",
pFilename, m_pFileSystem->GetFileSize(pFilename), DVDAddress); pFilename, m_pFileSystem->GetFileSize(pFilename), DVDAddress);
} }
else else
{ {
INFO_LOG(WII_IPC_DVD, "DVDLowSeek: file unknown - (DVDAddr: 0x%llx)", INFO_LOG(WII_IPC_DVD, "DVDLowSeek: file unknown - (DVDAddr: 0x%" PRIx64 ")",
DVDAddress); DVDAddress);
} }
} }

View file

@ -35,6 +35,10 @@
#include "WII_IPC_HLE_Device_es.h" #include "WII_IPC_HLE_Device_es.h"
// need to include this before polarssl/aes.h,
// otherwise we may not get __STDC_FORMAT_MACROS
#include <cinttypes>
#include "../PowerPC/PowerPC.h" #include "../PowerPC/PowerPC.h"
#include "../VolumeHandler.h" #include "../VolumeHandler.h"
#include "FileUtil.h" #include "FileUtil.h"
@ -205,7 +209,7 @@ u32 CWII_IPC_HLE_Device_es::OpenTitleContent(u32 CFD, u64 TitleID, u16 Index)
if (!Loader.IsValid()) if (!Loader.IsValid())
{ {
WARN_LOG(WII_IPC_ES, "ES: loader not valid for %llx", TitleID); WARN_LOG(WII_IPC_ES, "ES: loader not valid for %" PRIx64, TitleID);
return 0xffffffff; return 0xffffffff;
} }
@ -940,7 +944,7 @@ bool CWII_IPC_HLE_Device_es::IOCtlV(u32 _CommandAddress)
if (!bSuccess) if (!bSuccess)
{ {
PanicAlertT("IOCTL_ES_LAUNCH: Game tried to reload a title that is not available in your NAND dump\n" PanicAlertT("IOCTL_ES_LAUNCH: Game tried to reload a title that is not available in your NAND dump\n"
"TitleID %016llx.\n Dolphin will likely hang now.", TitleID); "TitleID %016" PRIx64".\n Dolphin will likely hang now.", TitleID);
} }
else else
{ {
@ -983,7 +987,7 @@ bool CWII_IPC_HLE_Device_es::IOCtlV(u32 _CommandAddress)
//TODO: provide correct return code when bSuccess= false //TODO: provide correct return code when bSuccess= false
Memory::Write_U32(0, _CommandAddress + 0x4); Memory::Write_U32(0, _CommandAddress + 0x4);
ERROR_LOG(WII_IPC_ES, "IOCTL_ES_LAUNCH %016llx %08x %016llx %08x %016llx %04x", TitleID,view,ticketid,devicetype,titleid,access); ERROR_LOG(WII_IPC_ES, "IOCTL_ES_LAUNCH %016" PRIx64 " %08x %016" PRIx64 " %08x %016" PRIx64 " %04x", TitleID,view,ticketid,devicetype,titleid,access);
// IOCTL_ES_LAUNCH 0001000248414341 00000001 0001c0fef3df2cfa 00000000 0001000248414341 ffff // IOCTL_ES_LAUNCH 0001000248414341 00000001 0001c0fef3df2cfa 00000000 0001000248414341 ffff
// This is necessary because Reset(true) above deleted this object. Ew. // This is necessary because Reset(true) above deleted this object. Ew.

View file

@ -10,11 +10,11 @@
#include "../../Host.h" #include "../../Host.h"
#include "../../IPC_HLE/WII_IPC_HLE.h" #include "../../IPC_HLE/WII_IPC_HLE.h"
#ifdef USE_GDBSTUB #ifdef USE_GDBSTUB
#include "../GDBStub.h" #include "../GDBStub.h"
#endif #endif
#include <cinttypes>
namespace { namespace {
u32 last_pc; u32 last_pc;
@ -79,7 +79,7 @@ void Trace( UGeckoInstruction &instCode )
std::string fregs = ""; std::string fregs = "";
for (int i=0; i<32; i++) for (int i=0; i<32; i++)
{ {
sprintf(freg, "f%02d: %08llx %08llx ", i, PowerPC::ppcState.ps[i][0], PowerPC::ppcState.ps[i][1]); sprintf(freg, "f%02d: %08" PRIx64 " %08" PRIx64 " ", i, PowerPC::ppcState.ps[i][0], PowerPC::ppcState.ps[i][1]);
fregs.append(freg); fregs.append(freg);
} }

View file

@ -3,6 +3,7 @@
// Refer to the license.txt file included. // Refer to the license.txt file included.
#include <map> #include <map>
#include <cinttypes>
#include "Common.h" #include "Common.h"
#include "../../HLE/HLE.h" #include "../../HLE/HLE.h"
@ -217,7 +218,7 @@ namespace JitILProfiler
const u64 totalElapsed = block.totalElapsed; const u64 totalElapsed = block.totalElapsed;
const u64 numberOfCalls = block.numberOfCalls; const u64 numberOfCalls = block.numberOfCalls;
const double elapsedPerCall = totalElapsed / (double)numberOfCalls; const double elapsedPerCall = totalElapsed / (double)numberOfCalls;
fprintf(file.GetHandle(), "%016llx,%lld,%lld,%f\n", codeHash, totalElapsed, numberOfCalls, elapsedPerCall); fprintf(file.GetHandle(), "%016" PRIx64 ",%" PRId64 ",%" PRId64 ",%f\n", codeHash, totalElapsed, numberOfCalls, elapsedPerCall);
} }
} }
}; };

View file

@ -3,6 +3,7 @@
// Refer to the license.txt file included. // Refer to the license.txt file included.
#include <string> #include <string>
#include <cinttypes>
#include "Common.h" #include "Common.h"
#include "disasm.h" #include "disasm.h"
@ -32,7 +33,7 @@ static void BackPatchError(const std::string &text, u8 *codePtr, u32 emAddress)
#endif #endif
PanicAlert("%s\n\n" PanicAlert("%s\n\n"
"Error encountered accessing emulated address %08x.\n" "Error encountered accessing emulated address %08x.\n"
"Culprit instruction: \n%s\nat %#llx", "Culprit instruction: \n%s\nat %#" PRIx64,
text.c_str(), emAddress, disbuf, code_addr); text.c_str(), emAddress, disbuf, code_addr);
return; return;
} }

View file

@ -118,6 +118,7 @@ Fix profiled loads/stores to work safely. On 32-bit, one solution is to
#include <algorithm> #include <algorithm>
#include <memory> #include <memory>
#include <cinttypes>
#include <ctime> #include <ctime>
#include <set> #include <set>
#include "IR.h" #include "IR.h"
@ -1279,7 +1280,7 @@ void IRBuilder::WriteToFile(u64 codeHash) {
} }
FILE* const file = writer->file.GetHandle(); FILE* const file = writer->file.GetHandle();
fprintf(file, "\ncode hash:%016llx\n", codeHash); fprintf(file, "\ncode hash:%016" PRIx64 "\n", codeHash);
const InstLoc lastCurReadPtr = curReadPtr; const InstLoc lastCurReadPtr = curReadPtr;
StartForwardPass(); StartForwardPass();

View file

@ -3,6 +3,7 @@
// Refer to the license.txt file included. // Refer to the license.txt file included.
#include <algorithm> #include <algorithm>
#include <cinttypes>
#ifdef _WIN32 #ifdef _WIN32
#include <windows.h> #include <windows.h>
@ -171,12 +172,12 @@ namespace JitInterface
double percent = 100.0 * (double)stat.cost / (double)cost_sum; double percent = 100.0 * (double)stat.cost / (double)cost_sum;
#ifdef _WIN32 #ifdef _WIN32
double timePercent = 100.0 * (double)block->ticCounter / (double)timecost_sum; double timePercent = 100.0 * (double)block->ticCounter / (double)timecost_sum;
fprintf(f.GetHandle(), "%08x\t%s\t%llu\t%llu\t%.2lf\t%llf\t%lf\t%i\n", fprintf(f.GetHandle(), "%08x\t%s\t%" PRIu64 "\t%" PRIu64 "\t%.2lf\t%llf\t%lf\t%i\n",
block->originalAddress, name.c_str(), stat.cost, block->originalAddress, name.c_str(), stat.cost,
block->ticCounter, percent, timePercent, block->ticCounter, percent, timePercent,
(double)block->ticCounter*1000.0/(double)countsPerSec, block->codeSize); (double)block->ticCounter*1000.0/(double)countsPerSec, block->codeSize);
#else #else
fprintf(f.GetHandle(), "%08x\t%s\t%llu\t???\t%.2lf\t???\t???\t%i\n", fprintf(f.GetHandle(), "%08x\t%s\t%" PRIu64 "\t???\t%.2lf\t???\t???\t%i\n",
block->originalAddress, name.c_str(), stat.cost, percent, block->codeSize); block->originalAddress, name.c_str(), stat.cost, percent, block->codeSize);
#endif #endif
} }

View file

@ -4,6 +4,7 @@
#include <algorithm> #include <algorithm>
#include <vector> #include <vector>
#include <cinttypes>
#include "Common.h" #include "Common.h"
#include "PPCTables.h" #include "PPCTables.h"
@ -213,7 +214,7 @@ void LogCompiledInstructions()
{ {
if (m_allInstructions[i]->compileCount > 0) if (m_allInstructions[i]->compileCount > 0)
{ {
fprintf(f.GetHandle(), "%s\t%i\t%lld\t%08x\n", m_allInstructions[i]->opname, fprintf(f.GetHandle(), "%s\t%i\t%" PRId64 "\t%08x\n", m_allInstructions[i]->opname,
m_allInstructions[i]->compileCount, m_allInstructions[i]->runCount, m_allInstructions[i]->lastUse); m_allInstructions[i]->compileCount, m_allInstructions[i]->runCount, m_allInstructions[i]->lastUse);
} }
} }
@ -223,7 +224,7 @@ void LogCompiledInstructions()
{ {
if (m_allInstructions[i]->compileCount == 0) if (m_allInstructions[i]->compileCount == 0)
{ {
fprintf(f.GetHandle(), "%s\t%i\t%lld\n", m_allInstructions[i]->opname, fprintf(f.GetHandle(), "%s\t%i\t%" PRId64 "\n", m_allInstructions[i]->opname,
m_allInstructions[i]->compileCount, m_allInstructions[i]->runCount); m_allInstructions[i]->compileCount, m_allInstructions[i]->runCount);
} }
} }

View file

@ -9,6 +9,8 @@
#include <unistd.h> #include <unistd.h>
#endif #endif
#include <cinttypes>
#include "CompressedBlob.h" #include "CompressedBlob.h"
#include "DiscScrubber.h" #include "DiscScrubber.h"
#include "FileUtil.h" #include "FileUtil.h"
@ -99,7 +101,7 @@ void CompressedBlobReader::GetBlock(u64 block_num, u8 *out_ptr)
// First, check hash. // First, check hash.
u32 block_hash = HashAdler32(source, comp_block_size); u32 block_hash = HashAdler32(source, comp_block_size);
if (block_hash != hashes[block_num]) if (block_hash != hashes[block_num])
PanicAlert("Hash of block %lli is %08x instead of %08x.\n" PanicAlert("Hash of block %" PRIu64 " is %08x instead of %08x.\n"
"Your ISO, %s, is corrupt.", "Your ISO, %s, is corrupt.",
block_num, block_hash, hashes[block_num], block_num, block_hash, hashes[block_num],
file_name.c_str()); file_name.c_str());
@ -127,7 +129,7 @@ void CompressedBlobReader::GetBlock(u64 block_num, u8 *out_ptr)
{ {
// this seem to fire wrongly from time to time // this seem to fire wrongly from time to time
// to be sure, don't use compressed isos :P // to be sure, don't use compressed isos :P
PanicAlert("Failure reading block %lli - out of data and not at end.", block_num); PanicAlert("Failure reading block %" PRIu64 " - out of data and not at end.", block_num);
} }
inflateEnd(&z); inflateEnd(&z);
if (uncomp_size != header.block_size) if (uncomp_size != header.block_size)

View file

@ -7,6 +7,8 @@
#include "FileUtil.h" #include "FileUtil.h"
#include "DiscScrubber.h" #include "DiscScrubber.h"
#include <cinttypes>
namespace DiscIO namespace DiscIO
{ {
@ -121,13 +123,13 @@ void GetNextBlock(File::IOFile& in, u8* buffer)
if (m_isScrubbing && m_FreeTable[i]) if (m_isScrubbing && m_FreeTable[i])
{ {
DEBUG_LOG(DISCIO, "Freeing 0x%016llx", CurrentOffset); DEBUG_LOG(DISCIO, "Freeing 0x%016" PRIx64, CurrentOffset);
std::fill(buffer, buffer + m_BlockSize, 0xFF); std::fill(buffer, buffer + m_BlockSize, 0xFF);
in.Seek(m_BlockSize, SEEK_CUR); in.Seek(m_BlockSize, SEEK_CUR);
} }
else else
{ {
DEBUG_LOG(DISCIO, "Used 0x%016llx", CurrentOffset); DEBUG_LOG(DISCIO, "Used 0x%016" PRIx64, CurrentOffset);
in.ReadBytes(buffer, m_BlockSize); in.ReadBytes(buffer, m_BlockSize);
} }
@ -150,7 +152,7 @@ void MarkAsUsed(u64 _Offset, u64 _Size)
u64 CurrentOffset = _Offset; u64 CurrentOffset = _Offset;
u64 EndOffset = CurrentOffset + _Size; u64 EndOffset = CurrentOffset + _Size;
DEBUG_LOG(DISCIO, "Marking 0x%016llx - 0x%016llx as used", _Offset, EndOffset); DEBUG_LOG(DISCIO, "Marking 0x%016" PRIx64 " - 0x%016" PRIx64 " as used", _Offset, EndOffset);
while ((CurrentOffset < EndOffset) && (CurrentOffset < m_FileSize)) while ((CurrentOffset < EndOffset) && (CurrentOffset < m_FileSize))
{ {

View file

@ -8,6 +8,7 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include <algorithm> #include <algorithm>
#include <cinttypes>
#include "FileSystemGCWii.h" #include "FileSystemGCWii.h"
#include "StringUtil.h" #include "StringUtil.h"
@ -70,7 +71,7 @@ u64 CFileSystemGCWii::ReadFile(const char* _rFullPath, u8* _pBuffer, size_t _Max
if (pFileInfo->m_FileSize > _MaxBufferSize) if (pFileInfo->m_FileSize > _MaxBufferSize)
return 0; return 0;
DEBUG_LOG(DISCIO, "Filename: %s. Offset: %llx. Size: %llx",_rFullPath, DEBUG_LOG(DISCIO, "Filename: %s. Offset: %" PRIx64 ". Size: %" PRIx64, _rFullPath,
pFileInfo->m_Offset, pFileInfo->m_FileSize); pFileInfo->m_Offset, pFileInfo->m_FileSize);
m_rVolume->Read(pFileInfo->m_Offset, pFileInfo->m_FileSize, _pBuffer); m_rVolume->Read(pFileInfo->m_Offset, pFileInfo->m_FileSize, _pBuffer);

View file

@ -9,6 +9,7 @@
#include <wx/filename.h> #include <wx/filename.h>
#include <algorithm> #include <algorithm>
#include <cinttypes>
#include <memory> #include <memory>
#include "FileSearch.h" #include "FileSearch.h"
@ -383,7 +384,7 @@ wxString NiceSizeFormat(u64 _size)
auto const value = (_size + unit_size / 2) / unit_size; auto const value = (_size + unit_size / 2) / unit_size;
auto const frac = (_size % unit_size * 10 + unit_size / 2) / unit_size % 10; auto const frac = (_size % unit_size * 10 + unit_size / 2) / unit_size % 10;
return StrToWxStr(StringFromFormat("%llu.%llu %s", value, frac, unit_symbols[unit])); return StrToWxStr(StringFromFormat("%" PRIu64 ".%" PRIu64 " %s", value, frac, unit_symbols[unit]));
} }
void CGameListCtrl::InsertItemInReportView(long _Index) void CGameListCtrl::InsertItemInReportView(long _Index)

View file

@ -188,7 +188,7 @@ std::string GameListItem::CreateCacheFilename()
// Filename.extension_HashOfFolderPath_Size.cache // Filename.extension_HashOfFolderPath_Size.cache
// Append hash to prevent ISO name-clashing in different folders. // Append hash to prevent ISO name-clashing in different folders.
Filename.append(StringFromFormat("%s_%x_%llx.cache", Filename.append(StringFromFormat("%s_%x_%zx.cache",
extension.c_str(), HashFletcher((const u8 *)LegalPathname.c_str(), LegalPathname.size()), extension.c_str(), HashFletcher((const u8 *)LegalPathname.c_str(), LegalPathname.size()),
File::GetSize(m_FileName))); File::GetSize(m_FileName)));

View file

@ -7,6 +7,7 @@
#endif #endif
#include <type_traits> #include <type_traits>
#include <cinttypes>
#include "Common.h" #include "Common.h"
#include "CommonPaths.h" #include "CommonPaths.h"
@ -118,7 +119,7 @@ CISOProperties::CISOProperties(const std::string fileName, wxWindow* parent, wxW
u8 _tTitleID[8]; u8 _tTitleID[8];
if(OpenISO->GetTitleID(_tTitleID)) if(OpenISO->GetTitleID(_tTitleID))
{ {
snprintf(tmp, 17, "%016llx", Common::swap64(_tTitleID)); snprintf(tmp, 17, "%016" PRIx64, Common::swap64(_tTitleID));
_iniFilename = tmp; _iniFilename = tmp;
} }
} }

View file

@ -7,12 +7,14 @@
// Licensed under the terms of the GNU GPL, version 2 // Licensed under the terms of the GNU GPL, version 2
// http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt // http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
#include <algorithm>
#include <cinttypes>
#include "WiiSaveCrypted.h" #include "WiiSaveCrypted.h"
#include "FileUtil.h" #include "FileUtil.h"
#include "MathUtil.h" #include "MathUtil.h"
#include "NandPaths.h" #include "NandPaths.h"
#include "FileUtil.h" #include "FileUtil.h"
#include <algorithm>
static Common::replace_v replacements; static Common::replace_v replacements;
@ -152,7 +154,7 @@ void CWiiSaveCrypted::ReadHDR()
md5((u8*)&_header, HEADER_SZ, md5_calc); md5((u8*)&_header, HEADER_SZ, md5_calc);
if (memcmp(md5_file, md5_calc, 0x10)) if (memcmp(md5_file, md5_calc, 0x10))
{ {
PanicAlertT("MD5 mismatch\n %016llx%016llx != %016llx%016llx", Common::swap64(md5_file),Common::swap64(md5_file+8), Common::swap64(md5_calc), Common::swap64(md5_calc+8)); PanicAlertT("MD5 mismatch\n %016" PRIx64 "%016" PRIx64 " != %016" PRIx64 "%016" PRIx64, Common::swap64(md5_file),Common::swap64(md5_file+8), Common::swap64(md5_calc), Common::swap64(md5_calc+8));
b_valid= false; b_valid= false;
} }
@ -244,7 +246,7 @@ void CWiiSaveCrypted::ReadBKHDR()
if (_sizeOfFiles + FULL_CERT_SZ != _totalSize) if (_sizeOfFiles + FULL_CERT_SZ != _totalSize)
WARN_LOG(CONSOLE, "Size(%x) + cert(%x) does not equal totalsize(%x)", _sizeOfFiles, FULL_CERT_SZ, _totalSize); WARN_LOG(CONSOLE, "Size(%x) + cert(%x) does not equal totalsize(%x)", _sizeOfFiles, FULL_CERT_SZ, _totalSize);
if (m_TitleID != Common::swap64(bkhdr.SaveGameTitle)) if (m_TitleID != Common::swap64(bkhdr.SaveGameTitle))
WARN_LOG(CONSOLE, "Encrypted title (%llx) does not match unencrypted title (%llx)", m_TitleID, Common::swap64(bkhdr.SaveGameTitle)); WARN_LOG(CONSOLE, "Encrypted title (%" PRIx64 ") does not match unencrypted title (%" PRIx64 ")", m_TitleID, Common::swap64(bkhdr.SaveGameTitle));
} }
void CWiiSaveCrypted::WriteBKHDR() void CWiiSaveCrypted::WriteBKHDR()

View file

@ -2,7 +2,8 @@
// Licensed under GPLv2 // Licensed under GPLv2
// Refer to the license.txt file included. // Refer to the license.txt file included.
#include <math.h> #include <cinttypes>
#include <cmath>
#include "Timer.h" #include "Timer.h"
@ -928,7 +929,7 @@ void Renderer::Swap(u32 xfbAddr, u32 fbWidth, u32 fbHeight,const EFBRectangle& r
if (SConfig::GetInstance().m_ShowLag) if (SConfig::GetInstance().m_ShowLag)
{ {
char lag[10]; char lag[10];
StringCchPrintfA(lag, 10, "Lag: %llu\n", Movie::g_currentLagCount); StringCchPrintfA(lag, 10, "Lag: %" PRIu64 "\n", Movie::g_currentLagCount);
D3D::font.DrawTextScaled(0, 18, 20, 0.0f, 0xFF00FFFF, lag); D3D::font.DrawTextScaled(0, 18, 20, 0.0f, 0xFF00FFFF, lag);
} }

View file

@ -9,6 +9,7 @@
#include <vector> #include <vector>
#include <cmath> #include <cmath>
#include <cstdio> #include <cstdio>
#include <cinttypes>
#include "GLUtil.h" #include "GLUtil.h"
#if defined(HAVE_WX) && HAVE_WX #if defined(HAVE_WX) && HAVE_WX
@ -709,7 +710,7 @@ void Renderer::DrawDebugInfo()
p+=sprintf(p, "FPS: %d\n", s_fps); p+=sprintf(p, "FPS: %d\n", s_fps);
if (SConfig::GetInstance().m_ShowLag) if (SConfig::GetInstance().m_ShowLag)
p+=sprintf(p, "Lag: %llu\n", Movie::g_currentLagCount); p+=sprintf(p, "Lag: %" PRIu64 "\n", Movie::g_currentLagCount);
if (g_ActiveConfig.bShowInputDisplay) if (g_ActiveConfig.bShowInputDisplay)
p+=sprintf(p, "%s", Movie::GetInputDisplay().c_str()); p+=sprintf(p, "%s", Movie::GetInputDisplay().c_str());