Print this page
8654 unused local typedef in rpc code

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/rpc/xdr_sizeof.c
          +++ new/usr/src/uts/common/rpc/xdr_sizeof.c
↓ open down ↓ 17 lines elided ↑ open up ↑
  18   18   * information: Portions Copyright [yyyy] [name of copyright owner]
  19   19   *
  20   20   * CDDL HEADER END
  21   21   */
  22   22  /*
  23   23   * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
  24   24   * Use is subject to license terms.
  25   25   */
  26   26  /*
  27   27   * Copyright 2012 Nexenta Systems, Inc. All rights reserved.
       28 + * Copyright 2017 RackTop Systems.
  28   29   */
  29   30  
  30   31  #include <rpc/types.h>
  31   32  #include <rpc/xdr.h>
  32   33  #include <sys/types.h>
  33   34  
  34   35  /* ARGSUSED */
  35   36  static bool_t
  36   37  x_putint32_t(XDR *xdrs, int32_t *ip)
  37   38  {
↓ open down ↓ 67 lines elided ↑ open up ↑
 105  106          }
 106  107          xdrs->x_base = 0;
 107  108  }
 108  109  
 109  110  unsigned int
 110  111  xdr_sizeof(xdrproc_t func, void *data)
 111  112  {
 112  113          XDR x;
 113  114          struct xdr_ops ops;
 114  115          bool_t stat;
 115      -        /* to stop ANSI-C compiler from complaining */
 116      -        typedef  bool_t (* dummyfunc1)(XDR *, long *);
 117      -        typedef  bool_t (* dummyfunc2)(XDR *, caddr_t, int);
 118      -        typedef  bool_t (* dummyfunc3)(XDR *, int32_t *);
 119      -        typedef  bool_t (* dummyfunc4)(XDR *, int, void *);
 120  116  
 121  117          ops.x_putbytes = x_putbytes;
 122  118          ops.x_inline = x_inline;
 123  119          ops.x_getpostn = x_getpostn;
 124  120          ops.x_setpostn = x_setpostn;
 125  121          ops.x_destroy = x_destroy;
 126  122  
 127  123  #if defined(_LP64) || defined(_KERNEL)
 128      -        ops.x_getint32 = (dummyfunc3)harmless;
      124 +        ops.x_getint32 = (void *)harmless;
 129  125          ops.x_putint32 = x_putint32_t;
 130  126  #endif
 131  127  
 132  128          /* the other harmless ones */
 133      -        ops.x_getbytes = (dummyfunc2)harmless;
 134      -        ops.x_control = (dummyfunc4)harmless;
      129 +        ops.x_getbytes = (void *)harmless;
      130 +        ops.x_control = (void *)harmless;
 135  131  
 136  132          x.x_op = XDR_ENCODE;
 137  133          x.x_ops = &ops;
 138  134          x.x_handy = 0;
 139  135          x.x_private = (caddr_t)NULL;
 140  136          x.x_base = NULL;
 141  137  
 142  138          stat = func(&x, data);
 143  139          if (x.x_private)
 144  140                  mem_free(x.x_private, (uintptr_t)x.x_base);
 145  141          return (stat == TRUE ? (unsigned int)x.x_handy: 0);
 146  142  }
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX