diff --git a/harbour/ChangeLog b/harbour/ChangeLog index a01d863282..aa4c16c1f4 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,10 +1,20 @@ +19991113-03:23 GMT+1 Victor Szel + * source/rtl/itemapi.c + % hb_evalNew(), hb_evalPutParam(), hb_evalRelease(), hb_itemRelease(), + hb_itemFreeC() - Variables and double initializations elimiated, faster, + simpler. + * source/rtl/dates.c + - DTOS() optimalization removed, it's now always 100% Clipper compatible, + STRICT option removed. + % hb_cmonth(), hb_cdow() optimalized. + 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 + + Removed the 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 diff --git a/harbour/source/rtl/dates.c b/harbour/source/rtl/dates.c index 9cc534d424..d5d49feb33 100644 --- a/harbour/source/rtl/dates.c +++ b/harbour/source/rtl/dates.c @@ -60,6 +60,7 @@ * hb_dateDecStr() * hb_dateStrPut() * hb_dateStrGet() + * HB_STOD() * HB_HB_STOD() * * See doc/license.txt for licensing terms. @@ -86,9 +87,6 @@ #if defined(__TURBOC__) || defined(__BORLANDC__) || defined(__DJGPP__) #include #endif -#ifndef HARBOUR_STRICT_CLIPPER_COMPATIBILITY - #define HB_OPTIMIZE_DTOS -#endif double hb_secondsToday( void ) { @@ -113,20 +111,14 @@ char * hb_cmonth( int iMonth ) { HB_TRACE(HB_TR_DEBUG, ("hb_cmonth(%d)", iMonth)); - if( iMonth >= 1 && iMonth <= 12 ) - return hb_monthsname[ iMonth - 1 ]; - else - return ""; + return ( iMonth >= 1 && iMonth <= 12 ) ? hb_monthsname[ iMonth - 1 ] : ""; } char * hb_cdow( int iDay ) { HB_TRACE(HB_TR_DEBUG, ("hb_cdow(%d)", iDay)); - if( iDay >= 1 && iDay <= 7 ) - return hb_daysname[ iDay - 1 ]; - else - return ""; + return ( iDay >= 1 && iDay <= 7 ) ? hb_daysname[ iDay - 1 ] : ""; } long hb_dateEncode( long lDay, long lMonth, long lYear ) @@ -535,21 +527,15 @@ HARBOUR HB_DTOC( void ) /* Clipper does these checks, anyway. */ HARBOUR HB_DTOS( void ) { -#ifndef HB_OPTIMIZE_DTOS if( hb_pcount() == 1 ) { if( ISDATE( 1 ) ) - { -#endif hb_retc( hb_pards( 1 ) ); -#ifndef HB_OPTIMIZE_DTOS - } else hb_errRT_BASE( EG_ARG, 1120, NULL, "DTOS" ); } else hb_errRT_BASE( EG_ARGCOUNT, 3000, NULL, "DTOS" ); /* NOTE: Clipper catches this at compile time! */ -#endif } #ifdef HB_COMPAT_XPP diff --git a/harbour/source/rtl/itemapi.c b/harbour/source/rtl/itemapi.c index f178b8fce1..2fdda230be 100644 --- a/harbour/source/rtl/itemapi.c +++ b/harbour/source/rtl/itemapi.c @@ -78,8 +78,6 @@ BOOL hb_evalNew( PEVALINFO pEvalInfo, PHB_ITEM pItem ) { - BOOL bResult; - HB_TRACE(HB_TR_DEBUG, ("hb_evalNew(%p, %p)", pEvalInfo, pItem)); if( pEvalInfo ) @@ -87,12 +85,11 @@ BOOL hb_evalNew( PEVALINFO pEvalInfo, PHB_ITEM pItem ) memset( pEvalInfo, 0, sizeof( EVALINFO ) ); pEvalInfo->pItems[ 0 ] = pItem; pEvalInfo->paramCount = 0; - bResult = TRUE; + + return TRUE; } else - bResult = FALSE; - - return bResult; + return FALSE; } /* NOTE: CA-Cl*pper is buggy and will not check if more parameters are @@ -100,19 +97,16 @@ BOOL hb_evalNew( PEVALINFO pEvalInfo, PHB_ITEM pItem ) BOOL hb_evalPutParam( PEVALINFO pEvalInfo, PHB_ITEM pItem ) { - BOOL bResult; - HB_TRACE(HB_TR_DEBUG, ("hb_evalPutParam(%p, %p)", pEvalInfo, pItem)); if( pEvalInfo && pItem && pEvalInfo->paramCount < HB_EVAL_PARAM_MAX_ ) { pEvalInfo->pItems[ ++pEvalInfo->paramCount ] = pItem; - bResult = TRUE; + + return TRUE; } else - bResult = FALSE; - - return bResult; + return FALSE; } PHB_ITEM hb_evalLaunch( PEVALINFO pEvalInfo ) @@ -158,8 +152,6 @@ PHB_ITEM hb_evalLaunch( PEVALINFO pEvalInfo ) BOOL hb_evalRelease( PEVALINFO pEvalInfo ) { - BOOL bResult; - HB_TRACE(HB_TR_DEBUG, ("hb_evalRelease(%p)", pEvalInfo)); if( pEvalInfo ) @@ -173,12 +165,11 @@ BOOL hb_evalRelease( PEVALINFO pEvalInfo ) } pEvalInfo->paramCount = 0; - bResult = TRUE; + + return TRUE; } else - bResult = FALSE; - - return bResult; + return FALSE; } /* NOTE: Same purpose as hb_evalLaunch(), but simpler, faster and more flexible. @@ -358,18 +349,17 @@ USHORT hb_itemPCount( void ) BOOL hb_itemRelease( PHB_ITEM pItem ) { - BOOL bResult = FALSE; - HB_TRACE(HB_TR_DEBUG, ("hb_itemRelease(%p)", pItem)); if( pItem ) { hb_itemClear( pItem ); hb_xfree( pItem ); - bResult = TRUE; - } - return bResult; + return TRUE; + } + else + return FALSE; } PHB_ITEM hb_itemArrayNew( ULONG ulLen ) @@ -532,17 +522,16 @@ ULONG hb_itemCopyC( PHB_ITEM pItem, char * szBuffer, ULONG ulLen ) BOOL hb_itemFreeC( char * szText ) { - BOOL bResult = FALSE; - HB_TRACE(HB_TR_DEBUG, ("hb_itemFreeC(%s)", szText)); if( szText ) { hb_xfree( szText ); - bResult = TRUE; - } - return bResult; + return TRUE; + } + else + return FALSE; } /* NOTE: Clipper is buggy and will not append a trailing zero, although