From b0adad4294e7ad50df75f5b13e18913a3e9deba4 Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sat, 19 Nov 2011 10:39:58 +0000 Subject: [PATCH] [CRT] Fix _fpclass prototype Fix headers included Remove internal defines that were useless and even not matching real defines. This fixes 4 tests svn path=/trunk/; revision=54432 --- reactos/lib/sdk/crt/float/fpclass.c | 50 ++++++----------------------- 1 file changed, 10 insertions(+), 40 deletions(-) diff --git a/reactos/lib/sdk/crt/float/fpclass.c b/reactos/lib/sdk/crt/float/fpclass.c index b2ca7e3026a..7bfbae7b645 100644 --- a/reactos/lib/sdk/crt/float/fpclass.c +++ b/reactos/lib/sdk/crt/float/fpclass.c @@ -9,43 +9,13 @@ */ #include -#include +#include #include - -#define _FPCLASS_SNAN 0x0001 /* signaling NaN */ -#define _FPCLASS_QNAN 0x0002 /* quiet NaN */ -#define _FPCLASS_NINF 0x0004 /* negative infinity */ -#define _FPCLASS_NN 0x0008 /* negative normal */ -#define _FPCLASS_ND 0x0010 /* negative denormal */ -#define _FPCLASS_NZ 0x0020 /* -0 */ -#define _FPCLASS_PZ 0x0040 /* +0 */ -#define _FPCLASS_PD 0x0080 /* positive denormal */ -#define _FPCLASS_PN 0x0100 /* positive normal */ -#define _FPCLASS_PINF 0x0200 /* positive infinity */ - - -//#if __MINGW32_MAJOR_VERSION < 3 || __MINGW32_MINOR_VERSION < 3 - -#define FP_SNAN 0x0001 // signaling NaN -#define FP_QNAN 0x0002 // quiet NaN -#define FP_NINF 0x0004 // negative infinity -#define FP_PINF 0x0200 // positive infinity -#define FP_NDENORM 0x0008 // negative denormalized non-zero -#define FP_PDENORM 0x0010 // positive denormalized non-zero -#define FP_NZERO 0x0020 // negative zero -#define FP_PZERO 0x0040 // positive zero -#define FP_NNORM 0x0080 // negative normalized non-zero -#define FP_PNORM 0x0100 // positive normalized non-zero - -//#endif - -typedef int fpclass_t; - /* * @implemented */ -fpclass_t _fpclass(double __d) +int _fpclass(double __d) { union { @@ -57,26 +27,26 @@ fpclass_t _fpclass(double __d) if ( d.d->exponent == 0 ) { if ( d.d->mantissah == 0 && d.d->mantissal == 0 ) { if ( d.d->sign == 0 ) - return FP_PZERO; + return _FPCLASS_PZ; else - return FP_NZERO; + return _FPCLASS_NZ; } else { if ( d.d->sign == 0 ) - return FP_PDENORM; + return _FPCLASS_PD; else - return FP_NDENORM; + return _FPCLASS_ND; } } else if (d.d->exponent == 0x7ff ) { if ( d.d->mantissah == 0 && d.d->mantissal == 0 ) { if ( d.d->sign == 0 ) - return FP_PINF; + return _FPCLASS_PINF; else - return FP_NINF; + return _FPCLASS_NINF; } else if ( (d.d->mantissah & 0x80000) != 0 ) { - return FP_QNAN; + return _FPCLASS_QNAN; } } - return FP_SNAN; + return _FPCLASS_SNAN; }