shithub: opus

Download patch

ref: 8fcde379ec369568e72d1294e332efa7ce11cd69
parent: df2c71ea5ad313e16c73e7eeaf42bbfa826866e3
author: Timothy B. Terriberry <[email protected]>
date: Thu Dec 23 06:01:22 EST 2010

Clean up some type usage.

ec_byte_read() ec_byte_read_from_end() had different return types.
ec_dec_bits() was storing its return value as int instead of
 ec_uint32, which will break if int is only 16 bits.

--- a/libcelt/entcode.h
+++ b/libcelt/entcode.h
@@ -72,7 +72,7 @@
 /*Decoding functions.*/
 void ec_byte_readinit(ec_byte_buffer *_b,unsigned char *_buf,ec_uint32 _bytes);
 int ec_byte_read(ec_byte_buffer *_b);
-unsigned char ec_byte_read_from_end(ec_byte_buffer *_b);
+int ec_byte_read_from_end(ec_byte_buffer *_b);
 /*Shared functions.*/
 static inline void ec_byte_reset(ec_byte_buffer *_b){
   _b->offs=_b->end_offs=0;
--- a/libcelt/entdec.c
+++ b/libcelt/entdec.c
@@ -48,7 +48,7 @@
   return _b->offs<_b->storage?_b->buf[_b->offs++]:0;
 }
 
-unsigned char ec_byte_read_from_end(ec_byte_buffer *_b){
+int ec_byte_read_from_end(ec_byte_buffer *_b){
   return _b->end_offs<_b->storage?_b->buf[_b->storage-++(_b->end_offs)]:0;
 }
 
--- a/libcelt/rangedec.c
+++ b/libcelt/rangedec.c
@@ -211,7 +211,7 @@
 ec_uint32 ec_dec_bits(ec_dec *_this,unsigned _bits){
   ec_window window;
   int       available;
-  int       ret;
+  ec_uint32 ret;
   window=_this->end_window;
   available=_this->nend_bits;
   if(available<_bits){