Print this page
2976 remove useless offsetof() macros

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/stat/common/acquire_iodevs.c
          +++ new/usr/src/cmd/stat/common/acquire_iodevs.c
↓ open down ↓ 21 lines elided ↑ open up ↑
  22   22   * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
  23   23   */
  24   24  
  25   25  #include "statcommon.h"
  26   26  #include "dsr.h"
  27   27  
  28   28  #include <sys/dklabel.h>
  29   29  #include <sys/dktp/fdisk.h>
  30   30  #include <stdlib.h>
  31   31  #include <stdarg.h>
       32 +#include <stddef.h>
  32   33  #include <unistd.h>
  33   34  #include <strings.h>
  34   35  #include <errno.h>
  35   36  #include <limits.h>
  36   37  
  37   38  static void insert_iodev(struct snapshot *ss, struct iodev_snapshot *iodev);
  38   39  
  39   40  static struct iodev_snapshot *
  40   41  make_controller(int cid)
  41   42  {
↓ open down ↓ 98 lines elided ↑ open up ↑
 140  141          }
 141  142  
 142  143          return (NULL);
 143  144  }
 144  145  
 145  146  /*
 146  147   * Introduce an index into the list to speed up insert_into looking for the
 147  148   * right position in the list. This index is an AVL tree of all the
 148  149   * iodev_snapshot in the list.
 149  150   */
 150      -
 151      -#define offsetof(s, m)  (size_t)(&(((s *)0)->m))        /* for avl_create */
 152      -
 153  151  static int
 154  152  avl_iodev_cmp(const void* is1, const void* is2)
 155  153  {
 156  154          int c = iodev_cmp((struct iodev_snapshot *)is1,
 157  155              (struct iodev_snapshot *)is2);
 158  156  
 159  157          if (c > 0)
 160  158                  return (1);
 161  159  
 162  160          if (c < 0)
↓ open down ↓ 964 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX