mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
[CONSRV] wcwidth.c: Fix out-of-range comparisons Clang warnings for wchar_t's, that are only 2 bytes long on NT. (#3619)
CORE-17545 win32ss/user/winsrv/consrv/frontends/wcwidth.c:203:30: warning: result of comparison of constant 262141 with expression of type 'wchar_t' (aka 'unsigned short') is always true [-Wtautological-constant-out-of-range-compare] (ucs >= 0x30000 && ucs <= 0x3fffd))); ~~~ ^ ~~~~~~~ win32ss/user/winsrv/consrv/frontends/wcwidth.c:203:12: warning: result of comparison of constant 196608 with expression of type 'wchar_t' (aka 'unsigned short') is always false [-Wtautological-constant-out-of-range-compare] (ucs >= 0x30000 && ucs <= 0x3fffd))); ~~~ ^ ~~~~~~~ win32ss/user/winsrv/consrv/frontends/wcwidth.c:202:30: warning: result of comparison of constant 196605 with expression of type 'wchar_t' (aka 'unsigned short') is always true [-Wtautological-constant-out-of-range-compare] (ucs >= 0x20000 && ucs <= 0x2fffd) || ~~~ ^ ~~~~~~~ win32ss/user/winsrv/consrv/frontends/wcwidth.c:202:12: warning: result of comparison of constant 131072 with expression of type 'wchar_t' (aka 'unsigned short') is always false [-Wtautological-constant-out-of-range-compare] (ucs >= 0x20000 && ucs <= 0x2fffd) || ~~~ ^ ~~~~~~~
This commit is contained in:
parent
db089c517e
commit
f9aca9f7d2
1 changed files with 6 additions and 2 deletions
|
@ -198,9 +198,13 @@ int mk_wcwidth(wchar_t ucs)
|
|||
(ucs >= 0xfe10 && ucs <= 0xfe19) || /* Vertical forms */
|
||||
(ucs >= 0xfe30 && ucs <= 0xfe6f) || /* CJK Compatibility Forms */
|
||||
(ucs >= 0xff00 && ucs <= 0xff60) || /* Fullwidth Forms */
|
||||
(ucs >= 0xffe0 && ucs <= 0xffe6) ||
|
||||
(ucs >= 0xffe0 && ucs <= 0xffe6)
|
||||
#if !defined(__REACTOS__) || (defined(WCHAR_MAX) && (WCHAR_MAX >= 0x10000))
|
||||
||
|
||||
(ucs >= 0x20000 && ucs <= 0x2fffd) ||
|
||||
(ucs >= 0x30000 && ucs <= 0x3fffd)));
|
||||
(ucs >= 0x30000 && ucs <= 0x3fffd)
|
||||
#endif
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue