diff options
Diffstat (limited to 'src/base/ftcalc.c')
-rw-r--r-- | src/base/ftcalc.c | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/src/base/ftcalc.c b/src/base/ftcalc.c index 3892fabf..b7866abc 100644 --- a/src/base/ftcalc.c +++ b/src/base/ftcalc.c @@ -202,25 +202,11 @@ #else - FT_Int s = 1; - FT_Long c; + FT_Int64 c; + c = (FT_Int64)a * b; - if ( a < 0 ) - { - a = -a; - s = -1; - } - - if ( b < 0 ) - { - b = -b; - s = -s; - } - - c = (FT_Long)( ( (FT_Int64)a * b + 0x8000L ) >> 16 ); - - return ( s > 0 ) ? c : -c; + return (FT_Long)((c + 0x8000 - (c < 0)) >> 16); #endif /* FT_MULFIX_ASSEMBLER */ } |