]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
up the msvc warning level on srtp
authorMichael Jerris <mike@jerris.com>
Thu, 19 Oct 2006 06:29:49 +0000 (06:29 +0000)
committerMichael Jerris <mike@jerris.com>
Thu, 19 Oct 2006 06:29:49 +0000 (06:29 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@3099 d0543943-73ff-0310-b7d9-9358b9ac24b2

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

index 8e1646f3244ffedcf5623ed3ce03af0f5b4f7bfb..4c01c437da4c52211d41eada026d97f838e9ae5b 100644 (file)
@@ -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 @@ aes_icm_encrypt_ismacryp(aes_icm_ctx_t *c,
   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 @@ aes_icm_encrypt_ismacryp(aes_icm_ctx_t *c,
   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];
index e697a59c13f2ca7e52ade62f5c2d16cd6938d390..761918bf5bbbe593828fa887dce4289c49ef87d3 100644 (file)
@@ -155,7 +155,7 @@ cipher_type_self_test(const cipher_type_t *ct) {
                                     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 @@ cipher_type_self_test(const cipher_type_t *ct) {
                                     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 @@ cipher_type_self_test(const cipher_type_t *ct) {
                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++)
index 812d679f4f0d5d8381169ad7f095c870b9838139..988f6a56afac044bb04b7e9a49af828148e57466 100644 (file)
 #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;
index 77e37da70d74d9503654889c7d5f9b47ee46d443..1d8c556310581d527913d98b45023398c7f15f95 100644 (file)
 #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;
index e64719c346a6369540494e6a986a24dc9b94ac5f..f68a629975c22211ec8a6bddc9c8ba38bc1c3f9c 100644 (file)
  *
  */
 
+#ifdef _MSC_VER
+#pragma warning(disable:4100)
+#endif
+
 #include "err.h"
 
 #ifdef ERR_REPORTING_SYSLOG
index 1b5989b7fa72d62565175362f77d175dfe6b750e..58c7502176dad0d36241502d5a39d8afa8ab9a32 100644 (file)
@@ -149,10 +149,9 @@ hex_char_to_nibble(uint8_t c) {
   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 @@ hex_string_to_octet_string(char *raw, char *hex, int len) {
     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 @@ base64_char_to_sextet(uint8_t c) {
     return 63;
   case '=':
     return 64;
-  default:
-    return -1;
  }
  return -1;
 }
@@ -586,7 +583,7 @@ base64_string_to_octet_string(char *raw, char *base64, int len) {
     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)
index bf1604c533395d96cece2baf65be4acefe10166a..6f94a0c6e690f4a8bd0e00cd0db93a70a4b44689 100644 (file)
@@ -28,7 +28,7 @@ stat_test_monobit(uint8_t *data) {
 
   ones_count = 0;
   while (data < data_end) {
-    ones_count += octet_get_weight(*data);
+    ones_count = (uint16_t)(ones_count + octet_get_weight(*data));
     data++;
   }
 
index 75ca70f4576d1d96f290bdc798ae00cb9420ffec..dcdb138510a21643e376f274bca36773870bc63f 100644 (file)
@@ -229,7 +229,7 @@ rdbx_add_index(rdbx_t *rdbx, int delta) {
   
   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 {
index 18ec4fe440e0c8c5ab31847fa0f597be1310a02e..15258c76ab29ef57bfa65088b085b6a5fc0f2e28 100644 (file)
@@ -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) {
index 48e2a6e0792f7eb473fa32e3e82a889a25a04919..aee16c03e877eb8ac64eb8da2265afbd77788a49 100644 (file)
@@ -97,7 +97,7 @@ rand_source_get_octet_string(void *dest, uint32_t len) {
          /* 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
index 0242744597c99b308d18108af907f155d9c4f08b..7ff861ea4e4a95556da1217a6a28d794d167fb34 100644 (file)
@@ -52,6 +52,7 @@ extern "C" {
 
 #ifdef _MSC_VER
 #pragma pack(4)
+#pragma warning(disable:4214)
 #endif
 
 #include "crypto_kernel.h"
index b27c823a6f5db3d897d43ee0a3d156fb3d85c8a7..71bec43a92ac7d0b6500f52445e1b05b6297aa35 100644 (file)
@@ -52,7 +52,8 @@
                                RuntimeLibrary="3"\r
                                StructMemberAlignment="0"\r
                                UsePrecompiledHeader="0"\r
-                               WarningLevel="3"\r
+                               WarningLevel="4"\r
+                               WarnAsError="true"\r
                                Detect64BitPortabilityProblems="true"\r
                                DebugInformationFormat="3"\r
                        />\r
                                RuntimeLibrary="2"\r
                                StructMemberAlignment="0"\r
                                UsePrecompiledHeader="0"\r
-                               WarningLevel="3"\r
+                               WarningLevel="4"\r
+                               WarnAsError="true"\r
                                Detect64BitPortabilityProblems="true"\r
                                DebugInformationFormat="3"\r
                        />\r
                                RuntimeLibrary="3"\r
                                StructMemberAlignment="0"\r
                                UsePrecompiledHeader="0"\r
-                               WarningLevel="3"\r
+                               WarningLevel="4"\r
+                               WarnAsError="true"\r
                                Detect64BitPortabilityProblems="true"\r
                                DebugInformationFormat="4"\r
                        />\r
                                RuntimeLibrary="2"\r
                                StructMemberAlignment="0"\r
                                UsePrecompiledHeader="0"\r
-                               WarningLevel="3"\r
+                               WarningLevel="4"\r
+                               WarnAsError="true"\r
                                Detect64BitPortabilityProblems="true"\r
                                DebugInformationFormat="3"\r
                        />\r