Bug 1336994 - Fix two -Wmax-unsigned-zero warnings (std::max(unsigned int, 0u) r?bz draft
authorSylvestre Ledru <sledru@mozilla.com>
Mon, 06 Feb 2017 16:06:55 +0100
changeset 479350 e7b85e98090d5fd5510fbfa464c43271d2a8c12a
parent 479332 0de555fdf88f20e1fb309617a7c509a9bf7ecb3a
child 479366 4b5b398c1caafc9de6b4e96c3eab3c44139c41e1
push id44228
push userbmo:sledru@mozilla.com
push dateMon, 06 Feb 2017 15:07:31 +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)
 {