[MPlayer-cvslog] r21218 - trunk/stream/freesdp/parser.c

Reimar Doeffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Mon Nov 27 10:19:21 CET 2006


Hello,
On Mon, Nov 27, 2006 at 03:10:18AM -0500, Rich Felker wrote:
> On Sat, Nov 25, 2006 at 02:39:22PM +0100, reimar wrote:
> > Author: reimar
> > Date: Sat Nov 25 14:39:21 2006
> > New Revision: 21218
> > 
> > Modified:
> >    trunk/stream/freesdp/parser.c
> > 
> > Log:
> > spurious () like in ({code;}) probably is not valid C, icc 9, definitely
> > will not compile it, and whatever it is supposed to be good for it
> > does not seem to be needed.
> > 
> > 
> > Modified: trunk/stream/freesdp/parser.c
> > ==============================================================================
> > --- trunk/stream/freesdp/parser.c	(original)
> > +++ trunk/stream/freesdp/parser.c	Sat Nov 25 14:39:21 2006
> > @@ -44,7 +44,7 @@
> >   * (not followed by a '\n') is found, returns
> >   */
> >  #define NEXT_LINE(c)                                                \
> > -({                                                                  \
> > +{                                                                   \
> >   while ((*(c) != '\0') && (*(c) != '\r') && (*(c) != '\n')) {       \
> >      (c)++;                                                          \
> >   }                                                                  \
> > @@ -58,7 +58,7 @@
> >         return FSDPE_ILLEGAL_CHARACTER;                              \
> >     }                                                                \
> >   }                                                                  \
> > -})
> > +}
> 
> don't use { ... } but instead do { ... } while(0). the former will 
> misbehave if you do something like if (foo) MACRO(); else ...

It's not necessary and ugly. Making it a function is probably a
much better idea...
It could be simplified by using strcspn, too, I'd just need something to
test it.
But actually since it is imported code I'm not sure that making more
than the absolutely necessary changes is a good idea.

Greetings,
Reimar D?ffinger



More information about the MPlayer-cvslog mailing list