Bug 542731: Add 'explicit' label to all single-arg constructors in SMIL code. r=roc
authorDaniel Holbert <dholbert@cs.stanford.edu>
Thu, 11 Feb 2010 11:40:50 -0800
changeset 38071 80619dcc4f9c648a7414efadef5b4c3225794529
parent 38070 fe08cc55524896c2d51697c1f7fdb7d7d5bab0b6
child 38072 165e0bfa83522c20944fa980d400bc5a3bb1f56e
push id11605
push userdholbert@mozilla.com
push dateThu, 11 Feb 2010 19:45:55 +0000
treeherdermozilla-central@165e0bfa8352 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs542731
milestone1.9.3a2pre
Bug 542731: Add 'explicit' label to all single-arg constructors in SMIL code. r=roc
content/smil/nsSMILAnimationFunction.cpp
content/smil/nsSMILCompositor.h
content/smil/nsSMILRepeatCount.h
content/smil/nsSMILValue.h
content/svg/content/src/nsSVGSMILTransform.h
--- a/content/smil/nsSMILAnimationFunction.cpp
+++ b/content/smil/nsSMILAnimationFunction.cpp
@@ -469,17 +469,17 @@ nsSMILAnimationFunction::InterpolateResu
 }
 
 nsresult
 nsSMILAnimationFunction::AccumulateResult(const nsSMILValueArray& aValues,
                                           nsSMILValue& aResult)
 {
   if (!IsToAnimation() && GetAccumulate() && mRepeatIteration)
   {
-    nsSMILValue lastValue = aValues[aValues.Length() - 1];
+    const nsSMILValue& lastValue = aValues[aValues.Length() - 1];
 
     // If the target attribute type doesn't support addition, Add will
     // fail and we leave aResult untouched.
     aResult.Add(lastValue, mRepeatIteration);
   }
 
   return NS_OK;
 }
--- a/content/smil/nsSMILCompositor.h
+++ b/content/smil/nsSMILCompositor.h
@@ -72,17 +72,17 @@ struct nsSMILCompositorKey
 // including prioritising animations.
 
 class nsSMILCompositor : public PLDHashEntryHdr
 {
 public:
   typedef const nsSMILCompositorKey& KeyType;
   typedef const nsSMILCompositorKey* KeyTypePointer;
 
-  nsSMILCompositor(KeyTypePointer aKey) : mKey(*aKey) { }
+  explicit nsSMILCompositor(KeyTypePointer aKey) : mKey(*aKey) { }
   nsSMILCompositor(const nsSMILCompositor& toCopy)
     : mKey(toCopy.mKey),
       mAnimationFunctions(toCopy.mAnimationFunctions)
   { }
   ~nsSMILCompositor() { }
 
   // PLDHashEntryHdr methods
   KeyType GetKey() const { return mKey; }
--- a/content/smil/nsSMILRepeatCount.h
+++ b/content/smil/nsSMILRepeatCount.h
@@ -49,17 +49,18 @@
 //  1. not-set
 //  2. set (with non-negative, non-zero count value)
 //  3. indefinite
 //
 class nsSMILRepeatCount
 {
 public:
   nsSMILRepeatCount() : mCount(kNotSet) {}
-  nsSMILRepeatCount(double aCount) : mCount(kNotSet) { SetCount(aCount); }
+  explicit nsSMILRepeatCount(double aCount)
+    : mCount(kNotSet) { SetCount(aCount); }
 
   operator double() const { return mCount; }
   PRBool IsDefinite() const {
     return mCount != kNotSet && mCount != kIndefinite;
   }
   PRBool IsIndefinite() const { return mCount == kIndefinite; }
   PRBool IsSet() const { return mCount != kNotSet; }
 
--- a/content/smil/nsSMILValue.h
+++ b/content/smil/nsSMILValue.h
@@ -41,17 +41,17 @@
 
 #include "nsISMILType.h"
 #include "nsSMILNullType.h"
 
 class nsSMILValue
 {
 public:
   nsSMILValue() : mU(), mType(&nsSMILNullType::sSingleton) { }
-  nsSMILValue(const nsISMILType* aType);
+  explicit nsSMILValue(const nsISMILType* aType);
   nsSMILValue(const nsSMILValue& aVal);
 
   ~nsSMILValue()
   {
     mType->Destroy(*this);
   }
 
   const nsSMILValue& operator=(const nsSMILValue& aVal);
--- a/content/svg/content/src/nsSVGSMILTransform.h
+++ b/content/svg/content/src/nsSVGSMILTransform.h
@@ -70,17 +70,17 @@ public:
     TRANSFORM_TRANSLATE,
     TRANSFORM_SCALE,
     TRANSFORM_ROTATE,
     TRANSFORM_SKEWX,
     TRANSFORM_SKEWY,
     TRANSFORM_MATRIX
   };
 
-  nsSVGSMILTransform(TransformType aType)
+  explicit nsSVGSMILTransform(TransformType aType)
   : mTransformType(aType)
   {
     for (int i = 0; i < 6; ++i) {
       mParams[i] = 0;
     }
   }
 
   nsSVGSMILTransform(TransformType aType, float (&aParams)[3])
@@ -89,17 +89,17 @@ public:
     for (int i = 0; i < 3; ++i) {
       mParams[i] = aParams[i];
     }
     for (int i = 3; i < 6; ++i) {
       mParams[i] = 0;
     }
   }
 
-  nsSVGSMILTransform(float (&aParams)[6])
+  explicit nsSVGSMILTransform(float (&aParams)[6])
   : mTransformType(TRANSFORM_MATRIX)
   {
     for (int i = 0; i < 6; ++i) {
       mParams[i] = aParams[i];
     }
   }
 
   TransformType mTransformType;