X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=libiberty%2Fstrncasecmp.c;h=47700dde5183e70708189672edc52ca4025c4af4;hb=32769083d1b6b1cb325409b3c9b99c06026f70d7;hp=4485cac7a6a2211727d36c3f3573e916c34fa7ce;hpb=27e232885db363fb545fd2f450e72d929e59b8f6;p=deliverable%2Fbinutils-gdb.git diff --git a/libiberty/strncasecmp.c b/libiberty/strncasecmp.c index 4485cac7a6..47700dde51 100644 --- a/libiberty/strncasecmp.c +++ b/libiberty/strncasecmp.c @@ -10,23 +10,29 @@ * is provided ``as is'' without express or implied warranty. */ +/* + +@deftypefn Supplemental int strncasecmp (const char *@var{s1}, const char *@var{s2}) + +A case-insensitive @code{strncmp}. + +@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 * together for a case independent comparison. The mappings are * based upon ascii character sequences. */ -static unsigned char charmap[] = { +static const unsigned char charmap[] = { '\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007', '\010', '\011', '\012', '\013', '\014', '\015', '\016', '\017', '\020', '\021', '\022', '\023', '\024', '\025', '\026', '\027', @@ -62,9 +68,7 @@ static unsigned char charmap[] = { }; int -strncasecmp(s1, s2, n) - const char *s1, *s2; - register size_t n; +strncasecmp(const char *s1, const char *s2, register size_t n) { register unsigned char u1, u2;