[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-libc-dev] vfscanf.c namespace clash and paren warning
From: |
Joerg Wunsch |
Subject: |
Re: [avr-libc-dev] vfscanf.c namespace clash and paren warning |
Date: |
Sat, 3 Apr 2004 09:05:34 +0200 |
User-agent: |
Mutt/1.2.5i |
As Theodore A. Roth wrote:
> /* bit set macros for %[ format */
> -#define set_bit(i) \
> +#define _set_bit(i) \
> buf[(unsigned char)(i) / 8] |= (1 << (unsigned char)(i) % 8)
> -#define bit_is_set(i) \
> +#define _bit_is_set(i) \
> (buf[(unsigned char)(i) / 8] & (1 << (unsigned char)(i) % 8))
I don't object, but don't particularly like the idea of a leading
underscore either. Maybe renaming them to something more descriptive
is better? I don't have a good idea about a better name thoug.
> @@ -401,7 +401,7 @@ vfscanf(FILE *stream, const char *fmt, v
> #if SCANF_LEVEL > SCANF_MIN
> if (!(flags & FLSTAR)) {
> #endif /* SCANF_LEVEL > SCANF_MIN */
> - if (flags & (FLLONG | FLUNSIGNED)
> + if ((flags & (FLLONG | FLUNSIGNED))
> == (FLLONG | FLUNSIGNED))
> *(va_arg(ap, unsigned long *)) =
> a.ul;
That actually fixes a bug. :-o
Hmpf, I thought I had fixed that before, but only introduced a different
bug. :( Should have tested it before committing.
--
J"org Wunsch Unix support engineer
address@hidden http://www.interface-systems.de/~j/