diff --git a/newlib/ChangeLog b/newlib/ChangeLog index f55df7a8e..d40ef9d86 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,19 @@ +2014-10-09 Freddie Chopin + + * libc/string/memccpy.c (memccpy): Fix warning about signed-unsigned + comparison + * libc/string/memchr.c (memchr): Ditto. + * libc/string/memrchr.c (memrchr): Ditto. + * libc/string/memset.c: (memset): Ditto. + * libc/string/rawmemchr.c (rawmemchr): Ditto. + * libc/string/local.h (__locale_cjk_lang): Fix "function declaration + isn't a prototype" warning. + * libc/string/strcasestr.c (strcasestr): Ditto. + * libc/string/u_strerr.c (_user_strerror): Fix "unused parameter" + warnings. + * libc/string/rawmemchr.c (rawmemchr): Fix comment type + "// ..." -> "/* ... */". + 2014-10-08 Steve Ellcey * newlib/libc/machine/mips/strcmp.c: Remove. diff --git a/newlib/libc/string/local.h b/newlib/libc/string/local.h index dfe01d70b..babaad0e5 100644 --- a/newlib/libc/string/local.h +++ b/newlib/libc/string/local.h @@ -6,7 +6,7 @@ int _EXFUN (__wcwidth, (wint_t)); /* Defined in locale/locale.c. Returns a value != 0 if the current language is assumed to use CJK fonts. */ -int __locale_cjk_lang (); +int _EXFUN (__locale_cjk_lang, (void)); /* Taken from glibc: diff --git a/newlib/libc/string/memccpy.c b/newlib/libc/string/memccpy.c index dded85781..332ed4660 100644 --- a/newlib/libc/string/memccpy.c +++ b/newlib/libc/string/memccpy.c @@ -98,7 +98,7 @@ _DEFUN (memccpy, (dst0, src0, endchar, len0), then punt into the byte copy loop. This should be rare. */ if (!TOO_SMALL(len0) && !UNALIGNED (src, dst)) { - int i; + unsigned int i; unsigned long mask = 0; aligned_dst = (long*)dst; diff --git a/newlib/libc/string/memchr.c b/newlib/libc/string/memchr.c index 13ed88186..db0af7cd7 100644 --- a/newlib/libc/string/memchr.c +++ b/newlib/libc/string/memchr.c @@ -80,7 +80,7 @@ _DEFUN (memchr, (src_void, c, length), #if !defined(PREFER_SIZE_OVER_SPEED) && !defined(__OPTIMIZE_SIZE__) unsigned long *asrc; unsigned long mask; - int i; + unsigned int i; while (UNALIGNED (src)) { diff --git a/newlib/libc/string/memrchr.c b/newlib/libc/string/memrchr.c index 42d9d147b..60dee42ed 100644 --- a/newlib/libc/string/memrchr.c +++ b/newlib/libc/string/memrchr.c @@ -80,7 +80,7 @@ _DEFUN (memrchr, (src_void, c, length), #if !defined(PREFER_SIZE_OVER_SPEED) && !defined(__OPTIMIZE_SIZE__) unsigned long *asrc; unsigned long mask; - int i; + unsigned int i; while (UNALIGNED (src)) { diff --git a/newlib/libc/string/memset.c b/newlib/libc/string/memset.c index ee91b056e..b84e155f7 100644 --- a/newlib/libc/string/memset.c +++ b/newlib/libc/string/memset.c @@ -50,7 +50,7 @@ _DEFUN (memset, (m, c, n), char *s = (char *) m; #if !defined(PREFER_SIZE_OVER_SPEED) && !defined(__OPTIMIZE_SIZE__) - int i; + unsigned int i; unsigned long buffer; unsigned long *aligned_addr; unsigned int d = c & 0xff; /* To avoid sign extension, copy C to an diff --git a/newlib/libc/string/rawmemchr.c b/newlib/libc/string/rawmemchr.c index a9e2acd85..4b5a4cdeb 100644 --- a/newlib/libc/string/rawmemchr.c +++ b/newlib/libc/string/rawmemchr.c @@ -77,7 +77,7 @@ _DEFUN (rawmemchr, (src_void, c), #if !defined(PREFER_SIZE_OVER_SPEED) && !defined(__OPTIMIZE_SIZE__) unsigned long *asrc; unsigned long mask; - int i; + unsigned int i; while (UNALIGNED (src)) { @@ -110,7 +110,7 @@ _DEFUN (rawmemchr, (src_void, c), src = (unsigned char *) asrc; -#endif // !PREFER_SIZE_OVER_SPEED && !__OPTIMIZE_SIZE__ +#endif /* !PREFER_SIZE_OVER_SPEED && !__OPTIMIZE_SIZE__ */ while (1) { diff --git a/newlib/libc/string/strcasestr.c b/newlib/libc/string/strcasestr.c index 1bde1cdbf..8fff00b00 100644 --- a/newlib/libc/string/strcasestr.c +++ b/newlib/libc/string/strcasestr.c @@ -96,8 +96,9 @@ QUICKREF * Find the first occurrence of find in s, ignore case. */ char * -strcasestr(s, find) - const char *s, *find; +_DEFUN (strcasestr, (s, find), + _CONST char *s _AND + _CONST char *find) { #if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__) diff --git a/newlib/libc/string/u_strerr.c b/newlib/libc/string/u_strerr.c index 7d902feb7..2978df0cf 100644 --- a/newlib/libc/string/u_strerr.c +++ b/newlib/libc/string/u_strerr.c @@ -6,5 +6,10 @@ _DEFUN(_user_strerror, (errnum, internal, errptr), int internal _AND int *errptr) { + /* prevent warning about unused parameters */ + _CAST_VOID errnum; + _CAST_VOID internal; + _CAST_VOID errptr; + return 0; }