From 79acc2d881f234be7d86dcd22a3b2f0f396ab433 Mon Sep 17 00:00:00 2001 From: aoliva Date: Wed, 9 Jul 2003 17:52:30 +0000 Subject: [PATCH] * libc/include/math.h (nan, nanf): Update prototype to C99. * libm/common/s_nan.c (nan): Likewise. * libm/common/s_nanf.c (nanf, nan): Likewise. * libc/sys/linux/cmath/math_private.h (nan, nanf): Likewise. --- newlib/ChangeLog | 7 +++++++ newlib/libc/include/math.h | 4 ++-- newlib/libc/sys/linux/cmath/math_private.h | 4 ++-- newlib/libm/common/s_nan.c | 9 +++++---- newlib/libm/common/sf_nan.c | 6 +++--- 5 files changed, 19 insertions(+), 11 deletions(-) diff --git a/newlib/ChangeLog b/newlib/ChangeLog index 6678bc4d24..95ada5031e 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,10 @@ +2003-07-09 Alexandre Oliva + + * libc/include/math.h (nan, nanf): Update prototype to C99. + * libm/common/s_nan.c (nan): Likewise. + * libm/common/s_nanf.c (nanf, nan): Likewise. + * libc/sys/linux/cmath/math_private.h (nan, nanf): Likewise. + 2003-07-07 Jeff Johnston * libc/include/stdbool.h: Removed as this is defined by gcc. diff --git a/newlib/libc/include/math.h b/newlib/libc/include/math.h index 16098c66cb..1be7511dc9 100644 --- a/newlib/libc/include/math.h +++ b/newlib/libc/include/math.h @@ -119,7 +119,7 @@ extern int __fpclassifyd (double x); /* Non ANSI double precision functions. */ extern double infinity _PARAMS((void)); -extern double nan _PARAMS((void)); +extern double nan _PARAMS((const char *)); extern int isnan _PARAMS((double)); extern int isinf _PARAMS((double)); extern int finite _PARAMS((double)); @@ -234,7 +234,7 @@ extern float fminf _PARAMS((float, float)); extern float fmaf _PARAMS((float, float, float)); extern float infinityf _PARAMS((void)); -extern float nanf _PARAMS((void)); +extern float nanf _PARAMS((const char *)); extern int isnanf _PARAMS((float)); extern int isinff _PARAMS((float)); extern int finitef _PARAMS((float)); diff --git a/newlib/libc/sys/linux/cmath/math_private.h b/newlib/libc/sys/linux/cmath/math_private.h index 6c4a472cf0..148376c447 100644 --- a/newlib/libc/sys/linux/cmath/math_private.h +++ b/newlib/libc/sys/linux/cmath/math_private.h @@ -24,14 +24,14 @@ #define INFINITY HUGE_VALF -#define __nan(x) nan() +#define __nan nan #define __isnan isnan #define __isinf isinf #define __copysignf copysignf #define __copysign copysign #define __isnanf isnanf #define __isinff isinff -#define __nanf(x) nanf() +#define __nanf nanf #define feraiseexcept(x) /* nothing */ #define __sincos sincos #define __sincosf sincosf diff --git a/newlib/libm/common/s_nan.c b/newlib/libm/common/s_nan.c index f06242647c..a7d4dadf87 100644 --- a/newlib/libm/common/s_nan.c +++ b/newlib/libm/common/s_nan.c @@ -14,8 +14,8 @@ INDEX ANSI_SYNOPSIS #include - double nan(void); - float nanf(void); + double nan(const char *); + float nanf(const char *); TRAD_SYNOPSIS #include @@ -25,7 +25,8 @@ TRAD_SYNOPSIS DESCRIPTION <> and <> return an IEEE NaN (Not a Number) in - double and single precision arithmetic respectivly. + double and single precision arithmetic respectivly. The + argument is currently disregarded. QUICKREF nan - pure @@ -36,7 +37,7 @@ QUICKREF #ifndef _DOUBLE_IS_32BITS - double nan() + double nan(const char *unused) { double x; diff --git a/newlib/libm/common/sf_nan.c b/newlib/libm/common/sf_nan.c index c8d7027f82..831f3f79fc 100644 --- a/newlib/libm/common/sf_nan.c +++ b/newlib/libm/common/sf_nan.c @@ -5,7 +5,7 @@ #include "fdlibm.h" - float nanf() + float nanf(const char *unused) { float x; @@ -15,9 +15,9 @@ #ifdef _DOUBLE_IS_32BITS - double nan() + double nan(const char *arg) { - return (double) nanf(); + return (double) nanf(arg); } #endif /* defined(_DOUBLE_IS_32BITS) */ -- 2.11.0