diff src/tls.c @ 5825:5d5aeb79edb4

Fix build with g++. This patch fixes various issues that cause build failures with g++ 4.8.3. See <CAHCOHQ=6yKcjQELvG8FOHXcWVez+HufUWb4FdcJKpUNhm+8B=g@mail.gmail.com> in xemacs-patches.
author Jerry James <james@xemacs.org>
date Thu, 06 Nov 2014 09:34:06 -0700
parents d59bfb050ca8
children 6eca500211f4 574f0cded429
line wrap: on
line diff
--- a/src/tls.c	Sat Oct 25 15:59:31 2014 +0200
+++ b/src/tls.c	Thu Nov 06 09:34:06 2014 -0700
@@ -122,7 +122,7 @@
     }
 
   /* Create the socket */
-  nspr = xmalloc (sizeof (*nspr));
+  nspr = (tls_state_t *) xmalloc (sizeof (*nspr));
   nspr->tls_refcount = 2;
   nspr->tls_file_desc =
     SSL_ImportFD (nss_model, PR_OpenTCPSocket (addr->sa_family));
@@ -507,7 +507,7 @@
   setsockopt (s, IPPROTO_TCP, TCP_NODELAY, &val, sizeof(val));
 
   /* Create the state object */
-  gnutls = xmalloc (sizeof (*gnutls));
+  gnutls = (tls_state_t *) xmalloc (sizeof (*gnutls));
   gnutls->tls_refcount = 2;
 
   /* Initialize the session object */
@@ -615,7 +615,9 @@
       gnutls_datum_t msg;
 
 #ifdef HAVE_GNUTLS_CERTIFICATE_VERIFICATION_STATUS_PRINT
-      int type = gnutls_certificate_type_get (gnutls->tls_session);
+      gnutls_certificate_type_t type;
+
+      type = gnutls_certificate_type_get (gnutls->tls_session);
       err =
 	gnutls_certificate_verification_status_print (status, type, &msg, 0);
 #else
@@ -966,7 +968,7 @@
   setsockopt (s, IPPROTO_TCP, TCP_NODELAY, &val, sizeof(val));
 
   /* Create the state object */
-  openssl = xmalloc (sizeof (*openssl));
+  openssl = (tls_state_t *) xmalloc (sizeof (*openssl));
   openssl->tls_refcount = 2;
 
   /* Create the connection object */