2004-04-02 Theodore A. Roth * libc/stdio/vfscanf.c: Rename set_bit and bit_is_set to avoid name space clash. Add parentheses when checking flags to quell a compiler warning. Index: libc/stdio/vfscanf.c =================================================================== RCS file: /cvsroot/avr-libc/avr-libc/libc/stdio/vfscanf.c,v retrieving revision 1.3 diff -u -p -p -r1.3 vfscanf.c --- libc/stdio/vfscanf.c 13 Feb 2004 20:35:02 -0000 1.3 +++ libc/stdio/vfscanf.c 2 Apr 2004 21:29:43 -0000 @@ -73,9 +73,9 @@ #define FLNEGATE 0x40 /* negate %[ set */ /* 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)) /* @@ -130,7 +130,7 @@ vfscanf(FILE *stream, const char *fmt, v if (c == '-') { if (i == 0) { addbit: - set_bit(c); + _set_bit(c); i++; continue; } @@ -142,7 +142,7 @@ vfscanf(FILE *stream, const char *fmt, v if (i == 0) goto addbit; if (flags & FLMINUS) /* trailing - before ] */ - set_bit('-'); + _set_bit('-'); if (flags & FLNEGATE) for (i = 0; i < 256 / 8; i++) buf[i] = ~buf[i]; @@ -151,7 +151,7 @@ vfscanf(FILE *stream, const char *fmt, v while (width-- > 0) { if ((i = getc(stream)) == EOF) break; - if (!bit_is_set(i)) { + if (!_bit_is_set(i)) { ungetc(i, stream); break; } @@ -165,7 +165,7 @@ vfscanf(FILE *stream, const char *fmt, v if (flags & FLMINUS) { flags &= ~FLMINUS; while ((unsigned char)j < (unsigned char)c) { - set_bit(j); + _set_bit(j); j++; } } @@ -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;