Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/cddl/osnet/dist/uts/common/rpc Use a static initial...



details:   https://anonhg.NetBSD.org/src/rev/286c7a11cc5d
branches:  trunk
changeset: 807459:286c7a11cc5d
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sat Apr 11 03:21:43 2015 +0000

description:
Use a static initializer, not a broken initializer.

diffstat:

 external/cddl/osnet/dist/uts/common/rpc/xdr_mem.c |  23 +++++++++++------------
 1 files changed, 11 insertions(+), 12 deletions(-)

diffs (33 lines):

diff -r 0ca038bf4e84 -r 286c7a11cc5d external/cddl/osnet/dist/uts/common/rpc/xdr_mem.c
--- a/external/cddl/osnet/dist/uts/common/rpc/xdr_mem.c Sat Apr 11 02:33:16 2015 +0000
+++ b/external/cddl/osnet/dist/uts/common/rpc/xdr_mem.c Sat Apr 11 03:21:43 2015 +0000
@@ -192,18 +192,17 @@
 static struct xdr_ops *
 xdrmem_ops(void)
 {
-       static struct xdr_ops ops;
+       static struct xdr_ops ops = {
+               .x_getbytes = xdrmem_getbytes,
+               .x_putbytes = xdrmem_putbytes,
+               .x_getpostn = xdrmem_getpos,
+               .x_setpostn = xdrmem_setpos,
+               .x_inline = xdrmem_inline,
+               .x_destroy = xdrmem_destroy,
+               .x_control = xdrmem_control,
+               .x_getint32 = xdrmem_getint32,
+               .x_putint32 = xdrmem_putint32,
+       };
 
-       if (ops.x_getint32 == NULL) {
-               ops.x_getbytes = xdrmem_getbytes;
-               ops.x_putbytes = xdrmem_putbytes;
-               ops.x_getpostn = xdrmem_getpos;
-               ops.x_setpostn = xdrmem_setpos;
-               ops.x_inline = xdrmem_inline;
-               ops.x_destroy = xdrmem_destroy;
-               ops.x_control = xdrmem_control;
-               ops.x_getint32 = xdrmem_getint32;
-               ops.x_putint32 = xdrmem_putint32;
-       }
        return (&ops);
 }



Home | Main Index | Thread Index | Old Index