diff --git a/libs/voipcodecs/src/gsm0610_encode.c b/libs/voipcodecs/src/gsm0610_encode.c index 3eea687aa9..e336fff0d0 100644 --- a/libs/voipcodecs/src/gsm0610_encode.c +++ b/libs/voipcodecs/src/gsm0610_encode.c @@ -169,87 +169,87 @@ int gsm0610_pack_wav49(uint8_t c[], const gsm0610_frame_t *s) sr = 0; sr = (sr >> 6) | (s->LARc[0] << 10); sr = (sr >> 6) | (s->LARc[1] << 10); - *c++ = sr >> 4; + *c++ = (uint8_t)(sr >> 4); sr = (sr >> 5) | (s->LARc[2] << 11); - *c++ = sr >> 7; + *c++ = (uint8_t)(sr >> 7); sr = (sr >> 5) | (s->LARc[3] << 11); sr = (sr >> 4) | (s->LARc[4] << 12); - *c++ = sr >> 6; + *c++ = (uint8_t)(sr >> 6); sr = (sr >> 4) | (s->LARc[5] << 12); sr = (sr >> 3) | (s->LARc[6] << 13); - *c++ = sr >> 7; + *c++ = (uint8_t)(sr >> 7); sr = (sr >> 3) | (s->LARc[7] << 13); for (i = 0; i < 4; i++) { sr = (sr >> 7) | (s->Nc[i] << 9); - *c++ = sr >> 5; + *c++ = (uint8_t)(sr >> 5); sr = (sr >> 2) | (s->bc[i] << 14); sr = (sr >> 2) | (s->Mc[i] << 14); sr = (sr >> 6) | (s->xmaxc[i] << 10); - *c++ = sr >> 3; + *c++ = (uint8_t)(sr >> 3); sr = (sr >> 3) | (s->xMc[i][0] << 13); *c++ = sr >> 8; sr = (sr >> 3) | (s->xMc[i][1] << 13); sr = (sr >> 3) | (s->xMc[i][2] << 13); sr = (sr >> 3) | (s->xMc[i][3] << 13); - *c++ = sr >> 7; + *c++ = (uint8_t)(sr >> 7); sr = (sr >> 3) | (s->xMc[i][4] << 13); sr = (sr >> 3) | (s->xMc[i][5] << 13); sr = (sr >> 3) | (s->xMc[i][6] << 13); - *c++ = sr >> 6; + *c++ = (uint8_t)(sr >> 6); sr = (sr >> 3) | (s->xMc[i][7] << 13); sr = (sr >> 3) | (s->xMc[i][8] << 13); - *c++ = sr >> 8; + *c++ = (uint8_t)(sr >> 8); sr = (sr >> 3) | (s->xMc[i][9] << 13); sr = (sr >> 3) | (s->xMc[i][10] << 13); sr = (sr >> 3) | (s->xMc[i][11] << 13); - *c++ = sr >> 7; + *c++ = (uint8_t)(sr >> 7); sr = (sr >> 3) | (s->xMc[i][12] << 13); } /*endfor*/ s++; sr = (sr >> 6) | (s->LARc[0] << 10); - *c++ = sr >> 6; + *c++ = (uint8_t)(sr >> 6); sr = (sr >> 6) | (s->LARc[1] << 10); - *c++ = sr >> 8; + *c++ = (uint8_t)(sr >> 8); sr = (sr >> 5) | (s->LARc[2] << 11); sr = (sr >> 5) | (s->LARc[3] << 11); - *c++ = sr >> 6; + *c++ = (uint8_t)(sr >> 6); sr = (sr >> 4) | (s->LARc[4] << 12); sr = (sr >> 4) | (s->LARc[5] << 12); - *c++ = sr >> 6; + *c++ = (uint8_t)(sr >> 6); sr = (sr >> 3) | (s->LARc[6] << 13); sr = (sr >> 3) | (s->LARc[7] << 13); - *c++ = sr >> 8; + *c++ = (uint8_t)(sr >> 8); for (i = 0; i < 4; i++) { sr = (sr >> 7) | (s->Nc[i] << 9); sr = (sr >> 2) | (s->bc[i] << 14); - *c++ = sr >> 7; + *c++ = (uint8_t)(sr >> 7); sr = (sr >> 2) | (s->Mc[i] << 14); sr = (sr >> 6) | (s->xmaxc[i] << 10); - *c++ = sr >> 7; + *c++ = (uint8_t)(sr >> 7); sr = (sr >> 3) | (s->xMc[i][0] << 13); sr = (sr >> 3) | (s->xMc[i][1] << 13); sr = (sr >> 3) | (s->xMc[i][2] << 13); - *c++ = sr >> 6; + *c++ = (uint8_t)(sr >> 6); sr = (sr >> 3) | (s->xMc[i][3] << 13); sr = (sr >> 3) | (s->xMc[i][4] << 13); - *c++ = sr >> 8; + *c++ = (uint8_t)(sr >> 8); sr = (sr >> 3) | (s->xMc[i][5] << 13); sr = (sr >> 3) | (s->xMc[i][6] << 13); sr = (sr >> 3) | (s->xMc[i][7] << 13); - *c++ = sr >> 7; + *c++ = (uint8_t)(sr >> 7); sr = (sr >> 3) | (s->xMc[i][8] << 13); sr = (sr >> 3) | (s->xMc[i][9] << 13); sr = (sr >> 3) | (s->xMc[i][10] << 13); - *c++ = sr >> 6; + *c++ = (uint8_t)(sr >> 6); sr = (sr >> 3) | (s->xMc[i][11] << 13); sr = (sr >> 3) | (s->xMc[i][12] << 13); - *c++ = sr >> 8; + *c++ = (uint8_t)(sr >> 8); } /*endfor*/ return 65; diff --git a/libs/voipcodecs/src/ima_adpcm.c b/libs/voipcodecs/src/ima_adpcm.c index 6612bb3fc2..4b40b09e3f 100644 --- a/libs/voipcodecs/src/ima_adpcm.c +++ b/libs/voipcodecs/src/ima_adpcm.c @@ -423,9 +423,9 @@ int ima_adpcm_encode(ima_adpcm_state_t *s, i = 0; if (s->chunk_size == 0) { - ima_data[bytes++] = amp[1]; + ima_data[bytes++] = (uint8_t)amp[1]; ima_data[bytes++] = amp[1] >> 8; - ima_data[bytes++] = s->step_index; + ima_data[bytes++] = (uint8_t)s->step_index; ima_data[bytes++] = 0; s->last = amp[1]; s->bits = 0; @@ -443,9 +443,9 @@ int ima_adpcm_encode(ima_adpcm_state_t *s, case IMA_ADPCM_DVI4: if (s->chunk_size == 0) { - ima_data[bytes++] = s->last >> 8; - ima_data[bytes++] = s->last; - ima_data[bytes++] = s->step_index; + ima_data[bytes++] = (uint8_t) (s->last >> 8); + ima_data[bytes++] = (uint8_t) s->last; + ima_data[bytes++] = (uint8_t) s->step_index; ima_data[bytes++] = 0; } for (i = 0; i < len; i++) @@ -460,9 +460,9 @@ int ima_adpcm_encode(ima_adpcm_state_t *s, case IMA_ADPCM_VDVI: if (s->chunk_size == 0) { - ima_data[bytes++] = s->last >> 8; - ima_data[bytes++] = s->last; - ima_data[bytes++] = s->step_index; + ima_data[bytes++] = (uint8_t) (s->last >> 8); + ima_data[bytes++] = (uint8_t) s->last; + ima_data[bytes++] = (uint8_t) s->step_index; ima_data[bytes++] = 0; } s->bits = 0;