diff --git a/cmake/BuildParameters.cmake b/cmake/BuildParameters.cmake index 35a12753a..e5699ef60 100644 --- a/cmake/BuildParameters.cmake +++ b/cmake/BuildParameters.cmake @@ -306,9 +306,8 @@ set(HARDENING_FLAG "-D_FORTIFY_SOURCE=2 -Wformat -Wformat-security") # -Wno-missing-field-initializers: standard allow to init only the begin of struct/array in static init. Just a silly warning. # Note: future GCC (aka GCC 5.1.1) has less false positive so warning could maybe put back # -Wno-unused-function: warn for function not used in release build -# -Wno-unused-variable: just annoying to manage different level of logging, a couple of extra var won't kill any serious compiler. # -Wno-unused-value: lots of warning for this kind of statements "0 && ...". There are used to disable some parts of code in release/dev build. -set(DEFAULT_WARNINGS "-Wall -Wextra -Wno-attributes -Wno-unused-function -Wno-unused-parameter -Wno-unused-variable -Wno-missing-field-initializers ") +set(DEFAULT_WARNINGS "-Wall -Wextra -Wno-attributes -Wno-unused-function -Wno-unused-parameter -Wno-missing-field-initializers ") if (NOT USE_ICC) set(DEFAULT_WARNINGS "${DEFAULT_WARNINGS} -Wno-unused-value ") endif() diff --git a/pcsx2/DebugTools/DisassemblyManager.cpp b/pcsx2/DebugTools/DisassemblyManager.cpp index d48c76804..b83a82bc0 100644 --- a/pcsx2/DebugTools/DisassemblyManager.cpp +++ b/pcsx2/DebugTools/DisassemblyManager.cpp @@ -293,7 +293,6 @@ u32 DisassemblyManager::getNthPreviousAddress(u32 address, int n) { DisassemblyEntry* entry = it->second; int oldLineNum = entry->getLineNum(address,true); - int oldNumLines = entry->getNumLines(); if (n <= oldLineNum) { return entry->getLineAddress(oldLineNum-n); @@ -388,7 +387,6 @@ int DisassemblyFunction::getLineNum(u32 address, bool findStart) int last = (int)lineAddresses.size() - 1; for (int i = 0; i < last; i++) { - u32 next = lineAddresses[i + 1]; if (lineAddresses[i] == address) return i; } diff --git a/pcsx2/DebugTools/MipsAssembler.cpp b/pcsx2/DebugTools/MipsAssembler.cpp index ffcc5ed96..53848567f 100644 --- a/pcsx2/DebugTools/MipsAssembler.cpp +++ b/pcsx2/DebugTools/MipsAssembler.cpp @@ -463,8 +463,7 @@ bool CMipsInstruction::parseOpcode(const tMipsOpcode& SourceOpcode, const char* bool CMipsInstruction::LoadEncoding(const tMipsOpcode& SourceOpcode, const char* Line) { int RetLen; - bool Immediate = false; - + immediateType = MIPS_NOIMMEDIATE; registers.reset(); @@ -477,7 +476,6 @@ bool CMipsInstruction::LoadEncoding(const tMipsOpcode& SourceOpcode, const char* } const char* SourceEncoding = SourceOpcode.encoding; - const char* OriginalLine = Line; while (*Line == ' ' || *Line == '\t') Line++; diff --git a/pcsx2/DebugTools/MipsStackWalk.cpp b/pcsx2/DebugTools/MipsStackWalk.cpp index 6eea5cd5d..46b379bff 100644 --- a/pcsx2/DebugTools/MipsStackWalk.cpp +++ b/pcsx2/DebugTools/MipsStackWalk.cpp @@ -52,7 +52,6 @@ namespace MipsStackWalk { bool IsSWInstr(const R5900::OPCODE& op) { if ((op.flags & IS_MEMORY) && (op.flags & IS_STORE)) { - u32 type = op.flags & MEMTYPE_MASK; switch (op.flags & MEMTYPE_MASK) { case MEMTYPE_WORD: diff --git a/pcsx2/Gif_Unit.h b/pcsx2/Gif_Unit.h index 534f7054f..9b57b9934 100644 --- a/pcsx2/Gif_Unit.h +++ b/pcsx2/Gif_Unit.h @@ -662,6 +662,8 @@ struct Gif_Unit { void PrintInfo(bool printP1=1, bool printP2=1, bool printP3=1) { u32 a = checkPaths(1,1,1), b = checkQueued(1,1,1); + (void)a; // Don't warn about unused variable + (void)b; GUNIT_LOG("Gif Unit - LastTransfer = %s, Paths = [%d,%d,%d], Queued = [%d,%d,%d]", Gif_TransferStr[(lastTranType>>8)&0xf], !!(a&1),!!(a&2),!!(a&4),!!(b&1),!!(b&2),!!(b&4)); diff --git a/pcsx2/Linux/LnxFlatFileReader.cpp b/pcsx2/Linux/LnxFlatFileReader.cpp index b04dac60b..33b145659 100644 --- a/pcsx2/Linux/LnxFlatFileReader.cpp +++ b/pcsx2/Linux/LnxFlatFileReader.cpp @@ -62,8 +62,6 @@ void FlatFileReader::BeginRead(void* pBuffer, uint sector, uint count) int FlatFileReader::FinishRead(void) { - u32 bytes; - int min_nr = 1; int max_nr = 1; struct io_event events[max_nr]; diff --git a/pcsx2/Sio.cpp b/pcsx2/Sio.cpp index c55c1fd35..a477b98ff 100644 --- a/pcsx2/Sio.cpp +++ b/pcsx2/Sio.cpp @@ -456,7 +456,7 @@ SIO_WRITE memcardWrite(u8 data) SIO_WRITE memcardRead(u8 data) { - static u8 checksum_pos = 0; + //static u8 checksum_pos = 0; static u8 transfer_size = 0; static bool once = false; diff --git a/pcsx2/Vif_Codes.cpp b/pcsx2/Vif_Codes.cpp index 281c52ef5..33981b10a 100644 --- a/pcsx2/Vif_Codes.cpp +++ b/pcsx2/Vif_Codes.cpp @@ -182,7 +182,7 @@ vifOp(vifCode_DirectHL) { vifOp(vifCode_Flush) { vif1Only(); - vifStruct& vifX = GetVifX; + //vifStruct& vifX = GetVifX; pass1or2 { bool p1or2 = (gifRegs.stat.APATH != 0 && gifRegs.stat.APATH != 3); vif1Regs.stat.VGW = false; @@ -204,7 +204,7 @@ vifOp(vifCode_Flush) { vifOp(vifCode_FlushA) { vif1Only(); - vifStruct& vifX = GetVifX; + //vifStruct& vifX = GetVifX; pass1or2 { //Gif_Path& p3 = gifUnit.gifPath[GIF_PATH_3]; u32 gifBusy = gifUnit.checkPaths(1,1,1) || (gifRegs.stat.APATH != 0); @@ -321,7 +321,6 @@ static __fi void _vifCode_MPG(int idx, u32 addr, const u32 *data, int size) { vifOp(vifCode_MPG) { vifStruct& vifX = GetVifX; pass1 { - bool bProgramExists = false; int vifNum = (u8)(vifXRegs.code >> 16); vifX.tag.addr = (u16)(vifXRegs.code << 3) & (idx ? 0x3fff : 0xfff); vifX.tag.size = vifNum ? (vifNum*2) : 512; diff --git a/pcsx2/gui/Debugger/CtrlDisassemblyView.cpp b/pcsx2/gui/Debugger/CtrlDisassemblyView.cpp index 287ac51fb..48ca2ba8c 100644 --- a/pcsx2/gui/Debugger/CtrlDisassemblyView.cpp +++ b/pcsx2/gui/Debugger/CtrlDisassemblyView.cpp @@ -493,10 +493,9 @@ void CtrlDisassemblyView::render(wxDC& dc) for (int i = 0; i < visibleRows+1; i++) { manager.getLine(address,displaySymbols,line); - + int rowY1 = rowHeight*i; - int rowY2 = rowHeight*(i+1); - + addressPositions[address] = rowY1; wxColor backgroundColor = wxColor(getBackgroundColor(address)); @@ -1227,7 +1226,7 @@ void CtrlDisassemblyView::copyInstructions(u32 startAddr, u32 endAddr, bool with int space = count * 32; char *temp = new char[space]; - char *p = temp, *end = temp + space; + char *p = temp; for (u32 pos = startAddr; pos < endAddr; pos += instructionSize) { p += sprintf(p, "%08X", cpu->read32(pos)); diff --git a/pcsx2/gui/Debugger/CtrlMemView.cpp b/pcsx2/gui/Debugger/CtrlMemView.cpp index a89ee38a0..86b86c0de 100644 --- a/pcsx2/gui/Debugger/CtrlMemView.cpp +++ b/pcsx2/gui/Debugger/CtrlMemView.cpp @@ -182,7 +182,6 @@ void CtrlMemView::render(wxDC& dc) const int TEMP_SIZE = 64; wchar_t temp[TEMP_SIZE]; - u32 byteGroupMask = ~(byteGroupSize - 1); bool validCpu = cpu && cpu->isAlive(); // not hexGroupPositionFromIndex(byteGroupSize), because we dont need space after last symbol; @@ -637,13 +636,10 @@ void CtrlMemView::updateStatusBarText() } void CtrlMemView::gotoAddress(u32 addr, bool pushInHistory) -{ +{ if (pushInHistory) history.push(windowStart); - int lines= GetClientSize().y / rowHeight; - u32 windowEnd = windowStart + lines * rowSize; - curAddress = addr; selectedNibble = 0; windowStart = curAddress; @@ -670,7 +666,6 @@ void CtrlMemView::gotoPoint(int x, int y) } else if (x >= hexStart) { int col = (x-hexStart); - int space = (charWidth / 4); int groupWidth = byteGroupSize * charWidth * 3; int group = col / groupWidth; diff --git a/pcsx2/gui/MemoryCardFolder.cpp b/pcsx2/gui/MemoryCardFolder.cpp index 6b72c5cfa..038a89fd8 100644 --- a/pcsx2/gui/MemoryCardFolder.cpp +++ b/pcsx2/gui/MemoryCardFolder.cpp @@ -314,8 +314,6 @@ bool FilterMatches( const wxString& fileName, const wxString& filter ) { bool FolderMemoryCard::AddFolder( MemoryCardFileEntry* const dirEntry, const wxString& dirPath, MemoryCardFileMetadataReference* parent, const bool enableFiltering, const wxString& filter ) { wxDir dir( dirPath ); if ( dir.IsOpened() ) { - const u32 dirStartCluster = dirEntry->entry.data.cluster; - wxString fileName; bool hasNext; @@ -751,10 +749,10 @@ bool FolderMemoryCard::ReadFromFile( u8 *dest, u32 adr, u32 dataLength ) { } s32 FolderMemoryCard::Read( u8 *dest, u32 adr, int size ) { - const u32 block = adr / BlockSizeRaw; + //const u32 block = adr / BlockSizeRaw; const u32 page = adr / PageSizeRaw; const u32 offset = adr % PageSizeRaw; - const u32 cluster = adr / ClusterSizeRaw; + //const u32 cluster = adr / ClusterSizeRaw; const u32 end = offset + size; if ( end > PageSizeRaw ) { @@ -767,7 +765,6 @@ s32 FolderMemoryCard::Read( u8 *dest, u32 adr, int size ) { if ( offset < PageSize ) { // is trying to read (part of) an actual data block - const u32 dataOffset = 0; const u32 dataLength = std::min( (u32)size, (u32)( PageSize - offset ) ); // if we have a cache for this page, just load from that @@ -816,8 +813,8 @@ void FolderMemoryCard::ReadDataWithoutCache( u8* const dest, const u32 adr, cons } s32 FolderMemoryCard::Save( const u8 *src, u32 adr, int size ) { - const u32 block = adr / BlockSizeRaw; - const u32 cluster = adr / ClusterSizeRaw; + //const u32 block = adr / BlockSizeRaw; + //const u32 cluster = adr / ClusterSizeRaw; const u32 page = adr / PageSizeRaw; const u32 offset = adr % PageSizeRaw; const u32 end = offset + size; @@ -1126,9 +1123,9 @@ void FolderMemoryCard::RemoveUnchangedDataFromCache( const MemoryCardFileEntry* } s32 FolderMemoryCard::WriteWithoutCache( const u8 *src, u32 adr, int size ) { - const u32 block = adr / BlockSizeRaw; - const u32 cluster = adr / ClusterSizeRaw; - const u32 page = adr / PageSizeRaw; + //const u32 block = adr / BlockSizeRaw; + //const u32 cluster = adr / ClusterSizeRaw; + //const u32 page = adr / PageSizeRaw; const u32 offset = adr % PageSizeRaw; const u32 end = offset + size; diff --git a/pcsx2/gui/Panels/MemoryCardListPanel.cpp b/pcsx2/gui/Panels/MemoryCardListPanel.cpp index 306b09be6..1a94d0e3a 100644 --- a/pcsx2/gui/Panels/MemoryCardListPanel.cpp +++ b/pcsx2/gui/Panels/MemoryCardListPanel.cpp @@ -314,8 +314,6 @@ public: //if( !pxAssert( (src.Slot >= 0) && (dest.Slot >= 0) ) ) return wxDragNone; const wxDirName basepath( m_listview->GetMcdProvider().GetMcdPath() ); - bool result = true; - if( wxDragCopy == def ) { if( !m_listview->GetMcdProvider().UiDuplicateCard(src, dest) ) diff --git a/pcsx2/gui/Panels/VideoPanel.cpp b/pcsx2/gui/Panels/VideoPanel.cpp index 2a5d8470d..22895747a 100644 --- a/pcsx2/gui/Panels/VideoPanel.cpp +++ b/pcsx2/gui/Panels/VideoPanel.cpp @@ -101,7 +101,6 @@ void Panels::FramelimiterPanel::AppStatusEvent_OnSettingsApplied() void Panels::FramelimiterPanel::ApplyConfigToGui( AppConfig& configToApply, int flags ) { - const AppConfig::GSWindowOptions& appwin( configToApply.GSWindow ); const AppConfig::FramerateOptions& appfps( configToApply.Framerate ); const Pcsx2Config::GSOptions& gsconf( configToApply.EmuOptions.GS ); diff --git a/pcsx2/ps2/Iop/IopHwRead.cpp b/pcsx2/ps2/Iop/IopHwRead.cpp index fa5d51857..478ec1573 100644 --- a/pcsx2/ps2/Iop/IopHwRead.cpp +++ b/pcsx2/ps2/Iop/IopHwRead.cpp @@ -222,8 +222,6 @@ static __fi T _HwRead_16or32_Page1( u32 addr ) } else { - u32 sif2fifosize = sif2.fifo.size; - switch( masked_addr ) { // ------------------------------------------------------------------------ @@ -309,7 +307,7 @@ static __fi T _HwRead_16or32_Page1( u32 addr ) mcase(HW_PS1_GPU_STATUS) : //ret = psxHu32(addr); - /*if (sif2fifosize == 0x8) psxHu32(0x1f801814) &= ~(3 << 25); + /*if (sif2.fifo.size == 0x8) psxHu32(0x1f801814) &= ~(3 << 25); else psxHu32(0x1f801814) |= (3 << 25);*/ /*switch ((psxHu32(HW_PS1_GPU_STATUS) >> 29) & 0x3) { @@ -333,7 +331,7 @@ static __fi T _HwRead_16or32_Page1( u32 addr ) ret = psxHu32(addr); //Idle & Ready to recieve command. //psxHu32(addr) = psHu32(0x1000f300); #if PSX_EXTRALOGS - DevCon.Warning("GPU Status Read %x Sif fifo size %x", ret, sif2fifosize); + DevCon.Warning("GPU Status Read %x Sif fifo size %x", ret, sif2.fifo.size); #endif //ret = -1; // fake alive GPU :p break; diff --git a/pcsx2/x86/iR3000A.cpp b/pcsx2/x86/iR3000A.cpp index 346b43e64..65169553d 100644 --- a/pcsx2/x86/iR3000A.cpp +++ b/pcsx2/x86/iR3000A.cpp @@ -101,8 +101,6 @@ static u32 psxdump = 0; static void __fastcall iopRecRecompile( const u32 startpc ); -static u32 s_store_ebp, s_store_esp; - // Recompiled code buffer for EE recompiler dispatchers! static u8 __pagealigned iopRecDispatchers[__pagesize]; diff --git a/pcsx2/x86/ix86-32/iR5900-32.cpp b/pcsx2/x86/ix86-32/iR5900-32.cpp index 18486ee3d..bc0a0686b 100644 --- a/pcsx2/x86/ix86-32/iR5900-32.cpp +++ b/pcsx2/x86/ix86-32/iR5900-32.cpp @@ -318,8 +318,6 @@ static void __fastcall recRecompile( const u32 startpc ); static void __fastcall dyna_block_discard(u32 start,u32 sz); static void __fastcall dyna_page_reset(u32 start,u32 sz); -static u32 s_store_ebp, s_store_esp; - // Recompiled code buffer for EE recompiler dispatchers! static u8 __pagealigned eeRecDispatchers[__pagesize]; diff --git a/pcsx2/x86/microVU_Branch.inl b/pcsx2/x86/microVU_Branch.inl index fc334f221..cd50bb206 100644 --- a/pcsx2/x86/microVU_Branch.inl +++ b/pcsx2/x86/microVU_Branch.inl @@ -262,7 +262,6 @@ void normBranch(mV, microFlagCycles& mFC) { void condJumpProcessingEvil(mV, microFlagCycles& mFC, int JMPcc) { u32 bPC = iPC-1; // mVUcompile can modify iPC, mVUpBlock, and mVUregs so back them up - microBlock* pBlock = mVUpBlock; u32 badBranchAddr; iPC = bPC-2; setCode(); diff --git a/plugins/LilyPad/Linux/JoyEvdev.cpp b/plugins/LilyPad/Linux/JoyEvdev.cpp index 5a61b2c31..fb39d3769 100644 --- a/plugins/LilyPad/Linux/JoyEvdev.cpp +++ b/plugins/LilyPad/Linux/JoyEvdev.cpp @@ -187,7 +187,6 @@ void EnumJoystickEvdev() // Technically it must be done with udev but another lib for // avoid a loop is too much for me (even if udev is mandatory // so maybe later) - int found_devices = 0; std::string input_root("/dev/input/event"); for (int i = 0; i < 32; i++) { std::string dev = input_root + std::to_string(i);