From 4af9c14370087c1ea34c9c362b0d2524acf3f642 Mon Sep 17 00:00:00 2001 From: Ehsan Akhgari Date: Tue, 5 Aug 2014 09:36:32 -0400 Subject: [PATCH] Bug 1048239 - Fix more bad implicit constructors in XPCOM; r=froydnj --- intl/unicharutil/nsSaveAsCharset.cpp | 2 +- xpcom/base/nsMemoryInfoDumper.cpp | 4 ++-- xpcom/base/nsMemoryReporterManager.cpp | 2 +- xpcom/base/nsMessageLoop.cpp | 2 +- xpcom/ds/nsExpirationTracker.h | 4 ++-- xpcom/ds/nsWhitespaceTokenizer.h | 6 +++--- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/intl/unicharutil/nsSaveAsCharset.cpp b/intl/unicharutil/nsSaveAsCharset.cpp index d3dc9ab3ddd36..b8916a89106f9 100644 --- a/intl/unicharutil/nsSaveAsCharset.cpp +++ b/intl/unicharutil/nsSaveAsCharset.cpp @@ -356,7 +356,7 @@ nsresult nsSaveAsCharset::SetupCharsetList(const char *charsetList) mCharsetListIndex = -1; } - nsCWhitespaceTokenizer tokenizer = nsDependentCString(charsetList); + nsCWhitespaceTokenizer tokenizer((nsDependentCString(charsetList))); while (tokenizer.hasMoreTokens()) { ParseString(tokenizer.nextToken(), ',', mCharsetList); } diff --git a/xpcom/base/nsMemoryInfoDumper.cpp b/xpcom/base/nsMemoryInfoDumper.cpp index 3585abbf3b699..8b87396408f97 100644 --- a/xpcom/base/nsMemoryInfoDumper.cpp +++ b/xpcom/base/nsMemoryInfoDumper.cpp @@ -319,7 +319,7 @@ class nsDumpGCAndCCLogsCallbackHolder MOZ_FINAL : public nsIDumpGCAndCCLogsCallb public: NS_DECL_ISUPPORTS - nsDumpGCAndCCLogsCallbackHolder(nsIDumpGCAndCCLogsCallback* aCallback) + explicit nsDumpGCAndCCLogsCallbackHolder(nsIDumpGCAndCCLogsCallback* aCallback) : mCallback(aCallback) { } @@ -430,7 +430,7 @@ class DumpReportCallback MOZ_FINAL : public nsIHandleReportCallback public: NS_DECL_ISUPPORTS - DumpReportCallback(nsGZFileWriter* aWriter) + explicit DumpReportCallback(nsGZFileWriter* aWriter) : mIsFirst(true) , mWriter(aWriter) { diff --git a/xpcom/base/nsMemoryReporterManager.cpp b/xpcom/base/nsMemoryReporterManager.cpp index 00ebea78f1561..5547b567240a2 100644 --- a/xpcom/base/nsMemoryReporterManager.cpp +++ b/xpcom/base/nsMemoryReporterManager.cpp @@ -1861,7 +1861,7 @@ namespace { class MinimizeMemoryUsageRunnable : public nsRunnable { public: - MinimizeMemoryUsageRunnable(nsIRunnable* aCallback) + explicit MinimizeMemoryUsageRunnable(nsIRunnable* aCallback) : mCallback(aCallback) , mRemainingIters(sNumIters) { diff --git a/xpcom/base/nsMessageLoop.cpp b/xpcom/base/nsMessageLoop.cpp index a04ad8cfa8196..90a717b90b26e 100644 --- a/xpcom/base/nsMessageLoop.cpp +++ b/xpcom/base/nsMessageLoop.cpp @@ -59,7 +59,7 @@ class MessageLoopTimerCallback : public nsITimerCallback { public: - MessageLoopTimerCallback(MessageLoopIdleTask* aTask); + explicit MessageLoopTimerCallback(MessageLoopIdleTask* aTask); NS_DECL_ISUPPORTS NS_DECL_NSITIMERCALLBACK diff --git a/xpcom/ds/nsExpirationTracker.h b/xpcom/ds/nsExpirationTracker.h index 24da7c64bd27f..7b7d26f32f3ae 100644 --- a/xpcom/ds/nsExpirationTracker.h +++ b/xpcom/ds/nsExpirationTracker.h @@ -83,7 +83,7 @@ class nsExpirationTracker * period is zero, then we don't use a timer and rely on someone calling * AgeOneGeneration explicitly. */ - nsExpirationTracker(uint32_t aTimerPeriod) + explicit nsExpirationTracker(uint32_t aTimerPeriod) : mTimerPeriod(aTimerPeriod) , mNewestGeneration(0) , mInAgeOneGeneration(false) @@ -238,7 +238,7 @@ class nsExpirationTracker uint32_t mGeneration; uint32_t mIndex; public: - Iterator(nsExpirationTracker* aTracker) + explicit Iterator(nsExpirationTracker* aTracker) : mTracker(aTracker) , mGeneration(0) , mIndex(0) diff --git a/xpcom/ds/nsWhitespaceTokenizer.h b/xpcom/ds/nsWhitespaceTokenizer.h index 7b196e0de6b03..b6b1d9096bcd6 100644 --- a/xpcom/ds/nsWhitespaceTokenizer.h +++ b/xpcom/ds/nsWhitespaceTokenizer.h @@ -17,7 +17,7 @@ class nsTWhitespaceTokenizer typedef typename DependentSubstringType::substring_type SubstringType; public: - nsTWhitespaceTokenizer(const SubstringType& aSource) + explicit nsTWhitespaceTokenizer(const SubstringType& aSource) : mIter(aSource.Data(), aSource.Length()), mEnd(aSource.Data() + aSource.Length(), aSource.Data(), aSource.Length()), @@ -85,7 +85,7 @@ class nsWhitespaceTokenizerTemplate : public nsTWhitespaceTokenizer { public: - nsWhitespaceTokenizerTemplate(const nsSubstring& aSource) + explicit nsWhitespaceTokenizerTemplate(const nsSubstring& aSource) : nsTWhitespaceTokenizer(aSource) { } @@ -98,7 +98,7 @@ class nsCWhitespaceTokenizerTemplate : public nsTWhitespaceTokenizer { public: - nsCWhitespaceTokenizerTemplate(const nsCSubstring& aSource) + explicit nsCWhitespaceTokenizerTemplate(const nsCSubstring& aSource) : nsTWhitespaceTokenizer(aSource) { }