Minor updates for suggestions from clang.

This commit is contained in:
Stephen Anthony 2018-12-04 20:40:50 -03:30
parent 540e0fb0b3
commit 26faaa8cce
7 changed files with 14 additions and 8 deletions

View File

@ -63,6 +63,10 @@
* Fixed bug in autodetecting Genesis controllers. * Fixed bug in autodetecting Genesis controllers.
* Fixed bug with 'thumb.trapfatal' commandline argument; sometimes Stella
would lock up when encountering a fatal error instead of entering the
debugger and displaying a message.
* Fixed bug in reading from settings file with entries that were empty; * Fixed bug in reading from settings file with entries that were empty;
the parsing was failing. This affected the 'cpurandom' argument; when the parsing was failing. This affected the 'cpurandom' argument; when
all options in it were turned off, they were all turned on again during all options in it were turned off, they were all turned on again during

View File

@ -20,7 +20,8 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ThreadDebuggingHelper::ThreadDebuggingHelper() ThreadDebuggingHelper::ThreadDebuggingHelper()
: myMainThreadIdConfigured(false) : myMainThreadIdConfigured(false)
{} {
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ThreadDebuggingHelper& ThreadDebuggingHelper::instance() ThreadDebuggingHelper& ThreadDebuggingHelper::instance()

View File

@ -46,7 +46,7 @@ class ThreadDebuggingHelper {
private: private:
void fail(const string& message); [[noreturn]] void fail(const string& message);
ThreadDebuggingHelper(); ThreadDebuggingHelper();

View File

@ -312,7 +312,6 @@ bool CartridgeCTY::save(Serializer& out) const
out.putIntArray(myMusicCounters, 3); out.putIntArray(myMusicCounters, 3);
out.putIntArray(myMusicFrequencies, 3); out.putIntArray(myMusicFrequencies, 3);
out.putLong(myFrequencyImage - myTuneData); out.putLong(myFrequencyImage - myTuneData);
} }
catch(...) catch(...)
{ {

View File

@ -1225,7 +1225,8 @@ void EventHandler::setState(EventHandlerState state)
// after a state change, which should be supressed // after a state change, which should be supressed
mySkipMouseMotion = true; mySkipMouseMotion = true;
// Erase and pending events // Erase any previously set events, since a state change implies
// that old events are now invalid
myEvent.clear(); myEvent.clear();
} }

View File

@ -20,10 +20,11 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FatalEmulationError::FatalEmulationError(const string& message) FatalEmulationError::FatalEmulationError(const string& message)
: myMessage(message) : myMessage(message)
{} {
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
const char* FatalEmulationError::what() const throw() const char* FatalEmulationError::what() const noexcept
{ {
return myMessage.c_str(); return myMessage.c_str();
} }

View File

@ -26,9 +26,9 @@ class FatalEmulationError: public std::exception {
FatalEmulationError(const string& message); FatalEmulationError(const string& message);
virtual const char* what() const throw(); virtual const char* what() const noexcept;
static void raise(const string& message); [[noreturn]] static void raise(const string& message);
private: private: