mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 05:18:08 +02:00
Use C99 NAN and INFINITY macros
This commit is contained in:
parent
65da837fcf
commit
fb85558ab1
1 changed files with 3 additions and 10 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue