From a67c43e1c819ad1499af6052ddf2f85b6b25e069 Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Wed, 19 Nov 2014 06:46:23 +0100 Subject: [PATCH] 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. --- ChangeLog | 14 ++++++++++++++ include/internal/ftcalc.h | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 4cebb38bd..62a3b4101 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2014-11-19 Behdad Esfahbod + + 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 [sfnt] Fix Savannah bug #43597. diff --git a/include/internal/ftcalc.h b/include/internal/ftcalc.h index d4023fa5b..14ec37b9c 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