On date Monday 2011-04-18 16:20:43 -0400, Ronald S. Bultje wrote: > Hi, > > On Mon, Apr 18, 2011 at 3:03 AM, Anton Khirnov <an...@khirnov.net> wrote: > > -#define AVIO_RDONLY 1 /**< read-only */ > > -#define AVIO_WRONLY 2 /**< write-only */ > > -#define AVIO_RDWR 4 /**< read-write */ > > +#define AVIO_FLAG_READ 1 /**< > > read-only */ > > +#define AVIO_FLAG_WRITE 2 /**< > > write-only */
> > +#define AVIO_FLAG_READ_WRITE (AVIO_FLAG_READ|AVIO_FLAG_WRITE) /**< > > read-write pseudo flag */ > > Now note this is very dangerous: you CAN NOT use a&b anymore to check > for R/W. You HAVE TO use a&b == b. Maybe it's better just get rid of the AVIO_FLAG_READ_WRITE pseudo flag, it's still useful when doing: ffurl_open(..., AVIO_FLAG_READ_WRITE) in place of: ffurl_open(..., AVIO_FLAG_READ|AVIO_FLAG_WRITE) to save some chars, but i agree it's rather misleading when used like a flag. > > - if (flags & AVIO_RDWR) { > > + if (flags & AVIO_FLAG_READ_WRITE) { > > E.g. this is wrong, it doesn't do what you think it does. -- "I say we take off; nuke the site from orbit. It's the only way to be sure." -- Corporal Hicks, in "Aliens" _______________________________________________ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel