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 340924 6332ef237e2145b7647d48cb90e39b27aed58a85
parent 340923 8c4afac0dcbad4a3ed5694e8df0d4171a5d8c148
child 340925 755e183915530e9bd7b25af25aecd6949a9f162f
push id31321
push userkwierso@gmail.com
push dateTue, 07 Feb 2017 01:37:59 +0000
treeherdermozilla-central@4f8b2d44eaa0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs1336994
milestone54.0a1
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 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)
 {