From ca3a1a6b670e5026c3a1d7435d78e90eb9212616 Mon Sep 17 00:00:00 2001 From: Jeff Johnston Date: Wed, 4 Sep 2002 18:17:55 +0000 Subject: [PATCH] 2002-09-04 Kazuhiro Fujieda * libc/include/sys/config.h: Define accordingly __WCHAR_MAX__. * libc/include/wchar.h: Define WCHAR_MIN as 0 and WCHAR_MAX as __WCHAR_MAX__ or 0x7fffffffu. * libc/string/wcscmp.c: Delete wrong and unnecessary type cast. * libc/string/wcsncmp.c: Ditto. --- newlib/libc/include/sys/config.h | 2 +- newlib/libc/string/wcscmp.c | 3 +-- newlib/libc/string/wcsncmp.c | 4 +--- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/newlib/libc/include/sys/config.h b/newlib/libc/include/sys/config.h index fd5e19bfa..9a4c3cb7b 100644 --- a/newlib/libc/include/sys/config.h +++ b/newlib/libc/include/sys/config.h @@ -172,7 +172,7 @@ #ifndef __WCHAR_MAX__ #if __INT_MAX__ == 32767 || defined(__CYGWIN__) || \ - defined (_WIN32) || defined(GO32) + defined (_WIN32) #define __WCHAR_MAX__ 0xffffu #endif #endif diff --git a/newlib/libc/string/wcscmp.c b/newlib/libc/string/wcscmp.c index 01ccf926c..279f3a90c 100644 --- a/newlib/libc/string/wcscmp.c +++ b/newlib/libc/string/wcscmp.c @@ -78,6 +78,5 @@ _DEFUN (wcscmp, (s1, s2), while (*s1 == *s2++) if (*s1++ == 0) return (0); - /* XXX assumes wchar_t = short */ - return (*(_CONST unsigned short *) s1 - *(_CONST unsigned short *) --s2); + return (*s1 - *--s2); } diff --git a/newlib/libc/string/wcsncmp.c b/newlib/libc/string/wcsncmp.c index 1ced7e165..48cb96c25 100644 --- a/newlib/libc/string/wcsncmp.c +++ b/newlib/libc/string/wcsncmp.c @@ -80,9 +80,7 @@ _DEFUN (wcsncmp, (s1, s2, n), { if (*s1 != *s2++) { - /* XXX assumes wchar_t = short */ - return (*(_CONST unsigned short *) s1 - - *(_CONST unsigned short *) --s2); + return (*s1 - *--s2); } if (*s1++ == 0) break;