From 201683afe4596ae32f7b1ea12dfca52995d59f9d Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Sun, 10 Nov 2019 19:11:03 -0500 Subject: Bug 1487082 - Resolve potential for build bustage regarding bad implicit conversion constructors * Part 1: make conversion CTORs explicit. Minor tweaks to conform with new(ish) static analysis rule which flags up implicit single-argument conversion constructors. * Part 2: fix a couple of double-mRefCnt declaration errors. * Part 3: Fix unsafe use of NS_ConvertASCIItoUTF16(). Tag #1273 --- mailnews/base/src/nsMailDirProvider.h | 2 +- mailnews/base/src/nsMsgCopyService.h | 2 +- mailnews/base/src/nsMsgDBView.h | 2 +- mailnews/base/src/nsMsgGroupThread.h | 2 +- mailnews/base/src/nsMsgPrintEngine.cpp | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) (limited to 'mailnews/base/src') diff --git a/mailnews/base/src/nsMailDirProvider.h b/mailnews/base/src/nsMailDirProvider.h index d12876d89..613551a79 100644 --- a/mailnews/base/src/nsMailDirProvider.h +++ b/mailnews/base/src/nsMailDirProvider.h @@ -29,7 +29,7 @@ private: NS_DECL_ISUPPORTS NS_DECL_NSISIMPLEENUMERATOR - AppendingEnumerator(nsISimpleEnumerator* aBase); + explicit AppendingEnumerator(nsISimpleEnumerator* aBase); private: ~AppendingEnumerator() {} diff --git a/mailnews/base/src/nsMsgCopyService.h b/mailnews/base/src/nsMsgCopyService.h index dfb9acc7a..8df9ccff5 100644 --- a/mailnews/base/src/nsMsgCopyService.h +++ b/mailnews/base/src/nsMsgCopyService.h @@ -29,7 +29,7 @@ class nsCopySource { public: nsCopySource(); - nsCopySource(nsIMsgFolder* srcFolder); + explicit nsCopySource(nsIMsgFolder* srcFolder); ~nsCopySource(); void AddMessage(nsIMsgDBHdr* aMsg); diff --git a/mailnews/base/src/nsMsgDBView.h b/mailnews/base/src/nsMsgDBView.h index 6dcbbea3b..feba5f14f 100644 --- a/mailnews/base/src/nsMsgDBView.h +++ b/mailnews/base/src/nsMsgDBView.h @@ -500,7 +500,7 @@ private: NS_DECL_NSISIMPLEENUMERATOR // nsMsgThreadEnumerator methods: - nsMsgViewHdrEnumerator(nsMsgDBView *view); + explicit nsMsgViewHdrEnumerator(nsMsgDBView *view); RefPtr m_view; nsMsgViewIndex m_curHdrIndex; diff --git a/mailnews/base/src/nsMsgGroupThread.h b/mailnews/base/src/nsMsgGroupThread.h index 3d1cb4fb4..076d7432a 100644 --- a/mailnews/base/src/nsMsgGroupThread.h +++ b/mailnews/base/src/nsMsgGroupThread.h @@ -21,7 +21,7 @@ public: friend class nsMsgGroupView; nsMsgGroupThread(); - nsMsgGroupThread(nsIMsgDatabase *db); + explicit nsMsgGroupThread(nsIMsgDatabase *db); NS_DECL_NSIMSGTHREAD NS_DECL_ISUPPORTS diff --git a/mailnews/base/src/nsMsgPrintEngine.cpp b/mailnews/base/src/nsMsgPrintEngine.cpp index d2f8157ed..2a509f380 100644 --- a/mailnews/base/src/nsMsgPrintEngine.cpp +++ b/mailnews/base/src/nsMsgPrintEngine.cpp @@ -653,7 +653,7 @@ nsMsgPrintEngine::PrintMsgWindow() class nsPrintMsgWindowEvent : public mozilla::Runnable { public: - nsPrintMsgWindowEvent(nsMsgPrintEngine *mpe) + explicit nsPrintMsgWindowEvent(nsMsgPrintEngine *mpe) : mMsgPrintEngine(mpe) {} @@ -672,7 +672,7 @@ private: class nsStartNextPrintOpEvent : public mozilla::Runnable { public: - nsStartNextPrintOpEvent(nsMsgPrintEngine *mpe) + explicit nsStartNextPrintOpEvent(nsMsgPrintEngine *mpe) : mMsgPrintEngine(mpe) {} -- cgit v1.2.3