truespeech: use sizeof() instead of hardcoded sizes

This commit is contained in:
Justin Ruggles 2011-10-13 14:03:17 -04:00
parent 6d55506c8b
commit c6ac30c84b
1 changed files with 3 additions and 3 deletions

View File

@ -127,7 +127,7 @@ static void truespeech_correlate_filter(TSContext *dec)
for(i = 0; i < 8; i++){ for(i = 0; i < 8; i++){
if(i > 0){ if(i > 0){
memcpy(tmp, dec->cvector, i * 2); memcpy(tmp, dec->cvector, i * sizeof(*tmp));
for(j = 0; j < i; j++) for(j = 0; j < i; j++)
dec->cvector[j] = ((tmp[i - j - 1] * dec->vector[i]) + dec->cvector[j] = ((tmp[i - j - 1] * dec->vector[i]) +
(dec->cvector[j] << 15) + 0x4000) >> 15; (dec->cvector[j] << 15) + 0x4000) >> 15;
@ -169,7 +169,7 @@ static void truespeech_apply_twopoint_filter(TSContext *dec, int quart)
t = dec->offset2[quart]; t = dec->offset2[quart];
if(t == 127){ if(t == 127){
memset(dec->newvec, 0, 60 * 2); memset(dec->newvec, 0, 60 * sizeof(*dec->newvec));
return; return;
} }
for(i = 0; i < 146; i++) for(i = 0; i < 146; i++)
@ -194,7 +194,7 @@ static void truespeech_place_pulses(TSContext *dec, int16_t *out, int quart)
int16_t *ptr2; int16_t *ptr2;
int coef; int coef;
memset(out, 0, 60 * 2); memset(out, 0, 60 * sizeof(*out));
for(i = 0; i < 7; i++) { for(i = 0; i < 7; i++) {
t = dec->pulseval[quart] & 3; t = dec->pulseval[quart] & 3;
dec->pulseval[quart] >>= 2; dec->pulseval[quart] >>= 2;