From 651062a75de085d728e7dc19135707533bcb6e34 Mon Sep 17 00:00:00 2001 From: Thomas McGrew Date: Tue, 19 Oct 2021 21:40:41 -0400 Subject: [PATCH] Fixed clang compiler warnings --- Core/Debugger.cpp | 6 +++--- Core/EPSMAudio.h | 4 ++-- Core/LuaApi.cpp | 2 ++ Core/MemoryManager.cpp | 3 ++- Core/PartyTap.h | 15 ++++++++------- Core/Sunsoft4.h | 3 +-- Lua/lundump.c | 2 +- 7 files changed, 19 insertions(+), 16 deletions(-) diff --git a/Core/Debugger.cpp b/Core/Debugger.cpp index d1f95942..3114411e 100644 --- a/Core/Debugger.cpp +++ b/Core/Debugger.cpp @@ -901,7 +901,7 @@ bool Debugger::ProcessRamOperation(MemoryOperationType type, uint16_t &addr, uin _currentReadValue = nullptr; if(type == MemoryOperationType::Write) { - if(_runToCycle == -1 && !CheckFlag(DebuggerFlags::IgnoreRedundantWrites) || _memoryManager->DebugRead(addr) != value) { + if((_runToCycle == -1 && !CheckFlag(DebuggerFlags::IgnoreRedundantWrites)) || (_memoryManager->DebugRead(addr) != value)) { _memoryAccessCounter->ProcessMemoryWrite(addressInfo, _cpu->GetCycleCount()); } @@ -916,7 +916,7 @@ bool Debugger::ProcessRamOperation(MemoryOperationType type, uint16_t &addr, uin } } else if(addr >= 0x4018 && _mapper->IsWriteRegister(addr)) { _eventManager->AddDebugEvent(DebugEventType::MapperRegisterWrite, addr, value); - } else if(addr >= 0x4000 && addr <= 0x4015 || addr == 0x4017) { + } else if((addr >= 0x4000 && addr <= 0x4015) || addr == 0x4017) { _eventManager->AddDebugEvent(DebugEventType::ApuRegisterWrite, addr, value); } else if(addr == 0x4016) { _eventManager->AddDebugEvent(DebugEventType::ControlRegisterWrite, addr, value); @@ -1670,4 +1670,4 @@ uint32_t Debugger::GetScreenPixel(uint8_t x, uint8_t y) void Debugger::AddTrace(const char* log) { _traceLogger->LogExtraInfo(log, _cpu->GetCycleCount()); -} \ No newline at end of file +} diff --git a/Core/EPSMAudio.h b/Core/EPSMAudio.h index 4944f229..66744fe6 100644 --- a/Core/EPSMAudio.h +++ b/Core/EPSMAudio.h @@ -130,7 +130,7 @@ private: } } } - if ((currentRegister == 0x29)) { + if (currentRegister == 0x29) { //std::cout << std::hex << "value: " << value << std::endl; if ((value & 0x3 && (value & 0x80))) { //if ((value & 0x3 )) { @@ -306,4 +306,4 @@ public: } } -}; \ No newline at end of file +}; diff --git a/Core/LuaApi.cpp b/Core/LuaApi.cpp index 44bdb982..54816aa4 100644 --- a/Core/LuaApi.cpp +++ b/Core/LuaApi.cpp @@ -826,6 +826,8 @@ int LuaApi::GetAccessCounters(lua_State *lua) lua_rawseti(lua, -2, i); } break; + default: + break; } return 1; diff --git a/Core/MemoryManager.cpp b/Core/MemoryManager.cpp index 1d642392..7ba9d20c 100644 --- a/Core/MemoryManager.cpp +++ b/Core/MemoryManager.cpp @@ -133,7 +133,7 @@ void MemoryManager::Write(uint16_t addr, uint8_t value, MemoryOperationType oper { if(_console->DebugProcessRamOperation(operationType, addr, value)) { _ramWriteHandlers[addr]->WriteRAM(addr, value); - if ((addr == 0x4016) /*| (addr >= 0x401c && addr <= 0x401f)*/) { + if (addr == 0x4016) { _ramWriteHandlers[0xE000]->WriteRAM(addr, value); } } @@ -165,6 +165,7 @@ uint32_t MemoryManager::ToAbsolutePrgAddress(uint16_t ramAddr) void MemoryManager::StreamState(bool saving) { + (void)saving; ArrayInfo internalRam = { _internalRAM, MemoryManager::InternalRAMSize }; Stream(internalRam); } diff --git a/Core/PartyTap.h b/Core/PartyTap.h index 29d70a7c..d69df460 100644 --- a/Core/PartyTap.h +++ b/Core/PartyTap.h @@ -58,16 +58,17 @@ public: { _readCount = 0; _stateBuffer = - IsPressed(PartyTap::Buttons::B1) ? 1 : 0 | - IsPressed(PartyTap::Buttons::B2) ? 2 : 0 | - IsPressed(PartyTap::Buttons::B3) ? 4 : 0 | - IsPressed(PartyTap::Buttons::B4) ? 8 : 0 | - IsPressed(PartyTap::Buttons::B5) ? 16 : 0 | - IsPressed(PartyTap::Buttons::B6) ? 32 : 0; + (IsPressed(PartyTap::Buttons::B1) ? 1 : 0) | + (IsPressed(PartyTap::Buttons::B2) ? 2 : 0) | + (IsPressed(PartyTap::Buttons::B3) ? 4 : 0) | + (IsPressed(PartyTap::Buttons::B4) ? 8 : 0) | + (IsPressed(PartyTap::Buttons::B5) ? 16 : 0) | + (IsPressed(PartyTap::Buttons::B6) ? 32 : 0); } void WriteRAM(uint16_t addr, uint8_t value) override { + (void)addr; StrobeProcessWrite(value); } -}; \ No newline at end of file +}; diff --git a/Core/Sunsoft4.h b/Core/Sunsoft4.h index 69112fde..4982d2e2 100644 --- a/Core/Sunsoft4.h +++ b/Core/Sunsoft4.h @@ -63,7 +63,6 @@ protected: void UpdateState() { - MemoryAccessType access = _prgRamEnabled ? MemoryAccessType::ReadWrite : MemoryAccessType::NoAccess; SetCpuMemoryMapping(0x6000, 0x7FFF, 0, HasBattery() ? PrgMemoryType::SaveRam : PrgMemoryType::WorkRam); if(_usingExternalRom) { @@ -136,4 +135,4 @@ protected: break; } } -}; \ No newline at end of file +}; diff --git a/Lua/lundump.c b/Lua/lundump.c index 4080af9c..414e3777 100644 --- a/Lua/lundump.c +++ b/Lua/lundump.c @@ -234,7 +234,7 @@ static void fchecksize (LoadState *S, size_t size, const char *tname) { #define checksize(S,t) fchecksize(S,sizeof(t),#t) static void checkHeader (LoadState *S) { - checkliteral(S, LUA_SIGNATURE + 1, "not a"); /* 1st char already checked */ + checkliteral(S, &LUA_SIGNATURE[1], "not a"); /* 1st char already checked */ if (LoadByte(S) != LUAC_VERSION) error(S, "version mismatch in"); if (LoadByte(S) != LUAC_FORMAT)