]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
cleanup msvc 2005 build warnings
authorMichael Jerris <mike@jerris.com>
Fri, 20 Feb 2009 21:21:48 +0000 (21:21 +0000)
committerMichael Jerris <mike@jerris.com>
Fri, 20 Feb 2009 21:21:48 +0000 (21:21 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12200 d0543943-73ff-0310-b7d9-9358b9ac24b2

libs/spandsp/src/complex_vector_int.c
libs/spandsp/src/dds_int.c
libs/spandsp/src/g722.c
libs/spandsp/src/lpc10_decode.c
libs/spandsp/src/oki_adpcm.c
libs/spandsp/src/spandsp/complex.h
libs/spandsp/src/vector_int.c

index 1d8d0fb423146d1fb667dbb89aa005dabd1b6ab2..e614d4fedee50b7ddf416283b944b514978b94a2 100644 (file)
@@ -123,8 +123,8 @@ SPAN_DECLARE(void) cvec_lmsi16(const complexi16_t x[], complexi16_t y[], int n,
 
     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 --------------------------------------------------------*/
index 56902d6fe1e719d1f16ef9f9081e1bf34ec1a06e..aebd844479ead3d87037376ff815f17b30c6ab53 100644 (file)
@@ -309,8 +309,8 @@ SPAN_DECLARE(complexi16_t) dds_complexi16_mod(uint32_t *phase_acc, int32_t phase
 {
     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;
 }
index eb3425c6ec3d435d7131977dca3bb7fc25354e58..e51c4d96a6cafbb4ee8563351938b0a8164b40ef 100644 (file)
@@ -214,7 +214,7 @@ static void block4(g722_band_t *s, int16_t dx)
 
     /* 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 @@ static void block4(g722_band_t *s, int16_t dx)
 
     /* 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 @@ static void block4(g722_band_t *s, int16_t dx)
     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;
index 88a88f404bc14e767761d9983801b6b5b25effb1..0cb54bfcd49955f6339028f93f81475ba6d936df 100644 (file)
@@ -68,7 +68,7 @@ static int32_t lpc10_random(lpc10_decode_state_t *s)
 
     /* 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;
index 787df3e32239f5509a7464c1daccb41e33aec7a4..d20f22f0fb13887334a323ab77101907128d18f2 100644 (file)
@@ -178,7 +178,7 @@ static int16_t decode(oki_adpcm_state_t *s, uint8_t adpcm)
         e += (ss >> 1);
     /*endif*/
     if (adpcm & 0x04)
-        e += ss;
+        e = (int16_t)(e + ss);
     /*endif*/
     if (adpcm & 0x08)
         e = -e;
@@ -193,7 +193,7 @@ static int16_t decode(oki_adpcm_state_t *s, uint8_t adpcm)
     /*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 @@ static uint8_t encode(oki_adpcm_state_t *s, int16_t linear)
     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))
index d1a6ec96581a34b669730c8567a204d5a74d3c27..955b1b136761d92f135050d5c15a768d719308f0 100644 (file)
@@ -343,8 +343,8 @@ static __inline__ complexi16_t complex_muli16(const complexi16_t *x, const compl
 {
     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 @@ static __inline__ complexi16_t complex_mul_q1_15(const complexi16_t *x, const co
 {
     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 --------------------------------------------------------*/
index 09e057a6f3b5f28d1d65ae8686bcc5adac0af115..17d5883a4d2e1cb9f5c51023322a6c43f0efa2c4 100644 (file)
@@ -300,7 +300,7 @@ SPAN_DECLARE(void) vec_lmsi16(const int16_t x[], int16_t y[], int n, int16_t err
     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 --------------------------------------------------------*/