Commit 8fcde379 authored by Timothy B. Terriberry's avatar Timothy B. Terriberry Committed by Jean-Marc Valin
Browse files

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.
parent df2c71ea
......@@ -72,7 +72,7 @@ int ec_byte_write_done(ec_byte_buffer *_b,int _start_bits_available,
/*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;
......
......@@ -48,7 +48,7 @@ int ec_byte_read(ec_byte_buffer *_b){
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;
}
......
......@@ -211,7 +211,7 @@ int ec_dec_cdf(ec_dec *_this,const unsigned *_cdf,unsigned _ftb){
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){
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment