From: Josh Coalson Date: Wed, 16 May 2001 19:28:12 +0000 (+0000) Subject: fix bug where gcc gets shifting wrong X-Git-Tag: 1.2.0~2395 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5157f7c1c34c8fb5ce3080b2fcdfe25d96551c44;p=platform%2Fupstream%2Fflac.git fix bug where gcc gets shifting wrong --- diff --git a/src/libFLAC/bitbuffer.c b/src/libFLAC/bitbuffer.c index dff03ca..6ec34c9 100644 --- a/src/libFLAC/bitbuffer.c +++ b/src/libFLAC/bitbuffer.c @@ -277,7 +277,8 @@ bool FLAC__bitbuffer_write_raw_uint32(FLAC__BitBuffer *bb, uint32 val, unsigned return true; if(!bitbuffer_ensure_size_(bb, bits)) return false; - val &= (~(0xffffffffu << bits)); /* zero-out unused bits */ + if(bits < 32) /* @@@ gcc seems to require this because the following line causes incorrect results when bits==32; investigate */ + val &= (~(0xffffffff << bits)); /* zero-out unused bits */ bb->total_bits += bits; while(bits > 0) { n = 8 - bb->bits;