diff options
Diffstat (limited to 'sysdeps/i386/i486/bits')
-rw-r--r-- | sysdeps/i386/i486/bits/string.h | 46 |
1 files changed, 24 insertions, 22 deletions
diff --git a/sysdeps/i386/i486/bits/string.h b/sysdeps/i386/i486/bits/string.h index c880f94eed..16e31bdd03 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; })) |