Merge pull request #723 from lioncash/warnings

Core: Fix two sets of warnings when compiling on Linux.
This commit is contained in:
Pierre Bourdon 2014-08-03 21:25:44 -07:00
commit 95a8c24841
2 changed files with 25 additions and 23 deletions

View File

@ -2,6 +2,8 @@
// Licensed under GPLv2 // Licensed under GPLv2
// Refer to the license.txt file included. // Refer to the license.txt file included.
#include <cinttypes>
#include "Core/DSP/DSPEmitter.h" #include "Core/DSP/DSPEmitter.h"
#include "Core/DSP/DSPMemoryMap.h" #include "Core/DSP/DSPMemoryMap.h"
#include "Core/DSP/Jit/DSPJitRegCache.h" #include "Core/DSP/Jit/DSPJitRegCache.h"
@ -282,7 +284,7 @@ void DSPJitRegCache::flushRegs(DSPJitRegCache &cache, bool emit)
{ {
_assert_msg_(DSPLLE, _assert_msg_(DSPLLE,
xregs[i].guest_reg == cache.xregs[i].guest_reg, xregs[i].guest_reg == cache.xregs[i].guest_reg,
"cache and current xreg guest_reg mismatch for %zi", i); "cache and current xreg guest_reg mismatch for %" PRIx64, i);
} }
for (i = 0; i <= DSP_REG_MAX_MEM_BACKED; i++) for (i = 0; i <= DSP_REG_MAX_MEM_BACKED; i++)
@ -316,7 +318,7 @@ void DSPJitRegCache::flushMemBackedRegs()
for (unsigned int i = 0; i <= DSP_REG_MAX_MEM_BACKED; i++) for (unsigned int i = 0; i <= DSP_REG_MAX_MEM_BACKED; i++)
{ {
_assert_msg_(DSPLLE, !regs[i].used, _assert_msg_(DSPLLE, !regs[i].used,
"register %x still in use", i); "register %u still in use", i);
if (regs[i].used) if (regs[i].used)
{ {
@ -351,7 +353,7 @@ void DSPJitRegCache::flushRegs()
{ {
_assert_msg_(DSPLLE, _assert_msg_(DSPLLE,
!regs[i].loc.IsSimpleReg(), !regs[i].loc.IsSimpleReg(),
"register %x is still a simple reg", i); "register %u is still a simple reg", i);
} }
_assert_msg_(DSPLLE, _assert_msg_(DSPLLE,
@ -440,7 +442,7 @@ void DSPJitRegCache::saveRegs()
{ {
_assert_msg_(DSPLLE, _assert_msg_(DSPLLE,
!regs[i].loc.IsSimpleReg(), !regs[i].loc.IsSimpleReg(),
"register %x is still a simple reg", i); "register %u is still a simple reg", i);
} }
emitter.MOV(64, R(RBP), M(&ebp_store)); emitter.MOV(64, R(RBP), M(&ebp_store));
@ -485,7 +487,7 @@ void DSPJitRegCache::pushRegs()
{ {
_assert_msg_(DSPLLE, _assert_msg_(DSPLLE,
!regs[i].loc.IsSimpleReg(), !regs[i].loc.IsSimpleReg(),
"register %x is still a simple reg", i); "register %u is still a simple reg", i);
} }
for (unsigned int i = 0; i < NUMXREGS; i++) for (unsigned int i = 0; i < NUMXREGS; i++)
@ -493,7 +495,7 @@ void DSPJitRegCache::pushRegs()
_assert_msg_(DSPLLE, _assert_msg_(DSPLLE,
xregs[i].guest_reg == DSP_REG_NONE || xregs[i].guest_reg == DSP_REG_NONE ||
xregs[i].guest_reg == DSP_REG_STATIC, xregs[i].guest_reg == DSP_REG_STATIC,
"register %x is still used", i); "register %u is still used", i);
} }
emitter.MOV(64, R(RBP), M(&ebp_store)); emitter.MOV(64, R(RBP), M(&ebp_store));
@ -558,11 +560,11 @@ X64Reg DSPJitRegCache::makeABICallSafe(X64Reg reg)
void DSPJitRegCache::movToHostReg(size_t reg, X64Reg host_reg, bool load) void DSPJitRegCache::movToHostReg(size_t reg, X64Reg host_reg, bool load)
{ {
_assert_msg_(DSPLLE, reg <= DSP_REG_MAX_MEM_BACKED, _assert_msg_(DSPLLE, reg <= DSP_REG_MAX_MEM_BACKED,
"bad register name %x", reg); "bad register name %" PRIx64, reg);
_assert_msg_(DSPLLE, regs[reg].parentReg == DSP_REG_NONE, _assert_msg_(DSPLLE, regs[reg].parentReg == DSP_REG_NONE,
"register %x is proxy for %x", reg, regs[reg].parentReg); "register %" PRIx64 " is proxy for %d", reg, regs[reg].parentReg);
_assert_msg_(DSPLLE, !regs[reg].used, _assert_msg_(DSPLLE, !regs[reg].used,
"moving to host reg in use guest reg %x!", reg); "moving to host reg in use guest reg %" PRIx64, reg);
X64Reg old_reg = regs[reg].loc.GetSimpleReg(); X64Reg old_reg = regs[reg].loc.GetSimpleReg();
if (old_reg == host_reg) if (old_reg == host_reg)
{ {
@ -604,11 +606,11 @@ void DSPJitRegCache::movToHostReg(size_t reg, X64Reg host_reg, bool load)
void DSPJitRegCache::movToHostReg(size_t reg, bool load) void DSPJitRegCache::movToHostReg(size_t reg, bool load)
{ {
_assert_msg_(DSPLLE, reg <= DSP_REG_MAX_MEM_BACKED, _assert_msg_(DSPLLE, reg <= DSP_REG_MAX_MEM_BACKED,
"bad register name %x", reg); "bad register name %" PRIx64, reg);
_assert_msg_(DSPLLE, regs[reg].parentReg == DSP_REG_NONE, _assert_msg_(DSPLLE, regs[reg].parentReg == DSP_REG_NONE,
"register %x is proxy for %x", reg, regs[reg].parentReg); "register %" PRIx64 " is proxy for %d", reg, regs[reg].parentReg);
_assert_msg_(DSPLLE, !regs[reg].used, _assert_msg_(DSPLLE, !regs[reg].used,
"moving to host reg in use guest reg %x!", reg); "moving to host reg in use guest reg %" PRIx64, reg);
if (regs[reg].loc.IsSimpleReg()) if (regs[reg].loc.IsSimpleReg())
{ {
@ -636,13 +638,13 @@ void DSPJitRegCache::movToHostReg(size_t reg, bool load)
void DSPJitRegCache::rotateHostReg(size_t reg, int shift, bool emit) void DSPJitRegCache::rotateHostReg(size_t reg, int shift, bool emit)
{ {
_assert_msg_(DSPLLE, reg <= DSP_REG_MAX_MEM_BACKED, _assert_msg_(DSPLLE, reg <= DSP_REG_MAX_MEM_BACKED,
"bad register name %x", reg); "bad register name %" PRIx64, reg);
_assert_msg_(DSPLLE, regs[reg].parentReg == DSP_REG_NONE, _assert_msg_(DSPLLE, regs[reg].parentReg == DSP_REG_NONE,
"register %x is proxy for %x", reg, regs[reg].parentReg); "register %" PRIx64 " is proxy for %d", reg, regs[reg].parentReg);
_assert_msg_(DSPLLE, regs[reg].loc.IsSimpleReg(), _assert_msg_(DSPLLE, regs[reg].loc.IsSimpleReg(),
"register %x is not a simple reg", reg); "register %" PRIx64 " is not a simple reg", reg);
_assert_msg_(DSPLLE, !regs[reg].used, _assert_msg_(DSPLLE, !regs[reg].used,
"rotating in use guest reg %x!", reg); "rotating in use guest reg %" PRIx64, reg);
if (shift > regs[reg].shift && emit) if (shift > regs[reg].shift && emit)
{ {
@ -680,11 +682,11 @@ void DSPJitRegCache::rotateHostReg(size_t reg, int shift, bool emit)
void DSPJitRegCache::movToMemory(size_t reg) void DSPJitRegCache::movToMemory(size_t reg)
{ {
_assert_msg_(DSPLLE, reg <= DSP_REG_MAX_MEM_BACKED, _assert_msg_(DSPLLE, reg <= DSP_REG_MAX_MEM_BACKED,
"bad register name %x", reg); "bad register name %" PRIx64, reg);
_assert_msg_(DSPLLE, regs[reg].parentReg == DSP_REG_NONE, _assert_msg_(DSPLLE, regs[reg].parentReg == DSP_REG_NONE,
"register %x is proxy for %x", reg, regs[reg].parentReg); "register %" PRIx64 " is proxy for %d", reg, regs[reg].parentReg);
_assert_msg_(DSPLLE, !regs[reg].used, _assert_msg_(DSPLLE, !regs[reg].used,
"moving to memory in use guest reg %x!", reg); "moving to memory in use guest reg %" PRIx64, reg);
if (regs[reg].used) if (regs[reg].used)
{ {
@ -766,7 +768,7 @@ void DSPJitRegCache::getReg(int reg, OpArg &oparg, bool load)
} }
_assert_msg_(DSPLLE, !regs[real_reg].used, _assert_msg_(DSPLLE, !regs[real_reg].used,
"register %x already in use", real_reg); "register %d already in use", real_reg);
if (regs[real_reg].used) if (regs[real_reg].used)
{ {
@ -778,7 +780,7 @@ void DSPJitRegCache::getReg(int reg, OpArg &oparg, bool load)
// TODO: actually handle INVALID_REG // TODO: actually handle INVALID_REG
_assert_msg_(DSPLLE, regs[real_reg].loc.IsSimpleReg(), _assert_msg_(DSPLLE, regs[real_reg].loc.IsSimpleReg(),
"did not get host reg for %x", reg); "did not get host reg for %d", reg);
rotateHostReg(real_reg, shift, load); rotateHostReg(real_reg, shift, load);
oparg = regs[real_reg].loc; oparg = regs[real_reg].loc;

View File

@ -135,7 +135,7 @@ GCMemcardDirectory::GCMemcardDirectory(std::string directory, int slot, u16 size
{ {
std::string ext; std::string ext;
std::string const &name = FST_Temp.children[j].virtualName; std::string const &name = FST_Temp.children[j].virtualName;
SplitPath(name, NULL, NULL, &ext); SplitPath(name, nullptr, nullptr, &ext);
if (strcasecmp(ext.c_str(), ".gci") == 0) if (strcasecmp(ext.c_str(), ".gci") == 0)
{ {
if (m_saves.size() == DIRLEN) if (m_saves.size() == DIRLEN)
@ -553,7 +553,7 @@ void GCMemcardDirectory::Flush(bool exiting)
void GCMemcardDirectory::DoState(PointerWrap &p) void GCMemcardDirectory::DoState(PointerWrap &p)
{ {
m_LastBlock = -1; m_LastBlock = -1;
m_LastBlockAddress = 0; m_LastBlockAddress = nullptr;
p.Do(m_SaveDirectory); p.Do(m_SaveDirectory);
p.DoPOD<Header>(m_hdr); p.DoPOD<Header>(m_hdr);
p.DoPOD<Directory>(m_dir1); p.DoPOD<Directory>(m_dir1);