Source-Changes-HG archive

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

[src/netbsd-1-6]: src/lib/libm/noieee_src Pull up revision 1.5 (requested by ...



details:   https://anonhg.NetBSD.org/src/rev/067dd97e319b
branches:  netbsd-1-6
changeset: 527939:067dd97e319b
user:      lukem <lukem%NetBSD.org@localhost>
date:      Tue Jun 18 13:37:05 2002 +0000

description:
Pull up revision 1.5 (requested by matt in ticket #286):
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 ++--
 2 files changed, 33 insertions(+), 18 deletions(-)

diffs (122 lines):

diff -r 7189900cee84 -r 067dd97e319b lib/libm/noieee_src/mathimpl.h
--- a/lib/libm/noieee_src/mathimpl.h    Tue Jun 18 13:30:14 2002 +0000
+++ b/lib/libm/noieee_src/mathimpl.h    Tue Jun 18 13:37:05 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.4.12.1 2002/06/18 13:37:05 lukem 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 7189900cee84 -r 067dd97e319b lib/libm/noieee_src/n_acosh.c
--- a/lib/libm/noieee_src/n_acosh.c     Tue Jun 18 13:30:14 2002 +0000
+++ b/lib/libm/noieee_src/n_acosh.c     Tue Jun 18 13:37:05 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.4.10.1 2002/06/18 13:37:14 lukem 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 */
 



Home | Main Index | Thread Index | Old Index