clang-tidy: Fix a few remaining warnings.

This commit is contained in:
Stephen Anthony 2023-11-17 18:58:05 -03:30
parent c3b81d00ae
commit e05761311a
10 changed files with 27 additions and 19 deletions

View File

@ -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;

View File

@ -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";
}
}

View File

@ -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;
}

View File

@ -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([=] {
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);
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

View File

@ -1446,9 +1446,9 @@ string CartDebug::saveAccessFile(string path)
}
catch(...)
{
}
return DebuggerParser::red("failed to save access counters file");
}
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
string CartDebug::listConfig(int bank)

View File

@ -965,11 +965,13 @@ string PromptWidget::saveBuffer(const FSNode& file)
try {
if(file.write(out) > 0)
return "saved " + file.getShortPath() + " OK";
}
catch(...) { return "unable to save session"; }
else
return "unable to save session";
}
catch(...) {
return "unable to save session";
}
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void PromptWidget::clearScreen()

View File

@ -100,6 +100,8 @@ bool CartridgeGL::checkSwitchBank(uInt16 address, uInt8)
case 0xc80:
control = true;
break;
default:
break; // satisfy compiler
}
if(slice >= 0)
{

View File

@ -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())
{

View File

@ -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

View File

@ -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