From 50374ec6946db15ad9d2a681992845840e5d327e Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Thu, 18 Dec 2008 19:22:31 -0300 Subject: Remove unnecessary code and fix a coding style. --- sbc/sbc.c | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) (limited to 'sbc') diff --git a/sbc/sbc.c b/sbc/sbc.c index f766642e..54118934 100644 --- a/sbc/sbc.c +++ b/sbc/sbc.c @@ -912,25 +912,22 @@ static int sbc_analyze_audio(struct sbc_encoder_state *state, /* Supplementary bitstream writing macros for 'sbc_pack_frame' */ #define PUT_BITS(v, n)\ - {\ - bits_cache = (v) | (bits_cache << (n));\ - bits_count += (n);\ - if (bits_count >= 16) {\ - bits_count -= 8;\ - *data_ptr++ = (uint8_t)(bits_cache >> bits_count);\ - bits_count -= 8;\ - *data_ptr++ = (uint8_t)(bits_cache >> bits_count);\ - }\ - } while (0);\ + bits_cache = (v) | (bits_cache << (n));\ + bits_count += (n);\ + if (bits_count >= 16) {\ + bits_count -= 8;\ + *data_ptr++ = (uint8_t) (bits_cache >> bits_count);\ + bits_count -= 8;\ + *data_ptr++ = (uint8_t) (bits_cache >> bits_count);\ + }\ #define FLUSH_BITS()\ while (bits_count >= 8) {\ bits_count -= 8;\ - *data_ptr++ = (uint8_t)(bits_cache >> bits_count);\ - }\ - if (bits_count > 0) {\ - *data_ptr++ = (uint8_t)(bits_cache << (8 - bits_count));\ + *data_ptr++ = (uint8_t) (bits_cache >> bits_count);\ }\ + if (bits_count > 0)\ + *data_ptr++ = (uint8_t) (bits_cache << (8 - bits_count));\ /* * Packs the SBC frame from frame into the memory at data. At most len -- cgit