Hey Christian, On 12/20/2011 09:08 PM, Lucas Stach wrote: > Hi all! > Just jumping in with regard to the assert. > > Am Dienstag, den 20.12.2011, 19:20 +0100 schrieb Maarten Lankhorst: > [snip] >>>> return vlc->buffer>> (64 - num_bits); >>>> } >>>> @@ -130,7 +132,7 @@ vl_vlc_peekbits(struct vl_vlc *vlc, unsigned num_bits) >>>> static INLINE void >>>> vl_vlc_eatbits(struct vl_vlc *vlc, unsigned num_bits) >>>> { >>>> - //assert(vlc->valid_bits> num_bits); >>>> + assert(vlc->valid_bits>= num_bits); >>> Just commenting in all checks isn't such a good idea, since that affect >>> performance very badly, a define which enables all assertions at once at >>> the beginning of the file seems the better idea. >> Sure. > Please don't define your own semantic for this checks. Assert is only > used in debug builds and there it shouldn't matter how it affects > performance. In release builds assert is typically a no-op and therefore > optimized away, but it could also be used to help the compiler optimize > for the asserted conditions. > Asserts should be never deactivated with code defines. > With my explanation for the changes and this, do you still want me to update this patch or would it be ok to apply as is?
~Maarten _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev