(strcmp): Cast arguments to __strcmp_cc, __strcmp_cg, and __strcmp_gc
authordrepper <drepper>
Fri, 3 Nov 2000 00:28:40 +0000 (00:28 +0000)
committerdrepper <drepper>
Fri, 3 Nov 2000 00:28:40 +0000 (00:28 +0000)
to unsigned char *.
(__strcmp_cc, __strcmp_cg, __strcmp_gc): Remove casts of values here.

sysdeps/i386/i486/bits/string.h

index c880f94..16e31bd 100644 (file)
@@ -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; }))