From 3552fd4161a3de144914a4b6696eef4c98bd8ff8 Mon Sep 17 00:00:00 2001 From: heckflosse Date: Mon, 3 Oct 2016 00:54:02 +0200 Subject: [PATCH] Cppcheck: Fix issues related to explicit constructors --- rtengine/StopWatch.h | 2 +- rtengine/alignedbuffer.h | 2 +- rtengine/colortemp.h | 2 +- rtengine/coord.h | 4 ++-- rtengine/dcp.h | 2 +- rtengine/iccstore.h | 4 ++-- rtengine/lcp.h | 2 +- rtengine/pipettebuffer.h | 2 +- rtengine/rawimage.h | 2 +- rtgui/batchqueue.h | 2 +- rtgui/batchqueuebuttonset.h | 2 +- rtgui/batchqueuepanel.h | 2 +- rtgui/batchtoolpanelcoord.h | 2 +- rtgui/coloredbar.h | 2 +- rtgui/curveeditorgroup.h | 2 +- rtgui/edit.h | 2 +- rtgui/editorpanel.h | 2 +- rtgui/editwindow.cc | 2 +- rtgui/editwindow.h | 2 +- rtgui/filecatalog.h | 2 +- rtgui/filethumbnailbuttonset.h | 2 +- rtgui/guiutils.h | 4 ++-- rtgui/histogrampanel.h | 2 +- rtgui/history.h | 2 +- rtgui/ilabel.h | 2 +- rtgui/imagearea.h | 2 +- rtgui/indclippedpanel.h | 2 +- rtgui/inspector.h | 2 +- rtgui/paramsedited.h | 2 +- rtgui/partialpastedlg.h | 2 +- rtgui/popuptogglebutton.h | 2 +- rtgui/preferences.h | 2 +- rtgui/previewmodepanel.h | 2 +- rtgui/profilepanel.h | 2 +- rtgui/profilestore.h | 2 +- rtgui/progressconnector.h | 2 +- rtgui/renamedlg.h | 4 ++-- rtgui/saveasdlg.h | 2 +- rtgui/splash.h | 2 +- rtgui/thumbbrowserentrybase.h | 2 +- rtgui/zoompanel.h | 2 +- 41 files changed, 45 insertions(+), 45 deletions(-) diff --git a/rtengine/StopWatch.h b/rtengine/StopWatch.h index 2b3ff1baf..ac4a4d16c 100644 --- a/rtengine/StopWatch.h +++ b/rtengine/StopWatch.h @@ -37,7 +37,7 @@ public: { stopped = false; } - StopWatch( const char* msg) + explicit StopWatch( const char* msg ) { message = msg; start(); diff --git a/rtengine/alignedbuffer.h b/rtengine/alignedbuffer.h index ac8471b7e..fbbf83523 100644 --- a/rtengine/alignedbuffer.h +++ b/rtengine/alignedbuffer.h @@ -143,7 +143,7 @@ private: size_t size; public: - AlignedBufferMP(size_t sizeP) + explicit AlignedBufferMP(size_t sizeP) { size = sizeP; } diff --git a/rtengine/colortemp.h b/rtengine/colortemp.h index a1a805092..cd3e422e9 100644 --- a/rtengine/colortemp.h +++ b/rtengine/colortemp.h @@ -53,7 +53,7 @@ private: public: 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 mulr, double mulg, double mulb, double e); diff --git a/rtengine/coord.h b/rtengine/coord.h index 2242cec1e..8b6c0cf6a 100644 --- a/rtengine/coord.h +++ b/rtengine/coord.h @@ -35,7 +35,7 @@ struct Coord Coord () = default; Coord (const int x, const int y); Coord (const Coord& other) = default; - Coord (const PolarCoord& other); + explicit Coord (const PolarCoord& other); Coord& operator= (const Coord& other) = default; Coord& operator= (const PolarCoord& other); @@ -66,7 +66,7 @@ struct PolarCoord PolarCoord () = default; PolarCoord (const double radius, const double angle); PolarCoord (const PolarCoord& other) = default; - PolarCoord (const Coord& other); + explicit PolarCoord (const Coord& other); PolarCoord& operator= (const PolarCoord& other) = default; PolarCoord& operator= (const Coord& other); diff --git a/rtengine/dcp.h b/rtengine/dcp.h index 11e368b80..ffc1e33ce 100644 --- a/rtengine/dcp.h +++ b/rtengine/dcp.h @@ -63,7 +63,7 @@ public: using Triple = std::array; using Matrix = std::array; - DCPProfile(const Glib::ustring& filename); + explicit DCPProfile(const Glib::ustring& filename); ~DCPProfile(); explicit operator bool() const; diff --git a/rtengine/iccstore.h b/rtengine/iccstore.h index 8b6e6465c..05281f9df 100644 --- a/rtengine/iccstore.h +++ b/rtengine/iccstore.h @@ -43,8 +43,8 @@ public: ProfileContent (const ProfileContent& other); ProfileContent& operator= (const rtengine::ProfileContent& other); - ProfileContent (const Glib::ustring& fileName); - ProfileContent (cmsHPROFILE hProfile); + explicit ProfileContent (const Glib::ustring& fileName); + explicit ProfileContent (cmsHPROFILE hProfile); cmsHPROFILE toProfile () const; }; diff --git a/rtengine/lcp.h b/rtengine/lcp.h index fa60a6013..15d51d556 100644 --- a/rtengine/lcp.h +++ b/rtengine/lcp.h @@ -89,7 +89,7 @@ public: static const int MaxPersModelCount = 3000; 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 diff --git a/rtengine/pipettebuffer.h b/rtengine/pipettebuffer.h index e6db8eb68..139438e1d 100644 --- a/rtengine/pipettebuffer.h +++ b/rtengine/pipettebuffer.h @@ -50,7 +50,7 @@ protected: void flush(); public: - PipetteBuffer(::EditDataProvider *dataProvider); + explicit PipetteBuffer(::EditDataProvider *dataProvider); ~PipetteBuffer(); /** @brief Getter to know if the pipette buffer is correctly filled */ diff --git a/rtengine/rawimage.h b/rtengine/rawimage.h index efb2dacc4..26ddbfd1b 100644 --- a/rtengine/rawimage.h +++ b/rtengine/rawimage.h @@ -102,7 +102,7 @@ class RawImage: public DCraw { public: - RawImage( const Glib::ustring &name ); + explicit RawImage( const Glib::ustring &name ); ~RawImage(); int loadRaw (bool loadData = true, bool closeFile = true, ProgressListener *plistener = 0, double progressRange = 1.0); diff --git a/rtgui/batchqueue.h b/rtgui/batchqueue.h index 3bf3cb228..fad2b6a25 100644 --- a/rtgui/batchqueue.h +++ b/rtgui/batchqueue.h @@ -68,7 +68,7 @@ protected: void notifyListener (bool queueEmptied); public: - BatchQueue (FileCatalog* aFileCatalog); + explicit BatchQueue (FileCatalog* aFileCatalog); ~BatchQueue (); void addEntries (const std::vector& entries, bool head = false, bool save = true); diff --git a/rtgui/batchqueuebuttonset.h b/rtgui/batchqueuebuttonset.h index cb6ccda56..bef125bb6 100644 --- a/rtgui/batchqueuebuttonset.h +++ b/rtgui/batchqueuebuttonset.h @@ -33,7 +33,7 @@ public: static Cairo::RefPtr headIcon; static Cairo::RefPtr tailIcon; - BatchQueueButtonSet (BatchQueueEntry* myEntry); + explicit BatchQueueButtonSet (BatchQueueEntry* myEntry); }; #endif diff --git a/rtgui/batchqueuepanel.h b/rtgui/batchqueuepanel.h index 997514bef..675745b8a 100644 --- a/rtgui/batchqueuepanel.h +++ b/rtgui/batchqueuepanel.h @@ -55,7 +55,7 @@ class BatchQueuePanel : public Gtk::VBox, public: - BatchQueuePanel (FileCatalog* aFileCatalog); + explicit BatchQueuePanel (FileCatalog* aFileCatalog); void setParent (RTWindow* p) { diff --git a/rtgui/batchtoolpanelcoord.h b/rtgui/batchtoolpanelcoord.h index e064452b2..0c12aa311 100644 --- a/rtgui/batchtoolpanelcoord.h +++ b/rtgui/batchtoolpanelcoord.h @@ -48,7 +48,7 @@ protected: public: - BatchToolPanelCoordinator (FilePanel* parent); + explicit BatchToolPanelCoordinator (FilePanel* parent); // FileSelectionChangeListener interface void selectionChanged (const std::vector& selected); diff --git a/rtgui/coloredbar.h b/rtgui/coloredbar.h index 917085e3c..237cd8595 100644 --- a/rtgui/coloredbar.h +++ b/rtgui/coloredbar.h @@ -37,7 +37,7 @@ protected: std::vector bgGradient; public: - ColoredBar (eRTOrientation orient); + explicit ColoredBar (eRTOrientation orient); void expose(Glib::RefPtr destWindow); void expose(Cairo::RefPtr destSurface); diff --git a/rtgui/curveeditorgroup.h b/rtgui/curveeditorgroup.h index 09cbb8167..f4ca3e8ed 100644 --- a/rtgui/curveeditorgroup.h +++ b/rtgui/curveeditorgroup.h @@ -154,7 +154,7 @@ protected: * This variable will be updated with actions in the * dialogs. */ - CurveEditorSubGroup(Glib::ustring& curveDir); + explicit CurveEditorSubGroup(Glib::ustring& curveDir); Glib::ustring outputFile (); Glib::ustring inputFile (); diff --git a/rtgui/edit.h b/rtgui/edit.h index c49c45408..1ca3894b8 100644 --- a/rtgui/edit.h +++ b/rtgui/edit.h @@ -463,7 +463,7 @@ protected: } action; /// object mode only, ignored in Pipette mode public: - EditSubscriber (EditType editType); + explicit EditSubscriber (EditType editType); virtual ~EditSubscriber () {} void setEditProvider(EditDataProvider *provider); diff --git a/rtgui/editorpanel.h b/rtgui/editorpanel.h index e506e1583..09faca7d3 100644 --- a/rtgui/editorpanel.h +++ b/rtgui/editorpanel.h @@ -138,7 +138,7 @@ protected: public: - EditorPanel (FilePanel* filePanel = NULL); + explicit EditorPanel (FilePanel* filePanel = NULL); virtual ~EditorPanel (); void open (Thumbnail* tmb, rtengine::InitialImage* isrc); diff --git a/rtgui/editwindow.cc b/rtgui/editwindow.cc index 605e915af..3115d9c1f 100644 --- a/rtgui/editwindow.cc +++ b/rtgui/editwindow.cc @@ -37,7 +37,7 @@ EditWindow* EditWindow::getInstance(RTWindow* p) { EditWindow editWnd; - EditWindowInstance(RTWindow* p) : editWnd(p) + explicit EditWindowInstance(RTWindow* p) : editWnd(p) { // Determine the other display and maximize the window on that const Glib::RefPtr< Gdk::Window >& wnd = p->get_window(); diff --git a/rtgui/editwindow.h b/rtgui/editwindow.h index fa47de489..9315b0eb9 100644 --- a/rtgui/editwindow.h +++ b/rtgui/editwindow.h @@ -42,7 +42,7 @@ public: // Should only be created once, auto-creates window on correct display static EditWindow* getInstance(RTWindow* p); - EditWindow (RTWindow* p); + explicit EditWindow (RTWindow* p); void addEditorPanel (EditorPanel* ep, const std::string &name); void remEditorPanel (EditorPanel* ep); diff --git a/rtgui/filecatalog.h b/rtgui/filecatalog.h index b7ea1802f..eb23e65a6 100644 --- a/rtgui/filecatalog.h +++ b/rtgui/filecatalog.h @@ -43,7 +43,7 @@ class DirEntry public: Glib::ustring fullName; - DirEntry (const Glib::ustring& n) : fullName (n) {} + explicit DirEntry (const Glib::ustring& n) : fullName (n) {} bool operator< (DirEntry& other) { diff --git a/rtgui/filethumbnailbuttonset.h b/rtgui/filethumbnailbuttonset.h index b152c3853..a83bacf7b 100644 --- a/rtgui/filethumbnailbuttonset.h +++ b/rtgui/filethumbnailbuttonset.h @@ -44,7 +44,7 @@ public: static Cairo::RefPtr colorLabelIcon_4; static Cairo::RefPtr colorLabelIcon_5; - FileThumbnailButtonSet (FileBrowserEntry* myEntry); + explicit FileThumbnailButtonSet (FileBrowserEntry* myEntry); void setRank (int stars); void setColorLabel (int colorlabel); void setInTrash (bool inTrash); diff --git a/rtgui/guiutils.h b/rtgui/guiutils.h index f91bb0245..3e5f0dd0a 100644 --- a/rtgui/guiutils.h +++ b/rtgui/guiutils.h @@ -79,7 +79,7 @@ public: class ConnectionBlocker { public: - ConnectionBlocker (sigc::connection& connection) : connection (connection) + explicit ConnectionBlocker (sigc::connection& connection) : connection (connection) { wasBlocked = connection.block(); } @@ -101,7 +101,7 @@ private: Gtk::Container *pC; public: - ExpanderBox( Gtk::Container *p); + explicit ExpanderBox( Gtk::Container *p); ~ExpanderBox( ) { delete pC; diff --git a/rtgui/histogrampanel.h b/rtgui/histogrampanel.h index 16a0747e3..60cb1a444 100644 --- a/rtgui/histogrampanel.h +++ b/rtgui/histogrampanel.h @@ -144,7 +144,7 @@ protected: public: - HistogramArea(FullModeListener *fml = NULL); + explicit HistogramArea(FullModeListener *fml = NULL); ~HistogramArea(); void renderHistogram (); diff --git a/rtgui/history.h b/rtgui/history.h index 760444b5f..23a7c30ae 100644 --- a/rtgui/history.h +++ b/rtgui/history.h @@ -95,7 +95,7 @@ protected: public: - History (bool bookmarkSupport = true); + explicit History (bool bookmarkSupport = true); void setProfileChangeListener (ProfileChangeListener* tpc_) { diff --git a/rtgui/ilabel.h b/rtgui/ilabel.h index aef5eb2ed..ab8f656cc 100644 --- a/rtgui/ilabel.h +++ b/rtgui/ilabel.h @@ -27,7 +27,7 @@ class ILabel : public Gtk::DrawingArea Glib::ustring label; public: - ILabel (Glib::ustring lab); + explicit ILabel (Glib::ustring lab); bool on_expose_event(GdkEventExpose* event); void on_realize(); void on_style_changed (const Glib::RefPtr& style); diff --git a/rtgui/imagearea.h b/rtgui/imagearea.h index bd2c19093..707729a6a 100644 --- a/rtgui/imagearea.h +++ b/rtgui/imagearea.h @@ -70,7 +70,7 @@ public: PreviewModePanel* previewModePanel; 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 (); void setImProcCoordinator (rtengine::StagedImageProcessor* ipc_); diff --git a/rtgui/indclippedpanel.h b/rtgui/indclippedpanel.h index 199a9f620..3a6bc5296 100644 --- a/rtgui/indclippedpanel.h +++ b/rtgui/indclippedpanel.h @@ -30,7 +30,7 @@ protected: ImageArea* imageArea; public: - IndicateClippedPanel (ImageArea* ia); + explicit IndicateClippedPanel (ImageArea* ia); void buttonToggled (); diff --git a/rtgui/inspector.h b/rtgui/inspector.h index ce2da9aeb..4d275abd5 100644 --- a/rtgui/inspector.h +++ b/rtgui/inspector.h @@ -34,7 +34,7 @@ public: int currTransform; // coarse rotation from RT, not from shot orientation bool fromRaw; - InspectorBuffer(const Glib::ustring &imgagePath); + explicit InspectorBuffer(const Glib::ustring &imgagePath); //~InspectorBuffer(); }; diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index f8d18ae57..503d6ee29 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -783,7 +783,7 @@ public: bool exif; bool iptc; - ParamsEdited (bool value = false); + explicit ParamsEdited (bool value = false); void set (bool v); void initFrom (const std::vector& src); diff --git a/rtgui/partialpastedlg.h b/rtgui/partialpastedlg.h index 7376e1481..57d77f532 100644 --- a/rtgui/partialpastedlg.h +++ b/rtgui/partialpastedlg.h @@ -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; 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); diff --git a/rtgui/popuptogglebutton.h b/rtgui/popuptogglebutton.h index 930fae4f2..58a7ff82a 100644 --- a/rtgui/popuptogglebutton.h +++ b/rtgui/popuptogglebutton.h @@ -28,7 +28,7 @@ class PopUpToggleButton : public Gtk::ToggleButton, public PopUpCommon { public: - PopUpToggleButton (const Glib::ustring& label = ""); + explicit PopUpToggleButton (const Glib::ustring& label = ""); void show (); void set_tooltip_text (const Glib::ustring &text); }; diff --git a/rtgui/preferences.h b/rtgui/preferences.h index 1cfb435cf..c9c5ca08c 100644 --- a/rtgui/preferences.h +++ b/rtgui/preferences.h @@ -229,7 +229,7 @@ protected: Gtk::Widget* getSoundPanel (); public: - Preferences (RTWindow *rtwindow); + explicit Preferences (RTWindow *rtwindow); ~Preferences (); void savePressed (); diff --git a/rtgui/previewmodepanel.h b/rtgui/previewmodepanel.h index 10906c30f..d3bf3c8e4 100644 --- a/rtgui/previewmodepanel.h +++ b/rtgui/previewmodepanel.h @@ -47,7 +47,7 @@ protected: Gtk::Image* iBC2, *igBC2; public: - PreviewModePanel (ImageArea* ia); + explicit PreviewModePanel (ImageArea* ia); ~PreviewModePanel(); void toggleR (); diff --git a/rtgui/profilepanel.h b/rtgui/profilepanel.h index 9bcc79196..f80438aac 100644 --- a/rtgui/profilepanel.h +++ b/rtgui/profilepanel.h @@ -69,7 +69,7 @@ protected: public: - ProfilePanel (bool readOnly = false); + explicit ProfilePanel (bool readOnly = false); virtual ~ProfilePanel (); void setProfileChangeListener (ProfileChangeListener* ppl) diff --git a/rtgui/profilestore.h b/rtgui/profilestore.h index d7b85b5f5..0304db330 100644 --- a/rtgui/profilestore.h +++ b/rtgui/profilestore.h @@ -108,7 +108,7 @@ public: * * @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); }; diff --git a/rtgui/progressconnector.h b/rtgui/progressconnector.h index ffa4bee67..2e235fa82 100644 --- a/rtgui/progressconnector.h +++ b/rtgui/progressconnector.h @@ -32,7 +32,7 @@ class PLDBridge : public rtengine::ProgressListener rtengine::ProgressListener* pl; public: - PLDBridge ( rtengine::ProgressListener* pb) + explicit PLDBridge ( rtengine::ProgressListener* pb) : pl(pb) {} // ProgressListener interface diff --git a/rtgui/renamedlg.h b/rtgui/renamedlg.h index a5dec4efa..8de7fe013 100644 --- a/rtgui/renamedlg.h +++ b/rtgui/renamedlg.h @@ -55,7 +55,7 @@ protected: void fillTemplateList (); public: - RenameDialog (Gtk::Window* parent); + explicit RenameDialog (Gtk::Window* parent); void initName (const Glib::ustring& iname, const CacheImageData* cid); Glib::ustring getNewName (); @@ -79,7 +79,7 @@ protected: void refreshTemplateList (); public: - RenameTemplateEditor (Gtk::Window* parent); + explicit RenameTemplateEditor (Gtk::Window* parent); Glib::ustring getSelectedTemplate (); diff --git a/rtgui/saveasdlg.h b/rtgui/saveasdlg.h index 4727b574c..188d915fb 100644 --- a/rtgui/saveasdlg.h +++ b/rtgui/saveasdlg.h @@ -45,7 +45,7 @@ protected: void putToQueueClicked (); public: - SaveAsDialog (Glib::ustring initialDir); + explicit SaveAsDialog (Glib::ustring initialDir); Glib::ustring getFileName (); Glib::ustring getDirectory (); diff --git a/rtgui/splash.h b/rtgui/splash.h index 5e3d5e1b4..9fe6d8220 100644 --- a/rtgui/splash.h +++ b/rtgui/splash.h @@ -46,7 +46,7 @@ private: public: Splash (Gtk::Window& parent, int maxtime); - Splash (Gtk::Window& parent); + explicit Splash (Gtk::Window& parent); bool hasReleaseNotes() { diff --git a/rtgui/thumbbrowserentrybase.h b/rtgui/thumbbrowserentrybase.h index 1b7f0691a..59b2c022f 100644 --- a/rtgui/thumbbrowserentrybase.h +++ b/rtgui/thumbbrowserentrybase.h @@ -107,7 +107,7 @@ public: bool updatepriority; eWithFilename withFilename; - ThumbBrowserEntryBase (const Glib::ustring& fname); + explicit ThumbBrowserEntryBase (const Glib::ustring& fname); virtual ~ThumbBrowserEntryBase (); void setParent (ThumbBrowserBase* l) diff --git a/rtgui/zoompanel.h b/rtgui/zoompanel.h index aa4d9177f..bcfbc2b34 100644 --- a/rtgui/zoompanel.h +++ b/rtgui/zoompanel.h @@ -38,7 +38,7 @@ protected: public: - ZoomPanel (ImageArea* iarea); + explicit ZoomPanel (ImageArea* iarea); void zoomInClicked (); void zoomOutClicked ();