Source-Changes-HG archive

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

[src/trunk]: src/lib/libm/noieee_src Ansify libm noieeesrc (for VAX). Also m...



details:   https://anonhg.NetBSD.org/src/rev/3bb7dc36cca7
branches:  trunk
changeset: 532778:3bb7dc36cca7
user:      matt <matt%NetBSD.org@localhost>
date:      Sat Jun 15 00:10:17 2002 +0000

description:
Ansify libm noieeesrc (for VAX).  Also make const data really const.
libm for VAX can compiles with WARNS=2

diffstat:

 lib/libm/noieee_src/mathimpl.h  |  45 +++++++++++++++-------
 lib/libm/noieee_src/n_acosh.c   |   6 +-
 lib/libm/noieee_src/n_asincos.c |   8 +--
 lib/libm/noieee_src/n_asinh.c   |   7 ++-
 lib/libm/noieee_src/n_atan.c    |   6 +-
 lib/libm/noieee_src/n_atan2.c   |   7 ++-
 lib/libm/noieee_src/n_atanh.c   |   6 +-
 lib/libm/noieee_src/n_cabs.c    |   6 +-
 lib/libm/noieee_src/n_cbrt.c    |   6 +-
 lib/libm/noieee_src/n_cosh.c    |  19 +++++----
 lib/libm/noieee_src/n_erf.c     |  22 +++++-----
 lib/libm/noieee_src/n_exp.c     |  11 +++--
 lib/libm/noieee_src/n_exp__E.c  |   7 ++-
 lib/libm/noieee_src/n_expm1.c   |  20 +++++----
 lib/libm/noieee_src/n_floor.c   |  12 ++---
 lib/libm/noieee_src/n_fmod.c    |  15 +++----
 lib/libm/noieee_src/n_gamma.c   |  33 +++++++---------
 lib/libm/noieee_src/n_j0.c      |  60 +++++++++++++++---------------
 lib/libm/noieee_src/n_j1.c      |  78 ++++++++++++++++++++--------------------
 lib/libm/noieee_src/n_jn.c      |  13 +++---
 lib/libm/noieee_src/n_lgamma.c  |  10 +++--
 lib/libm/noieee_src/n_log.c     |  22 +++-------
 lib/libm/noieee_src/n_log10.c   |   7 ++-
 lib/libm/noieee_src/n_log1p.c   |   7 ++-
 lib/libm/noieee_src/n_log__L.c  |   7 ++-
 lib/libm/noieee_src/n_pow.c     |  19 ++++-----
 lib/libm/noieee_src/n_sincos.c  |  32 ++++++++--------
 lib/libm/noieee_src/n_sinh.c    |  11 +++--
 lib/libm/noieee_src/n_support.c |  63 ++++++++++++++++----------------
 lib/libm/noieee_src/n_tan.c     |  17 ++++----
 lib/libm/noieee_src/n_tanh.c    |   8 ++--
 lib/libm/noieee_src/trig.h      |  37 +++++++++++++------
 32 files changed, 324 insertions(+), 303 deletions(-)

diffs (truncated from 1976 to 300 lines):

diff -r 5372b7c1a957 -r 3bb7dc36cca7 lib/libm/noieee_src/mathimpl.h
--- a/lib/libm/noieee_src/mathimpl.h    Fri Jun 14 23:36:27 2002 +0000
+++ b/lib/libm/noieee_src/mathimpl.h    Sat Jun 15 00:10:17 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mathimpl.h,v 1.4 1998/11/08 19:29:34 ragge Exp $       */
+/*     $NetBSD: mathimpl.h,v 1.5 2002/06/15 00:10:17 matt Exp $        */
 /*
  * Copyright (c) 1988, 1993
  *     The Regents of the University of California.  All rights reserved.
@@ -33,6 +33,8 @@
  *
  *     @(#)mathimpl.h  8.1 (Berkeley) 6/4/93
  */
+#ifndef _NOIEEE_SRC_MATHIMPL_H_
+#define _NOIEEE_SRC_MATHIMPL_H_
 
 #include <sys/cdefs.h>
 #include <math.h>
@@ -40,11 +42,7 @@
 #if defined(__vax__)||defined(tahoe)
 
 /* Deal with different ways to concatenate in cpp */
-#  ifdef __STDC__
-#    define    cat3(a,b,c) a ## b ## c
-#  else
-#    define    cat3(a,b,c) a/**/b/**/c
-#  endif
+#define cat3(a,b,c)    a ## b ## c
 
 /* Deal with vax/tahoe byte order issues */
 #  ifdef __vax__
@@ -53,7 +51,7 @@
 #    define    cat3t(a,b,c) cat3(a,c,b)
 #  endif
 
-#  define vccast(name) (*(const double *)(cat3(name,,x)))
+#  define vccast(name) (*(const double *)(cat3(__,name,x)))
 
    /*
     * Define a constant to high precision on a Vax or Tahoe.
@@ -71,9 +69,16 @@
     * since CPP cannot do this for them from inside another macro (sigh).
     * We define "vccast" if this needs doing.
     */
+#ifdef _LIBM_DECLARE
 #  define vc(name, value, x1,x2,x3,x4, bexp, xval) \
-       const static long cat3(name,,x)[] = {cat3t(0x,x1,x2), cat3t(0x,x3,x4)};
-
+       const long cat3(__,name,x)[] = {cat3t(0x,x1,x2), cat3t(0x,x3,x4)};
+#elif defined(_LIBM_STATIC)
+#  define vc(name, value, x1,x2,x3,x4, bexp, xval) \
+       static const long cat3(__,name,x)[] = {cat3t(0x,x1,x2), cat3t(0x,x3,x4)};
+#else
+#  define vc(name, value, x1,x2,x3,x4, bexp, xval) \
+       extern const long cat3(__,name,x)[];
+#endif
 #  define ic(name, value, bexp, xval) ;
 
 #else  /* __vax__ or tahoe */
@@ -82,8 +87,16 @@
 #  undef vccast
 #  define vc(name, value, x1,x2,x3,x4, bexp, xval) ;
 
+#ifdef _LIBM_DECLARE
 #  define ic(name, value, bexp, xval) \
-       const static double name = value;
+       const double __CONCAT(__,name) = value;
+#elif _LIBM_STATIC
+#  define ic(name, value, bexp, xval) \
+       static const double __CONCAT(__,name) = value;
+#else
+#  define ic(name, value, bexp, xval) \
+       extern const double __CONCAT(__,name);
+#endif
 
 #endif /* defined(__vax__)||defined(tahoe) */
 
@@ -91,10 +104,12 @@
 /*
  * Functions internal to the math package, yet not static.
  */
-extern double  __exp__E __P((double, double));
-extern double  __log__L __P((double));
-extern int     infnan __P((int));
+extern double  __exp__E (double, double);
+extern double  __log__L (double);
+extern int     infnan (int);
 
 struct Double {double a, b;};
-double __exp__D __P((double, double));
-struct Double __log__D __P((double));
+double __exp__D (double, double);
+struct Double __log__D (double);
+
+#endif /* _NOIEEE_SRC_MATHIMPL_H_ */
diff -r 5372b7c1a957 -r 3bb7dc36cca7 lib/libm/noieee_src/n_acosh.c
--- a/lib/libm/noieee_src/n_acosh.c     Fri Jun 14 23:36:27 2002 +0000
+++ b/lib/libm/noieee_src/n_acosh.c     Sat Jun 15 00:10:17 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: n_acosh.c,v 1.4 1999/07/02 15:37:36 simonb Exp $       */
+/*     $NetBSD: n_acosh.c,v 1.5 2002/06/15 00:10:17 matt Exp $ */
 /*
  * Copyright (c) 1985, 1993
  *     The Regents of the University of California.  All rights reserved.
@@ -75,6 +75,7 @@
  * shown.
  */
 
+#define _LIBM_STATIC
 #include "mathimpl.h"
 
 vc(ln2hi, 6.9314718055829871446E-1  ,7217,4031,0000,f7d0,   0, .B17217F7D00000)
@@ -89,8 +90,7 @@
 #endif
 
 double
-acosh(x)
-       double x;
+acosh(double x)
 {
        double t,big=1.E20; /* big+1==big */
 
diff -r 5372b7c1a957 -r 3bb7dc36cca7 lib/libm/noieee_src/n_asincos.c
--- a/lib/libm/noieee_src/n_asincos.c   Fri Jun 14 23:36:27 2002 +0000
+++ b/lib/libm/noieee_src/n_asincos.c   Sat Jun 15 00:10:17 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: n_asincos.c,v 1.5 1999/07/02 15:37:36 simonb Exp $     */
+/*     $NetBSD: n_asincos.c,v 1.6 2002/06/15 00:10:17 matt Exp $       */
 /*
  * Copyright (c) 1985, 1993
  *     The Regents of the University of California.  All rights reserved.
@@ -93,8 +93,7 @@
 #include "mathimpl.h"
 
 double
-asin(x)
-       double x;
+asin(double x)
 {
        double s,t,one=1.0;
 #if !defined(__vax__)&&!defined(tahoe)
@@ -161,8 +160,7 @@
  */
 
 double
-acos(x)
-       double x;
+acos(double x)
 {
        double t,one=1.0;
 #if !defined(__vax__)&&!defined(tahoe)
diff -r 5372b7c1a957 -r 3bb7dc36cca7 lib/libm/noieee_src/n_asinh.c
--- a/lib/libm/noieee_src/n_asinh.c     Fri Jun 14 23:36:27 2002 +0000
+++ b/lib/libm/noieee_src/n_asinh.c     Sat Jun 15 00:10:17 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: n_asinh.c,v 1.4 1999/07/02 15:37:36 simonb Exp $       */
+/*     $NetBSD: n_asinh.c,v 1.5 2002/06/15 00:10:17 matt Exp $ */
 /*
  * Copyright (c) 1985, 1993
  *     The Regents of the University of California.  All rights reserved.
@@ -70,6 +70,7 @@
  * from decimal to binary accurately enough to produce the hexadecimal values
  * shown.
  */
+#define _LIBM_STATIC
 #include "mathimpl.h"
 
 vc(ln2hi, 6.9314718055829871446E-1  ,7217,4031,0000,f7d0,   0, .B17217F7D00000)
@@ -83,8 +84,8 @@
 #define    ln2lo    vccast(ln2lo)
 #endif
 
-double asinh(x)
-double x;
+double
+asinh(double x)
 {
        double t,s;
        const static double     small=1.0E-10,  /* fl(1+small*small) == 1 */
diff -r 5372b7c1a957 -r 3bb7dc36cca7 lib/libm/noieee_src/n_atan.c
--- a/lib/libm/noieee_src/n_atan.c      Fri Jun 14 23:36:27 2002 +0000
+++ b/lib/libm/noieee_src/n_atan.c      Sat Jun 15 00:10:17 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: n_atan.c,v 1.3 1999/07/02 15:37:36 simonb Exp $        */
+/*     $NetBSD: n_atan.c,v 1.4 2002/06/15 00:10:17 matt Exp $  */
 /*
  * Copyright (c) 1985, 1993
  *     The Regents of the University of California.  All rights reserved.
@@ -83,8 +83,8 @@
  */
 #include "mathimpl.h"
 
-double atan(x)
-double x;
+double
+atan(double x)
 {
        double one=1.0;
        return(atan2(x,one));
diff -r 5372b7c1a957 -r 3bb7dc36cca7 lib/libm/noieee_src/n_atan2.c
--- a/lib/libm/noieee_src/n_atan2.c     Fri Jun 14 23:36:27 2002 +0000
+++ b/lib/libm/noieee_src/n_atan2.c     Sat Jun 15 00:10:17 2002 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: n_atan2.c,v 1.4 1999/07/02 15:37:36 simonb Exp $        */
+/*      $NetBSD: n_atan2.c,v 1.5 2002/06/15 00:10:17 matt Exp $        */
 /*
  * Copyright (c) 1985, 1993
  *     The Regents of the University of California.  All rights reserved.
@@ -110,6 +110,7 @@
  * shown.
  */
 
+#define _LIBM_STATIC
 #include "mathimpl.h"
 
 vc(athfhi, 4.6364760900080611433E-1  ,6338,3fed,da7b,2b0d,  -1, .ED63382B0DDA7B)
@@ -173,8 +174,8 @@
 #define        a12     vccast(a12)
 #endif
 
-double atan2(y,x)
-double  y,x;
+double
+atan2(double y, double x)
 {
        static const double zero=0, one=1, small=1.0E-9, big=1.0E18;
        double t,z,signy,signx,hi,lo;
diff -r 5372b7c1a957 -r 3bb7dc36cca7 lib/libm/noieee_src/n_atanh.c
--- a/lib/libm/noieee_src/n_atanh.c     Fri Jun 14 23:36:27 2002 +0000
+++ b/lib/libm/noieee_src/n_atanh.c     Sat Jun 15 00:10:17 2002 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: n_atanh.c,v 1.5 1999/07/02 15:37:36 simonb Exp $ */
+/*      $NetBSD: n_atanh.c,v 1.6 2002/06/15 00:10:17 matt Exp $ */
 /*
  * Copyright (c) 1985, 1993
  *     The Regents of the University of California.  All rights reserved.
@@ -70,8 +70,8 @@
 #include <errno.h>
 #endif /* defined(__vax__)||defined(tahoe) */
 
-double atanh(x)
-double x;
+double
+atanh(double x)
 {
        double z;
        z = copysign(0.5,x);
diff -r 5372b7c1a957 -r 3bb7dc36cca7 lib/libm/noieee_src/n_cabs.c
--- a/lib/libm/noieee_src/n_cabs.c      Fri Jun 14 23:36:27 2002 +0000
+++ b/lib/libm/noieee_src/n_cabs.c      Sat Jun 15 00:10:17 2002 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: n_cabs.c,v 1.3 1999/07/02 15:37:36 simonb Exp $ */
+/*      $NetBSD: n_cabs.c,v 1.4 2002/06/15 00:10:17 matt Exp $ */
 /*
  * Copyright (c) 1985, 1993
  *     The Regents of the University of California.  All rights reserved.
@@ -88,6 +88,7 @@
  * from decimal to binary accurately enough to produce the hexadecimal values
  * shown.
  */
+#define _LIBM_STATIC
 #include "mathimpl.h"
 
 vc(r2p1hi, 2.4142135623730950345E0   ,8279,411a,ef32,99fc,   2, .9A827999FCEF32)
@@ -105,8 +106,7 @@
 #endif
 
 double
-hypot(x,y)
-double x, y;
+hypot(double x, double y)
 {
        static const double zero=0, one=1,
                      small=1.0E-18;    /* fl(1+small)==1 */
diff -r 5372b7c1a957 -r 3bb7dc36cca7 lib/libm/noieee_src/n_cbrt.c
--- a/lib/libm/noieee_src/n_cbrt.c      Fri Jun 14 23:36:27 2002 +0000
+++ b/lib/libm/noieee_src/n_cbrt.c      Sat Jun 15 00:10:17 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: n_cbrt.c,v 1.3 1999/07/02 15:37:36 simonb Exp $        */
+/*     $NetBSD: n_cbrt.c,v 1.4 2002/06/15 00:10:17 matt Exp $  */
 /*
  * Copyright (c) 1985, 1993
  *     The Regents of the University of California.  All rights reserved.
@@ -66,8 +66,8 @@
            F= 45./28.,
            G= 5./14.;
 
-double cbrt(x)
-double x;
+double
+cbrt(double x)
 {
        double r,s,t=0.0,w;
        unsigned long *px = (unsigned long *) &x,
diff -r 5372b7c1a957 -r 3bb7dc36cca7 lib/libm/noieee_src/n_cosh.c
--- a/lib/libm/noieee_src/n_cosh.c      Fri Jun 14 23:36:27 2002 +0000
+++ b/lib/libm/noieee_src/n_cosh.c      Sat Jun 15 00:10:17 2002 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: n_cosh.c,v 1.5 1999/07/02 15:37:36 simonb Exp $ */
+/*      $NetBSD: n_cosh.c,v 1.6 2002/06/15 00:10:17 matt Exp $ */



Home | Main Index | Thread Index | Old Index