Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Core: Fix two sets of warnings when compiling on Linux. #723

Merged
merged 2 commits into from Aug 4, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
44 changes: 23 additions & 21 deletions Source/Core/Core/DSP/Jit/DSPJitRegCache.cpp
Expand Up @@ -2,6 +2,8 @@
// Licensed under GPLv2
// Refer to the license.txt file included.

#include <cinttypes>

#include "Core/DSP/DSPEmitter.h"
#include "Core/DSP/DSPMemoryMap.h"
#include "Core/DSP/Jit/DSPJitRegCache.h"
Expand Down Expand Up @@ -288,7 +290,7 @@ void DSPJitRegCache::flushRegs(DSPJitRegCache &cache, bool emit)
{
_assert_msg_(DSPLLE,
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++)
Expand Down Expand Up @@ -322,7 +324,7 @@ void DSPJitRegCache::flushMemBackedRegs()
for (unsigned int i = 0; i <= DSP_REG_MAX_MEM_BACKED; i++)
{
_assert_msg_(DSPLLE, !regs[i].used,
"register %x still in use", i);
"register %u still in use", i);

if (regs[i].used)
{
Expand Down Expand Up @@ -357,7 +359,7 @@ void DSPJitRegCache::flushRegs()
{
_assert_msg_(DSPLLE,
!regs[i].loc.IsSimpleReg(),
"register %x is still a simple reg", i);
"register %u is still a simple reg", i);
}

_assert_msg_(DSPLLE,
Expand Down Expand Up @@ -452,7 +454,7 @@ void DSPJitRegCache::saveRegs()
{
_assert_msg_(DSPLLE,
!regs[i].loc.IsSimpleReg(),
"register %x is still a simple reg", i);
"register %u is still a simple reg", i);
}

#if _M_X86_64
Expand Down Expand Up @@ -508,15 +510,15 @@ void DSPJitRegCache::pushRegs()
{
_assert_msg_(DSPLLE,
!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++)
{
_assert_msg_(DSPLLE,
xregs[i].guest_reg == DSP_REG_NONE ||
xregs[i].guest_reg == DSP_REG_STATIC,
"register %x is still used", i);
"register %u is still used", i);
}

#if _M_X86_64
Expand Down Expand Up @@ -600,11 +602,11 @@ X64Reg DSPJitRegCache::makeABICallSafe(X64Reg reg)
void DSPJitRegCache::movToHostReg(size_t reg, X64Reg host_reg, bool load)
{
_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,
"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,
"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();
if (old_reg == host_reg)
{
Expand Down Expand Up @@ -648,11 +650,11 @@ void DSPJitRegCache::movToHostReg(size_t reg, X64Reg host_reg, bool load)
void DSPJitRegCache::movToHostReg(size_t reg, bool load)
{
_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,
"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,
"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())
{
Expand Down Expand Up @@ -680,13 +682,13 @@ void DSPJitRegCache::movToHostReg(size_t reg, bool load)
void DSPJitRegCache::rotateHostReg(size_t reg, int shift, bool emit)
{
_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,
"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(),
"register %x is not a simple reg", reg);
"register %" PRIx64 " is not a simple reg", reg);
_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)
{
Expand Down Expand Up @@ -728,11 +730,11 @@ void DSPJitRegCache::rotateHostReg(size_t reg, int shift, bool emit)
void DSPJitRegCache::movToMemory(size_t reg)
{
_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,
"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,
"moving to memory in use guest reg %x!", reg);
"moving to memory in use guest reg %" PRIx64, reg);

if (regs[reg].used)
{
Expand Down Expand Up @@ -816,7 +818,7 @@ void DSPJitRegCache::getReg(int reg, OpArg &oparg, bool load)
}

_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)
{
Expand All @@ -828,7 +830,7 @@ void DSPJitRegCache::getReg(int reg, OpArg &oparg, bool load)

// TODO: actually handle INVALID_REG
_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);
oparg = regs[real_reg].loc;
Expand Down
4 changes: 2 additions & 2 deletions Source/Core/Core/HW/GCMemcardDirectory.cpp
Expand Up @@ -135,7 +135,7 @@ GCMemcardDirectory::GCMemcardDirectory(std::string directory, int slot, u16 size
{
std::string ext;
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 (m_saves.size() == DIRLEN)
Expand Down Expand Up @@ -553,7 +553,7 @@ void GCMemcardDirectory::Flush(bool exiting)
void GCMemcardDirectory::DoState(PointerWrap &p)
{
m_LastBlock = -1;
m_LastBlockAddress = 0;
m_LastBlockAddress = nullptr;
p.Do(m_SaveDirectory);
p.DoPOD<Header>(m_hdr);
p.DoPOD<Directory>(m_dir1);
Expand Down