diff options
author | Luiz Augusto von Dentz <luiz.dentz@openbossa.org> | 2008-12-18 19:22:31 -0300 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2012-07-29 19:48:27 -0700 |
commit | 66d35388cc48872f32290b25a5da83d8f0ba3562 (patch) | |
tree | ff7f87e6affe06a44593a2913a8b2d53ea47e49b | |
parent | 83bbf018cda76ce780a0af013499760a3c37c087 (diff) |
sbc: Remove unnecessary code and fix a coding style.
-rw-r--r-- | sbc/sbc.c | 25 |
1 files changed, 11 insertions, 14 deletions
@@ -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 |