ref: d135e27c23c089c64581065d5af6f962012fdf37
parent: 073a0e2901e931d457f205d870ee77eb0ed763cb
author: Werner Lemberg <[email protected]>
date: Sun May 5 06:44:21 EDT 2013
Fix 64bit compilation issues. * include/freetype/config/ftconfig.h [FT_LONG64]: Typedef `FT_Int64' here. * src/base/ftcalc.c: Remove typedef of `FT_Int64'. (FT_DivFix): Fix cast. * src/base/fttrigon.c: Remove typedef of `FT_Int64'.
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
2013-05-05 Werner Lemberg <[email protected]>
+ Fix 64bit compilation issues.
+
+ * include/freetype/config/ftconfig.h [FT_LONG64]: Typedef
+ `FT_Int64' here.
+
+ * src/base/ftcalc.c: Remove typedef of `FT_Int64'.
+ (FT_DivFix): Fix cast.
+ * src/base/fttrigon.c: Remove typedef of `FT_Int64'.
+
+2013-05-05 Werner Lemberg <[email protected]>
+
[raster] Fix clang issues.
Fix suggested by <[email protected]>.
--- a/include/freetype/config/ftconfig.h
+++ b/include/freetype/config/ftconfig.h
@@ -200,6 +200,18 @@
/* */
typedef unsigned XXX FT_UInt32;
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_Int64 */
+ /* */
+ /* A typedef for a 64bit signed integer type. The size depends on */
+ /* the configuration. Only defined if there is real 64bit support; */
+ /* otherwise, it gets emulated with a structure (if necessary). */
+ /* */
+ typedef signed XXX FT_Int64;
+
/* */
#endif
@@ -292,6 +304,10 @@
#endif /* __STDC__ */
#endif /* FT_LONG64 && !FT_CONFIG_OPTION_FORCE_INT64 */
+
+#ifdef FT_LONG64
+ typedef FT_INT64 FT_Int64;
+#endif
#define FT_BEGIN_STMNT do {
--- a/src/base/ftcalc.c
+++ b/src/base/ftcalc.c
@@ -43,14 +43,10 @@
#undef FT_MulFix
#endif
-/* we need to define a 64-bits data type here */
+/* we need to emulate a 64-bit data type if a real one isn't available */
-#ifdef FT_LONG64
+#ifndef FT_LONG64
- typedef FT_INT64 FT_Int64;
-
-#else
-
typedef struct FT_Int64_
{
FT_UInt32 lo;
@@ -58,7 +54,7 @@
} FT_Int64;
-#endif /* FT_LONG64 */
+#endif /* !FT_LONG64 */
/*************************************************************************/
@@ -302,7 +298,7 @@
q = 0x7FFFFFFFL;
else
/* compute result directly */
- q = (FT_UInt32)( ( ( (FT_UInt64)a << 16 ) + ( b >> 1 ) ) / b );
+ q = (FT_UInt32)( ( ( (FT_ULong)a << 16 ) + ( b >> 1 ) ) / b );
return ( s < 0 ? -(FT_Long)q : (FT_Long)q );
}
--- a/src/base/fttrigon.c
+++ b/src/base/fttrigon.c
@@ -35,11 +35,6 @@
#include FT_TRIGONOMETRY_H
-#ifdef FT_LONG64
- typedef FT_INT64 FT_Int64;
-#endif
-
-
/* the Cordic shrink factor 0.858785336480436 * 2^32 */
#define FT_TRIG_SCALE 0xDBD95B16UL