Bug 1336994 - Fix two -Wmax-unsigned-zero warnings (std::max(unsigned int, 0u) r=bz
authorSylvestre Ledru <sledru@mozilla.com>
Mon, 06 Feb 2017 16:06:55 +0100
changeset 479610 6332ef237e2145b7647d48cb90e39b27aed58a85
parent 479609 8c4afac0dcbad4a3ed5694e8df0d4171a5d8c148
child 479611 755e183915530e9bd7b25af25aecd6949a9f162f
push id44315
push usertnguyen@mozilla.com
push dateTue, 07 Feb 2017 02:03:39 +0000
reviewersbz
bugs1336994
milestone54.0a1
Bug 1336994 - Fix two -Wmax-unsigned-zero warnings (std::max(unsigned int, 0u) r=bz MozReview-Commit-ID: LX663JqH3lM
dom/html/HTMLImageElement.cpp
--- a/dom/html/HTMLImageElement.cpp
+++ b/dom/html/HTMLImageElement.cpp
@@ -765,17 +765,16 @@ HTMLImageElement::NaturalHeight()
     MOZ_ASSERT(false, "GetNaturalHeight should not fail");
     return 0;
   }
 
   if (mResponsiveSelector) {
     double density = mResponsiveSelector->GetSelectedImageDensity();
     MOZ_ASSERT(density >= 0.0);
     height = NSToIntRound(double(height) / density);
-    height = std::max(height, 0u);
   }
 
   return height;
 }
 
 NS_IMETHODIMP
 HTMLImageElement::GetNaturalHeight(uint32_t* aNaturalHeight)
 {
@@ -793,17 +792,16 @@ HTMLImageElement::NaturalWidth()
     MOZ_ASSERT(false, "GetNaturalWidth should not fail");
     return 0;
   }
 
   if (mResponsiveSelector) {
     double density = mResponsiveSelector->GetSelectedImageDensity();
     MOZ_ASSERT(density >= 0.0);
     width = NSToIntRound(double(width) / density);
-    width = std::max(width, 0u);
   }
 
   return width;
 }
 
 NS_IMETHODIMP
 HTMLImageElement::GetNaturalWidth(uint32_t* aNaturalWidth)
 {