From f82afd1b2f4f13aecec6c7a36542121167cda357 Mon Sep 17 00:00:00 2001 From: Tillmann Karras Date: Mon, 16 Mar 2015 10:56:16 +0100 Subject: [PATCH] Fix warnings --- Source/Core/Core/PowerPC/JitCommon/JitBackpatch.cpp | 4 ++-- Source/Core/VideoBackends/OGL/GLInterface/GLX.h | 2 +- Source/Core/VideoCommon/OpcodeDecoding.cpp | 8 ++++---- Source/UnitTests/Core/MMIOTest.cpp | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Source/Core/Core/PowerPC/JitCommon/JitBackpatch.cpp b/Source/Core/Core/PowerPC/JitCommon/JitBackpatch.cpp index 03963dc5dd..5039996c43 100644 --- a/Source/Core/Core/PowerPC/JitCommon/JitBackpatch.cpp +++ b/Source/Core/Core/PowerPC/JitCommon/JitBackpatch.cpp @@ -109,7 +109,7 @@ bool Jitx86Base::BackPatch(u32 emAddress, SContext* ctx) if (codePtr[totalSize] != 0xc1 || codePtr[totalSize + 2] != 0x10) { PanicAlert("BackPatch: didn't find expected shift %p", codePtr); - return nullptr; + return false; } info.signExtend = (codePtr[totalSize + 1] & 0x10) != 0; totalSize += 3; @@ -168,7 +168,7 @@ bool Jitx86Base::BackPatch(u32 emAddress, SContext* ctx) if (it3 == pcAtLoc.end()) { PanicAlert("BackPatch: no pc entry for address %p", codePtr); - return nullptr; + return false; } u32 pc = it3->second; diff --git a/Source/Core/VideoBackends/OGL/GLInterface/GLX.h b/Source/Core/VideoBackends/OGL/GLInterface/GLX.h index 7b6f8ac8f0..56630475ec 100644 --- a/Source/Core/VideoBackends/OGL/GLInterface/GLX.h +++ b/Source/Core/VideoBackends/OGL/GLInterface/GLX.h @@ -23,7 +23,7 @@ public: void SwapInterval(int Interval) override; void Swap() override; void* GetFuncAddress(const std::string& name) override; - bool Create(void *window_handle); + bool Create(void *window_handle) override; bool MakeCurrent() override; bool ClearCurrent() override; void Shutdown() override; diff --git a/Source/Core/VideoCommon/OpcodeDecoding.cpp b/Source/Core/VideoCommon/OpcodeDecoding.cpp index 20a8f2eac9..4b258e7127 100644 --- a/Source/Core/VideoCommon/OpcodeDecoding.cpp +++ b/Source/Core/VideoCommon/OpcodeDecoding.cpp @@ -33,7 +33,7 @@ bool g_bRecordFifoData = false; -bool g_bFifoErrorSeen = false; +static bool s_bFifoErrorSeen = false; static u32 InterpretDisplayList(u32 address, u32 size) { @@ -125,7 +125,7 @@ static void UnknownOpcode(u8 cmd_byte, void *buffer, bool preprocess) void OpcodeDecoder_Init() { - g_bFifoErrorSeen = false; + s_bFifoErrorSeen = false; } @@ -291,10 +291,10 @@ u8* OpcodeDecoder_Run(DataReader src, u32* cycles, bool in_display_list) } else { - if (!g_bFifoErrorSeen) + if (!s_bFifoErrorSeen) UnknownOpcode(cmd_byte, opcodeStart, is_preprocess); ERROR_LOG(VIDEO, "FIFO: Unknown Opcode(0x%02x @ %p, preprocessing = %s)", cmd_byte, opcodeStart, is_preprocess ? "yes" : "no"); - g_bFifoErrorSeen = true; + s_bFifoErrorSeen = true; totalCycles += 1; } break; diff --git a/Source/UnitTests/Core/MMIOTest.cpp b/Source/UnitTests/Core/MMIOTest.cpp index 7285157c34..9da0dee684 100644 --- a/Source/UnitTests/Core/MMIOTest.cpp +++ b/Source/UnitTests/Core/MMIOTest.cpp @@ -108,12 +108,12 @@ TEST_F(MappingTest, ReadWriteComplex) m_mapping->Register(0x0C001234, MMIO::ComplexRead([&read_called](u32 addr) { - EXPECT_EQ(0x0C001234, addr); + EXPECT_EQ(0x0C001234u, addr); read_called = true; return 0x12; }), MMIO::ComplexWrite([&write_called](u32 addr, u8 val) { - EXPECT_EQ(0x0C001234, addr); + EXPECT_EQ(0x0C001234u, addr); EXPECT_EQ(0x34, val); write_called = true; })