Bug 832486: Cast enum values from different types to int32_t before asserting that they're equal, in gfxPangoFonts.cpp. r=jfkthame
authorDaniel Holbert <dholbert@cs.stanford.edu>
Fri, 18 Jan 2013 15:15:21 -0800
changeset 119316 127e397704f5a4c73773db2b2afaf60e76ccef4d
parent 119315 0a5efd0aabfb9783307c9da8fe81e99d8807dddd
child 119317 c01ed477136cec51992fc6decbfa66bf89da1f76
push id24195
push userMs2ger@gmail.com
push dateSat, 19 Jan 2013 16:10:11 +0000
treeherdermozilla-central@02e12a80aef9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjfkthame
bugs832486
milestone21.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 832486: Cast enum values from different types to int32_t before asserting that they're equal, in gfxPangoFonts.cpp. r=jfkthame
gfx/thebes/gfxPangoFonts.cpp
--- a/gfx/thebes/gfxPangoFonts.cpp
+++ b/gfx/thebes/gfxPangoFonts.cpp
@@ -2187,22 +2187,26 @@ gfxPangoFontGroup::FindFontForChar(uint3
         }
     }
 
     return nullptr;
 }
 
 // Sanity-check: spot-check a few constants to confirm that Thebes and
 // Pango script codes really do match
-PR_STATIC_ASSERT(MOZ_SCRIPT_COMMON    == PANGO_SCRIPT_COMMON);
-PR_STATIC_ASSERT(MOZ_SCRIPT_INHERITED == PANGO_SCRIPT_INHERITED);
-PR_STATIC_ASSERT(MOZ_SCRIPT_ARABIC    == PANGO_SCRIPT_ARABIC);
-PR_STATIC_ASSERT(MOZ_SCRIPT_LATIN     == PANGO_SCRIPT_LATIN);
-PR_STATIC_ASSERT(MOZ_SCRIPT_UNKNOWN   == PANGO_SCRIPT_UNKNOWN);
-PR_STATIC_ASSERT(MOZ_SCRIPT_NKO       == PANGO_SCRIPT_NKO);
+#define CHECK_SCRIPT_CODE(script) \
+    PR_STATIC_ASSERT(int32_t(MOZ_SCRIPT_##script) == \
+                     int32_t(PANGO_SCRIPT_##script))
+
+CHECK_SCRIPT_CODE(COMMON);
+CHECK_SCRIPT_CODE(INHERITED);
+CHECK_SCRIPT_CODE(ARABIC);
+CHECK_SCRIPT_CODE(LATIN);
+CHECK_SCRIPT_CODE(UNKNOWN);
+CHECK_SCRIPT_CODE(NKO);
 
 /**
  ** gfxFcFont
  **/
 
 cairo_user_data_key_t gfxFcFont::sGfxFontKey;
 
 gfxFcFont::gfxFcFont(cairo_scaled_font_t *aCairoFont,