Yet more fixes for warnings from cppcheck.

This commit is contained in:
Stephen Anthony 2018-08-28 17:00:00 -02:30
parent 7e4dc350f0
commit 0f8dc1f2bb
33 changed files with 36 additions and 36 deletions

View File

@ -37,7 +37,7 @@ using CheatList = vector<shared_ptr<Cheat>>;
class CheatManager
{
public:
CheatManager(OSystem& osystem);
explicit CheatManager(OSystem& osystem);
/**
Adds the specified cheat to an internal list.

View File

@ -67,7 +67,7 @@ class AudioSettings
AudioSettings();
AudioSettings(Settings* mySettings);
explicit AudioSettings(Settings* mySettings);
static void normalize(Settings& settings);

View File

@ -35,7 +35,7 @@ class EventHandlerSDL2 : public EventHandler
/**
Create a new SDL2 event handler object
*/
EventHandlerSDL2(OSystem& osystem);
explicit EventHandlerSDL2(OSystem& osystem);
virtual ~EventHandlerSDL2() = default;
private:
@ -57,7 +57,7 @@ class EventHandlerSDL2 : public EventHandler
class JoystickSDL2 : public PhysicalJoystick
{
public:
JoystickSDL2(int idx);
explicit JoystickSDL2(int idx);
virtual ~JoystickSDL2();
private:

View File

@ -43,7 +43,7 @@ class FilesystemNodeZIP : public AbstractFSNode
*
* @param path String with the path the new node should point to.
*/
FilesystemNodeZIP(const string& path);
explicit FilesystemNodeZIP(const string& path);
bool exists() const override { return _realNode && _realNode->exists(); }
const string& getName() const override { return _name; }

View File

@ -26,7 +26,7 @@ class FpsMeter
{
public:
FpsMeter(uInt32 queueSize);
explicit FpsMeter(uInt32 queueSize);
void reset(uInt32 garbageFrameLimit = 0);

View File

@ -40,7 +40,7 @@ class FrameBufferSDL2 : public FrameBuffer
/**
Creates a new SDL2 framebuffer
*/
FrameBufferSDL2(OSystem& osystem);
explicit FrameBufferSDL2(OSystem& osystem);
virtual ~FrameBufferSDL2();
//////////////////////////////////////////////////////////////////////

View File

@ -80,7 +80,7 @@ class MouseControl
int xid, yid;
string message;
MouseMode(const string& msg = "")
explicit MouseMode(const string& msg = "")
: xtype(Controller::Joystick),
ytype(Controller::Joystick),
xid(-1),

View File

@ -37,7 +37,7 @@ class Properties;
class PNGLibrary
{
public:
PNGLibrary(OSystem& osystem);
explicit PNGLibrary(OSystem& osystem);
/**
Read a PNG image from the specified file into a FBSurface structure,

View File

@ -37,7 +37,7 @@ class SoundNull : public Sound
Create a new sound object. The init method must be invoked before
using the object.
*/
SoundNull(OSystem& osystem) : Sound(osystem)
explicit SoundNull(OSystem& osystem) : Sound(osystem)
{
myOSystem.logMessage("Sound disabled.\n", 1);
}

View File

@ -43,7 +43,7 @@ class StateManager
/**
Create a new statemananger class.
*/
StateManager(OSystem& osystem);
explicit StateManager(OSystem& osystem);
~StateManager();
public:

View File

@ -34,7 +34,7 @@ class StringParser
@param str The string to split
*/
StringParser(const string& str)
explicit StringParser(const string& str)
{
istringstream buf(str);
string line;

View File

@ -24,7 +24,7 @@ class ConvolutionBuffer
{
public:
ConvolutionBuffer(uInt32 size);
explicit ConvolutionBuffer(uInt32 size);
void shift(float nextValue);

View File

@ -261,7 +261,7 @@ class FilesystemNode
private:
AbstractFSNodePtr _realNode;
FilesystemNode(AbstractFSNodePtr realNode);
explicit FilesystemNode(AbstractFSNodePtr realNode);
};

View File

@ -62,7 +62,7 @@ class M6502 : public Serializable
/**
Create a new 6502 microprocessor.
*/
M6502(const Settings& settings);
explicit M6502(const Settings& settings);
virtual ~M6502() = default;
public:

View File

@ -42,7 +42,7 @@ class PropertiesSet
/**
Create a properties set object from the specified properties file.
*/
PropertiesSet(const string& propsfile);
explicit PropertiesSet(const string& propsfile);
public:
/**

View File

@ -34,7 +34,7 @@ class Random : public Serializable
/**
Create a new random number generator
*/
Random(uInt32 seed) { initSeed(seed); }
explicit Random(uInt32 seed) { initSeed(seed); }
/**
Re-initialize the random number generator with a new seed,

View File

@ -36,7 +36,7 @@ class Settings
/**
Create a new settings abstract class
*/
Settings(OSystem& osystem);
explicit Settings(OSystem& osystem);
virtual ~Settings() = default;
public:

View File

@ -47,7 +47,7 @@ class TIASurface
/**
Creates a new TIASurface object
*/
TIASurface(OSystem& system);
explicit TIASurface(OSystem& system);
/**
Set the TIA object, which is needed for actually rendering the TIA image.

View File

@ -27,7 +27,7 @@ class Ball : public Serializable
{
public:
Ball(uInt32 collisionMask);
explicit Ball(uInt32 collisionMask);
public:

View File

@ -27,7 +27,7 @@ template<unsigned length, unsigned capacity>
class DelayQueueIteratorImpl : public DelayQueueIterator
{
public:
DelayQueueIteratorImpl(const DelayQueue<length, capacity>& delayQueue);
explicit DelayQueueIteratorImpl(const DelayQueue<length, capacity>& delayQueue);
public:

View File

@ -28,7 +28,7 @@ class Missile : public Serializable
{
public:
Missile(uInt32 collisionMask);
explicit Missile(uInt32 collisionMask);
public:

View File

@ -26,7 +26,7 @@ class TIA;
class Player : public Serializable
{
public:
Player(uInt32 collisionMask);
explicit Player(uInt32 collisionMask);
public:

View File

@ -26,7 +26,7 @@ class TIA;
class Playfield : public Serializable
{
public:
Playfield(uInt32 collisionMask);
explicit Playfield(uInt32 collisionMask);
public:

View File

@ -47,7 +47,7 @@ class CommandSender
// TODO - allow for multiple targets, i.e. store targets in a list
// and add methods addTarget/removeTarget.
public:
CommandSender(CommandReceiver* target)
explicit CommandSender(CommandReceiver* target)
: _target(target) { }
virtual ~CommandSender() = default;

View File

@ -34,7 +34,7 @@ class CommandMenu : public DialogContainer
/**
Create a new menu stack
*/
CommandMenu(OSystem& osystem);
explicit CommandMenu(OSystem& osystem);
virtual ~CommandMenu() = default;
private:

View File

@ -165,7 +165,7 @@ class Dialog : public GuiObject
Widget* widget;
WidgetArray list;
Focus(Widget* w = nullptr) : widget(w) { }
explicit Focus(Widget* w = nullptr) : widget(w) { }
virtual ~Focus() = default;
Focus(const Focus&) = default;
@ -178,7 +178,7 @@ class Dialog : public GuiObject
FocusList focus;
uInt32 currentTab;
TabFocus(TabWidget* w = nullptr) : widget(w), currentTab(0) { }
explicit TabFocus(TabWidget* w = nullptr) : widget(w), currentTab(0) { }
virtual ~TabFocus() = default;
TabFocus(const TabFocus&) = default;

View File

@ -46,7 +46,7 @@ class DialogContainer
/**
Create a new DialogContainer stack
*/
DialogContainer(OSystem& osystem);
explicit DialogContainer(OSystem& osystem);
virtual ~DialogContainer();
public:

View File

@ -55,7 +55,7 @@ namespace GUI {
class Font
{
public:
Font(const FontDesc& desc);
explicit Font(const FontDesc& desc);
const FontDesc& desc() const { return myFontDesc; }

View File

@ -36,7 +36,7 @@ class Launcher : public DialogContainer
/**
Create a new menu stack
*/
Launcher(OSystem& osystem);
explicit Launcher(OSystem& osystem);
virtual ~Launcher() = default;
/**

View File

@ -33,7 +33,7 @@ class Menu : public DialogContainer
/**
Create a new menu stack
*/
Menu(OSystem& osystem);
explicit Menu(OSystem& osystem);
virtual ~Menu() = default;
private:

View File

@ -38,7 +38,7 @@ struct Point
Point() : x(0), y(0) { }
Point(const Point& p) : x(p.x), y(p.y) { }
explicit Point(uInt32 x1, uInt32 y1) : x(x1), y(y1) { }
Point(const string& p) : x(0), y(0) {
explicit Point(const string& p) : x(0), y(0) {
char c = '\0';
istringstream buf(p);
buf >> x >> c >> y;
@ -63,7 +63,7 @@ struct Size
Size() : w(0), h(0) { }
Size(const Size& s) : w(s.w), h(s.h) { }
explicit Size(uInt32 w1, uInt32 h1) : w(w1), h(h1) { }
Size(const string& s) : w(0), h(0) {
explicit Size(const string& s) : w(0), h(0) {
char c = '\0';
istringstream buf(s);
buf >> w >> c >> h;

View File

@ -30,7 +30,7 @@ class OSystem;
class TimeMachine : public DialogContainer
{
public:
TimeMachine(OSystem& osystem);
explicit TimeMachine(OSystem& osystem);
virtual ~TimeMachine() = default;
/**

View File

@ -33,7 +33,7 @@ class SettingsUNIX : public Settings
/**
Create a new UNIX settings object
*/
SettingsUNIX(OSystem& osystem);
explicit SettingsUNIX(OSystem& osystem);
virtual ~SettingsUNIX() = default;
private: