Prepare to convert various types to size_t.

This makes some behaviorally-invariant changes to make certain code that
currently only works correctly with signed types work safely regardless of the
signedness of the types in question.  This is preparation for a future change
that will convert a variety of types to size_t.

There are also some formatting changes (e.g. converting "enum hack" usage to real consts) to make it simpler to just change "int" to "size_t" in the future to change the types of those constants.

BUG=none
R=andrew@webrtc.org, juberti@webrtc.org, kwiberg@webrtc.org
TBR=ajm

Review URL: https://codereview.webrtc.org/1174813003

Cr-Commit-Position: refs/heads/master@{#9413}
This commit is contained in:
Peter Kasting
2015-06-10 21:15:38 -07:00
parent 786dbdcc38
commit f045e4da43
42 changed files with 153 additions and 127 deletions

View File

@ -41,7 +41,7 @@ void WebRtcIlbcfix_DecodeResidual(
int16_t *syntdenum /* (i) the decoded synthesis filter
coefficients */
) {
int16_t meml_gotten, Nfor, Nback, diff, start_pos;
int16_t meml_gotten, diff, start_pos;
int16_t subcount, subframe;
int16_t *reverseDecresidual = iLBCdec_inst->enh_buf; /* Reversed decoded data, used for decoding backwards in time (reuse memory in state) */
int16_t *memVec = iLBCdec_inst->prevResidual; /* Memory for codebook and filter state (reuse memory in state) */
@ -110,9 +110,7 @@ void WebRtcIlbcfix_DecodeResidual(
/* forward prediction of subframes */
Nfor = iLBCdec_inst->nsub-iLBC_encbits->startIdx-1;
if( Nfor > 0 ) {
if (iLBCdec_inst->nsub > iLBC_encbits->startIdx + 1) {
/* setup memory */
WebRtcSpl_MemSetW16(mem, 0, CB_MEML-STATE_LEN);
@ -121,6 +119,7 @@ void WebRtcIlbcfix_DecodeResidual(
/* loop over subframes to encode */
int16_t Nfor = iLBCdec_inst->nsub - iLBC_encbits->startIdx - 1;
for (subframe=0; subframe<Nfor; subframe++) {
/* construct decoded vector */
@ -143,9 +142,7 @@ void WebRtcIlbcfix_DecodeResidual(
/* backward prediction of subframes */
Nback = iLBC_encbits->startIdx-1;
if( Nback > 0 ){
if (iLBC_encbits->startIdx > 1) {
/* setup memory */
@ -160,6 +157,7 @@ void WebRtcIlbcfix_DecodeResidual(
/* loop over subframes to decode */
int16_t Nback = iLBC_encbits->startIdx - 1;
for (subframe=0; subframe<Nback; subframe++) {
/* construct decoded vector */