shithub: freetype+ttf2subf

Download patch

ref: fa22ec1cfba5975c0622e374f8506c742d3f8d18
parent: 0690d3d7b59ccb54a9938ff99c8621350780fc6e
author: Werner Lemberg <[email protected]>
date: Sat Nov 17 06:45:24 EST 2012

* src/base/fttrigon.c (ft_trig_downscale): Make 64bit version work.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2012-11-17  Werner Lemberg  <[email protected]>
+
+	* src/base/fttrigon.c (ft_trig_downscale): Make 64bit version work.
+
 2012-11-15  Alexei Podtelezhnikov  <[email protected]>
 
 	[base] Fix integer overflows in dd5718c7d67a.
--- a/src/base/fttrigon.c
+++ b/src/base/fttrigon.c
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType trigonometric functions (body).                             */
 /*                                                                         */
-/*  Copyright 2001, 2002, 2003, 2004, 2005 by                              */
+/*  Copyright 2001-2005, 2012 by                                           */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -21,6 +21,11 @@
 #include FT_TRIGONOMETRY_H
 
 
+#ifdef FT_LONG64
+  typedef FT_INT64  FT_Int64;
+#endif
+
+
   /* the following is 0.2715717684432231 * 2^30 */
 #define FT_TRIG_COSCALE  0x11616E8EUL
 
@@ -39,7 +44,7 @@
 #define FT_TRIG_SCALE    1166391785UL  /* 0x4585BA38UL */
 
 
-#ifdef FT_CONFIG_HAS_INT64
+#ifdef FT_LONG64
 
   /* multiply a given value by the CORDIC shrink factor */
   static FT_Fixed
@@ -58,7 +63,7 @@
     return ( s >= 0 ) ? val : -val;
   }
 
-#else /* !FT_CONFIG_HAS_INT64 */
+#else /* !FT_LONG64 */
 
   /* multiply a given value by the CORDIC shrink factor */
   static FT_Fixed
@@ -72,10 +77,10 @@
     val = ( val >= 0 ) ? val : -val;
 
     v1 = (FT_UInt32)val >> 16;
-    v2 = (FT_UInt32)(val & 0xFFFFL);
+    v2 = (FT_UInt32)( val & 0xFFFFL );
 
-    k1 = (FT_UInt32)FT_TRIG_SCALE >> 16;       /* constant */
-    k2 = (FT_UInt32)(FT_TRIG_SCALE & 0xFFFFL);   /* constant */
+    k1 = (FT_UInt32)FT_TRIG_SCALE >> 16;           /* constant */
+    k2 = (FT_UInt32)( FT_TRIG_SCALE & 0xFFFFL );   /* constant */
 
     hi   = k1 * v1;
     lo1  = k1 * v2 + k2 * v1;       /* can't overflow */
@@ -93,7 +98,7 @@
     return ( s >= 0 ) ? val : -val;
   }
 
-#endif /* !FT_CONFIG_HAS_INT64 */
+#endif /* !FT_LONG64 */
 
 
   static FT_Int