[PATCH 0/1] MR7633: win32u: Fixed the sign error in the conversion from FIXED to FT_Fixed
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(a)uniontech.com> -- https://gitlab.winehq.org/wine/wine/-/merge_requests/7633
From: YeshunYe <yeyeshun(a)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(a)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) -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/7633
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. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/7633#note_98603
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. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/7633#note_98604
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.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/7633#note_98605
participants (3)
-
Alfred Agrell (@Alcaro) -
Yeshun Ye (@yeyeshun) -
YeshunYe