diff options
author | Eric Blake <ebb9@byu.net> | 2009-12-12 15:54:48 +0100 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2009-12-12 15:59:27 +0100 |
commit | 7abd428fe7be9424ac61e7bfe8691f5e4f1caa9c (patch) | |
tree | 6ba12701fa7ac9e45feb61fa4cfcd294db4dc96e /gettext-runtime | |
parent | 93436b9bb14bdcec377046079d8c910a56d11bd0 (diff) | |
download | external_gettext-7abd428fe7be9424ac61e7bfe8691f5e4f1caa9c.zip external_gettext-7abd428fe7be9424ac61e7bfe8691f5e4f1caa9c.tar.gz external_gettext-7abd428fe7be9424ac61e7bfe8691f5e4f1caa9c.tar.bz2 |
vasnprintf: avoid compiler warnings
Diffstat (limited to 'gettext-runtime')
-rw-r--r-- | gettext-runtime/intl/ChangeLog | 4 | ||||
-rw-r--r-- | gettext-runtime/intl/vasnprintf.c | 36 | ||||
-rw-r--r-- | gettext-runtime/libasprintf/ChangeLog | 4 | ||||
-rw-r--r-- | gettext-runtime/libasprintf/vasnprintf.c | 36 |
4 files changed, 44 insertions, 36 deletions
diff --git a/gettext-runtime/intl/ChangeLog b/gettext-runtime/intl/ChangeLog index 3efacdb..01c65c3 100644 --- a/gettext-runtime/intl/ChangeLog +++ b/gettext-runtime/intl/ChangeLog @@ -1,3 +1,7 @@ +2009-11-17 Eric Blake <ebb9@byu.net> + + * vasnprintf.c (VASNPRINTF): Avoid shadowing our own local variables. + 2009-10-10 Eric Blake <ebb9@byu.net> * relocatable.c (compute_curr_prefix): Fix spelling. diff --git a/gettext-runtime/intl/vasnprintf.c b/gettext-runtime/intl/vasnprintf.c index e198646..791376b 100644 --- a/gettext-runtime/intl/vasnprintf.c +++ b/gettext-runtime/intl/vasnprintf.c @@ -2376,16 +2376,16 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, characters = 0; while (precision > 0) { - char buf[64]; /* Assume MB_CUR_MAX <= 64. */ + char cbuf[64]; /* Assume MB_CUR_MAX <= 64. */ int count; if (*arg_end == 0) /* Found the terminating null wide character. */ break; # if HAVE_WCRTOMB - count = wcrtomb (buf, *arg_end, &state); + count = wcrtomb (cbuf, *arg_end, &state); # else - count = wctomb (buf, *arg_end); + count = wctomb (cbuf, *arg_end); # endif if (count < 0) { @@ -2421,16 +2421,16 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, characters = 0; for (;;) { - char buf[64]; /* Assume MB_CUR_MAX <= 64. */ + char cbuf[64]; /* Assume MB_CUR_MAX <= 64. */ int count; if (*arg_end == 0) /* Found the terminating null wide character. */ break; # if HAVE_WCRTOMB - count = wcrtomb (buf, *arg_end, &state); + count = wcrtomb (cbuf, *arg_end, &state); # else - count = wctomb (buf, *arg_end); + count = wctomb (cbuf, *arg_end); # endif if (count < 0) { @@ -2471,20 +2471,20 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, # endif for (remaining = characters; remaining > 0; ) { - char buf[64]; /* Assume MB_CUR_MAX <= 64. */ + char cbuf[64]; /* Assume MB_CUR_MAX <= 64. */ int count; if (*arg == 0) abort (); # if HAVE_WCRTOMB - count = wcrtomb (buf, *arg, &state); + count = wcrtomb (cbuf, *arg, &state); # else - count = wctomb (buf, *arg); + count = wctomb (cbuf, *arg); # endif if (count <= 0) /* Inconsistency. */ abort (); - memcpy (tmpptr, buf, count); + memcpy (tmpptr, cbuf, count); tmpptr += count; arg++; remaining -= count; @@ -2553,20 +2553,20 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, ENSURE_ALLOCATION (xsum (length, characters)); for (remaining = characters; remaining > 0; ) { - char buf[64]; /* Assume MB_CUR_MAX <= 64. */ + char cbuf[64]; /* Assume MB_CUR_MAX <= 64. */ int count; if (*arg == 0) abort (); # if HAVE_WCRTOMB - count = wcrtomb (buf, *arg, &state); + count = wcrtomb (cbuf, *arg, &state); # else - count = wctomb (buf, *arg); + count = wctomb (cbuf, *arg); # endif if (count <= 0) /* Inconsistency. */ abort (); - memcpy (result + length, buf, count); + memcpy (result + length, cbuf, count); length += count; arg++; remaining -= count; @@ -2582,21 +2582,21 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, # endif while (arg < arg_end) { - char buf[64]; /* Assume MB_CUR_MAX <= 64. */ + char cbuf[64]; /* Assume MB_CUR_MAX <= 64. */ int count; if (*arg == 0) abort (); # if HAVE_WCRTOMB - count = wcrtomb (buf, *arg, &state); + count = wcrtomb (cbuf, *arg, &state); # else - count = wctomb (buf, *arg); + count = wctomb (cbuf, *arg); # endif if (count <= 0) /* Inconsistency. */ abort (); ENSURE_ALLOCATION (xsum (length, count)); - memcpy (result + length, buf, count); + memcpy (result + length, cbuf, count); length += count; arg++; } diff --git a/gettext-runtime/libasprintf/ChangeLog b/gettext-runtime/libasprintf/ChangeLog index 18d875e..458c2c5 100644 --- a/gettext-runtime/libasprintf/ChangeLog +++ b/gettext-runtime/libasprintf/ChangeLog @@ -1,3 +1,7 @@ +2009-11-17 Eric Blake <ebb9@byu.net> + + * vasnprintf.c (VASNPRINTF): Avoid shadowing our own local variables. + 2009-08-20 Eric Blake <ebb9@byu.net> * vasnprintf.c (decimal_point_char): Avoid warning on old-style diff --git a/gettext-runtime/libasprintf/vasnprintf.c b/gettext-runtime/libasprintf/vasnprintf.c index e198646..791376b 100644 --- a/gettext-runtime/libasprintf/vasnprintf.c +++ b/gettext-runtime/libasprintf/vasnprintf.c @@ -2376,16 +2376,16 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, characters = 0; while (precision > 0) { - char buf[64]; /* Assume MB_CUR_MAX <= 64. */ + char cbuf[64]; /* Assume MB_CUR_MAX <= 64. */ int count; if (*arg_end == 0) /* Found the terminating null wide character. */ break; # if HAVE_WCRTOMB - count = wcrtomb (buf, *arg_end, &state); + count = wcrtomb (cbuf, *arg_end, &state); # else - count = wctomb (buf, *arg_end); + count = wctomb (cbuf, *arg_end); # endif if (count < 0) { @@ -2421,16 +2421,16 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, characters = 0; for (;;) { - char buf[64]; /* Assume MB_CUR_MAX <= 64. */ + char cbuf[64]; /* Assume MB_CUR_MAX <= 64. */ int count; if (*arg_end == 0) /* Found the terminating null wide character. */ break; # if HAVE_WCRTOMB - count = wcrtomb (buf, *arg_end, &state); + count = wcrtomb (cbuf, *arg_end, &state); # else - count = wctomb (buf, *arg_end); + count = wctomb (cbuf, *arg_end); # endif if (count < 0) { @@ -2471,20 +2471,20 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, # endif for (remaining = characters; remaining > 0; ) { - char buf[64]; /* Assume MB_CUR_MAX <= 64. */ + char cbuf[64]; /* Assume MB_CUR_MAX <= 64. */ int count; if (*arg == 0) abort (); # if HAVE_WCRTOMB - count = wcrtomb (buf, *arg, &state); + count = wcrtomb (cbuf, *arg, &state); # else - count = wctomb (buf, *arg); + count = wctomb (cbuf, *arg); # endif if (count <= 0) /* Inconsistency. */ abort (); - memcpy (tmpptr, buf, count); + memcpy (tmpptr, cbuf, count); tmpptr += count; arg++; remaining -= count; @@ -2553,20 +2553,20 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, ENSURE_ALLOCATION (xsum (length, characters)); for (remaining = characters; remaining > 0; ) { - char buf[64]; /* Assume MB_CUR_MAX <= 64. */ + char cbuf[64]; /* Assume MB_CUR_MAX <= 64. */ int count; if (*arg == 0) abort (); # if HAVE_WCRTOMB - count = wcrtomb (buf, *arg, &state); + count = wcrtomb (cbuf, *arg, &state); # else - count = wctomb (buf, *arg); + count = wctomb (cbuf, *arg); # endif if (count <= 0) /* Inconsistency. */ abort (); - memcpy (result + length, buf, count); + memcpy (result + length, cbuf, count); length += count; arg++; remaining -= count; @@ -2582,21 +2582,21 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, # endif while (arg < arg_end) { - char buf[64]; /* Assume MB_CUR_MAX <= 64. */ + char cbuf[64]; /* Assume MB_CUR_MAX <= 64. */ int count; if (*arg == 0) abort (); # if HAVE_WCRTOMB - count = wcrtomb (buf, *arg, &state); + count = wcrtomb (cbuf, *arg, &state); # else - count = wctomb (buf, *arg); + count = wctomb (cbuf, *arg); # endif if (count <= 0) /* Inconsistency. */ abort (); ENSURE_ALLOCATION (xsum (length, count)); - memcpy (result + length, buf, count); + memcpy (result + length, cbuf, count); length += count; arg++; } |