Bug 923249 - Remove some prtypes use in gfx/; r=roc
authorMs2ger <ms2ger@gmail.com>
Sun, 20 Oct 2013 09:25:20 +0200
changeset 166191 b443665abc830e71b9cb2ad3118e44d7f423d8f8
parent 166190 a8ba2927199823c3a5787550f9f379ebd9821b1e
child 166192 182b8450e32fbfa4b238aef6ca01939e86a10904
push id428
push userbbajaj@mozilla.com
push dateTue, 28 Jan 2014 00:16:25 +0000
treeherdermozilla-release@cd72a7ff3a75 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs923249
milestone27.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 923249 - Remove some prtypes use in gfx/; r=roc
gfx/layers/opengl/CompositorOGL.cpp
gfx/src/nsFont.cpp
gfx/src/nsRect.cpp
--- a/gfx/layers/opengl/CompositorOGL.cpp
+++ b/gfx/layers/opengl/CompositorOGL.cpp
@@ -34,17 +34,16 @@
 #include "nsAString.h"
 #include "nsIConsoleService.h"          // for nsIConsoleService, etc
 #include "nsIWidget.h"                  // for nsIWidget
 #include "nsLiteralString.h"            // for NS_LITERAL_STRING
 #include "nsMathUtils.h"                // for NS_roundf
 #include "nsRect.h"                     // for nsIntRect
 #include "nsServiceManagerUtils.h"      // for do_GetService
 #include "nsString.h"                   // for nsString, nsAutoCString, etc
-#include "prtypes.h"                    // for PR_INT32_MAX
 
 #if MOZ_ANDROID_OMTC
 #include "TexturePoolOGL.h"
 #endif
 #include "GeckoProfiler.h"
 
 
 namespace mozilla {
@@ -1351,17 +1350,17 @@ CompositorOGL::CopyToTarget(DrawTarget *
   if (mUseExternalSurfaceSize) {
     rect = IntRect(0, 0, mSurfaceSize.width, mSurfaceSize.height);
   } else {
     rect = IntRect(0, 0, mWidgetSize.width, mWidgetSize.height);
   }
   GLint width = rect.width;
   GLint height = rect.height;
 
-  if ((int64_t(width) * int64_t(height) * int64_t(4)) > PR_INT32_MAX) {
+  if ((int64_t(width) * int64_t(height) * int64_t(4)) > INT32_MAX) {
     NS_ERROR("Widget size too big - integer overflow!");
     return;
   }
 
   mGLContext->fBindFramebuffer(LOCAL_GL_FRAMEBUFFER, 0);
 
   if (!mGLContext->IsGLES2()) {
     // GLES2 promises that binding to any custom FBO will attach
--- a/gfx/src/nsFont.cpp
+++ b/gfx/src/nsFont.cpp
@@ -9,17 +9,16 @@
 #include "gfxFontFeatures.h"            // for gfxFontFeature, etc
 #include "gfxFontUtils.h"               // for TRUETYPE_TAG
 #include "nsCRT.h"                      // for nsCRT
 #include "nsDebug.h"                    // for NS_ASSERTION
 #include "nsISupports.h"
 #include "nsMemory.h"                   // for NS_ARRAY_LENGTH
 #include "nsUnicharUtils.h"
 #include "nscore.h"                     // for PRUnichar
-#include "prtypes.h"                    // for PR_STATIC_ASSERT
 #include "mozilla/gfx/2D.h"
 
 nsFont::nsFont(const char* aName, uint8_t aStyle, uint8_t aVariant,
                uint16_t aWeight, int16_t aStretch, uint8_t aDecoration,
                nscoord aSize)
 {
   NS_ASSERTION(aName && IsASCII(nsDependentCString(aName)),
                "Must only pass ASCII names here");
@@ -250,48 +249,51 @@ const gfxFontFeature eastAsianDefaults[]
   { TRUETYPE_TAG('j','p','0','4'), 1 },
   { TRUETYPE_TAG('s','m','p','l'), 1 },
   { TRUETYPE_TAG('t','r','a','d'), 1 },
   { TRUETYPE_TAG('f','w','i','d'), 1 },
   { TRUETYPE_TAG('p','w','i','d'), 1 },
   { TRUETYPE_TAG('r','u','b','y'), 1 }
 };
 
-PR_STATIC_ASSERT(NS_ARRAY_LENGTH(eastAsianDefaults) ==
-                 eFeatureEastAsian_numFeatures);
+static_assert(NS_ARRAY_LENGTH(eastAsianDefaults) ==
+              eFeatureEastAsian_numFeatures,
+              "eFeatureEastAsian_numFeatures should be correct");
 
 // NS_FONT_VARIANT_LIGATURES_xxx values
 const gfxFontFeature ligDefaults[] = {
   { TRUETYPE_TAG('l','i','g','a'), 1 },
   { TRUETYPE_TAG('l','i','g','a'), 0 },
   { TRUETYPE_TAG('d','l','i','g'), 1 },
   { TRUETYPE_TAG('d','l','i','g'), 0 },
   { TRUETYPE_TAG('h','l','i','g'), 1 },
   { TRUETYPE_TAG('h','l','i','g'), 0 },
   { TRUETYPE_TAG('c','a','l','t'), 1 },
   { TRUETYPE_TAG('c','a','l','t'), 0 }
 };
 
-PR_STATIC_ASSERT(NS_ARRAY_LENGTH(ligDefaults) ==
-                 eFeatureLigatures_numFeatures);
+static_assert(NS_ARRAY_LENGTH(ligDefaults) ==
+              eFeatureLigatures_numFeatures,
+              "eFeatureLigatures_numFeatures should be correct");
 
 // NS_FONT_VARIANT_NUMERIC_xxx values
 const gfxFontFeature numericDefaults[] = {
   { TRUETYPE_TAG('l','n','u','m'), 1 },
   { TRUETYPE_TAG('o','n','u','m'), 1 },
   { TRUETYPE_TAG('p','n','u','m'), 1 },
   { TRUETYPE_TAG('t','n','u','m'), 1 },
   { TRUETYPE_TAG('f','r','a','c'), 1 },
   { TRUETYPE_TAG('a','f','r','c'), 1 },
   { TRUETYPE_TAG('z','e','r','o'), 1 },
   { TRUETYPE_TAG('o','r','d','n'), 1 }
 };
 
-PR_STATIC_ASSERT(NS_ARRAY_LENGTH(numericDefaults) ==
-                 eFeatureNumeric_numFeatures);
+static_assert(NS_ARRAY_LENGTH(numericDefaults) ==
+              eFeatureNumeric_numFeatures,
+              "eFeatureNumeric_numFeatures should be correct");
 
 static void
 AddFontFeaturesBitmask(uint32_t aValue, uint32_t aMin, uint32_t aMax,
                       const gfxFontFeature aFeatureDefaults[],
                       nsTArray<gfxFontFeature>& aFeaturesOut)
 
 {
   uint32_t i, m;
--- a/gfx/src/nsRect.cpp
+++ b/gfx/src/nsRect.cpp
@@ -2,21 +2,20 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsRect.h"
 #include "mozilla/gfx/Types.h"          // for NS_SIDE_BOTTOM, etc
 #include "nsDeviceContext.h"            // for nsDeviceContext
 #include "nsString.h"               // for nsAutoString, etc
-#include "prtypes.h"                    // for PR_STATIC_ASSERT
 #include "nsMargin.h"                   // for nsMargin
 
-// the mozilla::css::Side sequence must match the nsMargin nscoord sequence
-PR_STATIC_ASSERT((NS_SIDE_TOP == 0) && (NS_SIDE_RIGHT == 1) && (NS_SIDE_BOTTOM == 2) && (NS_SIDE_LEFT == 3));
+static_assert((NS_SIDE_TOP == 0) && (NS_SIDE_RIGHT == 1) && (NS_SIDE_BOTTOM == 2) && (NS_SIDE_LEFT == 3),
+              "The mozilla::css::Side sequence must match the nsMargin nscoord sequence");
 
 #ifdef DEBUG
 // Diagnostics
 
 FILE* operator<<(FILE* out, const nsRect& rect)
 {
   nsAutoString tmp;