X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=libiberty%2Fstrcasecmp.c;h=131d81c2ce7881fa48c363dc5bf5fb302c61ce0b;hb=ab1ddbcf110a3f1ad45e3a346d2da98ffb833dec;hp=3aa930b696f07b877a489010d1cedf5687efaafd;hpb=30727aa6d12fb866494020c0b62ab265a2bdcdfe;p=deliverable%2Fbinutils-gdb.git diff --git a/libiberty/strcasecmp.c b/libiberty/strcasecmp.c index 3aa930b696..131d81c2ce 100644 --- a/libiberty/strcasecmp.c +++ b/libiberty/strcasecmp.c @@ -10,16 +10,22 @@ * is provided ``as is'' without express or implied warranty. */ +/* + +@deftypefn Supplemental int strcasecmp (const char *@var{s1}, const char *@var{s2}) + +A case-insensitive @code{strcmp}. + +@end deftypefn + +*/ + #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)strcasecmp.c 5.5 (Berkeley) 11/24/87"; #endif /* LIBC_SCCS and not lint */ #include -#ifdef __STDC__ #include -#else -#define size_t unsigned long -#endif /* * This array is designed for mapping upper and lower case letter @@ -27,7 +33,7 @@ static char sccsid[] = "@(#)strcasecmp.c 5.5 (Berkeley) 11/24/87"; * based upon ascii character sequences. */ typedef unsigned char uc; -static unsigned char charmap[] = { +static const unsigned char charmap[] = { (uc)'\000',(uc)'\001',(uc)'\002',(uc)'\003',(uc)'\004',(uc)'\005',(uc)'\006',(uc)'\007', (uc)'\010',(uc)'\011',(uc)'\012',(uc)'\013',(uc)'\014',(uc)'\015',(uc)'\016',(uc)'\017', (uc)'\020',(uc)'\021',(uc)'\022',(uc)'\023',(uc)'\024',(uc)'\025',(uc)'\026',(uc)'\027', @@ -63,8 +69,7 @@ static unsigned char charmap[] = { }; int -strcasecmp(s1, s2) - const char *s1, *s2; +strcasecmp(const char *s1, const char *s2) { register unsigned char u1, u2;