shithub: freetype+ttf2subf

Download patch

ref: 46c371c2c7398d25fa614065c28a27ebb4b5d489
parent: d1bf3e33f73e953724a02206bfd68dd4e23b2962
author: suzuki toshiya <[email protected]>
date: Sun Oct 24 20:14:13 EDT 2010

Replace "%lx" for memory address by "%p", LLP64 platforms.

On LLP64 platforms (e.g. Win64), long (32-bit) cannot cover
the memory address (64-bit).  Also the casts from the pointer
type to long int should be removed to preserve the address
correctly.

* src/raster/ftraster.c (New_Profile): Replace "%lx" by "%p".
(End_Profile) Ditto.
* src/truetype/ttinterp.c (Init_Context): Ditto.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2010-10-24  suzuki toshiya  <[email protected]>
+
+	Replace "%lx" for memory address by "%p", LLP64 platforms.
+
+	On LLP64 platforms (e.g. Win64), long (32-bit) cannot cover
+	the memory address (64-bit).  Also the casts from the pointer
+	type to long int should be removed to preserve the address
+	correctly.
+
+	* src/raster/ftraster.c (New_Profile): Replace "%lx" by "%p".
+	(End_Profile) Ditto.
+	* src/truetype/ttinterp.c (Init_Context): Ditto.
+
 2010-10-15  Alexei Podtelezhnikov  <[email protected]>
 
 	Fix thinko in spline flattening.
--- a/src/raster/ftraster.c
+++ b/src/raster/ftraster.c
@@ -725,13 +725,13 @@
       if ( overshoot )
         ras.cProfile->flags |= Overshoot_Bottom;
 
-      FT_TRACE6(( "New ascending profile = %lx\n", (long)ras.cProfile ));
+      FT_TRACE6(( "New ascending profile = %p\n", ras.cProfile ));
       break;
 
     case Descending_State:
       if ( overshoot )
         ras.cProfile->flags |= Overshoot_Top;
-      FT_TRACE6(( "New descending profile = %lx\n", (long)ras.cProfile ));
+      FT_TRACE6(( "New descending profile = %p\n", ras.cProfile ));
       break;
 
     default:
@@ -784,8 +784,8 @@
 
     if ( h > 0 )
     {
-      FT_TRACE6(( "Ending profile %lx, start = %ld, height = %ld\n",
-                  (long)ras.cProfile, ras.cProfile->start, h ));
+      FT_TRACE6(( "Ending profile %p, start = %ld, height = %ld\n",
+                  ras.cProfile, ras.cProfile->start, h ));
 
       ras.cProfile->height = h;
       if ( overshoot )
--- a/src/truetype/ttinterp.c
+++ b/src/truetype/ttinterp.c
@@ -478,8 +478,7 @@
     return TT_Err_Ok;
 
   Fail_Memory:
-    FT_ERROR(( "Init_Context: not enough memory for 0x%08lx\n",
-               (FT_Long)exec ));
+    FT_ERROR(( "Init_Context: not enough memory for %p\n", exec ));
     TT_Done_Context( exec );
 
     return error;