If the `FT_MULFIX_ASSEMBLER` macro is not used during the compilation of FreeType, unsigned extension to `FT_Fixed` will cause `FT_MulFix` to produce incorrect results.
The usage of the attached code is for compilation with GCC on x86_64. Toggling the `FT_MULFIX_ASSEMBLER` macro will produce different results. demo: [main.c](/uploads/18e77f790be1cb5acf2ef8f52b61bf39/main.c) Signed-off-by: YeshunYe yeyeshun@uniontech.com
From: YeshunYe yeyeshun@uniontech.com
If the `FT_MULFIX_ASSEMBLER` macro is not used during the compilation of FreeType, unsigned extension to `FT_Fixed` will cause `FT_MulFix` to produce incorrect results.
Signed-off-by: YeshunYe yeyeshun@uniontech.com --- dlls/win32u/freetype.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/win32u/freetype.c b/dlls/win32u/freetype.c index d1e46a681ea..3c1eb6740a3 100644 --- a/dlls/win32u/freetype.c +++ b/dlls/win32u/freetype.c @@ -544,7 +544,7 @@ static inline FT_Fixed FT_FixedFromFloat(double f) */ static inline FT_Fixed FT_FixedFromFIXED(FIXED f) { - return (FT_Fixed)((int)f.value << 16 | (unsigned int)f.fract); + return (FT_Fixed)(int)((int)f.value << 16 | (unsigned int)f.fract); }
static BOOL is_hinting_enabled(void)
I don't understand why there are so many strange errors in the test-linux-32 tests. The code I modified should hardly have any impact on 32-bit systems.
On Fri Mar 21 11:54:40 2025 +0000, Yeshun Ye wrote:
I don't understand why there are so many strange errors in the test-linux-32 tests. The code I modified should hardly have any impact on 32-bit systems.
They're broken in master too. Just ignore everything that's unrelated to the parts you changed.
Yes, it's annoying.
On Fri Mar 21 11:54:40 2025 +0000, Alfred Agrell wrote:
They're broken in master too. Just ignore everything that's unrelated to the parts you changed. Yes, it's annoying.
Thank you, kind soul. I was really startled.