diff options
author | Ulrich Drepper <drepper@redhat.com> | 2000-11-03 00:30:48 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2000-11-03 00:30:48 +0000 |
commit | cf37087aaf575bf9aaa53527d9936a20bb7644e3 (patch) | |
tree | 183ac56f15a2b5dd523359df8d6b5bff3f366931 | |
parent | 59a8849de31975aebfc85842b6c87f57a972fd8d (diff) | |
download | glibc-cf37087aaf575bf9aaa53527d9936a20bb7644e3.zip glibc-cf37087aaf575bf9aaa53527d9936a20bb7644e3.tar.gz glibc-cf37087aaf575bf9aaa53527d9936a20bb7644e3.tar.bz2 |
Update.
* sysdeps/i386/i486/bits/string.h (strcmp): Cast arguments to
__strcmp_cc, __strcmp_cg, and __strcmp_gc to unsigned char *.
(__strcmp_cc, __strcmp_cg, __strcmp_gc): Remove casts of values here.
Reported by Denis Zaitsev <zzz@cd-club.ru>.
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | sysdeps/i386/i486/bits/string.h | 46 |
2 files changed, 29 insertions, 22 deletions
@@ -1,5 +1,10 @@ 2000-11-02 Ulrich Drepper <drepper@redhat.com> + * sysdeps/i386/i486/bits/string.h (strcmp): Cast arguments to + __strcmp_cc, __strcmp_cg, and __strcmp_gc to unsigned char *. + (__strcmp_cc, __strcmp_cg, __strcmp_gc): Remove casts of values here. + Reported by Denis Zaitsev <zzz@cd-club.ru>. + * iconvdata/utf-16.c (PREPARE_LOOP): Correct typo preventing BOM from being written. diff --git a/sysdeps/i386/i486/bits/string.h b/sysdeps/i386/i486/bits/string.h index c880f94..16e31bd 100644 --- a/sysdeps/i386/i486/bits/string.h +++ b/sysdeps/i386/i486/bits/string.h @@ -1056,59 +1056,61 @@ __strncat_g (char *__dest, __const char __src[], size_t __n) : (__builtin_constant_p (s1) && sizeof ((s1)[0]) == 1 \ && sizeof ((s2)[0]) == 1 && strlen (s1) < 4 \ ? (__builtin_constant_p (s2) && sizeof ((s2)[0]) == 1 \ - ? __strcmp_cc (s1, s2, strlen (s1)) \ - : __strcmp_cg (s1, s2, strlen (s1))) \ + ? __strcmp_cc ((unsigned char *) (s1), \ + (unsigned char *) (s2), strlen (s1)) \ + : __strcmp_cg ((unsigned char *) (s1), \ + (unsigned char *) (s2), strlen (s1))) \ : (__builtin_constant_p (s2) && sizeof ((s1)[0]) == 1 \ && sizeof ((s2)[0]) == 1 && strlen (s2) < 4 \ ? (__builtin_constant_p (s1) \ - ? __strcmp_cc (s1, s2, strlen (s2)) \ - : __strcmp_gc (s1, s2, strlen (s2))) \ + ? __strcmp_cc ((unsigned char *) (s1), \ + (unsigned char *) (s2), \ + strlen (s2)) \ + : __strcmp_gc ((unsigned char *) (s1), \ + (unsigned char *) (s2), \ + strlen (s2))) \ : __strcmp_gg (s1, s2))))) #define __strcmp_cc(s1, s2, l) \ - (__extension__ ({ register int __result = ((unsigned char) (s1)[0] \ - - (unsigned char) (s2)[0]); \ + (__extension__ ({ register int __result = (s1)[0] - (s2)[0]; \ if (l > 0 && __result == 0) \ { \ - __result = ((unsigned char) (s1)[1] \ - - (unsigned char) (s2)[1]); \ + __result = (s1)[1] - (s2)[1]; \ if (l > 1 && __result == 0) \ { \ - __result = ((unsigned char) (s1)[2] \ - - (unsigned char) (s2)[2]); \ + __result = (s1)[2] - (s2)[2]; \ if (l > 2 && __result == 0) \ - __result = ((unsigned char) (s1)[3] \ - - (unsigned char) (s2)[3]); \ + __result = (s1)[3] - (s2)[3]; \ } \ } \ __result; })) #define __strcmp_cg(s1, s2, l1) \ - (__extension__ ({ __const unsigned char *__s2 = (unsigned char *) (s2); \ - register int __result = (unsigned char) (s1)[0] - __s2[0];\ + (__extension__ ({ __const unsigned char *__s2 = (s2); \ + register int __result = (s1)[0] - __s2[0]; \ if (l1 > 0 && __result == 0) \ { \ - __result = (unsigned char) (s1)[1] - __s2[1]; \ + __result = (s1)[1] - __s2[1]; \ if (l1 > 1 && __result == 0) \ { \ - __result = (unsigned char) (s1)[2] - __s2[2]; \ + __result = (s1)[2] - __s2[2]; \ if (l1 > 2 && __result == 0) \ - __result = (unsigned char) (s1)[3] - __s2[3]; \ + __result = (s1)[3] - __s2[3]; \ } \ } \ __result; })) #define __strcmp_gc(s1, s2, l2) \ - (__extension__ ({ __const unsigned char *__s1 = (unsigned char *) (s1); \ - register int __result = __s1[0] - (unsigned char) (s2)[0];\ + (__extension__ ({ __const unsigned char *__s1 = (s1); \ + register int __result = __s1[0] - (s2)[0]; \ if (l2 > 0 && __result == 0) \ { \ - __result = __s1[1] - (unsigned char) (s2)[1]; \ + __result = __s1[1] - (s2)[1]; \ if (l2 > 1 && __result == 0) \ { \ - __result = __s1[2] - (unsigned char) (s2)[2]; \ + __result = __s1[2] - (s2)[2]; \ if (l2 > 2 && __result == 0) \ - __result = __s1[3] - (unsigned char) (s2)[3]; \ + __result = __s1[3] - (s2)[3]; \ } \ } \ __result; })) |