Commit d7e9cfc4 authored by Stephen Anthony's avatar Stephen Anthony
Browse files

Fix some warnings from cppcheck.

I'll admit that some of these suggestions are of dubious importance, but at least we shut up the tester :)
parent 521e5dc5
......@@ -22,12 +22,11 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CheetahCheat::CheetahCheat(OSystem& os, const string& name, const string& code)
: Cheat(os, name, code)
: Cheat(os, name, code),
address(0xf000 + unhex(code.substr(0, 3))),
value(uInt8(unhex(code.substr(3, 2)))),
count(uInt8(unhex(code.substr(5, 1)) + 1))
{
address = 0xf000 + unhex(code.substr(0, 3));
value = uInt8(unhex(code.substr(3, 2)));
count = uInt8(unhex(code.substr(5, 1)) + 1);
// Back up original data; we need this if the cheat is ever disabled
for(int i = 0; i < count; ++i)
savedRom[i] = myOSystem.console().cartridge().peek(address + i);
......
......@@ -24,10 +24,10 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
RamCheat::RamCheat(OSystem& os, const string& name, const string& code)
: Cheat(os, name, code)
: Cheat(os, name, code),
address(uInt16(unhex(myCode.substr(0, 2)))),
value(uInt8(unhex(myCode.substr(2, 2))))
{
address = uInt16(unhex(myCode.substr(0, 2)));
value = uInt8(unhex(myCode.substr(2, 2)));
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
......
......@@ -88,7 +88,7 @@ void StaggeredLogger::_log()
{
if (!myIsCurrentlyCollecting) startInterval();
myCurrentEventCount++;
++myCurrentEventCount;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
......@@ -116,7 +116,7 @@ void StaggeredLogger::increaseInterval()
{
if (myCurrentIntervalFactor >= myMaxIntervalFactor) return;
myCurrentIntervalFactor++;
++myCurrentIntervalFactor;
myCurrentIntervalSize *= 2;
}
......@@ -125,7 +125,7 @@ void StaggeredLogger::decreaseInterval()
{
if (myCurrentIntervalFactor <= 1) return;
myCurrentIntervalFactor--;
--myCurrentIntervalFactor;
myCurrentIntervalSize /= 2;
}
......
......@@ -23,7 +23,7 @@
class EmulationWarning : public std::exception
{
public:
EmulationWarning(const string& message) : myMessage(message) { }
explicit EmulationWarning(const string& message) : myMessage(message) { }
const char* what() const noexcept override { return myMessage.c_str(); }
......
......@@ -23,7 +23,7 @@
class FatalEmulationError : public std::exception
{
public:
FatalEmulationError(const string& message) : myMessage(message) { }
explicit FatalEmulationError(const string& message) : myMessage(message) { }
const char* what() const noexcept override { return myMessage.c_str(); }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment