OSDN Git Service

Cppcheck: Class '...' has a constructor with 1 argument that is not explicit.
authorTakashi Sawanaka <sdottaka@users.sourceforge.net>
Sun, 31 Jan 2016 09:54:18 +0000 (18:54 +0900)
committerTakashi Sawanaka <sdottaka@users.sourceforge.net>
Sun, 31 Jan 2016 09:54:18 +0000 (18:54 +0900)
Src/DDXHelper.h
Src/DiffThread.cpp
Src/DirScan.cpp
Src/DirView.cpp
Src/DirViewColItems.h
Src/IListCtrlImpl.h
Src/MergeDoc.cpp

index 53bbe84..6cca299 100644 (file)
@@ -7,19 +7,19 @@
 class PopString : public CString\r
 {\r
 public:\r
-    PopString(String & final) : CString(final.c_str()), m_final(final)\r
-    {\r
+       explicit PopString(String & final) : CString(final.c_str()), m_final(final)\r
+       {\r
        }\r
 \r
-    ~PopString()\r
-    {\r
-        m_final = (PCTSTR) *this;\r
-    }\r
+       ~PopString()\r
+       {\r
+               m_final = (PCTSTR) *this;\r
+       }\r
 private:\r
-    PopString(const PopString &);  // private copy constructor to prevent copying\r
-    PopString & operator=(const PopString &);  // private copy operator\r
+       PopString(const PopString &);  // private copy constructor to prevent copying\r
+       PopString & operator=(const PopString &);  // private copy operator\r
 \r
-    String & m_final;\r
+       String & m_final;\r
 };\r
 \r
 inline void DDX_Check(CDataExchange* pDX, int nIDC, bool& value)\r
index 2d125f1..99ba123 100644 (file)
@@ -49,7 +49,7 @@ public:
 
 // All this object does is forward ShouldAbort calls to its containing CDiffThread
 
-       DiffThreadAbortable(CDiffThread * diffthread) : m_diffthread(diffthread) { }
+       explicit DiffThreadAbortable(CDiffThread * diffthread) : m_diffthread(diffthread) { }
        CDiffThread * m_diffthread;
 };
 
index a4b2ed9..b2d041e 100644 (file)
@@ -69,7 +69,7 @@ private:
 class WorkCompletedNotification: public Poco::Notification
 {
 public:
-       WorkCompletedNotification(DIFFITEM& di): m_di(di) {}
+       explicit WorkCompletedNotification(DIFFITEM& di): m_di(di) {}
        DIFFITEM& data() const { return m_di; }
 private:
        DIFFITEM& m_di;
index 3f9638d..2b5ca2c 100644 (file)
@@ -2390,7 +2390,7 @@ void CDirView::GetCurrentColRegKeys(std::vector<String>& colKeys)
 
 struct FileCmpReport: public IFileCmpReport
 {
-       FileCmpReport(CDirView *pDirView) : m_pDirView(pDirView) {}
+       explicit FileCmpReport(CDirView *pDirView) : m_pDirView(pDirView) {}
        bool operator()(REPORT_TYPE nReportType, IListCtrl *pList, int nIndex, const String &sDestDir, String &sLinkPath)
        {
                const CDiffContext& ctxt = m_pDirView->GetDiffContext();
index 4f6bfbe..68322c8 100644 (file)
@@ -49,7 +49,7 @@ extern const int g_ncols3;
 class DirViewColItems
 {
 public:
-       DirViewColItems(int nDirs):
+       explicit DirViewColItems(int nDirs):
          m_nDirs(nDirs), m_numcols(-1), m_dispcols(-1) {}
        String GetColRegValueNameBase(int col) const;
        int GetColDefaultOrder(int col) const;
index 6ac1b0b..3ba1770 100644 (file)
@@ -7,7 +7,7 @@
 class IListCtrlImpl : public IListCtrl\r
 {\r
 public:\r
-       IListCtrlImpl(HWND hwndListCtrl) : m_hwndListCtrl(hwndListCtrl)\r
+       explicit IListCtrlImpl(HWND hwndListCtrl) : m_hwndListCtrl(hwndListCtrl)\r
        {\r
        }\r
 \r
index 6b42f04..e95a509 100644 (file)
@@ -764,7 +764,7 @@ bool CMergeDoc::Undo()
 class RescanSuppress
 {
 public:
-       RescanSuppress(CMergeDoc & doc) : m_doc(doc)
+       explicit RescanSuppress(CMergeDoc & doc) : m_doc(doc)
        {
                m_bSuppress = true;
                m_bPrev = doc.m_bEnableRescan;