Cppcheck: Fix issues related to explicit constructors

This commit is contained in:
heckflosse 2016-10-03 00:54:02 +02:00
parent ccd9002c3a
commit 3552fd4161
41 changed files with 45 additions and 45 deletions

View File

@ -37,7 +37,7 @@ public:
{ {
stopped = false; stopped = false;
} }
StopWatch( const char* msg) explicit StopWatch( const char* msg )
{ {
message = msg; message = msg;
start(); start();

View File

@ -143,7 +143,7 @@ private:
size_t size; size_t size;
public: public:
AlignedBufferMP(size_t sizeP) explicit AlignedBufferMP(size_t sizeP)
{ {
size = sizeP; size = sizeP;
} }

View File

@ -53,7 +53,7 @@ private:
public: public:
ColorTemp () : temp(-1.), green(-1.), equal (1.), method("Custom") {} ColorTemp () : temp(-1.), green(-1.), equal (1.), method("Custom") {}
ColorTemp (double e) : temp(-1.), green(-1.), equal (e), method("Custom") {} explicit ColorTemp (double e) : temp(-1.), green(-1.), equal (e), method("Custom") {}
ColorTemp (double t, double g, double e, const Glib::ustring &m); ColorTemp (double t, double g, double e, const Glib::ustring &m);
ColorTemp (double mulr, double mulg, double mulb, double e); ColorTemp (double mulr, double mulg, double mulb, double e);

View File

@ -35,7 +35,7 @@ struct Coord
Coord () = default; Coord () = default;
Coord (const int x, const int y); Coord (const int x, const int y);
Coord (const Coord& other) = default; Coord (const Coord& other) = default;
Coord (const PolarCoord& other); explicit Coord (const PolarCoord& other);
Coord& operator= (const Coord& other) = default; Coord& operator= (const Coord& other) = default;
Coord& operator= (const PolarCoord& other); Coord& operator= (const PolarCoord& other);
@ -66,7 +66,7 @@ struct PolarCoord
PolarCoord () = default; PolarCoord () = default;
PolarCoord (const double radius, const double angle); PolarCoord (const double radius, const double angle);
PolarCoord (const PolarCoord& other) = default; PolarCoord (const PolarCoord& other) = default;
PolarCoord (const Coord& other); explicit PolarCoord (const Coord& other);
PolarCoord& operator= (const PolarCoord& other) = default; PolarCoord& operator= (const PolarCoord& other) = default;
PolarCoord& operator= (const Coord& other); PolarCoord& operator= (const Coord& other);

View File

@ -63,7 +63,7 @@ public:
using Triple = std::array<double, 3>; using Triple = std::array<double, 3>;
using Matrix = std::array<Triple, 3>; using Matrix = std::array<Triple, 3>;
DCPProfile(const Glib::ustring& filename); explicit DCPProfile(const Glib::ustring& filename);
~DCPProfile(); ~DCPProfile();
explicit operator bool() const; explicit operator bool() const;

View File

@ -43,8 +43,8 @@ public:
ProfileContent (const ProfileContent& other); ProfileContent (const ProfileContent& other);
ProfileContent& operator= (const rtengine::ProfileContent& other); ProfileContent& operator= (const rtengine::ProfileContent& other);
ProfileContent (const Glib::ustring& fileName); explicit ProfileContent (const Glib::ustring& fileName);
ProfileContent (cmsHPROFILE hProfile); explicit ProfileContent (cmsHPROFILE hProfile);
cmsHPROFILE toProfile () const; cmsHPROFILE toProfile () const;
}; };

View File

@ -89,7 +89,7 @@ public:
static const int MaxPersModelCount = 3000; static const int MaxPersModelCount = 3000;
LCPPersModel* aPersModel[MaxPersModelCount]; // Do NOT use std::list or something, it's buggy in GCC! LCPPersModel* aPersModel[MaxPersModelCount]; // Do NOT use std::list or something, it's buggy in GCC!
LCPProfile(Glib::ustring fname); explicit LCPProfile(Glib::ustring fname);
void calcParams(int mode, float focalLength, float focusDist, float aperture, LCPModelCommon *pCorr1, LCPModelCommon *pCorr2, LCPModelCommon *pCorr3) const; // Interpolates between the persModels frames void calcParams(int mode, float focalLength, float focusDist, float aperture, LCPModelCommon *pCorr1, LCPModelCommon *pCorr2, LCPModelCommon *pCorr3) const; // Interpolates between the persModels frames

View File

@ -50,7 +50,7 @@ protected:
void flush(); void flush();
public: public:
PipetteBuffer(::EditDataProvider *dataProvider); explicit PipetteBuffer(::EditDataProvider *dataProvider);
~PipetteBuffer(); ~PipetteBuffer();
/** @brief Getter to know if the pipette buffer is correctly filled */ /** @brief Getter to know if the pipette buffer is correctly filled */

View File

@ -102,7 +102,7 @@ class RawImage: public DCraw
{ {
public: public:
RawImage( const Glib::ustring &name ); explicit RawImage( const Glib::ustring &name );
~RawImage(); ~RawImage();
int loadRaw (bool loadData = true, bool closeFile = true, ProgressListener *plistener = 0, double progressRange = 1.0); int loadRaw (bool loadData = true, bool closeFile = true, ProgressListener *plistener = 0, double progressRange = 1.0);

View File

@ -68,7 +68,7 @@ protected:
void notifyListener (bool queueEmptied); void notifyListener (bool queueEmptied);
public: public:
BatchQueue (FileCatalog* aFileCatalog); explicit BatchQueue (FileCatalog* aFileCatalog);
~BatchQueue (); ~BatchQueue ();
void addEntries (const std::vector<BatchQueueEntry*>& entries, bool head = false, bool save = true); void addEntries (const std::vector<BatchQueueEntry*>& entries, bool head = false, bool save = true);

View File

@ -33,7 +33,7 @@ public:
static Cairo::RefPtr<Cairo::ImageSurface> headIcon; static Cairo::RefPtr<Cairo::ImageSurface> headIcon;
static Cairo::RefPtr<Cairo::ImageSurface> tailIcon; static Cairo::RefPtr<Cairo::ImageSurface> tailIcon;
BatchQueueButtonSet (BatchQueueEntry* myEntry); explicit BatchQueueButtonSet (BatchQueueEntry* myEntry);
}; };
#endif #endif

View File

@ -55,7 +55,7 @@ class BatchQueuePanel : public Gtk::VBox,
public: public:
BatchQueuePanel (FileCatalog* aFileCatalog); explicit BatchQueuePanel (FileCatalog* aFileCatalog);
void setParent (RTWindow* p) void setParent (RTWindow* p)
{ {

View File

@ -48,7 +48,7 @@ protected:
public: public:
BatchToolPanelCoordinator (FilePanel* parent); explicit BatchToolPanelCoordinator (FilePanel* parent);
// FileSelectionChangeListener interface // FileSelectionChangeListener interface
void selectionChanged (const std::vector<Thumbnail*>& selected); void selectionChanged (const std::vector<Thumbnail*>& selected);

View File

@ -37,7 +37,7 @@ protected:
std::vector<GradientMilestone> bgGradient; std::vector<GradientMilestone> bgGradient;
public: public:
ColoredBar (eRTOrientation orient); explicit ColoredBar (eRTOrientation orient);
void expose(Glib::RefPtr<Gdk::Window> destWindow); void expose(Glib::RefPtr<Gdk::Window> destWindow);
void expose(Cairo::RefPtr<Cairo::ImageSurface> destSurface); void expose(Cairo::RefPtr<Cairo::ImageSurface> destSurface);

View File

@ -154,7 +154,7 @@ protected:
* This variable will be updated with actions in the * This variable will be updated with actions in the
* dialogs. * dialogs.
*/ */
CurveEditorSubGroup(Glib::ustring& curveDir); explicit CurveEditorSubGroup(Glib::ustring& curveDir);
Glib::ustring outputFile (); Glib::ustring outputFile ();
Glib::ustring inputFile (); Glib::ustring inputFile ();

View File

@ -463,7 +463,7 @@ protected:
} action; /// object mode only, ignored in Pipette mode } action; /// object mode only, ignored in Pipette mode
public: public:
EditSubscriber (EditType editType); explicit EditSubscriber (EditType editType);
virtual ~EditSubscriber () {} virtual ~EditSubscriber () {}
void setEditProvider(EditDataProvider *provider); void setEditProvider(EditDataProvider *provider);

View File

@ -138,7 +138,7 @@ protected:
public: public:
EditorPanel (FilePanel* filePanel = NULL); explicit EditorPanel (FilePanel* filePanel = NULL);
virtual ~EditorPanel (); virtual ~EditorPanel ();
void open (Thumbnail* tmb, rtengine::InitialImage* isrc); void open (Thumbnail* tmb, rtengine::InitialImage* isrc);

View File

@ -37,7 +37,7 @@ EditWindow* EditWindow::getInstance(RTWindow* p)
{ {
EditWindow editWnd; EditWindow editWnd;
EditWindowInstance(RTWindow* p) : editWnd(p) explicit EditWindowInstance(RTWindow* p) : editWnd(p)
{ {
// Determine the other display and maximize the window on that // Determine the other display and maximize the window on that
const Glib::RefPtr< Gdk::Window >& wnd = p->get_window(); const Glib::RefPtr< Gdk::Window >& wnd = p->get_window();

View File

@ -42,7 +42,7 @@ public:
// Should only be created once, auto-creates window on correct display // Should only be created once, auto-creates window on correct display
static EditWindow* getInstance(RTWindow* p); static EditWindow* getInstance(RTWindow* p);
EditWindow (RTWindow* p); explicit EditWindow (RTWindow* p);
void addEditorPanel (EditorPanel* ep, const std::string &name); void addEditorPanel (EditorPanel* ep, const std::string &name);
void remEditorPanel (EditorPanel* ep); void remEditorPanel (EditorPanel* ep);

View File

@ -43,7 +43,7 @@ class DirEntry
public: public:
Glib::ustring fullName; Glib::ustring fullName;
DirEntry (const Glib::ustring& n) : fullName (n) {} explicit DirEntry (const Glib::ustring& n) : fullName (n) {}
bool operator< (DirEntry& other) bool operator< (DirEntry& other)
{ {

View File

@ -44,7 +44,7 @@ public:
static Cairo::RefPtr<Cairo::ImageSurface> colorLabelIcon_4; static Cairo::RefPtr<Cairo::ImageSurface> colorLabelIcon_4;
static Cairo::RefPtr<Cairo::ImageSurface> colorLabelIcon_5; static Cairo::RefPtr<Cairo::ImageSurface> colorLabelIcon_5;
FileThumbnailButtonSet (FileBrowserEntry* myEntry); explicit FileThumbnailButtonSet (FileBrowserEntry* myEntry);
void setRank (int stars); void setRank (int stars);
void setColorLabel (int colorlabel); void setColorLabel (int colorlabel);
void setInTrash (bool inTrash); void setInTrash (bool inTrash);

View File

@ -79,7 +79,7 @@ public:
class ConnectionBlocker class ConnectionBlocker
{ {
public: public:
ConnectionBlocker (sigc::connection& connection) : connection (connection) explicit ConnectionBlocker (sigc::connection& connection) : connection (connection)
{ {
wasBlocked = connection.block(); wasBlocked = connection.block();
} }
@ -101,7 +101,7 @@ private:
Gtk::Container *pC; Gtk::Container *pC;
public: public:
ExpanderBox( Gtk::Container *p); explicit ExpanderBox( Gtk::Container *p);
~ExpanderBox( ) ~ExpanderBox( )
{ {
delete pC; delete pC;

View File

@ -144,7 +144,7 @@ protected:
public: public:
HistogramArea(FullModeListener *fml = NULL); explicit HistogramArea(FullModeListener *fml = NULL);
~HistogramArea(); ~HistogramArea();
void renderHistogram (); void renderHistogram ();

View File

@ -95,7 +95,7 @@ protected:
public: public:
History (bool bookmarkSupport = true); explicit History (bool bookmarkSupport = true);
void setProfileChangeListener (ProfileChangeListener* tpc_) void setProfileChangeListener (ProfileChangeListener* tpc_)
{ {

View File

@ -27,7 +27,7 @@ class ILabel : public Gtk::DrawingArea
Glib::ustring label; Glib::ustring label;
public: public:
ILabel (Glib::ustring lab); explicit ILabel (Glib::ustring lab);
bool on_expose_event(GdkEventExpose* event); bool on_expose_event(GdkEventExpose* event);
void on_realize(); void on_realize();
void on_style_changed (const Glib::RefPtr<Gtk::Style>& style); void on_style_changed (const Glib::RefPtr<Gtk::Style>& style);

View File

@ -70,7 +70,7 @@ public:
PreviewModePanel* previewModePanel; PreviewModePanel* previewModePanel;
ImageArea* iLinkedImageArea; // used to set a reference to the Before image area, which is set when before/after view is enabled ImageArea* iLinkedImageArea; // used to set a reference to the Before image area, which is set when before/after view is enabled
ImageArea (ImageAreaPanel* p); explicit ImageArea (ImageAreaPanel* p);
~ImageArea (); ~ImageArea ();
void setImProcCoordinator (rtengine::StagedImageProcessor* ipc_); void setImProcCoordinator (rtengine::StagedImageProcessor* ipc_);

View File

@ -30,7 +30,7 @@ protected:
ImageArea* imageArea; ImageArea* imageArea;
public: public:
IndicateClippedPanel (ImageArea* ia); explicit IndicateClippedPanel (ImageArea* ia);
void buttonToggled (); void buttonToggled ();

View File

@ -34,7 +34,7 @@ public:
int currTransform; // coarse rotation from RT, not from shot orientation int currTransform; // coarse rotation from RT, not from shot orientation
bool fromRaw; bool fromRaw;
InspectorBuffer(const Glib::ustring &imgagePath); explicit InspectorBuffer(const Glib::ustring &imgagePath);
//~InspectorBuffer(); //~InspectorBuffer();
}; };

View File

@ -783,7 +783,7 @@ public:
bool exif; bool exif;
bool iptc; bool iptc;
ParamsEdited (bool value = false); explicit ParamsEdited (bool value = false);
void set (bool v); void set (bool v);
void initFrom (const std::vector<rtengine::procparams::ProcParams>& src); void initFrom (const std::vector<rtengine::procparams::ProcParams>& src);

View File

@ -132,7 +132,7 @@ public:
sigc::connection raw_caredConn, raw_cablueConn, raw_ca_autocorrectConn, raw_hotpix_filtConn, raw_deadpix_filtConn, raw_linenoiseConn, raw_greenthreshConn, raw_ccStepsConn, raw_methodConn, raw_dcb_iterationsConn, raw_lmmse_iterationsConn, raw_dcb_enhanceConn, raw_exposConn, raw_preserConn, raw_blackConn; sigc::connection raw_caredConn, raw_cablueConn, raw_ca_autocorrectConn, raw_hotpix_filtConn, raw_deadpix_filtConn, raw_linenoiseConn, raw_greenthreshConn, raw_ccStepsConn, raw_methodConn, raw_dcb_iterationsConn, raw_lmmse_iterationsConn, raw_dcb_enhanceConn, raw_exposConn, raw_preserConn, raw_blackConn;
public: public:
PartialPasteDlg (Glib::ustring title); explicit PartialPasteDlg (Glib::ustring title);
void applyPaste (rtengine::procparams::ProcParams* dstPP, ParamsEdited* dstPE, const rtengine::procparams::ProcParams* srcPP, const ParamsEdited* srcPE = NULL); void applyPaste (rtengine::procparams::ProcParams* dstPP, ParamsEdited* dstPE, const rtengine::procparams::ProcParams* srcPP, const ParamsEdited* srcPE = NULL);

View File

@ -28,7 +28,7 @@ class PopUpToggleButton : public Gtk::ToggleButton, public PopUpCommon
{ {
public: public:
PopUpToggleButton (const Glib::ustring& label = ""); explicit PopUpToggleButton (const Glib::ustring& label = "");
void show (); void show ();
void set_tooltip_text (const Glib::ustring &text); void set_tooltip_text (const Glib::ustring &text);
}; };

View File

@ -229,7 +229,7 @@ protected:
Gtk::Widget* getSoundPanel (); Gtk::Widget* getSoundPanel ();
public: public:
Preferences (RTWindow *rtwindow); explicit Preferences (RTWindow *rtwindow);
~Preferences (); ~Preferences ();
void savePressed (); void savePressed ();

View File

@ -47,7 +47,7 @@ protected:
Gtk::Image* iBC2, *igBC2; Gtk::Image* iBC2, *igBC2;
public: public:
PreviewModePanel (ImageArea* ia); explicit PreviewModePanel (ImageArea* ia);
~PreviewModePanel(); ~PreviewModePanel();
void toggleR (); void toggleR ();

View File

@ -69,7 +69,7 @@ protected:
public: public:
ProfilePanel (bool readOnly = false); explicit ProfilePanel (bool readOnly = false);
virtual ~ProfilePanel (); virtual ~ProfilePanel ();
void setProfileChangeListener (ProfileChangeListener* ppl) void setProfileChangeListener (ProfileChangeListener* ppl)

View File

@ -108,7 +108,7 @@ public:
* *
* @param entry Pointer to the ProfileStoreEntry object, be it a directory or a file * @param entry Pointer to the ProfileStoreEntry object, be it a directory or a file
*/ */
ProfileStoreLabel(const ProfileStoreEntry *entry); explicit ProfileStoreLabel(const ProfileStoreEntry *entry);
ProfileStoreLabel (const ProfileStoreLabel &other); ProfileStoreLabel (const ProfileStoreLabel &other);
}; };

View File

@ -32,7 +32,7 @@ class PLDBridge : public rtengine::ProgressListener
rtengine::ProgressListener* pl; rtengine::ProgressListener* pl;
public: public:
PLDBridge ( rtengine::ProgressListener* pb) explicit PLDBridge ( rtengine::ProgressListener* pb)
: pl(pb) {} : pl(pb) {}
// ProgressListener interface // ProgressListener interface

View File

@ -55,7 +55,7 @@ protected:
void fillTemplateList (); void fillTemplateList ();
public: public:
RenameDialog (Gtk::Window* parent); explicit RenameDialog (Gtk::Window* parent);
void initName (const Glib::ustring& iname, const CacheImageData* cid); void initName (const Glib::ustring& iname, const CacheImageData* cid);
Glib::ustring getNewName (); Glib::ustring getNewName ();
@ -79,7 +79,7 @@ protected:
void refreshTemplateList (); void refreshTemplateList ();
public: public:
RenameTemplateEditor (Gtk::Window* parent); explicit RenameTemplateEditor (Gtk::Window* parent);
Glib::ustring getSelectedTemplate (); Glib::ustring getSelectedTemplate ();

View File

@ -45,7 +45,7 @@ protected:
void putToQueueClicked (); void putToQueueClicked ();
public: public:
SaveAsDialog (Glib::ustring initialDir); explicit SaveAsDialog (Glib::ustring initialDir);
Glib::ustring getFileName (); Glib::ustring getFileName ();
Glib::ustring getDirectory (); Glib::ustring getDirectory ();

View File

@ -46,7 +46,7 @@ private:
public: public:
Splash (Gtk::Window& parent, int maxtime); Splash (Gtk::Window& parent, int maxtime);
Splash (Gtk::Window& parent); explicit Splash (Gtk::Window& parent);
bool hasReleaseNotes() bool hasReleaseNotes()
{ {

View File

@ -107,7 +107,7 @@ public:
bool updatepriority; bool updatepriority;
eWithFilename withFilename; eWithFilename withFilename;
ThumbBrowserEntryBase (const Glib::ustring& fname); explicit ThumbBrowserEntryBase (const Glib::ustring& fname);
virtual ~ThumbBrowserEntryBase (); virtual ~ThumbBrowserEntryBase ();
void setParent (ThumbBrowserBase* l) void setParent (ThumbBrowserBase* l)

View File

@ -38,7 +38,7 @@ protected:
public: public:
ZoomPanel (ImageArea* iarea); explicit ZoomPanel (ImageArea* iarea);
void zoomInClicked (); void zoomInClicked ();
void zoomOutClicked (); void zoomOutClicked ();