shithub: freetype+ttf2subf

Download patch

ref: 6dc27526a97bfc8889840454205e030e4b3051d9
parent: 3b56c4d39068ba038b021fc57b57522f879e2721
author: suzuki toshiya <[email protected]>
date: Fri Jul 31 20:32:15 EDT 2009

truetype: Cast the numerical operands to 32-bit for LP64 systems.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2009-07-31  suzuki toshiya <[email protected]>
 
+	truetype: Cast the numerical operands to 32-bit for LP64 systems.
+
+	* src/truetype/ttinterp.c (Ins_SPHIX, INS_MIAP,
+	Ins_MIRP): Insert cast from long (args[], the
+	operands passed to TrueType operator) to FT_Int32
+	(the argument of TT_MulFix14()).
+
+2009-07-31  suzuki toshiya <[email protected]>
+
 	truetype: Cast the project vector to 32-bit for LP64 system.
 
 	* src/truetype/ttinterp.c (Project, DualProject):
--- a/src/truetype/ttinterp.c
+++ b/src/truetype/ttinterp.c
@@ -5527,20 +5527,20 @@
     {
       if ( CUR.GS.both_x_axis )
       {
-        dx = TT_MulFix14( args[0], 0x4000 );
+        dx = TT_MulFix14( (FT_UInt32)args[0], 0x4000 );
         dy = 0;
       }
       else
       {
         dx = 0;
-        dy = TT_MulFix14( args[0], 0x4000 );
+        dy = TT_MulFix14( (FT_UInt32)args[0], 0x4000 );
       }
     }
     else
 #endif
     {
-      dx = TT_MulFix14( args[0], CUR.GS.freeVector.x );
-      dy = TT_MulFix14( args[0], CUR.GS.freeVector.y );
+      dx = TT_MulFix14( (FT_UInt32)args[0], CUR.GS.freeVector.x );
+      dy = TT_MulFix14( (FT_UInt32)args[0], CUR.GS.freeVector.y );
     }
 
     while ( CUR.GS.loop > 0 )
@@ -5706,8 +5706,8 @@
 
     if ( CUR.GS.gep0 == 0 )   /* If in twilight zone */
     {
-      CUR.zp0.org[point].x = TT_MulFix14( distance, CUR.GS.freeVector.x );
-      CUR.zp0.org[point].y = TT_MulFix14( distance, CUR.GS.freeVector.y ),
+      CUR.zp0.org[point].x = TT_MulFix14( (FT_UInt32)distance, CUR.GS.freeVector.x );
+      CUR.zp0.org[point].y = TT_MulFix14( (FT_UInt32)distance, CUR.GS.freeVector.y ),
       CUR.zp0.cur[point]   = CUR.zp0.org[point];
     }
 
@@ -5894,10 +5894,12 @@
     if ( CUR.GS.gep1 == 0 )
     {
       CUR.zp1.org[point].x = CUR.zp0.org[CUR.GS.rp0].x +
-                             TT_MulFix14( cvt_dist, CUR.GS.freeVector.x );
+                             TT_MulFix14( (FT_UInt32)cvt_dist,
+                                          CUR.GS.freeVector.x );
 
       CUR.zp1.org[point].y = CUR.zp0.org[CUR.GS.rp0].y +
-                             TT_MulFix14( cvt_dist, CUR.GS.freeVector.y );
+                             TT_MulFix14( (FT_UInt32)cvt_dist,
+                                          CUR.GS.freeVector.y );
 
       CUR.zp1.cur[point] = CUR.zp0.cur[point];
     }