From f18a6c36b38ed8422eb6ed5e43cebaa3d212917c Mon Sep 17 00:00:00 2001 From: Simon Wilkinson Date: Sun, 17 Jan 2010 18:34:03 +0000 Subject: [PATCH] Label elements of rx structures Label all of the assignments to the xdr_ops structure. This allows the rec, stdio and mem variants to continue to function, even when the ordering of the elements has changed in the header. Change-Id: I006bbbdb8923dbb72a97fde931a1b23e303375c2 Reviewed-on: http://gerrit.openafs.org/1126 Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- src/rx/xdr_mem.c | 16 ++++++++-------- src/rx/xdr_rec.c | 16 ++++++++-------- src/rx/xdr_rx.c | 26 +++++++++++++------------- src/rx/xdr_stdio.c | 16 ++++++++-------- 4 files changed, 37 insertions(+), 37 deletions(-) diff --git a/src/rx/xdr_mem.c b/src/rx/xdr_mem.c index 38e8f1aca..eeffd76d4 100644 --- a/src/rx/xdr_mem.c +++ b/src/rx/xdr_mem.c @@ -60,14 +60,14 @@ static afs_int32 *xdrmem_inline(); static void xdrmem_destroy(); static struct xdr_ops xdrmem_ops = { - xdrmem_getint32, - xdrmem_putint32, - xdrmem_getbytes, - xdrmem_putbytes, - xdrmem_getpos, - xdrmem_setpos, - xdrmem_inline, - xdrmem_destroy + .x_getint32 = xdrmem_getint32, + .x_putint32 = xdrmem_putint32, + .x_getbytes = xdrmem_getbytes, + .x_putbytes = xdrmem_putbytes, + .x_getpos = xdrmem_getpos, + .x_setpos = xdrmem_setpos, + .x_inline = xdrmem_inline, + .x_destroy = xdrmem_destroy }; /* diff --git a/src/rx/xdr_rec.c b/src/rx/xdr_rec.c index 591502e4c..d19f763a6 100644 --- a/src/rx/xdr_rec.c +++ b/src/rx/xdr_rec.c @@ -117,14 +117,14 @@ static bool_t skip_input_bytes(RECSTREAM * rstrm, int cnt); static u_int fix_buf_size(u_int s); static struct xdr_ops xdrrec_ops = { - xdrrec_getint32, - xdrrec_putint32, - xdrrec_getbytes, - xdrrec_putbytes, - xdrrec_getpos, - xdrrec_setpos, - xdrrec_inline, - xdrrec_destroy + .x_getint32 = xdrrec_getint32, + .x_putint32 = xdrrec_putint32, + .x_getbytes = xdrrec_getbytes, + .x_putbytes = xdrrec_putbytes, + .x_getpos = xdrrec_getpos, + .x_setpos = xdrrec_setpos, + .x_inline = xdrrec_inline, + .x_destroy = xdrrec_destroy }; /* * Create an xdr handle for xdrrec diff --git a/src/rx/xdr_rx.c b/src/rx/xdr_rx.c index 2fcde30a1..510e84619 100644 --- a/src/rx/xdr_rx.c +++ b/src/rx/xdr_rx.c @@ -115,23 +115,23 @@ static AFS_RPC_INLINE_T *xdrrx_inline(AFS_XDRS_T axdrs, u_int len); */ static struct xdr_ops xdrrx_ops = { #if defined(KERNEL) && ((defined(AFS_SGI61_ENV) && (_MIPS_SZLONG != _MIPS_SZINT)) || defined(AFS_HPUX_64BIT_ENV)) - xdrrx_getint64, - xdrrx_putint64, + .x_getint64 = xdrrx_getint64, + .x_putint64 = xdrrx_putint64, #endif /* defined(KERNEL) && ((defined(AFS_SGI61_ENV) && (_MIPS_SZLONG != _MIPS_SZINT)) || defined(AFS_HPUX_64BIT_ENV)) */ #if !(defined(KERNEL) && defined(AFS_SUN57_ENV)) - xdrrx_getint32, /* deserialize an afs_int32 */ - xdrrx_putint32, /* serialize an afs_int32 */ + .x_getint32 = xdrrx_getint32, /* deserialize an afs_int32 */ + .x_putint32 = xdrrx_putint32, /* serialize an afs_int32 */ #endif - xdrrx_getbytes, /* deserialize counted bytes */ - xdrrx_putbytes, /* serialize counted bytes */ - 0, /* get offset in the stream: not supported. */ - 0, /* set offset in the stream: not supported. */ - xdrrx_inline, /* prime stream for inline macros */ - 0, /* destroy stream */ + .x_getbytes = xdrrx_getbytes, /* deserialize counted bytes */ + .x_putbytes = xdrrx_putbytes, /* serialize counted bytes */ + .x_getpostn = NULL, /* get offset in the stream: not supported. */ + .x_setpostn = NULL, /* set offset in the stream: not supported. */ + .x_inline = xdrrx_inline, /* prime stream for inline macros */ + .x_destroy = NULL, /* destroy stream */ #if defined(KERNEL) && defined(AFS_SUN57_ENV) - 0, - xdrrx_getint32, /* deserialize an afs_int32 */ - xdrrx_putint32, /* serialize an afs_int32 */ + .x_control = NULL, + .x_getint32 = xdrrx_getint32, /* deserialize an afs_int32 */ + .x_putint32 = xdrrx_putint32, /* serialize an afs_int32 */ #endif }; diff --git a/src/rx/xdr_stdio.c b/src/rx/xdr_stdio.c index 8b5fe1ddc..0b24f45bf 100644 --- a/src/rx/xdr_stdio.c +++ b/src/rx/xdr_stdio.c @@ -58,14 +58,14 @@ static void xdrstdio_destroy(); * Ops vector for stdio type XDR */ static struct xdr_ops xdrstdio_ops = { - xdrstdio_getint32, /* deserialize an afs_int32 */ - xdrstdio_putint32, /* serialize an afs_int32 */ - xdrstdio_getbytes, /* deserialize counted bytes */ - xdrstdio_putbytes, /* serialize counted bytes */ - xdrstdio_getpos, /* get offset in the stream */ - xdrstdio_setpos, /* set offset in the stream */ - xdrstdio_inline, /* prime stream for inline macros */ - xdrstdio_destroy /* destroy stream */ + .x_getint32 = xdrstdio_getint32, /* deserialize an afs_int32 */ + .x_putint32 = xdrstdio_putint32, /* serialize an afs_int32 */ + .x_getbytes = xdrstdio_getbytes, /* deserialize counted bytes */ + .x_putbytes = xdrstdio_putbytes, /* serialize counted bytes */ + .x_getpos = xdrstdio_getpos, /* get offset in the stream */ + .x_setpos = xdrstdio_setpos, /* set offset in the stream */ + .x_inline = xdrstdio_inline, /* prime stream for inline macros */ + .x_destroy = xdrstdio_destroy /* destroy stream */ }; /* -- 2.39.5