Print this page
2976 remove useless offsetof() macros

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/pools/poolstat/poolstat.c
          +++ new/usr/src/cmd/pools/poolstat/poolstat.c
↓ open down ↓ 27 lines elided ↑ open up ↑
  28   28   */
  29   29  #include <stdio.h>
  30   30  #include <unistd.h>
  31   31  #include <stdlib.h>
  32   32  #include <unistd.h>
  33   33  #include <locale.h>
  34   34  #include <string.h>
  35   35  #include <ctype.h>
  36   36  #include <limits.h>
  37   37  #include <errno.h>
       38 +#include <stddef.h>
  38   39  
  39   40  #include <pool.h>
  40   41  #include "utils.h"
  41   42  #include "poolstat.h"
  42   43  #include "poolstat_utils.h"
  43   44  #include "statcommon.h"
  44   45  
  45   46  #ifndef TEXT_DOMAIN
  46   47  #define TEXT_DOMAIN     "SYS_TEST"
  47   48  #endif
  48   49  
  49      -/* calculate offset of a particular element in a structure      */
  50      -#define offsetof(s, m)  ((size_t)(&(((s *)0)->m)))
  51   50  #define addrof(s)  ((char **)&(s))
  52   51  
  53   52  /* verify if a field is printable in respect of the current option flags */
  54   53  #define PRINTABLE(i)    ((lf->plf_ffs[(i)].pff_prt & D_FIELD) || \
  55   54          (lf->plf_ffs[(i)].pff_prt & X_FIELD))
  56   55  
  57   56  typedef int (* formatter) (char *, int, int, poolstat_field_format_t *, char *);
  58   57  
  59   58  static uint_t timestamp_fmt = NODATE;
  60   59  
↓ open down ↓ 965 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX