]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Fixed compiler warnings in Windows build (MinGW).
authorjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>
Sat, 26 Jul 2008 08:27:50 +0000 (08:27 +0000)
committerjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>
Sat, 26 Jul 2008 08:27:50 +0000 (08:27 +0000)
git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@3125 e7ae566f-a301-0410-adde-c780ea21d3b5

buffer.c
cryptoapi.c
error.c
pkcs11.c
route.c
win32.c

index b62d4b88e0bd4773b4f2a9020a49fffb9c8371f1..0fe9b61fd8298ac573019b16d4890aa1de6f8b00 100644 (file)
--- a/buffer.c
+++ b/buffer.c
@@ -35,9 +35,9 @@
 size_t
 array_mult_safe (const size_t m1, const size_t m2)
 {
-  const unsigned long long limit = 0xFFFFFFFF;
+  const size_t limit = 0xFFFFFFFF;
   unsigned long long res = (unsigned long long)m1 * (unsigned long long)m2;
-  if (unlikely(m1 > limit) || unlikely(m2 > limit) || unlikely(res > limit))
+  if (unlikely(m1 > limit) || unlikely(m2 > limit) || unlikely(res > (unsigned long long)limit))
     msg (M_FATAL, "attemped allocation of excessively large array");
   return (size_t) res;
 }
index 9324b2731412c8991146f2996c4f8fb18b8f585e..3b78e2bdf1699c908d2f2fa6d9230d42b2df2d12 100644 (file)
@@ -369,7 +369,7 @@ int SSL_CTX_use_CryptoAPI_certificate(SSL_CTX *ssl_ctx, const char *cert_prop)
     }
 
     /* cert_context->pbCertEncoded is the cert X509 DER encoded. */
-    cert = d2i_X509(NULL, (unsigned char **) &cd->cert_context->pbCertEncoded,
+    cert = d2i_X509(NULL, (const unsigned char **) &cd->cert_context->pbCertEncoded,
                    cd->cert_context->cbCertEncoded);
     if (cert == NULL) {
        SSLerr(SSL_F_SSL_CTX_USE_CERTIFICATE_FILE, ERR_R_ASN1_LIB);
diff --git a/error.c b/error.c
index 842ad83d0919d822da8a3ec80872ed33eccf2a01..f1e79969b674bd79f1c97f163ee2ab970e0efb19 100644 (file)
--- a/error.c
+++ b/error.c
@@ -78,7 +78,9 @@ static bool use_syslog;     /* GLOBAL */
 static bool suppress_timestamps; /* GLOBAL */
 
 /* The program name passed to syslog */
+#if SYSLOG_CAPABILITY
 static char *pgmname_syslog;  /* GLOBAL */
+#endif
 
 /* If non-null, messages should be written here (used for debugging only) */
 static FILE *msgfp;         /* GLOBAL */
index d2f3c802ba62baf500f5aee2513c1540b1298dfa..a58a00cb458d21377e257b3c9716099ae9c45e6e 100644 (file)
--- a/pkcs11.c
+++ b/pkcs11.c
@@ -436,7 +436,9 @@ pkcs11_management_id_get (
 ) {
        pkcs11h_certificate_id_list_t id_list = NULL;
        pkcs11h_certificate_id_list_t entry = NULL;
+#if 0 /* certificate_id seems to be unused -- JY */
        pkcs11h_certificate_id_t certificate_id = NULL;
+#endif
        pkcs11h_certificate_t certificate = NULL;
        CK_RV rv = CKR_OK;
        char *certificate_blob = NULL;
diff --git a/route.c b/route.c
index 47a6013f628719e041b7b297b87981b29bc3ae8d..5b7b036bc4a7f46b4bafd3d968197c3ef5879b4f 100644 (file)
--- a/route.c
+++ b/route.c
@@ -2041,7 +2041,7 @@ static void
 get_bypass_addresses (struct route_bypass *rb, const unsigned int flags)
 {
   struct gc_arena gc = gc_new ();
-  bool ret_bool = false;
+  /*bool ret_bool = false;*/
 
   /* get full routing table */
   const MIB_IPFORWARDTABLE *routes = get_windows_routing_table (&gc);
diff --git a/win32.c b/win32.c
index ec9247eaa50ad360313a7ab62d8863b848236a76..e6d7b483c97a132e4edb959264efb6b3e81d9478 100644 (file)
--- a/win32.c
+++ b/win32.c
@@ -774,7 +774,6 @@ getpass (const char *prompt)
 static bool
 cmp_prefix (const char *str, const bool n, const char *pre)
 {
-  const size_t len = strlen (pre);
   size_t i = 0;
 
   if (!str)