Remove duplicate __strcmp_cg
authorOndrej Bilka <neleai@seznam.cz>
Wed, 1 May 2013 18:55:06 +0000 (20:55 +0200)
committerOndrej Bilka <neleai@seznam.cz>
Wed, 1 May 2013 18:55:06 +0000 (20:55 +0200)
The __strcmp_cg code was duplicate of of __strcmp_gc. This patch unifies
these two cases into one.

ChangeLog
string/bits/string2.h

index cd846f9..7df0492 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2013-05-01  Ondřej Bílka  <neleai@seznam.cz>
+
+       * string/bits/string2.h (__strcmp_cg): Call __strcmp_gc.
+
 2013-05-01  Roland McGrath  <roland@hack.frob.com>
 
        * sysdeps/posix/opendir.c: Include <sys/param.h> to get MIN/MAX macros.
index 94f5ee9..ddd1c04 100644 (file)
@@ -887,30 +887,7 @@ __stpcpy_small (char *__dest,
                      }                                                       \
                    __result; }))
 
-# define __strcmp_gc(s1, s2, l2) \
-  (__extension__ ({ const unsigned char *__s1 =                                      \
-                     (const unsigned char *) (const char *) (s1);            \
-                   register int __result =                                   \
-                     __s1[0] - ((const unsigned char *)                      \
-                                (const char *) (s2))[0];                     \
-                   if (l2 > 0 && __result == 0)                              \
-                     {                                                       \
-                       __result = (__s1[1]                                   \
-                                   - ((const unsigned char *)                \
-                                      (const char *) (s2))[1]);              \
-                       if (l2 > 1 && __result == 0)                          \
-                         {                                                   \
-                           __result =                                        \
-                             (__s1[2] - ((const unsigned char *)             \
-                                         (const char *) (s2))[2]);           \
-                           if (l2 > 2 && __result == 0)                      \
-                             __result =                                      \
-                               (__s1[3]                                      \
-                                - ((const unsigned char *)                   \
-                                   (const char *) (s2))[3]);                 \
-                         }                                                   \
-                     }                                                       \
-                   __result; }))
+# define __strcmp_gc(s1, s2, l2) (- __strcmp_cg (s2, s1, l2))
 #endif