freetype-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[freetype2] master 837285e: [truetype] Remove integer to pointer convers


From: Werner LEMBERG
Subject: [freetype2] master 837285e: [truetype] Remove integer to pointer conversion compiler warning.
Date: Mon, 09 Nov 2015 08:20:32 +0000

branch: master
commit 837285e40772aa10338bcb1fa5118ec93d575a8d
Author: Werner Lemberg <address@hidden>
Commit: Werner Lemberg <address@hidden>

    [truetype] Remove integer to pointer conversion compiler warning.
    
    Problem reported by Alexei.
    
    * src/truetype/ttgload.c (load_truetype_glyph): Use a solution found
    in the glib library to fix the issue.
---
 ChangeLog              |    9 +++++++++
 src/truetype/ttgload.c |   12 ++++++++++--
 2 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index e681f66..d663d9e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2015-11-09  Werner Lemberg  <address@hidden>
+
+       [truetype] Remove integer to pointer conversion compiler warning.
+
+       Problem reported by Alexei.
+
+       * src/truetype/ttgload.c (load_truetype_glyph): Use a solution found
+       in the glib library to fix the issue.
+
 2015-11-08  Behdad Esfahbod  <address@hidden>
 
        [sfnt] Accept version 3 of `EBLC' and `CBLC' tables also.
diff --git a/src/truetype/ttgload.c b/src/truetype/ttgload.c
index 9a8b458..c9d5716 100644
--- a/src/truetype/ttgload.c
+++ b/src/truetype/ttgload.c
@@ -1641,8 +1641,16 @@
       FT_ULong  ins_pos;  /* position of composite instructions, if any */
 
 
+      /*
+       * We store the glyph index directly in the `node->data' pointer,
+       * following the glib solution (cf. macro `GUINT_TO_POINTER') with a
+       * double cast to make this portable.  Note, however, that this needs
+       * pointers with a width of at least 32 bits.
+       */
+
       /* check whether we already have a composite glyph with this index */
-      if ( FT_List_Find( &loader->composites, (void*)glyph_index ) )
+      if ( FT_List_Find( &loader->composites,
+                         (void*)(unsigned long)glyph_index ) )
       {
         FT_TRACE1(( "TT_Load_Composite_Glyph:"
                     " infinite recursion detected\n" ));
@@ -1656,7 +1664,7 @@
 
         if ( FT_NEW( node ) )
           goto Exit;
-        node->data = (void*)glyph_index;
+        node->data = (void*)(unsigned long)glyph_index;
         FT_List_Add( &loader->composites, node );
       }
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]