Skip to content

Commit

Permalink
clang-tidy: Fix a few remaining warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
sa666666 committed Nov 17, 2023
1 parent c3b81d0 commit e057613
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 19 deletions.
2 changes: 1 addition & 1 deletion src/common/Bezel.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions src/common/FSNodeZIP.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}
}

Expand Down
3 changes: 1 addition & 2 deletions src/common/PJoystickHandler.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
11 changes: 7 additions & 4 deletions src/common/tv_filters/AtariNTSC.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/debugger/CartDebug.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Expand Down
8 changes: 5 additions & 3 deletions src/debugger/gui/PromptWidget.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Expand Down
2 changes: 2 additions & 0 deletions src/emucore/CartGL.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ bool CartridgeGL::checkSwitchBank(uInt16 address, uInt8)
case 0xc80:
control = true;
break;
default:
break; // satisfy compiler
}
if(slice >= 0)
{
Expand Down
3 changes: 2 additions & 1 deletion src/emucore/PlusROM.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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())
{
Expand Down
8 changes: 4 additions & 4 deletions src/emucore/Thumbulator.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions src/os/windows/OSystemWINDOWS.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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())
{
Expand All @@ -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
Expand Down

0 comments on commit e057613

Please sign in to comment.