Commit a67c43e1c819ad1499af6052ddf2f85b6b25e069

Werner Lemberg 2014-11-19T06:46:23

Avoid compiler warnings on x86-64 for `FT_MulFix'. `FT_MulFix' takes `FT_Long' parameters as defined in `freetype.h', but several inline implementations of it in `ftcalc.h' take `FT_Int32' arguments. This is causing compiler warnings on x86-64: If parameters of type `FT_Fixed' (= `FT_Long') are passed to the inline implementation of this function, integer values are truncated from 64bit to 32bit. * include/internal/ftcalc.h (FT_MulFix) [FT_MULFIX_ASSEMBLER]: Add casts.

diff --git a/ChangeLog b/ChangeLog
index 4cebb38..62a3b41 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2014-11-19  Behdad Esfahbod  <behdad@behdad.org>
+
+	Avoid compiler warnings on x86-64 for `FT_MulFix'.
+
+	`FT_MulFix' takes `FT_Long' parameters as defined in `freetype.h',
+	but several inline implementations of it in `ftcalc.h' take
+	`FT_Int32' arguments.  This is causing compiler warnings on x86-64:
+	If parameters of type `FT_Fixed' (= `FT_Long') are passed to the
+	inline implementation of this function, integer values are truncated
+	from 64bit to 32bit.
+
+	* include/internal/ftcalc.h (FT_MulFix) [FT_MULFIX_ASSEMBLER]: Add
+	casts.
+
 2014-11-15  Werner Lemberg  <wl@gnu.org>
 
 	[sfnt] Fix Savannah bug #43597.
diff --git a/include/internal/ftcalc.h b/include/internal/ftcalc.h
index d4023fa..14ec37b 100644
--- a/include/internal/ftcalc.h
+++ b/include/internal/ftcalc.h
@@ -241,7 +241,7 @@ FT_BEGIN_HEADER
 
 #ifdef FT_CONFIG_OPTION_INLINE_MULFIX
 #ifdef FT_MULFIX_ASSEMBLER
-#define FT_MulFix( a, b )  FT_MULFIX_ASSEMBLER( a, b )
+#define FT_MulFix( a, b )  FT_MULFIX_ASSEMBLER( (FT_Int32)(a), (FT_Int32)(b) )
 #endif
 #endif