[cairo-commit] src/cairo-ft-font.c

Carl Worth cworth at kemper.freedesktop.org
Tue Jun 20 11:33:13 PDT 2006


 src/cairo-ft-font.c |   11 ++---------
 1 files changed, 2 insertions(+), 9 deletions(-)

New commits:
diff-tree 2f43a79e4e87341dd0df49fc6c11fd17a21350c2 (from b806b50cfe890b534dbf86f0b4d2cc0c22b880ff)
Author: Carl Worth <cworth at cworth.org>
Date:   Tue Jun 20 11:28:23 2006 -0700

    ft-font: Use compile-time test (WORDS_BIGENDIAN) rather than run-time function to test endian-ness.

diff --git a/src/cairo-ft-font.c b/src/cairo-ft-font.c
index 9a30cc8..9db46d2 100644
--- a/src/cairo-ft-font.c
+++ b/src/cairo-ft-font.c
@@ -698,14 +698,6 @@ static const int    filters[3][3] = {
     {    65538*1/13,65538*3/13,65538*9/13 },
 };
 
-static cairo_bool_t
-_native_byte_order_lsb (void)
-{
-    int	x = 1;
-
-    return *((char *) &x) == 1;
-}
-
 /* Fills in val->image with an image surface created from @bitmap
  */
 static cairo_status_t
@@ -751,7 +743,7 @@ _get_bitmap_surface (FT_Bitmap		     *bi
 	    }
 	}
 
-	if (_native_byte_order_lsb())
+#ifndef WORDS_BIGENDIAN
 	{
 	    unsigned char   *d = data;
 	    int		count = stride * height;
@@ -761,6 +753,7 @@ _get_bitmap_surface (FT_Bitmap		     *bi
 		*d++;
 	    }
 	}
+#endif
 	format = CAIRO_FORMAT_A1;
 	break;
 


More information about the cairo-commit mailing list