avr-libc-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-libc-dev] vfscanf.c namespace clash and paren warning


From: Theodore A. Roth
Subject: Re: [avr-libc-dev] vfscanf.c namespace clash and paren warning
Date: Sat, 3 Apr 2004 00:01:04 -0800 (PST)


On Sat, 3 Apr 2004, Joerg Wunsch wrote:

> 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.

Yeah, I didn't really like it either, but I couldn't think of a better
name myself.

>
> > @@ -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.

I guess I got the parens in the right spot then. ;-)

I'll commit this later this weekend.

Are these ok for 1.0 branch too?

Ted Roth




reply via email to

[Prev in Thread] Current Thread [Next in Thread]