diff --git a/src/common/Bezel.cxx b/src/common/Bezel.cxx index 22053bc13..2d0aa0789 100644 --- a/src/common/Bezel.cxx +++ b/src/common/Bezel.cxx @@ -127,7 +127,7 @@ bool Bezel::load() } } while(index != -1); } - catch(const runtime_error&) { } + catch(const runtime_error&) { cerr << "ERROR: Bezel load\n"; } } #else const bool show = false; diff --git a/src/common/FSNodeZIP.cxx b/src/common/FSNodeZIP.cxx index 086d88483..d4cd9ec0c 100644 --- a/src/common/FSNodeZIP.cxx +++ b/src/common/FSNodeZIP.cxx @@ -162,6 +162,7 @@ bool FSNodeZIP::exists() const catch(const runtime_error&) { // TODO: Actually present the error passed in back to the user + cerr << "ERROR: FSNodeZIP::exists()\n"; } } diff --git a/src/common/PJoystickHandler.cxx b/src/common/PJoystickHandler.cxx index c115dc3ee..c929c5852 100644 --- a/src/common/PJoystickHandler.cxx +++ b/src/common/PJoystickHandler.cxx @@ -208,9 +208,8 @@ bool PhysicalJoystickHandler::remove(int id) } catch(const std::out_of_range&) { - // fall through to indicate remove failed + return false; } - return false; } diff --git a/src/common/tv_filters/AtariNTSC.cxx b/src/common/tv_filters/AtariNTSC.cxx index af3c90047..56842b153 100644 --- a/src/common/tv_filters/AtariNTSC.cxx +++ b/src/common/tv_filters/AtariNTSC.cxx @@ -107,10 +107,13 @@ void AtariNTSC::render(const uInt8* atari_in, const uInt32 in_width, // Spawn the threads... for(uInt32 i = 0; i < myWorkerThreads; ++i) { - myThreads[i] = std::thread([=] { - rgb_in == nullptr ? - renderThread(atari_in, in_width, in_height, myTotalThreads, i+1, rgb_out, out_pitch) : - renderWithPhosphorThread(atari_in, in_width, in_height, myTotalThreads, i+1, rgb_in, rgb_out, out_pitch); + myThreads[i] = std::thread([=] // NOLINT (cppcoreguidelines-misleading-capture-default-by-value + { + rgb_in == nullptr ? + renderThread(atari_in, in_width, in_height, myTotalThreads, + i+1, rgb_out, out_pitch) : + renderWithPhosphorThread(atari_in, in_width, in_height, myTotalThreads, + i+1, rgb_in, rgb_out, out_pitch); }); } // Make the main thread busy too diff --git a/src/debugger/CartDebug.cxx b/src/debugger/CartDebug.cxx index c3f32fee7..6081172ae 100644 --- a/src/debugger/CartDebug.cxx +++ b/src/debugger/CartDebug.cxx @@ -1446,8 +1446,8 @@ string CartDebug::saveAccessFile(string path) } catch(...) { + return DebuggerParser::red("failed to save access counters file"); } - return DebuggerParser::red("failed to save access counters file"); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/debugger/gui/PromptWidget.cxx b/src/debugger/gui/PromptWidget.cxx index 0c2a8fff9..66d502fa1 100644 --- a/src/debugger/gui/PromptWidget.cxx +++ b/src/debugger/gui/PromptWidget.cxx @@ -965,10 +965,12 @@ string PromptWidget::saveBuffer(const FSNode& file) try { if(file.write(out) > 0) return "saved " + file.getShortPath() + " OK"; + else + return "unable to save session"; + } + catch(...) { + return "unable to save session"; } - catch(...) { return "unable to save session"; } - - return "unable to save session"; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/emucore/CartGL.cxx b/src/emucore/CartGL.cxx index a884f434a..68d6a92be 100644 --- a/src/emucore/CartGL.cxx +++ b/src/emucore/CartGL.cxx @@ -100,6 +100,8 @@ bool CartridgeGL::checkSwitchBank(uInt16 address, uInt8) case 0xc80: control = true; break; + default: + break; // satisfy compiler } if(slice >= 0) { diff --git a/src/emucore/PlusROM.cxx b/src/emucore/PlusROM.cxx index 1ee52d0cc..b59a48795 100644 --- a/src/emucore/PlusROM.cxx +++ b/src/emucore/PlusROM.cxx @@ -432,7 +432,8 @@ void PlusROM::send() // as the thread is running. Thus, the request can only be destructed once // the thread has finished, and we can safely evict it from the deque at // any time. - std::thread thread([=]() { + std::thread thread([=]() // NOLINT (cppcoreguidelines-misleading-capture-default-by-value) + { request->execute(); switch(request->getState()) { diff --git a/src/emucore/Thumbulator.cxx b/src/emucore/Thumbulator.cxx index d51650888..85331cf60 100644 --- a/src/emucore/Thumbulator.cxx +++ b/src/emucore/Thumbulator.cxx @@ -372,7 +372,7 @@ void Thumbulator::write16(uInt32 addr, uInt32 data) THUMB_STAT(_stats.writes) DO_DBUG(statusMsg << "write16(" << Base::HEX8 << addr << "," << Base::HEX8 << data << ")\n"); - switch(addr & 0xF0000000) + switch(addr & 0xF0000000) // NOLINT (missing default for UNSAFE_OPTIMIZATIONS) { case 0x40000000: //RAM #ifndef UNSAFE_OPTIMIZATIONS @@ -413,7 +413,7 @@ void Thumbulator::write32(uInt32 addr, uInt32 data) #endif DO_DBUG(statusMsg << "write32(" << Base::HEX8 << addr << "," << Base::HEX8 << data << ")\n"); - switch(addr & 0xF0000000) + switch(addr & 0xF0000000) // NOLINT (missing default for UNSAFE_OPTIMIZATIONS) { #ifndef UNSAFE_OPTIMIZATIONS case 0xF0000000: //halt @@ -626,7 +626,7 @@ uInt32 Thumbulator::read16(uInt32 addr) #endif THUMB_STAT(_stats.reads) - switch(addr & 0xF0000000) + switch(addr & 0xF0000000) // NOLINT (missing default for UNSAFE_OPTIMIZATIONS) { case 0x00000000: //ROM #ifndef UNSAFE_OPTIMIZATIONS @@ -676,7 +676,7 @@ uInt32 Thumbulator::read32(uInt32 addr) #endif uInt32 data = 0; - switch(addr & 0xF0000000) + switch(addr & 0xF0000000) // NOLINT (missing default for UNSAFE_OPTIMIZATIONS) { case 0x00000000: //ROM #ifndef UNSAFE_OPTIMIZATIONS diff --git a/src/os/windows/OSystemWINDOWS.cxx b/src/os/windows/OSystemWINDOWS.cxx index 4c2044897..162d8c036 100644 --- a/src/os/windows/OSystemWINDOWS.cxx +++ b/src/os/windows/OSystemWINDOWS.cxx @@ -25,8 +25,8 @@ void OSystemWINDOWS::getBaseDirectories(string& basedir, string& homedir, bool useappdir, string_view usedir) { - HomeFinder homefinder; - FSNode appdata(homefinder.getAppDataPath()); + const HomeFinder homefinder; + const FSNode appdata(homefinder.getAppDataPath()); if(appdata.isDirectory()) { @@ -36,7 +36,7 @@ void OSystemWINDOWS::getBaseDirectories(string& basedir, string& homedir, basedir += "Stella\\"; } - FSNode defaultHomeDir(homefinder.getDesktopPath()); + const FSNode defaultHomeDir(homefinder.getDesktopPath()); homedir = defaultHomeDir.getShortPath(); // Check to see if basedir overrides are active