提交 e4cefcd1 authored 作者: Michael Jerris's avatar Michael Jerris

casts to shut up msvc warnings.

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7651 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 70bed7ec
......@@ -49,6 +49,7 @@
UsePrecompiledHeader="0"
WarningLevel="4"
DebugInformationFormat="3"
EnablePREfast="true"
/>
<Tool
Name="VCManagedResourceCompilerTool"
......@@ -109,6 +110,7 @@
UsePrecompiledHeader="0"
WarningLevel="4"
DebugInformationFormat="3"
EnablePREfast="true"
/>
<Tool
Name="VCManagedResourceCompilerTool"
......
......@@ -189,7 +189,7 @@ int gsm0610_pack_wav49(uint8_t c[], const gsm0610_frame_t *s)
sr = (sr >> 6) | (s->xmaxc[i] << 10);
*c++ = (uint8_t)(sr >> 3);
sr = (sr >> 3) | (s->xMc[i][0] << 13);
*c++ = sr >> 8;
*c++ = (uint8_t)(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);
......@@ -260,43 +260,43 @@ int gsm0610_pack_voip(uint8_t c[33], const gsm0610_frame_t *s)
{
int i;
*c++ = ((GSM0610_MAGIC & 0xF) << 4)
| ((s->LARc[0] >> 2) & 0xF);
*c++ = ((s->LARc[0] & 0x3) << 6)
| (s->LARc[1] & 0x3F);
*c++ = ((s->LARc[2] & 0x1F) << 3)
| ((s->LARc[3] >> 2) & 0x7);
*c++ = ((s->LARc[3] & 0x3) << 6)
*c++ = (uint8_t)(((GSM0610_MAGIC & 0xF) << 4)
| ((s->LARc[0] >> 2) & 0xF));
*c++ = (uint8_t)(((s->LARc[0] & 0x3) << 6)
| (s->LARc[1] & 0x3F));
*c++ = (uint8_t)(((s->LARc[2] & 0x1F) << 3)
| ((s->LARc[3] >> 2) & 0x7));
*c++ = (uint8_t)(((s->LARc[3] & 0x3) << 6)
| ((s->LARc[4] & 0xF) << 2)
| ((s->LARc[5] >> 2) & 0x3);
*c++ = ((s->LARc[5] & 0x3) << 6)
| ((s->LARc[5] >> 2) & 0x3));
*c++ = (uint8_t)(((s->LARc[5] & 0x3) << 6)
| ((s->LARc[6] & 0x7) << 3)
| (s->LARc[7] & 0x7);
| (s->LARc[7] & 0x7));
for (i = 0; i < 4; i++)
{
*c++ = ((s->Nc[i] & 0x7F) << 1)
| ((s->bc[i] >> 1) & 0x1);
*c++ = ((s->bc[i] & 0x1) << 7)
*c++ = (uint8_t)(((s->Nc[i] & 0x7F) << 1)
| ((s->bc[i] >> 1) & 0x1));
*c++ = (uint8_t)(((s->bc[i] & 0x1) << 7)
| ((s->Mc[i] & 0x3) << 5)
| ((s->xmaxc[i] >> 1) & 0x1F);
*c++ = ((s->xmaxc[i] & 0x1) << 7)
| ((s->xmaxc[i] >> 1) & 0x1F));
*c++ = (uint8_t)(((s->xmaxc[i] & 0x1) << 7)
| ((s->xMc[i][0] & 0x7) << 4)
| ((s->xMc[i][1] & 0x7) << 1)
| ((s->xMc[i][2] >> 2) & 0x1);
*c++ = ((s->xMc[i][2] & 0x3) << 6)
| ((s->xMc[i][2] >> 2) & 0x1));
*c++ = (uint8_t)(((s->xMc[i][2] & 0x3) << 6)
| ((s->xMc[i][3] & 0x7) << 3)
| (s->xMc[i][4] & 0x7);
*c++ = ((s->xMc[i][5] & 0x7) << 5)
| (s->xMc[i][4] & 0x7));
*c++ = (uint8_t)(((s->xMc[i][5] & 0x7) << 5)
| ((s->xMc[i][6] & 0x7) << 2)
| ((s->xMc[i][7] >> 1) & 0x3);
*c++ = ((s->xMc[i][7] & 0x1) << 7)
| ((s->xMc[i][7] >> 1) & 0x3));
*c++ = (uint8_t)(((s->xMc[i][7] & 0x1) << 7)
| ((s->xMc[i][8] & 0x7) << 4)
| ((s->xMc[i][9] & 0x7) << 1)
| ((s->xMc[i][10] >> 2) & 0x1);
*c++ = ((s->xMc[i][10] & 0x3) << 6)
| ((s->xMc[i][10] >> 2) & 0x1));
*c++ = (uint8_t)(((s->xMc[i][10] & 0x3) << 6)
| ((s->xMc[i][11] & 0x7) << 3)
| (s->xMc[i][12] & 0x7);
| (s->xMc[i][12] & 0x7));
}
/*endfor*/
return 33;
......
......@@ -140,15 +140,15 @@ static __inline__ int16_t gsm_abs(int16_t a)
static __inline__ int16_t gsm_asr(int16_t a, int n)
{
if (n >= 16)
return -(a < 0);
return (int16_t)(-(a < 0));
/*endif*/
if (n <= -16)
return 0;
/*endif*/
if (n < 0)
return a << -n;
return (int16_t)(a << -n);
/*endif*/
return a >> n;
return (int16_t)(a >> n);
}
/*- End of function --------------------------------------------------------*/
......@@ -158,12 +158,12 @@ static __inline__ int16_t gsm_asl(int16_t a, int n)
return 0;
/*endif*/
if (n <= -16)
return -(a < 0);
return (int16_t)(-(a < 0));
/*endif*/
if (n < 0)
return gsm_asr(a, -n);
/*endif*/
return a << n;
return (int16_t)(a << n);
}
/*- End of function --------------------------------------------------------*/
......
......@@ -424,7 +424,7 @@ int ima_adpcm_encode(ima_adpcm_state_t *s,
if (s->chunk_size == 0)
{
ima_data[bytes++] = (uint8_t)amp[1];
ima_data[bytes++] = amp[1] >> 8;
ima_data[bytes++] = (uint8_t)(amp[1] >> 8);
ima_data[bytes++] = (uint8_t)s->step_index;
ima_data[bytes++] = 0;
s->last = amp[1];
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论