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.
This commit is contained in:
parent
df2c71ea5a
commit
8fcde379ec
3 changed files with 3 additions and 3 deletions
|
@ -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){
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue