From 5157f7c1c34c8fb5ce3080b2fcdfe25d96551c44 Mon Sep 17 00:00:00 2001 From: Josh Coalson Date: Wed, 16 May 2001 19:28:12 +0000 Subject: [PATCH] fix bug where gcc gets shifting wrong --- src/libFLAC/bitbuffer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libFLAC/bitbuffer.c b/src/libFLAC/bitbuffer.c index dff03ca9..6ec34c93 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;