From 09948e426e95a486017913158a46ac570cc7a91a Mon Sep 17 00:00:00 2001 From: Alexei Podtelezhnikov Date: Wed, 9 Sep 2015 21:30:15 -0400 Subject: [PATCH] * src/base/ftcalc.c (FT_RoundFix): Improve. --- ChangeLog | 4 ++++ src/base/ftcalc.c | 3 +-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4e226c146..807197171 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2015-09-09 Alexei Podtelezhnikov + + * src/base/ftcalc.c (FT_RoundFix): Improve. + 2015-09-09 Wojciech Mamrak * src/base/ftcalc.c (FT_CeilFix, FT_FloorFix): Normalize. diff --git a/src/base/ftcalc.c b/src/base/ftcalc.c index edb27fd98..dbddedacd 100644 --- a/src/base/ftcalc.c +++ b/src/base/ftcalc.c @@ -86,8 +86,7 @@ FT_EXPORT_DEF( FT_Fixed ) FT_RoundFix( FT_Fixed a ) { - return a >= 0 ? ( a + 0x8000L ) & ~0xFFFFL - : -((-a + 0x8000L ) & ~0xFFFFL ); + return ( a + 0x8000L - ( a < 0 ) ) & ~0xFFFFL; }