Print this page
11210 libm should be cstyle(1ONBLD) clean

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libm/common/complex/complex_wrapper.h
          +++ new/usr/src/lib/libm/common/complex/complex_wrapper.h
↓ open down ↓ 14 lines elided ↑ open up ↑
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  
  22   22  /*
  23   23   * Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
  24   24   */
       25 +
  25   26  /*
  26   27   * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
  27   28   * Use is subject to license terms.
  28   29   */
  29   30  
  30   31  #ifndef _COMPLEX_WRAPPER_H
  31   32  #define _COMPLEX_WRAPPER_H
  32   33  
  33   34  #pragma ident   "@(#)complex_wrapper.h  1.7     06/01/31 SMI"
  34   35  
  35   36  #if defined(__GNUC__)
  36      -#define dcomplex double _Complex
  37      -#define fcomplex float _Complex
  38      -#define ldcomplex long double _Complex
  39      -#define D_RE(x) __real__ x
  40      -#define D_IM(x) __imag__ x
  41      -#define F_RE(x) __real__ x
  42      -#define F_IM(x) __imag__ x
  43      -#define LD_RE(x) __real__ x
  44      -#define LD_IM(x) __imag__ x
       37 +#define dcomplex                double _Complex
       38 +#define fcomplex                float _Complex
       39 +#define ldcomplex               long double _Complex
       40 +#define D_RE(x)                 __real__ x
       41 +#define D_IM(x)                 __imag__ x
       42 +#define F_RE(x)                 __real__ x
       43 +#define F_IM(x)                 __imag__ x
       44 +#define LD_RE(x)                __real__ x
       45 +#define LD_IM(x)                __imag__ x
  45   46  
  46   47  #include <complex.h>
  47   48  #else
  48      -
  49      -#define dcomplex        double complex
  50      -#define fcomplex        float complex
  51      -#define ldcomplex       long double complex
  52      -#define _X_RE(__t, __z) ((__t *) &__z)[0]
  53      -#define _X_IM(__t, __z) ((__t *) &__z)[1]
  54      -#define D_RE(__z)       _X_RE(double, __z)
  55      -#define D_IM(__z)       _X_IM(double, __z)
  56      -#define F_RE(__z)       _X_RE(float, __z)
  57      -#define F_IM(__z)       _X_IM(float, __z)
  58      -#define LD_RE(__z)      _X_RE(long double, __z)
  59      -#define LD_IM(__z)      _X_IM(long double, __z)
       49 +#define dcomplex                double complex
       50 +#define fcomplex                float complex
       51 +#define ldcomplex               long double complex
       52 +#define _X_RE(__t, __z)         ((__t *)&__z)[0]
       53 +#define _X_IM(__t, __z)         ((__t *)&__z)[1]
       54 +#define D_RE(__z)               _X_RE(double, __z)
       55 +#define D_IM(__z)               _X_IM(double, __z)
       56 +#define F_RE(__z)               _X_RE(float, __z)
       57 +#define F_IM(__z)               _X_IM(float, __z)
       58 +#define LD_RE(__z)              _X_RE(long double, __z)
       59 +#define LD_IM(__z)              _X_IM(long double, __z)
  60   60  
  61   61  #include <complex.h>
  62   62  #endif
  63   63  
  64   64  #if defined(__sparc)
  65      -#define HIWORD  0
  66      -#define LOWORD  1
  67      -#define HI_XWORD(x)     ((unsigned *) &x)[0]
  68      -#define XFSCALE(x, n)   ((unsigned *) &x)[0] += n << 16 /* signbitl(x) == 0 */
  69      -#define CHOPPED(x)      ((long double) ((double) (x)))
       65 +#define HIWORD          0
       66 +#define LOWORD          1
       67 +#define HI_XWORD(x)     ((unsigned *)&x)[0]
       68 +#define XFSCALE(x, n)   ((unsigned *)&x)[0] += n << 16  /* signbitl(x) == 0 */
       69 +#define CHOPPED(x)      ((long double)((double)(x)))
  70   70  #elif defined(__x86)
  71      -#define HIWORD  1
  72      -#define LOWORD  0
  73      -#define HI_XWORD(x)     ((((int *) &x)[2] << 16) | \
  74      -                        (0xffff & ((unsigned *) &x)[1] >> 15))
  75      -#define XFSCALE(x, n)   ((unsigned short *) &x)[4] += n /* signbitl(x) == 0 */
  76      -#define CHOPPED(x)      ((long double) ((float) (x)))
       71 +#define HIWORD          1
       72 +#define LOWORD          0
       73 +#define HI_XWORD(x)     ((((int *)&x)[2] << 16) | (0xffff & \
       74 +        ((unsigned *)&x)[1] >> 15))
       75 +#define XFSCALE(x, n)   ((unsigned short *)&x)[4] += n  /* signbitl(x) == 0 */
       76 +#define CHOPPED(x)      ((long double)((float)(x)))
  77   77  #else
  78   78  #error Unknown architecture
  79   79  #endif
  80      -#define HI_WORD(x)      ((int *) &x)[HIWORD]    /* for double */
  81      -#define LO_WORD(x)      ((int *) &x)[LOWORD]    /* for double */
  82      -#define THE_WORD(x)     ((int *) &x)[0]         /* for float */
       80 +#define HI_WORD(x)              ((int *)&x)[HIWORD]     /* for double */
       81 +#define LO_WORD(x)              ((int *)&x)[LOWORD]     /* for double */
       82 +#define THE_WORD(x)             ((int *)&x)[0]          /* for float */
  83   83  
  84   84  /*
  85   85   * iy:ly must have the sign bit already cleared
  86   86   */
  87      -#define ISINF(iy, ly)   (((iy - 0x7ff00000) | ly) == 0)
  88      -
  89      -#endif  /* _COMPLEX_WRAPPER_H */
       87 +#define ISINF(iy, ly)           (((iy - 0x7ff00000) | ly) == 0)
       88 +#endif /* _COMPLEX_WRAPPER_H */
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX