[FFmpeg-devel] [PATCH 3/4] Sanitise get_bits macros, part 2

Michael Niedermayer michaelni
Sun Jan 23 12:21:18 CET 2011


On Sun, Jan 23, 2011 at 09:45:26AM +0100, Diego Biurrun wrote:
> On Sun, Jan 23, 2011 at 02:35:51AM +0000, Mans Rullgard wrote:
> > These whitespace changes improve the readability of the get_bits
> > macros.
> > 
> > --- a/libavcodec/get_bits.h
> > +++ b/libavcodec/get_bits.h
> > @@ -125,56 +125,46 @@ for examples see get_bits, show_bits, skip_bits, get_vlc
> >  
> > -#   define UPDATE_CACHE(name, gb)\
> > -        name##_cache= AV_RL32( ((const uint8_t *)(gb)->buffer)+(name##_index>>3) ) >> (name##_index&0x07)
> > +#   define UPDATE_CACHE(name, gb) \
> > +    name##_cache = AV_RL32(((const uint8_t *)(gb)->buffer)+(name##_index>>3)) >> (name##_index&0x07)
> >  
> > -#   define UPDATE_CACHE(name, gb)\
> > -        name##_cache= AV_RB32( ((const uint8_t *)(gb)->buffer)+(name##_index>>3) ) << (name##_index&0x07)
> > +#   define UPDATE_CACHE(name, gb) \
> > +    name##_cache = AV_RB32(((const uint8_t *)(gb)->buffer)+(name##_index>>3)) << (name##_index&0x07)
> >  
> > @@ -409,38 +391,38 @@ static inline int check_marker(GetBitContext *s, const char *msg)
> >  
> >  #elif defined A32_BITSTREAM_READER
> > -    s->buffer_ptr = (uint32_t*)((intptr_t)buffer&(~3));
> > -    s->bit_count = 32 + 8*((intptr_t)buffer&3);
> > +    s->buffer_ptr   = (uint32_t*)((intptr_t)buffer&(~3));
> > +    s->bit_count    = 32 + 8*((intptr_t)buffer&3);
> 
> 
> While you are changing these lines anyway, I think a few more spaces
> around operators would make this more readable.

agree
and some vertical alignment should help too

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Many things microsoft did are stupid, but not doing something just because
microsoft did it is even more stupid. If everything ms did were stupid they
would be bankrupt already.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20110123/8c6159d0/attachment.pgp>



More information about the ffmpeg-devel mailing list