Commit 9123404c578f6cfb6b69e9b23fbce357027d2bfc

Gilles Espinasse 2012-07-07T11:17:02

Fix strict-aliasing warning. * src/base/ftglyph.c (FT_Glyph_To_Bitmap): Avoid double cast.

diff --git a/ChangeLog b/ChangeLog
index 0102765..0a89f6a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2012-07-07  Gilles Espinasse  <g.esp@free.fr>
+
+	Fix strict-aliasing warning.
+
+	* src/base/ftglyph.c (FT_Glyph_To_Bitmap): Avoid double cast.
+
 2012-07-07  Dave Thomas  <dave.thomas@metaforic.com>
 
 	[ARM] Fix FT_MulFix_arm.
diff --git a/src/base/ftglyph.c b/src/base/ftglyph.c
index 591b57a..7363c7d 100644
--- a/src/base/ftglyph.c
+++ b/src/base/ftglyph.c
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType convenience functions to handle glyphs (body).              */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2007, 2008, 2010 by       */
+/*  Copyright 1996-2005, 2007, 2008, 2010, 2012 by                         */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -510,7 +510,7 @@
     FT_GlyphSlotRec           dummy;
     FT_GlyphSlot_InternalRec  dummy_internal;
     FT_Error                  error = FT_Err_Ok;
-    FT_Glyph                  glyph;
+    FT_Glyph                  b, glyph;
     FT_BitmapGlyph            bitmap = NULL;
     const FT_Glyph_Class*     clazz;
 
@@ -547,10 +547,10 @@
     dummy.format   = clazz->glyph_format;
 
     /* create result bitmap glyph */
-    error = ft_new_glyph( library, FT_BITMAP_GLYPH_CLASS_GET,
-                          (FT_Glyph*)(void*)&bitmap );
+    error = ft_new_glyph( library, FT_BITMAP_GLYPH_CLASS_GET, &b );
     if ( error )
       goto Exit;
+    bitmap = (FT_BitmapGlyph)b;
 
 #if 1
     /* if `origin' is set, translate the glyph image */