[Freeswitch-svn] [commit] r7651 - in freeswitch/trunk/libs/voipcodecs: . src

Freeswitch SVN mikej at freeswitch.org
Sun Feb 17 00:00:41 EST 2008


Author: mikej
Date: Sun Feb 17 00:00:41 2008
New Revision: 7651

Modified:
   freeswitch/trunk/libs/voipcodecs/libvoipcodecs.2008.vcproj
   freeswitch/trunk/libs/voipcodecs/src/gsm0610_encode.c
   freeswitch/trunk/libs/voipcodecs/src/gsm0610_local.h
   freeswitch/trunk/libs/voipcodecs/src/ima_adpcm.c

Log:
casts to shut up msvc warnings.

Modified: freeswitch/trunk/libs/voipcodecs/libvoipcodecs.2008.vcproj
==============================================================================
--- freeswitch/trunk/libs/voipcodecs/libvoipcodecs.2008.vcproj	(original)
+++ freeswitch/trunk/libs/voipcodecs/libvoipcodecs.2008.vcproj	Sun Feb 17 00:00:41 2008
@@ -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"

Modified: freeswitch/trunk/libs/voipcodecs/src/gsm0610_encode.c
==============================================================================
--- freeswitch/trunk/libs/voipcodecs/src/gsm0610_encode.c	(original)
+++ freeswitch/trunk/libs/voipcodecs/src/gsm0610_encode.c	Sun Feb 17 00:00:41 2008
@@ -189,7 +189,7 @@
     	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 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;

Modified: freeswitch/trunk/libs/voipcodecs/src/gsm0610_local.h
==============================================================================
--- freeswitch/trunk/libs/voipcodecs/src/gsm0610_local.h	(original)
+++ freeswitch/trunk/libs/voipcodecs/src/gsm0610_local.h	Sun Feb 17 00:00:41 2008
@@ -140,15 +140,15 @@
 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 @@
         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 --------------------------------------------------------*/
 

Modified: freeswitch/trunk/libs/voipcodecs/src/ima_adpcm.c
==============================================================================
--- freeswitch/trunk/libs/voipcodecs/src/ima_adpcm.c	(original)
+++ freeswitch/trunk/libs/voipcodecs/src/ima_adpcm.c	Sun Feb 17 00:00:41 2008
@@ -424,7 +424,7 @@
         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];



More information about the Freeswitch-svn mailing list