aboutsummaryrefslogtreecommitdiff
path: root/math/libm-test.inc
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2013-05-04 13:08:34 +0000
committerJoseph Myers <joseph@codesourcery.com>2013-05-04 13:08:34 +0000
commita7548d41a7459ff85a751ae84b4bd77631833473 (patch)
treeadd06765751f14963baeea0e8315e8e7b9d54ab7 /math/libm-test.inc
parentcc0e6ed81fa3ab0eeecfc576098b4522f0323c4b (diff)
downloadglibc-a7548d41a7459ff85a751ae84b4bd77631833473.zip
glibc-a7548d41a7459ff85a751ae84b4bd77631833473.tar.gz
glibc-a7548d41a7459ff85a751ae84b4bd77631833473.tar.bz2
Use static initializers for constant variables in libm-test.inc.
Diffstat (limited to 'math/libm-test.inc')
-rw-r--r--math/libm-test.inc49
1 files changed, 19 insertions, 30 deletions
diff --git a/math/libm-test.inc b/math/libm-test.inc
index 7597547..c58bd45 100644
--- a/math/libm-test.inc
+++ b/math/libm-test.inc
@@ -231,9 +231,25 @@ static int output_max_error; /* Should the maximal errors printed? */
static int output_points; /* Should the single function results printed? */
static int ignore_max_ulp; /* Should we ignore max_ulp? */
-static FLOAT minus_zero, plus_zero;
-static FLOAT plus_infty, minus_infty, qnan_value, max_value, min_value;
-static FLOAT min_subnorm_value;
+static const FLOAT plus_zero = CHOOSE (0.0L, 0.0, 0.0f,
+ 0.0L, 0.0, 0.0f);
+static const FLOAT minus_zero = CHOOSE (-0.0L, -0.0, -0.0f,
+ -0.0L, -0.0, -0.0f);
+static const FLOAT plus_infty = CHOOSE (HUGE_VALL, HUGE_VAL, HUGE_VALF,
+ HUGE_VALL, HUGE_VAL, HUGE_VALF);
+static const FLOAT minus_infty = CHOOSE (-HUGE_VALL, -HUGE_VAL, -HUGE_VALF,
+ -HUGE_VALL, -HUGE_VAL, -HUGE_VALF);
+static const FLOAT qnan_value = FUNC (__builtin_nan) ("");
+static const FLOAT max_value = CHOOSE (LDBL_MAX, DBL_MAX, FLT_MAX,
+ LDBL_MAX, DBL_MAX, FLT_MAX);
+static const FLOAT min_value = CHOOSE (LDBL_MIN, DBL_MIN, FLT_MIN,
+ LDBL_MIN, DBL_MIN, FLT_MIN);
+static const FLOAT min_subnorm_value = CHOOSE (__LDBL_DENORM_MIN__,
+ __DBL_DENORM_MIN__,
+ __FLT_DENORM_MIN__,
+ __LDBL_DENORM_MIN__,
+ __DBL_DENORM_MIN__,
+ __FLT_DENORM_MIN__);
static FLOAT max_error, real_max_error, imag_max_error;
@@ -13814,33 +13830,6 @@ initialize (void)
{
fpstack_test ("start *init*");
- plus_zero = 0.0;
- qnan_value = FUNC (__builtin_nan) ("");
- minus_zero = FUNC (copysign) (0.0, -1.0);
- plus_infty = CHOOSE (HUGE_VALL, HUGE_VAL, HUGE_VALF,
- HUGE_VALL, HUGE_VAL, HUGE_VALF);
- minus_infty = CHOOSE (-HUGE_VALL, -HUGE_VAL, -HUGE_VALF,
- -HUGE_VALL, -HUGE_VAL, -HUGE_VALF);
- max_value = CHOOSE (LDBL_MAX, DBL_MAX, FLT_MAX,
- LDBL_MAX, DBL_MAX, FLT_MAX);
- min_value = CHOOSE (LDBL_MIN, DBL_MIN, FLT_MIN,
- LDBL_MIN, DBL_MIN, FLT_MIN);
- min_subnorm_value = CHOOSE (__LDBL_DENORM_MIN__,
- __DBL_DENORM_MIN__,
- __FLT_DENORM_MIN__,
- __LDBL_DENORM_MIN__,
- __DBL_DENORM_MIN__,
- __FLT_DENORM_MIN__);
-
- (void) &plus_zero;
- (void) &qnan_value;
- (void) &minus_zero;
- (void) &plus_infty;
- (void) &minus_infty;
- (void) &max_value;
- (void) &min_value;
- (void) &min_subnorm_value;
-
/* Clear all exceptions. From now on we must not get random exceptions. */
feclearexcept (FE_ALL_EXCEPT);
errno = 0;