From 5f4802bf0b260e7edbe0268a8499e5532e42fd6d Mon Sep 17 00:00:00 2001 From: Ting-Yu Chou Date: Fri, 16 Dec 2016 16:01:11 +0800 Subject: [PATCH] Bug 1322465 part 15 - Use explicit/MOZ_IMPLICIT for the unary constructors in xpcom/. r=bobowen,Ehsan MozReview-Commit-ID: JtmtNbPwNOg --HG-- extra : rebase_source : f877b0504c7106a0874b23b8cfc0eab12d610767 --- xpcom/base/nsWindowsHelpers.h | 8 ++++---- xpcom/glue/nsVersionComparator.h | 2 +- xpcom/tests/windows/TestNtPathToDosPath.cpp | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/xpcom/base/nsWindowsHelpers.h b/xpcom/base/nsWindowsHelpers.h index 66505b3458af..9cd75bdcf449 100644 --- a/xpcom/base/nsWindowsHelpers.h +++ b/xpcom/base/nsWindowsHelpers.h @@ -19,7 +19,7 @@ class AutoCriticalSection { public: - AutoCriticalSection(LPCRITICAL_SECTION aSection) + explicit AutoCriticalSection(LPCRITICAL_SECTION aSection) : mSection(aSection) { ::EnterCriticalSection(mSection); @@ -150,7 +150,7 @@ protected: { } - nsSimpleRef(RawRef aRawRef) : mRawRef(aRawRef) + explicit nsSimpleRef(RawRef aRawRef) : mRawRef(aRawRef) { } @@ -219,7 +219,7 @@ public: // nsAutoRef work as intention. class nsHGLOBAL { public: - nsHGLOBAL(HGLOBAL hGlobal) : m_hGlobal(hGlobal) + MOZ_IMPLICIT nsHGLOBAL(HGLOBAL hGlobal) : m_hGlobal(hGlobal) { } @@ -255,7 +255,7 @@ public: // another specialization for nsAutoRefTraits. class nsHPRINTER { public: - nsHPRINTER(HANDLE hPrinter) : m_hPrinter(hPrinter) + MOZ_IMPLICIT nsHPRINTER(HANDLE hPrinter) : m_hPrinter(hPrinter) { } diff --git a/xpcom/glue/nsVersionComparator.h b/xpcom/glue/nsVersionComparator.h index 0dbf8532b0b6..dcf77bc40f15 100644 --- a/xpcom/glue/nsVersionComparator.h +++ b/xpcom/glue/nsVersionComparator.h @@ -122,7 +122,7 @@ private: #ifdef XP_WIN struct VersionW { - VersionW(const char16_t* aVersionStringW) + explicit VersionW(const char16_t* aVersionStringW) { versionContentW = reinterpret_cast(wcsdup(char16ptr_t(aVersionStringW))); diff --git a/xpcom/tests/windows/TestNtPathToDosPath.cpp b/xpcom/tests/windows/TestNtPathToDosPath.cpp index b826d4f2045d..eaa5a7a9b6bb 100644 --- a/xpcom/tests/windows/TestNtPathToDosPath.cpp +++ b/xpcom/tests/windows/TestNtPathToDosPath.cpp @@ -16,7 +16,7 @@ class DriveMapping { public: - DriveMapping(const nsAString& aRemoteUNCPath); + explicit DriveMapping(const nsAString& aRemoteUNCPath); ~DriveMapping(); bool