* src/base/fttrigon.c (ft_trig_downscale): Make 64bit version work.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
diff --git a/ChangeLog b/ChangeLog
index f6b3d52..3f501aa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2012-11-17 Werner Lemberg <wl@gnu.org>
+
+ * src/base/fttrigon.c (ft_trig_downscale): Make 64bit version work.
+
2012-11-15 Alexei Podtelezhnikov <apodtele@gmail.com>
[base] Fix integer overflows in dd5718c7d67a.
diff --git a/src/base/fttrigon.c b/src/base/fttrigon.c
index fdf433a..1556984 100644
--- 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