Bug 1171528 - Remove overflowed nscoord_MAX warnings from nsRect. r=dholbert
authorEric Rahm <erahm@mozilla.com>
Wed, 10 Jun 2015 15:14:54 -0700
changeset 248187 b3f90ab360afe8da2916d5fac83e2f2f1f01f1cf
parent 248186 179adcb0f8628c0adb037d3b5a2beb959a250e7b
child 248188 31ba39bfadb09ebb61559372d572b9e32c0e2bba
push id28893
push userkwierso@gmail.com
push dateFri, 12 Jun 2015 00:02:58 +0000
treeherderautoland@8cf9d3e497f9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdholbert
bugs1171528
milestone41.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 1171528 - Remove overflowed nscoord_MAX warnings from nsRect. r=dholbert
gfx/src/nsRect.h
--- a/gfx/src/nsRect.h
+++ b/gfx/src/nsRect.h
@@ -5,17 +5,16 @@
 
 
 #ifndef NSRECT_H
 #define NSRECT_H
 
 #include <stdio.h>                      // for FILE
 #include <stdint.h>                     // for int32_t, int64_t
 #include <algorithm>                    // for min/max
-#include "nsDebug.h"                    // for NS_WARNING
 #include "gfxCore.h"                    // for NS_GFX
 #include "mozilla/Likely.h"             // for MOZ_UNLIKELY
 #include "mozilla/gfx/Rect.h"
 #include "nsCoord.h"                    // for nscoord, etc
 #include "nsISupportsImpl.h"            // for MOZ_COUNT_CTOR, etc
 #include "nsPoint.h"                    // for nsIntPoint, nsPoint
 #include "nsSize.h"                     // for IntSize, nsSize
 #include "nscore.h"                     // for NS_BUILD_REFCNT_LOGGING
@@ -75,30 +74,28 @@ struct NS_GFX nsRect :
   {
 #ifdef NS_COORD_IS_FLOAT
     return UnionEdges(aRect);
 #else
     nsRect result;
     result.x = std::min(aRect.x, x);
     int64_t w = std::max(int64_t(aRect.x) + aRect.width, int64_t(x) + width) - result.x;
     if (MOZ_UNLIKELY(w > nscoord_MAX)) {
-      NS_WARNING("Overflowed nscoord_MAX in conversion to nscoord width");
       // Clamp huge negative x to nscoord_MIN / 2 and try again.
       result.x = std::max(result.x, nscoord_MIN / 2);
       w = std::max(int64_t(aRect.x) + aRect.width, int64_t(x) + width) - result.x;
       if (MOZ_UNLIKELY(w > nscoord_MAX)) {
         w = nscoord_MAX;
       }
     }
     result.width = nscoord(w);
 
     result.y = std::min(aRect.y, y);
     int64_t h = std::max(int64_t(aRect.y) + aRect.height, int64_t(y) + height) - result.y;
     if (MOZ_UNLIKELY(h > nscoord_MAX)) {
-      NS_WARNING("Overflowed nscoord_MAX in conversion to nscoord height");
       // Clamp huge negative y to nscoord_MIN / 2 and try again.
       result.y = std::max(result.y, nscoord_MIN / 2);
       h = std::max(int64_t(aRect.y) + aRect.height, int64_t(y) + height) - result.y;
       if (MOZ_UNLIKELY(h > nscoord_MAX)) {
         h = nscoord_MAX;
       }
     }
     result.height = nscoord(h);