aboutsummaryrefslogtreecommitdiff
path: root/string/strcmp.c
diff options
context:
space:
mode:
authorWill Newton <will.newton@linaro.org>2014-03-31 13:47:56 +0100
committerWill Newton <will.newton@linaro.org>2014-04-07 09:44:02 +0100
commit8667f90ec51aa88146dce815a9105daf23d9bd07 (patch)
tree4ef536ec1362e60ec08c64eca2cd6cce1a7d8dac /string/strcmp.c
parent7ffa9423020fe331b45a56b804c95929a0398e8b (diff)
downloadglibc-8667f90ec51aa88146dce815a9105daf23d9bd07.tar
glibc-8667f90ec51aa88146dce815a9105daf23d9bd07.tar.gz
glibc-8667f90ec51aa88146dce815a9105daf23d9bd07.tar.bz2
glibc-8667f90ec51aa88146dce815a9105daf23d9bd07.zip
string: Cosmetic cleanup of string functions
Clean up string functions that do not have a version in gnulib on the assumption that glibc is the canonical upstream copy of this code. basename has a copy in gnulib but it is largely written to handle Windows paths so merging it is not really viable. The changes mostly consist of switching to ANSI function prototypes and removing unused includes. As many of these functions do not get built in a typical build due to architecture optimized versions being used instead I built these by hand to verify there were no build warnings and the code was identical. 2014-04-07 Will Newton <will.newton@linaro.org> * string/basename.c [HAVE_CONFIG_H]: Remove #ifdef and and contents. [!_LIBC] Remove #ifndef and contents. (basename): Use ANSI prototype. [_LIBC] Remove #idef. * string/memccpy.c (__memccpy): Use ANSI prototype. * string/memfrob.c (memfrob): Likewise. * string/strcoll.c (STRCOLL): Likewise. * string/strlen.c (strlen): Likewise. * string/strtok.c (STRTOK): Likewise. * string/strcat.c: Remove unused #include of memcopy.h. (strcat): Use ANSI prototype. * string/strchr.c: Remove unused #include of memcopy.h. (strchr): Use ANSI prototype. * string/strcmp.c: Remove unused #include of memcopy.h. (strcmp): Use ANSI prototype. * string/strcpy.c: Remove unused #include of memcopy.h. (strcpy): Use ANSI prototype.
Diffstat (limited to 'string/strcmp.c')
-rw-r--r--string/strcmp.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/string/strcmp.c b/string/strcmp.c
index 212f20cc1c..85b0170277 100644
--- a/string/strcmp.c
+++ b/string/strcmp.c
@@ -16,7 +16,6 @@
<http://www.gnu.org/licenses/>. */
#include <string.h>
-#include <memcopy.h>
#undef strcmp
@@ -24,9 +23,7 @@
greater than zero if S1 is lexicographically less than,
equal to or greater than S2. */
int
-strcmp (p1, p2)
- const char *p1;
- const char *p2;
+strcmp (const char *p1, const char *p2)
{
const unsigned char *s1 = (const unsigned char *) p1;
const unsigned char *s2 = (const unsigned char *) p2;