]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
Fix integer/pointer cast warnings in the Guile bindings on x86_64.
authorLudovic Courtès <ludo@gnu.org>
Wed, 23 Sep 2009 09:07:13 +0000 (11:07 +0200)
committerLudovic Courtès <ludo@gnu.org>
Wed, 23 Sep 2009 09:08:19 +0000 (11:08 +0200)
* guile/src/core.c (do_fill_port, fill_session_record_port_input,
  scm_gnutls_set_session_transport_fd_x): Make sure pointer/integer casts
  use integers of the right size.

guile/src/core.c

index 2eafd740a125088d26f4339fcb1e2812c5fac221..f791ef80ff63f86396fd0e747507bf750b1ffcd3 100644 (file)
@@ -22,6 +22,7 @@
 #endif
 
 #include <stdio.h>
+#include <stdint.h>
 #include <string.h>
 #include <gnutls/gnutls.h>
 #include <libguile.h>
@@ -787,7 +788,7 @@ do_fill_port (void *data)
   else
     scm_gnutls_error (result, "fill_session_record_port_input");
 
-  return ((void *) chr);
+  return ((void *) (uintptr_t) chr);
 }
 
 /* Fill in the input buffer of PORT.  */
@@ -813,11 +814,11 @@ fill_session_record_port_input (SCM port)
       if (SCM_GNUTLS_SESSION_TRANSPORT_IS_FD (c_session))
        /* SESSION's underlying transport is a raw file descriptor, so we
           must leave "Guile mode" to allow the GC to run.  */
-       chr = (int) scm_without_guile (do_fill_port, &c_args);
+       chr = (intptr_t) scm_without_guile (do_fill_port, &c_args);
       else
        /* SESSION's underlying transport is a port, so don't leave "Guile
           mode".  */
-       chr = (int) do_fill_port (&c_args);
+       chr = (intptr_t) do_fill_port (&c_args);
     }
   else
     chr = (int) *c_port->read_pos;
@@ -939,7 +940,7 @@ SCM_DEFINE (scm_gnutls_set_session_transport_fd_x,
   c_session = scm_to_gnutls_session (session, 1, FUNC_NAME);
   c_fd = (int) scm_to_uint (fd);
 
-  gnutls_transport_set_ptr (c_session, (gnutls_transport_ptr_t) c_fd);
+  gnutls_transport_set_ptr (c_session, (gnutls_transport_ptr_t) (intptr_t) c_fd);
 
   SCM_GNUTLS_SET_SESSION_TRANSPORT_IS_FD (c_session, 1);