2002-09-04 Kazuhiro Fujieda <fujieda@jaist.ac.jp>
* 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.
This commit is contained in:
parent
efa077ce22
commit
ca3a1a6b67
|
@ -172,7 +172,7 @@
|
||||||
|
|
||||||
#ifndef __WCHAR_MAX__
|
#ifndef __WCHAR_MAX__
|
||||||
#if __INT_MAX__ == 32767 || defined(__CYGWIN__) || \
|
#if __INT_MAX__ == 32767 || defined(__CYGWIN__) || \
|
||||||
defined (_WIN32) || defined(GO32)
|
defined (_WIN32)
|
||||||
#define __WCHAR_MAX__ 0xffffu
|
#define __WCHAR_MAX__ 0xffffu
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -78,6 +78,5 @@ _DEFUN (wcscmp, (s1, s2),
|
||||||
while (*s1 == *s2++)
|
while (*s1 == *s2++)
|
||||||
if (*s1++ == 0)
|
if (*s1++ == 0)
|
||||||
return (0);
|
return (0);
|
||||||
/* XXX assumes wchar_t = short */
|
return (*s1 - *--s2);
|
||||||
return (*(_CONST unsigned short *) s1 - *(_CONST unsigned short *) --s2);
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -80,9 +80,7 @@ _DEFUN (wcsncmp, (s1, s2, n),
|
||||||
{
|
{
|
||||||
if (*s1 != *s2++)
|
if (*s1 != *s2++)
|
||||||
{
|
{
|
||||||
/* XXX assumes wchar_t = short */
|
return (*s1 - *--s2);
|
||||||
return (*(_CONST unsigned short *) s1 -
|
|
||||||
*(_CONST unsigned short *) --s2);
|
|
||||||
}
|
}
|
||||||
if (*s1++ == 0)
|
if (*s1++ == 0)
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue