[PATCH] daemon/Win32: Use xdr_u_int for PortableXDR compatibility.
-- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming blog: http://rwmj.wordpress.com Fedora now supports 80 OCaml packages (the OPEN alternative to F#) http://cocan.org/getting_started_with_ocaml_on_red_hat_and_fedora
Richard W.M. Jones wrote:
Subject: [PATCH 3/7] daemon/Win32: Use xdr_u_int for PortableXDR compatibility.
PortableXDR didn't support xdr_uint32_t. xdr_u_int is the same type.
It looks to me like xdr_uint32_t is the preferred name, because it is more descriptive. If so, can you do something like this instead? #define xdr_uint32_t xdr_u_int or use a typedef?
diff --git a/daemon/guestfsd.c b/daemon/guestfsd.c index 67206d0..f31f1f2 100644 --- a/daemon/guestfsd.c +++ b/daemon/guestfsd.c @@ -311,7 +311,7 @@ main (int argc, char *argv[]) XDR xdr; uint32_t len = GUESTFS_LAUNCH_FLAG; xdrmem_create (&xdr, lenbuf, sizeof lenbuf, XDR_ENCODE); - xdr_uint32_t (&xdr, &len); + xdr_u_int (&xdr, &len);
if (xwrite (sock, lenbuf, sizeof lenbuf) == -1) exit (EXIT_FAILURE); diff --git a/daemon/proto.c b/daemon/proto.c index 4106d92..2231037 100644 --- a/daemon/proto.c +++ b/daemon/proto.c @@ -67,7 +67,7 @@ main_loop (int _sock) exit (EXIT_FAILURE);
xdrmem_create (&xdr, lenbuf, 4, XDR_DECODE); - xdr_uint32_t (&xdr, &len); + xdr_u_int (&xdr, &len); ...
On Wed, Nov 25, 2009 at 06:56:25PM +0100, Jim Meyering wrote:
Richard W.M. Jones wrote:
Subject: [PATCH 3/7] daemon/Win32: Use xdr_u_int for PortableXDR compatibility.
PortableXDR didn't support xdr_uint32_t. xdr_u_int is the same type.
It looks to me like xdr_uint32_t is the preferred name, because it is more descriptive. If so, can you do something like this instead?
#define xdr_uint32_t xdr_u_int
or use a typedef?
TBH xdr_u_int is the preferred type in XDR itself. xdr_uint32_t etc is an invention of glibc. Nevertheless xdr_u_int is guaranteed always to be an unsigned 32 bit integer. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://et.redhat.com/~rjones/libguestfs/ See what it can do: http://et.redhat.com/~rjones/libguestfs/recipes.html
participants (2)
-
Jim Meyering -
Richard W.M. Jones