[Freeswitch-svn] [commit] r3099 - in freeswitch/trunk/libs/srtp: . crypto/cipher crypto/hash crypto/kernel crypto/math crypto/replay crypto/rng include

Freeswitch SVN mikej at freeswitch.org
Thu Oct 19 02:29:51 EDT 2006


Author: mikej
Date: Thu Oct 19 02:29:49 2006
New Revision: 3099

Modified:
   freeswitch/trunk/libs/srtp/crypto/cipher/aes_icm.c
   freeswitch/trunk/libs/srtp/crypto/cipher/cipher.c
   freeswitch/trunk/libs/srtp/crypto/cipher/null_cipher.c
   freeswitch/trunk/libs/srtp/crypto/hash/null_auth.c
   freeswitch/trunk/libs/srtp/crypto/kernel/err.c
   freeswitch/trunk/libs/srtp/crypto/math/datatypes.c
   freeswitch/trunk/libs/srtp/crypto/math/stat.c
   freeswitch/trunk/libs/srtp/crypto/replay/rdbx.c
   freeswitch/trunk/libs/srtp/crypto/replay/ut_sim.c
   freeswitch/trunk/libs/srtp/crypto/rng/rand_source.c
   freeswitch/trunk/libs/srtp/include/srtp.h
   freeswitch/trunk/libs/srtp/libsrtp.vcproj

Log:
up the msvc warning level on srtp

Modified: freeswitch/trunk/libs/srtp/crypto/cipher/aes_icm.c
==============================================================================
--- freeswitch/trunk/libs/srtp/crypto/cipher/aes_icm.c	(original)
+++ freeswitch/trunk/libs/srtp/crypto/cipher/aes_icm.c	Thu Oct 19 02:29:49 2006
@@ -49,6 +49,9 @@
 #include "aes_icm.h"
 #include "alloc.h"
 
+#ifdef _MSC_VER
+#pragma warning(disable:4100)
+#endif
 
 debug_module_t mod_aes_icm = {
   0,                 /* debugging is off by default */
@@ -367,7 +370,7 @@
   for (i=0; i < (bytes_to_encr/sizeof(v128_t)); i++) {
 
     /* fill buffer with new keystream */
-    aes_icm_advance_ismacryp(c, forIsmacryp);
+    aes_icm_advance_ismacryp(c, (uint8_t)forIsmacryp);
 
     /*
      * add keystream into the data buffer (this would be a lot faster
@@ -415,7 +418,7 @@
   if ((bytes_to_encr & 0xf) != 0) {
     
     /* fill buffer with new keystream */
-    aes_icm_advance_ismacryp(c, forIsmacryp);
+    aes_icm_advance_ismacryp(c, (uint8_t)forIsmacryp);
     
     for (i=0; i < (bytes_to_encr & 0xf); i++)
       *buf++ ^= c->keystream_buffer.v8[i];

Modified: freeswitch/trunk/libs/srtp/crypto/cipher/cipher.c
==============================================================================
--- freeswitch/trunk/libs/srtp/crypto/cipher/cipher.c	(original)
+++ freeswitch/trunk/libs/srtp/crypto/cipher/cipher.c	Thu Oct 19 02:29:49 2006
@@ -155,7 +155,7 @@
 				     test_case->ciphertext_length_octets));
 
     /* compare the resulting ciphertext with that in the test case */
-    if (len != test_case->ciphertext_length_octets)
+    if ((int)len != test_case->ciphertext_length_octets)
       return err_status_algo_fail;
     status = err_status_ok;
     for (i=0; i < test_case->ciphertext_length_octets; i++)
@@ -222,7 +222,7 @@
 				     test_case->plaintext_length_octets));
 
     /* compare the resulting plaintext with that in the test case */
-    if (len != test_case->plaintext_length_octets)
+    if ((int)len != test_case->plaintext_length_octets)
       return err_status_algo_fail;
     status = err_status_ok;
     for (i=0; i < test_case->plaintext_length_octets; i++)
@@ -344,7 +344,7 @@
 		octet_string_hex_string(buffer, length));    
 
     /* compare the resulting plaintext with the original one */
-    if (length != plaintext_len)
+    if ((int)length != plaintext_len)
       return err_status_algo_fail;
     status = err_status_ok;
     for (i=0; i < plaintext_len; i++)

Modified: freeswitch/trunk/libs/srtp/crypto/cipher/null_cipher.c
==============================================================================
--- freeswitch/trunk/libs/srtp/crypto/cipher/null_cipher.c	(original)
+++ freeswitch/trunk/libs/srtp/crypto/cipher/null_cipher.c	Thu Oct 19 02:29:49 2006
@@ -48,6 +48,10 @@
 #include "null_cipher.h"
 #include "alloc.h"
 
+#ifdef _MSC_VER
+#pragma warning(disable:4100)
+#endif
+
 /* the null_cipher uses the cipher debug module  */
 
 extern debug_module_t mod_cipher;

Modified: freeswitch/trunk/libs/srtp/crypto/hash/null_auth.c
==============================================================================
--- freeswitch/trunk/libs/srtp/crypto/hash/null_auth.c	(original)
+++ freeswitch/trunk/libs/srtp/crypto/hash/null_auth.c	Thu Oct 19 02:29:49 2006
@@ -48,6 +48,10 @@
 #include "null_auth.h" 
 #include "alloc.h"
 
+#ifdef _MSC_VER
+#pragma warning(disable:4100)
+#endif
+
 /* null_auth uses the auth debug module */
 
 extern debug_module_t mod_auth;

Modified: freeswitch/trunk/libs/srtp/crypto/kernel/err.c
==============================================================================
--- freeswitch/trunk/libs/srtp/crypto/kernel/err.c	(original)
+++ freeswitch/trunk/libs/srtp/crypto/kernel/err.c	Thu Oct 19 02:29:49 2006
@@ -42,6 +42,10 @@
  *
  */
 
+#ifdef _MSC_VER
+#pragma warning(disable:4100)
+#endif
+
 #include "err.h"
 
 #ifdef ERR_REPORTING_SYSLOG

Modified: freeswitch/trunk/libs/srtp/crypto/math/datatypes.c
==============================================================================
--- freeswitch/trunk/libs/srtp/crypto/math/datatypes.c	(original)
+++ freeswitch/trunk/libs/srtp/crypto/math/datatypes.c	Thu Oct 19 02:29:49 2006
@@ -149,10 +149,9 @@
   case ('E'): return 0xe;
   case ('f'): return 0xf;
   case ('F'): return 0xf;
-  default: return -1;   /* this flags an error */
   }
-  /* NOTREACHED */
-  return -1;  /* this keeps compilers from complaining */
+  /* this flags an error */
+  return -1;
 }
 
 int
@@ -179,7 +178,7 @@
     tmp = hex_char_to_nibble(hex[0]);
     if (tmp == -1)
       return hex_len;
-    x = (tmp << 4);
+    x = (uint8_t)(tmp << 4);
     hex_len++;
     tmp = hex_char_to_nibble(hex[1]);
     if (tmp == -1)
@@ -564,8 +563,6 @@
     return 63;
   case '=':
     return 64;
-  default:
-    return -1;
  }
  return -1;
 }
@@ -586,7 +583,7 @@
     tmp = base64_char_to_sextet(base64[0]);
     if (tmp == -1)
       return base64_len;
-    x = (tmp << 6);
+    x = (uint8_t)(tmp << 6);
     base64_len++;
     tmp = base64_char_to_sextet(base64[1]);
     if (tmp == -1)

Modified: freeswitch/trunk/libs/srtp/crypto/math/stat.c
==============================================================================
--- freeswitch/trunk/libs/srtp/crypto/math/stat.c	(original)
+++ freeswitch/trunk/libs/srtp/crypto/math/stat.c	Thu Oct 19 02:29:49 2006
@@ -28,7 +28,7 @@
 
   ones_count = 0;
   while (data < data_end) {
-    ones_count += octet_get_weight(*data);
+    ones_count = (uint16_t)(ones_count + octet_get_weight(*data));
     data++;
   }
 

Modified: freeswitch/trunk/libs/srtp/crypto/replay/rdbx.c
==============================================================================
--- freeswitch/trunk/libs/srtp/crypto/replay/rdbx.c	(original)
+++ freeswitch/trunk/libs/srtp/crypto/replay/rdbx.c	Thu Oct 19 02:29:49 2006
@@ -229,7 +229,7 @@
   
   if (delta > 0) {
     /* shift forward by delta */
-    index_advance(&rdbx->index, delta);
+    index_advance(&rdbx->index, (sequence_number_t)delta);
     v128_left_shift(&rdbx->bitmask, delta);
     v128_set_bit(&rdbx->bitmask, 127);
   } else {

Modified: freeswitch/trunk/libs/srtp/crypto/replay/ut_sim.c
==============================================================================
--- freeswitch/trunk/libs/srtp/crypto/replay/ut_sim.c	(original)
+++ freeswitch/trunk/libs/srtp/crypto/replay/ut_sim.c	Thu Oct 19 02:29:49 2006
@@ -47,6 +47,9 @@
 
 #include "ut_sim.h"
 
+#ifdef _MSC_VER
+#pragma warning(disable:4100)
+#endif
 
 int
 ut_compar(const void *a, const void *b) {

Modified: freeswitch/trunk/libs/srtp/crypto/rng/rand_source.c
==============================================================================
--- freeswitch/trunk/libs/srtp/crypto/rng/rand_source.c	(original)
+++ freeswitch/trunk/libs/srtp/crypto/rng/rand_source.c	Thu Oct 19 02:29:49 2006
@@ -97,7 +97,7 @@
 	  /* rand() returns 0-32767 (ugh) */
 	  /* Is this a good enough way to get random bytes?
 	     It is if it passes FIPS-140... */
-	  *dst++ = val & 0xff;
+	  *dst++ = (uint8_t)(val & 0xff);
 	  len--;
   }
 #endif

Modified: freeswitch/trunk/libs/srtp/include/srtp.h
==============================================================================
--- freeswitch/trunk/libs/srtp/include/srtp.h	(original)
+++ freeswitch/trunk/libs/srtp/include/srtp.h	Thu Oct 19 02:29:49 2006
@@ -52,6 +52,7 @@
 
 #ifdef _MSC_VER
 #pragma pack(4)
+#pragma warning(disable:4214)
 #endif
 
 #include "crypto_kernel.h"

Modified: freeswitch/trunk/libs/srtp/libsrtp.vcproj
==============================================================================
--- freeswitch/trunk/libs/srtp/libsrtp.vcproj	(original)
+++ freeswitch/trunk/libs/srtp/libsrtp.vcproj	Thu Oct 19 02:29:49 2006
@@ -52,7 +52,8 @@
 				RuntimeLibrary="3"
 				StructMemberAlignment="0"
 				UsePrecompiledHeader="0"
-				WarningLevel="3"
+				WarningLevel="4"
+				WarnAsError="true"
 				Detect64BitPortabilityProblems="true"
 				DebugInformationFormat="3"
 			/>
@@ -119,7 +120,8 @@
 				RuntimeLibrary="2"
 				StructMemberAlignment="0"
 				UsePrecompiledHeader="0"
-				WarningLevel="3"
+				WarningLevel="4"
+				WarnAsError="true"
 				Detect64BitPortabilityProblems="true"
 				DebugInformationFormat="3"
 			/>
@@ -189,7 +191,8 @@
 				RuntimeLibrary="3"
 				StructMemberAlignment="0"
 				UsePrecompiledHeader="0"
-				WarningLevel="3"
+				WarningLevel="4"
+				WarnAsError="true"
 				Detect64BitPortabilityProblems="true"
 				DebugInformationFormat="4"
 			/>
@@ -271,7 +274,8 @@
 				RuntimeLibrary="2"
 				StructMemberAlignment="0"
 				UsePrecompiledHeader="0"
-				WarningLevel="3"
+				WarningLevel="4"
+				WarnAsError="true"
 				Detect64BitPortabilityProblems="true"
 				DebugInformationFormat="3"
 			/>



More information about the Freeswitch-svn mailing list