* src/base/ftcalc.c (FT_MulAddFix): Simplify 32-bit rounding.

This commit is contained in:
Alexei Podtelezhnikov 2023-08-25 17:57:47 +00:00
parent d42679b93d
commit 0c817334b7
1 changed files with 3 additions and 9 deletions

View File

@ -1070,9 +1070,6 @@
{
FT_UInt i;
FT_Int64 temp;
#ifndef FT_INT64
FT_Int64 halfUnit;
#endif
#ifdef FT_INT64
@ -1117,13 +1114,10 @@
FT_Add64( &temp, &multResult, &temp );
}
/* Round value. */
halfUnit.hi = 0;
halfUnit.lo = 0x8000;
FT_Add64( &temp, &halfUnit, &temp );
/* Shift and round value. */
return (FT_Int32)( ( ( temp.hi << 16 ) | ( temp.lo >> 16 ) )
+ ( 1 & ( temp.lo >> 15 ) ) );
return (FT_Int32)( ( (FT_Int32)( temp.hi & 0xFFFF ) << 16 ) |
( temp.lo >> 16 ) );
#endif /* !FT_INT64 */