[klibc] [PATCH] vsscanf: remove unused variables
maximilian attems
max at stro.at
Thu Dec 1 00:35:57 PST 2011
On Wed, Nov 30, 2011 at 03:55:57PM -0800, Greg Thelen wrote:
> Removed unused local variable from vsscanf().
>
> Signed-off-by: Greg Thelen <gthelen at google.com>
> ---
> usr/klibc/vsscanf.c | 7 -------
> 1 files changed, 0 insertions(+), 7 deletions(-)
hmm in principle correct of course, I was reluctant on doing that,
as hpa might have had something in mind with that variable?
> diff --git a/usr/klibc/vsscanf.c b/usr/klibc/vsscanf.c
> index 51e50f7..b8f068c 100644
> --- a/usr/klibc/vsscanf.c
> +++ b/usr/klibc/vsscanf.c
> @@ -88,7 +88,6 @@ int vsscanf(const char *buffer, const char *format, va_list ap)
> } state = st_normal;
> char *sarg = NULL; /* %s %c or %[ string argument */
> enum bail bail = bail_none;
> - int sign;
> int converted = 0; /* Successful conversions */
> unsigned long matchmap[((1 << CHAR_BIT) + (LONG_BIT - 1)) / LONG_BIT];
> int matchinv = 0; /* Is match map inverted? */
> @@ -177,33 +176,27 @@ int vsscanf(const char *buffer, const char *format, va_list ap)
> case 'p': /* Pointer */
> rank = rank_ptr;
> base = 0;
> - sign = 0;
> goto scan_int;
>
> case 'i': /* Base-independent integer */
> base = 0;
> - sign = 1;
> goto scan_int;
>
> case 'd': /* Decimal integer */
> base = 10;
> - sign = 1;
> goto scan_int;
>
> case 'o': /* Octal integer */
> base = 8;
> - sign = 0;
> goto scan_int;
>
> case 'u': /* Unsigned decimal integer */
> base = 10;
> - sign = 0;
> goto scan_int;
>
> case 'x': /* Hexadecimal integer */
> case 'X':
> base = 16;
> - sign = 0;
> goto scan_int;
>
> case 'n': /* # of characters consumed */
> --
> 1.7.3.1
>
More information about the klibc
mailing list