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

@ -165,6 +165,10 @@ int main(int argc, char* argv[])
fprintf(stderr, "--- Encoding block %i --- ",blockcount);
len = WebRtcIlbcfix_Encode(Enc_Inst, data, (int16_t)frameLen, encoded_data);
if (len < 0) {
fprintf(stderr, "Error encoding\n");
exit(0);
}
fprintf(stderr, "\r");
/* write byte file */
@ -202,6 +206,10 @@ int main(int argc, char* argv[])
if (pli==1) {
len=WebRtcIlbcfix_Decode(Dec_Inst, encoded_data,
(int16_t)len, decoded_data,&speechType);
if (len < 0) {
fprintf(stderr, "Error decoding\n");
exit(0);
}
} else {
len=WebRtcIlbcfix_DecodePlc(Dec_Inst, decoded_data, 1);
}

View File

@ -139,6 +139,10 @@ int main(int argc, char* argv[])
#else
len=WebRtcIlbcfix_Encode(Enc_Inst, data, (short)(mode<<3), encoded_data);
#endif
if (len < 0) {
fprintf(stderr, "Error encoding\n");
exit(0);
}
fprintf(stderr, "\r");
#ifdef JUNK_DATA
@ -176,6 +180,10 @@ int main(int argc, char* argv[])
if (pli==1) {
len=WebRtcIlbcfix_Decode(Dec_Inst, encoded_data, (int16_t)len, data,
&speechType);
if (len < 0) {
fprintf(stderr, "Error decoding\n");
exit(0);
}
} else {
len=WebRtcIlbcfix_DecodePlc(Dec_Inst, data, 1);
}