From marlam at web.de Thu Aug 26 14:54:51 2004 From: marlam at web.de (Martin Lambers) Date: Thu, 26 Aug 2004 14:54:51 +0200 Subject: [Help-gnutls] gnutls_transport_set_ptr() Message-ID: <20040826125451.GA30575@cthulhu.lambers.home> Hello! This is the prototype of gnutls_transport_set_ptr() from version 1.0.19: void gnutls_transport_set_ptr(gnutls_session session, gnutls_transport_ptr ptr); gnutls_transport_ptr is void*, but the argument ptr is a file descriptor, therefore int. A cast from int to void* seems a little bit strange, and it gives compilation warnings like "warning: cast to pointer from integer of different size" on certain platforms, for example alpha-unknown-linux-gnu. Is there a different way to do the same? BTW, all examples in the documentation use gnutls_transport_set_ptr(session, (gnutls_transport_ptr_t) sd); (the _t is wrong). Regards, Martin From jas at extundo.com Thu Aug 26 16:43:01 2004 From: jas at extundo.com (Simon Josefsson) Date: Thu, 26 Aug 2004 16:43:01 +0200 Subject: [Help-gnutls] Re: gnutls_transport_set_ptr() References: <20040826125451.GA30575@cthulhu.lambers.home> Message-ID: Martin Lambers writes: > Hello! > > This is the prototype of gnutls_transport_set_ptr() from version 1.0.19: > void gnutls_transport_set_ptr(gnutls_session session, gnutls_transport_ptr ptr); > > gnutls_transport_ptr is void*, but the argument ptr is a file > descriptor, therefore int. > > A cast from int to void* seems a little bit strange, and it gives > compilation warnings like "warning: cast to pointer from integer of > different size" on certain platforms, for example > alpha-unknown-linux-gnu. > > Is there a different way to do the same? I dunno, but I agree this is suboptimal and should be improved. I suspect the reason has to do with the push/pull layers, which I'm unfamiliar with. Patches welcome. > BTW, all examples in the documentation use > gnutls_transport_set_ptr(session, (gnutls_transport_ptr_t) sd); > (the _t is wrong). This I can answer -- in 1.1 all types have been renamed, to *_t. So you are likely reading 1.1 documentation, but using 1.0. All 1.0 types should still work in 1.1, though. But the examples are correct in using *_t. See the links from for which manual correspond to the stable and development branch. Regards, Simon