diff --git a/newlib/ChangeLog b/newlib/ChangeLog index a9350e8b8..01ea6fbbc 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,16 @@ +2000-08-23 Werner Almesberger + + * libc/stdio/stdio.c (__swrite): declare "oldmode" only if it's + used later (ifdef __SCLE) + * libc/stdio/vfscanf.c (__svfscanf): declare "state" only if it's + used later (ifdef MB_CAPABLE) + * libc/string/memset.c (memset): removed unused variables "count" + and "unaligned_addr" + * libc/locale/locale.c (_setlocale_r): declare "lc_ctype" and + "last_lc_ctype" only of they're used later (ifdef MB_CAPABLE) + * libc/unix/getpwent.c (getpwnam): removed unused variables "uid" + and "gid" + 2000-08-23 Werner Almesberger * libc/stdlib/envlock.c: changed documented "__env_lock" and diff --git a/newlib/libc/locale/locale.c b/newlib/libc/locale/locale.c index 81d6ae2bc..e1f45335a 100644 --- a/newlib/libc/locale/locale.c +++ b/newlib/libc/locale/locale.c @@ -110,9 +110,6 @@ _DEFUN(_setlocale_r, (p, category, locale), int category _AND _CONST char *locale) { - static char lc_ctype[8] = "C"; - static char last_lc_ctype[8] = "C"; - #ifndef MB_CAPABLE if (locale) { @@ -123,6 +120,9 @@ _DEFUN(_setlocale_r, (p, category, locale), } return "C"; #else + static char lc_ctype[8] = "C"; + static char last_lc_ctype[8] = "C"; + if (locale) { if (category != LC_CTYPE) diff --git a/newlib/libc/stdio/stdio.c b/newlib/libc/stdio/stdio.c index abb7c2335..ddebc8a39 100644 --- a/newlib/libc/stdio/stdio.c +++ b/newlib/libc/stdio/stdio.c @@ -66,7 +66,10 @@ __swrite (cookie, buf, n) int n; { register FILE *fp = (FILE *) cookie; - int w, oldmode=0; + int w; +#ifdef __SCLE + int oldmode=0; +#endif if (fp->_flags & __SAPP) (void) _lseek_r (fp->_data, fp->_file, (off_t) 0, SEEK_END); diff --git a/newlib/libc/stdio/vfscanf.c b/newlib/libc/stdio/vfscanf.c index e9c67fca1..7e88f1202 100644 --- a/newlib/libc/stdio/vfscanf.c +++ b/newlib/libc/stdio/vfscanf.c @@ -116,7 +116,9 @@ __svfscanf (fp, fmt0, ap) char ccltab[256]; /* character class table for %[...] */ char buf[BUF]; /* buffer for numeric conversions */ char *lptr; /* literal pointer */ +#ifdef MB_CAPABLE int state = 0; /* value to keep track of multibyte state */ +#endif short *sp; int *ip; diff --git a/newlib/libc/string/memset.c b/newlib/libc/string/memset.c index f6ec46b9a..a5890c884 100644 --- a/newlib/libc/string/memset.c +++ b/newlib/libc/string/memset.c @@ -56,10 +56,9 @@ _DEFUN (memset, (m, c, n), return m; #else char *s = (char *) m; - int count, i; + int i; unsigned long buffer; unsigned long *aligned_addr; - unsigned char *unaligned_addr; if (!TOO_SMALL (n) && !UNALIGNED (m)) { diff --git a/newlib/libc/unix/getpwent.c b/newlib/libc/unix/getpwent.c index 23a35f49b..90ce30eaf 100644 --- a/newlib/libc/unix/getpwent.c +++ b/newlib/libc/unix/getpwent.c @@ -22,7 +22,6 @@ getpwnam (name) const char *name; { FILE *fp; - int uid, gid; char buf[1024]; if ((fp = fopen ("/etc/passwd", "r")) == NULL)