about summary refs log tree commit diff
diff options
context:
space:
mode:
authorOndrej Bilka <neleai@seznam.cz>2013-05-01 20:55:06 +0200
committerOndrej Bilka <neleai@seznam.cz>2013-05-01 20:55:06 +0200
commita07c5731d63d0db1659d273ee42d46ac15daeffc (patch)
treef74eb481e12a7726949307adf8bdcbde040c1de9
parent1324e37f2e36fb641b82ad7b353fa28d5d57e44b (diff)
downloadglibc-a07c5731d63d0db1659d273ee42d46ac15daeffc.tar.gz
glibc-a07c5731d63d0db1659d273ee42d46ac15daeffc.tar.xz
glibc-a07c5731d63d0db1659d273ee42d46ac15daeffc.zip
Remove duplicate __strcmp_cg
The __strcmp_cg code was duplicate of of __strcmp_gc. This patch unifies
these two cases into one.
-rw-r--r--ChangeLog4
-rw-r--r--string/bits/string2.h25
2 files changed, 5 insertions, 24 deletions
diff --git a/ChangeLog b/ChangeLog
index cd846f94ea..7df0492270 100644
--- 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.
diff --git a/string/bits/string2.h b/string/bits/string2.h
index 94f5ee917f..ddd1c045a0 100644
--- a/string/bits/string2.h
+++ b/string/bits/string2.h
@@ -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