summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatt Turner <[email protected]>2012-08-01 14:48:47 -0700
committerMatt Turner <[email protected]>2012-08-03 15:02:09 -0700
commitfb85558ab1e40698bfb1aedaaf32b182560f2479 (patch)
treef5e6a8321491ad974630b261d2f9bd19fb6b7d67 /src
parent65da837fcfd4eaf444c54df22b0887440424297c (diff)
Use C99 NAN and INFINITY macros
Diffstat (limited to 'src')
-rw-r--r--src/gallium/auxiliary/util/u_format_tests.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/gallium/auxiliary/util/u_format_tests.c b/src/gallium/auxiliary/util/u_format_tests.c
index d34860886e1..26e7acb6285 100644
--- a/src/gallium/auxiliary/util/u_format_tests.c
+++ b/src/gallium/auxiliary/util/u_format_tests.c
@@ -26,6 +26,7 @@
**************************************************************************/
+#include <math.h>
#include <float.h>
#include "pipe/p_config.h"
@@ -66,14 +67,6 @@
{{ 0, 0, 0, 0}, { 0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}}
-#ifdef __GNUC__
-#define NAN __builtin_nan("")
-#define INF __builtin_inf()
-#else
-#define NAN (0.0 / 0.0)
-#define INF (1.0 / 0.0)
-#endif
-
/**
* Test cases.
*
@@ -911,8 +904,8 @@ util_format_test_cases[] =
{PIPE_FORMAT_R16_FLOAT, PACKED_1x16(0xffff), PACKED_1x16(0xffff), UNPACKED_1x1( -NAN, 0.0, 0.0, 1.0)},
/* Inf */
- {PIPE_FORMAT_R16_FLOAT, PACKED_1x16(0xffff), PACKED_1x16(0x7c00), UNPACKED_1x1( INF, 0.0, 0.0, 1.0)},
- {PIPE_FORMAT_R16_FLOAT, PACKED_1x16(0xffff), PACKED_1x16(0xfc00), UNPACKED_1x1( -INF, 0.0, 0.0, 1.0)},
+ {PIPE_FORMAT_R16_FLOAT, PACKED_1x16(0xffff), PACKED_1x16(0x7c00), UNPACKED_1x1( INFINITY, 0.0, 0.0, 1.0)},
+ {PIPE_FORMAT_R16_FLOAT, PACKED_1x16(0xffff), PACKED_1x16(0xfc00), UNPACKED_1x1( -INFINITY, 0.0, 0.0, 1.0)},
#endif