Bug 1399679 - Add a no-op cast to cairo-ft-font.c draft
authorMike Hommey <mh+mozilla@glandium.org>
Wed, 27 Dec 2017 18:18:18 +0900
changeset 722002 0b0bd86eac97de9a428b144abaaec70cee0cdf4c
parent 722001 3be7f290323aa68ca430853158e13657e38e7e4b
child 722003 363d1661518a729d4c2e3933db0f4b60fa4161bd
push id96025
push userbmo:mh+mozilla@glandium.org
push dateThu, 18 Jan 2018 09:37:19 +0000
bugs1399679
milestone59.0a1
Bug 1399679 - Add a no-op cast to cairo-ft-font.c In the freetype version on CentOS, many FT_* constants are defined as plain integer. One of them is FT_LOAD_VERTICAL_LAYOUT, defined as 0x10. On the version on Debian wheezy, it's defined as (1L << 4), which is the same value, but explicitly defined as a long. For some reason, there's one place in cairo-ft-font.c where that difference in constant definitions makes a difference in codegen (and not other places). So we add an explicit cast to long for that value in that one place. The variable tested against is an int, so there's no inherent problem with the code either way.
gfx/cairo/cairo/src/cairo-ft-font.c
--- a/gfx/cairo/cairo/src/cairo-ft-font.c
+++ b/gfx/cairo/cairo/src/cairo-ft-font.c
@@ -2305,17 +2305,17 @@ static cairo_int_status_t
     if ((info & CAIRO_SCALED_GLYPH_INFO_PATH) != 0 &&
 	(info & CAIRO_SCALED_GLYPH_INFO_SURFACE) == 0)
 	load_flags |= FT_LOAD_NO_BITMAP;
 
     /*
      * Don't pass FT_LOAD_VERTICAL_LAYOUT to FT_Load_Glyph here as
      * suggested by freetype people.
      */
-    if (load_flags & FT_LOAD_VERTICAL_LAYOUT) {
+    if (load_flags & (long)FT_LOAD_VERTICAL_LAYOUT) {
 	load_flags &= ~FT_LOAD_VERTICAL_LAYOUT;
 	vertical_layout = TRUE;
     }
 
 #ifdef FT_LOAD_COLOR
     /* Color-glyph support:
      *
      * This flags needs plumbing through fontconfig (does it?), and