Avoid GCC warning about conversion from integer to ptr.
authorAdam Dickmeiss <adam@indexdata.dk>
Tue, 14 Apr 2009 09:44:03 +0000 (11:44 +0200)
committerAdam Dickmeiss <adam@indexdata.dk>
Tue, 14 Apr 2009 09:44:03 +0000 (11:44 +0200)
Add intermediate cast to size_t from int to avoid GCC warning:
cast to pointer from integer of different size .

src/tcpip.c

index ffbcf44..715d0cf 100644 (file)
@@ -610,8 +610,10 @@ int tcpip_rcvconnect(COMSTACK h)
         gnutls_credentials_set (sp->session, GNUTLS_CRD_CERTIFICATE,
                                 sp->cred_ptr->xcred);
         
         gnutls_credentials_set (sp->session, GNUTLS_CRD_CERTIFICATE,
                                 sp->cred_ptr->xcred);
         
-        gnutls_transport_set_ptr(sp->session, (gnutls_transport_ptr_t) h->iofile);
-        
+        /* cast to intermediate size_t to avoid GCC warning. */
+        gnutls_transport_set_ptr(sp->session, 
+                                 (gnutls_transport_ptr_t) 
+                                 (size_t) h->iofile);
         res = gnutls_handshake(sp->session);
         if (res < 0)
         {
         res = gnutls_handshake(sp->session);
         if (res < 0)
         {
@@ -965,8 +967,10 @@ COMSTACK tcpip_accept(COMSTACK h)
                 xfree(state);
                 return 0;
             }
                 xfree(state);
                 return 0;
             }
+            /* cast to intermediate size_t to avoid GCC warning. */
             gnutls_transport_set_ptr(state->session, 
             gnutls_transport_set_ptr(state->session, 
-                                     (gnutls_transport_ptr_t) cnew->iofile);
+                                     (gnutls_transport_ptr_t)
+                                     (size_t) cnew->iofile);
         }
 #elif HAVE_OPENSSL_SSL_H
         state->ctx = st->ctx;
         }
 #elif HAVE_OPENSSL_SSL_H
         state->ctx = st->ctx;