[Freeswitch-svn] [commit] r12200 - in freeswitch/trunk/libs/spandsp/src: . msvc spandsp
FreeSWITCH SVN
mikej at freeswitch.org
Fri Feb 20 13:21:48 PST 2009
Author: mikej
Date: Fri Feb 20 15:21:48 2009
New Revision: 12200
Log:
cleanup msvc 2005 build warnings
Modified:
freeswitch/trunk/libs/spandsp/src/complex_vector_int.c
freeswitch/trunk/libs/spandsp/src/dds_int.c
freeswitch/trunk/libs/spandsp/src/g722.c
freeswitch/trunk/libs/spandsp/src/lpc10_decode.c
freeswitch/trunk/libs/spandsp/src/msvc/ (props changed)
freeswitch/trunk/libs/spandsp/src/oki_adpcm.c
freeswitch/trunk/libs/spandsp/src/spandsp/complex.h
freeswitch/trunk/libs/spandsp/src/vector_int.c
Modified: freeswitch/trunk/libs/spandsp/src/complex_vector_int.c
==============================================================================
--- freeswitch/trunk/libs/spandsp/src/complex_vector_int.c (original)
+++ freeswitch/trunk/libs/spandsp/src/complex_vector_int.c Fri Feb 20 15:21:48 2009
@@ -123,8 +123,8 @@
for (i = 0; i < n; i++)
{
- y[i].re += ((int32_t) x[i].im*(int32_t) error->im + (int32_t) x[i].re*(int32_t) error->re) >> 12;
- y[i].im += ((int32_t) x[i].re*(int32_t) error->im - (int32_t) x[i].im*(int32_t) error->re) >> 12;
+ y[i].re = (int16_t)(y[i].re + (((int32_t) x[i].im*(int32_t) error->im + (int32_t) x[i].re*(int32_t) error->re) >> 12));
+ y[i].im = (int16_t)(y[i].im + (((int32_t) x[i].re*(int32_t) error->im - (int32_t) x[i].im*(int32_t) error->re) >> 12));
}
}
/*- End of function --------------------------------------------------------*/
Modified: freeswitch/trunk/libs/spandsp/src/dds_int.c
==============================================================================
--- freeswitch/trunk/libs/spandsp/src/dds_int.c (original)
+++ freeswitch/trunk/libs/spandsp/src/dds_int.c Fri Feb 20 15:21:48 2009
@@ -309,8 +309,8 @@
{
complexi16_t amp;
- amp = complex_seti16(((int32_t) dds_lookup(*phase_acc + phase + (1 << 30))*(int32_t) scale) >> 15,
- ((int32_t) dds_lookup(*phase_acc + phase)*(int32_t) scale) >> 15);
+ amp = complex_seti16((int16_t)(((int32_t) dds_lookup(*phase_acc + phase + (1 << 30))*(int32_t) scale) >> 15),
+ (int16_t)(((int32_t) dds_lookup(*phase_acc + phase)*(int32_t) scale) >> 15));
*phase_acc += phase_rate;
return amp;
}
Modified: freeswitch/trunk/libs/spandsp/src/g722.c
==============================================================================
--- freeswitch/trunk/libs/spandsp/src/g722.c (original)
+++ freeswitch/trunk/libs/spandsp/src/g722.c Fri Feb 20 15:21:48 2009
@@ -214,7 +214,7 @@
/* UPPOL1 */
wd1 = ((p ^ s->p[0]) & 0x8000) ? -192 : 192;
- wd2 = ((int32_t) s->a[0]*(int32_t) 32640) >> 15;
+ wd2 = (int16_t)(((int32_t) s->a[0]*(int32_t) 32640) >> 15);
ap[0] = saturated_add16(wd1, wd2);
wd3 = saturated_sub16(15360, ap[1]);
@@ -223,9 +223,9 @@
/* FILTEP */
wd1 = saturated_add16(r, r);
- wd1 = ((int32_t) ap[0]*(int32_t) wd1) >> 15;
+ wd1 = (int16_t)(((int32_t) ap[0]*(int32_t) wd1) >> 15);
wd2 = saturated_add16(s->r, s->r);
- wd2 = ((int32_t) ap[1]*(int32_t) wd2) >> 15;
+ wd2 = (int16_t)(((int32_t) ap[1]*(int32_t) wd2) >> 15);
sp = saturated_add16(wd1, wd2);
s->r = r;
s->a[1] = ap[1];
@@ -242,7 +242,7 @@
for (i = 5; i >= 0; i--)
{
wd2 = ((s->d[i + 1] ^ dx) & 0x8000) ? -wd1 : wd1;
- wd3 = ((int32_t) s->b[i]*(int32_t) 32640) >> 15;
+ wd3 = (int16_t)(((int32_t) s->b[i]*(int32_t) 32640) >> 15);
s->b[i] = saturated_add16(wd2, wd3);
wd3 = saturated_add16(s->d[i], s->d[i]);
sz += ((int32_t) s->b[i]*(int32_t) wd3) >> 15;
Modified: freeswitch/trunk/libs/spandsp/src/lpc10_decode.c
==============================================================================
--- freeswitch/trunk/libs/spandsp/src/lpc10_decode.c (original)
+++ freeswitch/trunk/libs/spandsp/src/lpc10_decode.c Fri Feb 20 15:21:48 2009
@@ -68,7 +68,7 @@
/* The following is a 16 bit 2's complement addition,
with overflow checking disabled */
- s->y[s->k] += s->y[s->j];
+ s->y[s->k] = (int16_t)(s->y[s->k] + s->y[s->j]);
ret_val = s->y[s->k];
if (--s->k < 0)
s->k = 4;
Modified: freeswitch/trunk/libs/spandsp/src/oki_adpcm.c
==============================================================================
--- freeswitch/trunk/libs/spandsp/src/oki_adpcm.c (original)
+++ freeswitch/trunk/libs/spandsp/src/oki_adpcm.c Fri Feb 20 15:21:48 2009
@@ -178,7 +178,7 @@
e += (ss >> 1);
/*endif*/
if (adpcm & 0x04)
- e += ss;
+ e = (int16_t)(e + ss);
/*endif*/
if (adpcm & 0x08)
e = -e;
@@ -193,7 +193,7 @@
/*endif*/
s->last = linear;
- s->step_index += step_adjustment[adpcm & 0x07];
+ s->step_index = (int16_t)(s->step_index + step_adjustment[adpcm & 0x07]);
if (s->step_index < 0)
s->step_index = 0;
else if (s->step_index > 48)
@@ -222,13 +222,13 @@
if (e >= ss)
{
adpcm |= (uint8_t) 0x04;
- e -= ss;
+ e = (int16_t)(e - ss);
}
/*endif*/
if (e >= (ss >> 1))
{
adpcm |= (uint8_t) 0x02;
- e -= ss;
+ e = (int16_t)(e - ss);
}
/*endif*/
if (e >= (ss >> 2))
Modified: freeswitch/trunk/libs/spandsp/src/spandsp/complex.h
==============================================================================
--- freeswitch/trunk/libs/spandsp/src/spandsp/complex.h (original)
+++ freeswitch/trunk/libs/spandsp/src/spandsp/complex.h Fri Feb 20 15:21:48 2009
@@ -343,8 +343,8 @@
{
complexi16_t z;
- z.re = (int32_t) x->re*(int32_t) y->re - (int32_t) x->im*(int32_t) y->im;
- z.im = (int32_t) x->re*(int32_t) y->im + (int32_t) x->im*(int32_t) y->re;
+ z.re = (int16_t)((int32_t) x->re*(int32_t) y->re - (int32_t) x->im*(int32_t) y->im);
+ z.im = (int16_t)((int32_t) x->re*(int32_t) y->im + (int32_t) x->im*(int32_t) y->re);
return z;
}
/*- End of function --------------------------------------------------------*/
@@ -353,8 +353,8 @@
{
complexi16_t z;
- z.re = ((int32_t) x->re*(int32_t) y->re - (int32_t) x->im*(int32_t) y->im) >> 15;
- z.im = ((int32_t) x->re*(int32_t) y->im + (int32_t) x->im*(int32_t) y->re) >> 15;
+ z.re = (int16_t)(((int32_t) x->re*(int32_t) y->re - (int32_t) x->im*(int32_t) y->im) >> 15);
+ z.im = (int16_t)(((int32_t) x->re*(int32_t) y->im + (int32_t) x->im*(int32_t) y->re) >> 15);
return z;
}
/*- End of function --------------------------------------------------------*/
Modified: freeswitch/trunk/libs/spandsp/src/vector_int.c
==============================================================================
--- freeswitch/trunk/libs/spandsp/src/vector_int.c (original)
+++ freeswitch/trunk/libs/spandsp/src/vector_int.c Fri Feb 20 15:21:48 2009
@@ -300,7 +300,7 @@
int i;
for (i = 0; i < n; i++)
- y[i] += ((int32_t) x[i]*(int32_t) error) >> 15;
+ y[i] = (int16_t) (y[i] + (((int32_t) x[i]*(int32_t) error) >> 15));
}
/*- End of function --------------------------------------------------------*/
More information about the Freeswitch-svn
mailing list