From 2e851863ddaeee34a629f28b7cfd389a7f67448a Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 12 Nov 1999 18:41:14 +0000 Subject: [PATCH] 19991112-19:29 GMT+1 Victor Szel --- harbour/ChangeLog | 9 +++++++++ harbour/source/rtl/itemapi.c | 12 ++++++++++-- harbour/source/rtl/strings.c | 16 ---------------- 3 files changed, 19 insertions(+), 18 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index ac9fc648a4..a01d863282 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,12 @@ +19991112-19:29 GMT+1 Victor Szel + * source/rtl/itemapi.c + source/rtl/strings.c + ! Moved the infinity support from strings.c to itemapi.c. + + The infinity support changed to not require the init on startup feature + of the compilers, it's now plain ANSI C. + + Removed to STRICT option from the infinity support, it's now turned on + all the time. Now one more RTL_TEST line will pass. + 19991112-11:40 EDT Paul Tucker * makefile.vc + source/rtl/dbedit diff --git a/harbour/source/rtl/itemapi.c b/harbour/source/rtl/itemapi.c index 7d03ce9ddd..5487013a2c 100644 --- a/harbour/source/rtl/itemapi.c +++ b/harbour/source/rtl/itemapi.c @@ -64,6 +64,8 @@ * */ +#include /* For log() */ + #include "extend.h" #include "itemapi.h" #include "ctoharb.h" @@ -1147,13 +1149,19 @@ char * hb_itemStr( PHB_ITEM pNumber, PHB_ITEM pWidth, PHB_ITEM pDec ) if( IS_DOUBLE( pNumber ) || iDec != 0 ) { double dNumber = hb_itemGetND( pNumber ); + static double s_dInfinity = 0; + static double s_bInfinityInit = FALSE; + + if( ! s_bInfinityInit ) + { + s_dInfinity = -log( 0 ); + s_bInfinityInit = TRUE; + } -#ifdef HARBOUR_STRICT_CLIPPER_COMPATIBILITY if( pNumber->item.asDouble.length == 99 || dNumber == s_dInfinity || dNumber == -s_dInfinity ) /* Numeric overflow */ iBytes = iSize + 1; else -#endif { if( IS_DOUBLE( pNumber ) && iDec < pNumber->item.asDouble.decimal ) dNumber = hb_numRound( dNumber, iDec ); diff --git a/harbour/source/rtl/strings.c b/harbour/source/rtl/strings.c index b8f4cf5009..cc3987ec5d 100644 --- a/harbour/source/rtl/strings.c +++ b/harbour/source/rtl/strings.c @@ -51,7 +51,6 @@ */ #include -#include #include "extend.h" #include "dates.h" @@ -64,21 +63,6 @@ ( c ) == HB_CHAR_CR || \ ( c ) == ' ' ) -#ifdef HARBOUR_STRICT_CLIPPER_COMPATIBILITY - -#include "init.h" - -static double s_dInfinity = 0; - -HB_CALL_ON_STARTUP_BEGIN( Strings_InitInfinity ) - s_dInfinity = -log( 0 ); -HB_CALL_ON_STARTUP_END( Strings_InitInfinity ) -#if ! defined(__GNUC__) -#pragma startup Strings_InitInfinity -#endif - -#endif - BOOL hb_strEmpty( const char * szText, ULONG ulLen ) { HB_TRACE(HB_TR_DEBUG, ("hb_strEmpty(%s, %lu)", szText, ulLen));