summaryrefslogtreecommitdiffstats
path: root/sbc
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.dentz@openbossa.org>2008-12-18 19:22:31 -0300
committerMarcel Holtmann <marcel@holtmann.org>2008-12-18 23:46:43 +0100
commit50374ec6946db15ad9d2a681992845840e5d327e (patch)
tree676b612ffd4c857c3c62a950897c42823e8e6419 /sbc
parent91a3fc0c35014d43da84700204178ef594746b1f (diff)
Remove unnecessary code and fix a coding style.
Diffstat (limited to 'sbc')
-rw-r--r--sbc/sbc.c25
1 files changed, 11 insertions, 14 deletions
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