Bug 577905 mark DEBUG only variables as ifdef DEBUG in svg
authortimeless@mozdev.org
Sun, 11 Jul 2010 15:30:35 +0300
changeset 58643 f6dbfac1ab2205cae5d36edfd55f7abe83c263a4
parent 58642 d239dedd96d35e93523ca452d001faf1ab46ece8
child 58644 2f15cc56a2c289d8961a0897f5b81be76716df7a
push idunknown
push userunknown
push dateunknown
bugs577905
milestone2.0b8pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 577905 mark DEBUG only variables as ifdef DEBUG in svg r=dholbert a=roc
content/smil/nsSMILAnimationFunction.cpp
content/svg/content/src/nsSVGAttrTearoffTable.h
content/svg/content/src/nsSVGElement.cpp
--- a/content/smil/nsSMILAnimationFunction.cpp
+++ b/content/smil/nsSMILAnimationFunction.cpp
@@ -546,17 +546,21 @@ nsSMILAnimationFunction::ComputePacedPos
   // interval-distances in an array, but maybe that's excessive.
   for (PRUint32 i = 0; i < aValues.Length() - 1; i++) {
     // Note: The following assertion is valid because remainingDist should
     // start out non-negative, and this loop never shaves off more than its
     // current value.
     NS_ASSERTION(remainingDist >= 0, "distance values must be non-negative");
 
     double curIntervalDist;
-    nsresult rv = aValues[i].ComputeDistance(aValues[i+1], curIntervalDist);
+
+#ifdef DEBUG
+    nsresult rv =
+#endif
+      aValues[i].ComputeDistance(aValues[i+1], curIntervalDist);
     NS_ABORT_IF_FALSE(NS_SUCCEEDED(rv),
                       "If we got through ComputePacedTotalDistance, we should "
                       "be able to recompute each sub-distance without errors");
 
     NS_ASSERTION(curIntervalDist >= 0, "distance values must be non-negative");
     // Clamp distance value at 0, just in case ComputeDistance is evil.
     curIntervalDist = NS_MAX(curIntervalDist, 0.0);
 
--- a/content/svg/content/src/nsSVGAttrTearoffTable.h
+++ b/content/svg/content/src/nsSVGAttrTearoffTable.h
@@ -70,17 +70,21 @@ private:
 template<class SimpleType, class TearoffType>
 TearoffType*
 nsSVGAttrTearoffTable<SimpleType, TearoffType>::GetTearoff(SimpleType* aSimple)
 {
   if (!mTable.IsInitialized())
     return nsnull;
 
   TearoffType *tearoff = nsnull;
-  PRBool found = mTable.Get(aSimple, &tearoff);
+
+#ifdef DEBUG
+  PRBool found =
+#endif
+    mTable.Get(aSimple, &tearoff);
   NS_ABORT_IF_FALSE(!found || tearoff,
       "NULL pointer stored in attribute tear-off map");
 
   return tearoff;
 }
 
 template<class SimpleType, class TearoffType>
 void
@@ -93,17 +97,20 @@ nsSVGAttrTearoffTable<SimpleType, Tearof
 
   // We shouldn't be adding a tear-off if there already is one. If that happens,
   // something is wrong.
   if (mTable.Get(aSimple, nsnull)) {
     NS_ABORT_IF_FALSE(PR_FALSE, "There is already a tear-off for this object.");
     return;
   }
 
-  PRBool result = mTable.Put(aSimple, aTearoff);
+#ifdef DEBUG
+  PRBool result =
+#endif
+    mTable.Put(aSimple, aTearoff);
   NS_ABORT_IF_FALSE(result, "Out of memory.");
 }
 
 template<class SimpleType, class TearoffType>
 void
 nsSVGAttrTearoffTable<SimpleType, TearoffType>::RemoveTearoff(
     SimpleType* aSimple)
 {
--- a/content/svg/content/src/nsSVGElement.cpp
+++ b/content/svg/content/src/nsSVGElement.cpp
@@ -1344,19 +1344,23 @@ nsSVGElement::UpdateAnimatedContentStyle
                                     GetBaseURI(), NodePrincipal());
   doc->PropertyTable(SMIL_MAPPED_ATTR_ANIMVAL)->
     Enumerate(this, ParseMappedAttrAnimValueCallback, &mappedAttrParser);
  
   nsRefPtr<nsICSSStyleRule>
     animContentStyleRule(mappedAttrParser.CreateStyleRule());
 
   if (animContentStyleRule) {
-    nsresult rv = SetProperty(SMIL_MAPPED_ATTR_ANIMVAL,
-                              SMIL_MAPPED_ATTR_STYLERULE_ATOM,
-                              animContentStyleRule.get(), ReleaseStyleRule);
+#ifdef DEBUG
+    nsresult rv =
+#endif
+      SetProperty(SMIL_MAPPED_ATTR_ANIMVAL,
+                  SMIL_MAPPED_ATTR_STYLERULE_ATOM,
+                  animContentStyleRule.get(),
+                  ReleaseStyleRule);
     animContentStyleRule.forget();
     NS_ABORT_IF_FALSE(rv == NS_OK,
                       "SetProperty failed (or overwrote something)");
   }
 }
 
 nsICSSStyleRule*
 nsSVGElement::GetAnimatedContentStyleRule()