From f3a2f8216dfd8076bb363e18dda4fe8bc86bccfe Mon Sep 17 00:00:00 2001 From: "David G. Holm" Date: Wed, 10 Sep 2003 19:24:03 +0000 Subject: [PATCH] See ChangeLog entry 2003-09-10 15:00 UTC-0400 David G. Holm --- harbour/ChangeLog | 16 ++++++++ harbour/config/dos/bcc16.cf | 2 +- harbour/config/os2/icc.cf | 2 +- harbour/source/common/hbstr.c | 56 ++++++++++++++++++++++++++++ harbour/source/compiler/harbour.l | 53 --------------------------- harbour/source/rdd/dbfcdx/dbfcdx1.c | 6 +-- harbour/source/rtl/symbol.prg | 6 +-- harbour/source/rtl/val.c | 57 ----------------------------- 8 files changed, 80 insertions(+), 118 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index b9345112a8..ba9465a913 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -7,6 +7,22 @@ For example: 2002-12-01 23:12 UTC+0100 Foo Bar */ +2003-09-10 15:00 UTC-0400 David G. Holm + * config/dos/bcc16.cf + * config/os2/icc.cf + ! Disabled the LONGLONG and UNLONGLONG definitions in hbdefs.h, which + only work for GCC and Windows, by defining HB_LONG_LONG_OFF. + * source/compiler/harbour.l + * source/rtl/val.c + ! Moved the duplicate definitions of hb_strVal to source/common/hbstr.c. + * source/rtl/symbol.prg + ! Removed static declarations from GETSYMBOLPOINTER, GETSYMBOLNAME, and + SYMBOL_EXEC in order to eliminate static vs. extern errors in os2/icc + builds. + * source/rdd/dbfcdx/dbfcdx1.c + ! Corrected two instances of (unsigned char *) typecasts on hb_fs... + functions, which use BYTE * parameters, not unsigned char * (the + distinction is very important for those builds that use C++ mode. 2003-09-10 09:45 UTC-0300 Antonio Carlos Pantaglione * source/vm/arrayshb.c diff --git a/harbour/config/dos/bcc16.cf b/harbour/config/dos/bcc16.cf index 072e389c1c..1ab3372fa6 100644 --- a/harbour/config/dos/bcc16.cf +++ b/harbour/config/dos/bcc16.cf @@ -25,7 +25,7 @@ CC = bcc CC_IN = -c CC_OUT = -o CPPFLAGS = -I$($(HB_ARCHITECTURE)_$(HB_COMPILER)_GRANDP) -I$(_HB_INC_COMPILE) -CFLAGS = -i48 -O2 -mh -d +CFLAGS = -i48 -O2 -mh -d -DHB_LONG_LONG_OFF #Note: The empty line below HAVE TO exist! define link_file diff --git a/harbour/config/os2/icc.cf b/harbour/config/os2/icc.cf index 747e5b9b47..e2e54fd692 100644 --- a/harbour/config/os2/icc.cf +++ b/harbour/config/os2/icc.cf @@ -14,7 +14,7 @@ CC_IN = /C+ /Tp CC_OUT = /Fo CPPFLAGS = /I$(GRANDP) /I$(HB_INC_COMPILE) #CFLAGS = /Gs+ /W2 /Se /Sd+ /Ti+ -CFLAGS = /Gs+ /W2 /Se /Sd+ +CFLAGS = /Gs+ /W2 /Se /Sd+ -DHB_LONG_LONG_OFF LD = icc LD_OUT = /Fe diff --git a/harbour/source/common/hbstr.c b/harbour/source/common/hbstr.c index 8fa47ac923..e1ffbf6b78 100644 --- a/harbour/source/common/hbstr.c +++ b/harbour/source/common/hbstr.c @@ -156,3 +156,59 @@ int hb_stricmp( const char * s1, const char * s2 ) return rc; } + +/* returns the numeric value of a character string representation of a number */ +double hb_strVal( const char * szText, ULONG ulLen ) +{ + long double ldValue = 0.0; + ULONG ulPos; + ULONG ulDecPos = 0; + BOOL bNegative = FALSE; + long double ldScale = 0.1L; + + HB_TRACE(HB_TR_DEBUG, ("hb_strVal(%s, %d)", szText, ulLen)); + + /* Look for sign */ + + for( ulPos = 0; ulPos < ulLen; ulPos++ ) + { + if( szText[ ulPos ] == '-' ) + { + bNegative = TRUE; + ulPos++; + break; + } + else if( szText[ ulPos ] == '+' ) + { + ulPos++; + break; + } + else if( ! HB_ISSPACE( szText[ ulPos ] ) ) + break; + } + + /* Build the number */ + + for(; ulPos < ulLen; ulPos++ ) + { + if( szText[ ulPos ] == '.' && ulDecPos == 0 ) + { + ulDecPos++; + ldScale = 0.1L; + } + else if( szText[ ulPos ] >= '0' && szText[ ulPos ] <= '9' ) + { + if( ulDecPos ) + { + ldValue += ldScale * ( long double )( szText[ ulPos ] - '0' ); + ldScale *= 0.1L; + } + else + ldValue = ( ldValue * 10.0L ) + ( long double )( szText[ ulPos ] - '0' ); + } + else + break; + } + + return ( double )( bNegative && ldValue != 0.0L ? -ldValue : ldValue ); +} diff --git a/harbour/source/compiler/harbour.l b/harbour/source/compiler/harbour.l index b2e8f2bace..249c9d3987 100644 --- a/harbour/source/compiler/harbour.l +++ b/harbour/source/compiler/harbour.l @@ -1593,59 +1593,6 @@ int yy_lex_input( char *buffer, int iBufferSize ) return hb_pp_Internal( hb_comp_bPPO ? hb_comp_yyppo : NULL, buffer ); } -static double hb_strVal( const char * szText, ULONG ulLen ) -{ - long double ldValue = 0.0; - ULONG ulPos; - ULONG ulDecPos = 0; - BOOL bNegative = FALSE; - long double ldScale = 0.1L; - - /* Look for sign */ - - for( ulPos = 0; ulPos < ulLen; ulPos++ ) - { - if( szText[ ulPos ] == '-' ) - { - bNegative = TRUE; - ulPos++; - break; - } - else if( szText[ ulPos ] == '+' ) - { - ulPos++; - break; - } - else if( ! HB_ISSPACE( szText[ ulPos ] ) ) - break; - } - - /* Build the number */ - - for(; ulPos < ulLen; ulPos++ ) - { - if( szText[ ulPos ] == '.' && ulDecPos == 0 ) - { - ulDecPos++; - ldScale = 0.1L; - } - else if( szText[ ulPos ] >= '0' && szText[ ulPos ] <= '9' ) - { - if( ulDecPos ) - { - ldValue += ldScale * ( long double )( szText[ ulPos ] - '0' ); - ldScale *= 0.1L; - } - else - ldValue = ( ldValue * 10.0L ) + ( long double )( szText[ ulPos ] - '0' ); - } - else - break; - } - - return ( double )( bNegative && ldValue != 0.0L ? -ldValue : ldValue ); -} - static int yy_ConvertNumber( char * szBuffer ) { char * ptr; diff --git a/harbour/source/rdd/dbfcdx/dbfcdx1.c b/harbour/source/rdd/dbfcdx/dbfcdx1.c index ce01bfe0cc..7a37aff920 100644 --- a/harbour/source/rdd/dbfcdx/dbfcdx1.c +++ b/harbour/source/rdd/dbfcdx/dbfcdx1.c @@ -945,7 +945,7 @@ static void hb_xfptGetMemo( CDXAREAP pArea, USHORT uiIndex, PHB_ITEM pItem ) static void hb_xfptReadItemSx( FHANDLE hMemoFile, PHB_ITEM pItem ) { BYTE itmBuffer[14]; - char * pStr; + BYTE * pStr; USHORT usType; ULONG ulLen, i; PHB_ITEM pArray, pNewItem; @@ -974,7 +974,7 @@ static void hb_xfptReadItemSx( FHANDLE hMemoFile, PHB_ITEM pItem ) case 0x0400 : /* CLIP_IT_CHAR */ ulLen = *(short *)(&itmBuffer[2]); /* only 2 bytes for SIX compatibility */ pStr = (char *) hb_xgrab( ulLen + 1 ); - hb_fsRead( hMemoFile, (unsigned char *) pStr, ulLen ); + hb_fsRead( hMemoFile, pStr, ulLen ); hb_itemPutCPtr( pItem, pStr, ulLen ); break; @@ -1088,7 +1088,7 @@ static ULONG hb_xfptWriteItemSx( FHANDLE hMemoFile, PHB_ITEM pItem ) ulSize += ulLen; if ( ulLen > 0 ) { - hb_fsWrite( hMemoFile, (unsigned char *) (pItem->item.asString.value), ulLen ); + hb_fsWrite( hMemoFile, (BYTE *) (pItem->item.asString.value), ulLen ); } break; diff --git a/harbour/source/rtl/symbol.prg b/harbour/source/rtl/symbol.prg index 327820de1e..b481a5125e 100644 --- a/harbour/source/rtl/symbol.prg +++ b/harbour/source/rtl/symbol.prg @@ -114,19 +114,19 @@ return .f. #include #include -static HB_FUNC( GETSYMBOLPOINTER ) +HB_FUNC( GETSYMBOLPOINTER ) { hb_retnl( ( long ) hb_dynsymGet( hb_parc( 1 ) ) ); } -static HB_FUNC( GETSYMBOLNAME ) +HB_FUNC( GETSYMBOLNAME ) { PHB_DYNS pDynSym = ( PHB_DYNS ) hb_parnl( 1 ); hb_retc( ( pDynSym != NULL ? pDynSym->pSymbol->szName : "" ) ); } -static HB_FUNC( SYMBOL_EXEC ) +HB_FUNC( SYMBOL_EXEC ) { PHB_ITEM pSelf = hb_param( 0, HB_IT_OBJECT ); /* we retrieve Self */ PHB_DYNS pSym; diff --git a/harbour/source/rtl/val.c b/harbour/source/rtl/val.c index 78ceda03fe..b5ecd74e78 100644 --- a/harbour/source/rtl/val.c +++ b/harbour/source/rtl/val.c @@ -56,63 +56,6 @@ #include "hbapiitm.h" #include "hbapierr.h" -/* returns the numeric value of a character string representation of a number */ -double hb_strVal( const char * szText, ULONG ulLen ) -{ - long double ldValue = 0.0; - ULONG ulPos; - ULONG ulDecPos = 0; - BOOL bNegative = FALSE; - long double ldScale = 0.1L; - - HB_TRACE(HB_TR_DEBUG, ("hb_strVal(%s, %d)", szText, ulLen)); - - /* Look for sign */ - - for( ulPos = 0; ulPos < ulLen; ulPos++ ) - { - if( szText[ ulPos ] == '-' ) - { - bNegative = TRUE; - ulPos++; - break; - } - else if( szText[ ulPos ] == '+' ) - { - ulPos++; - break; - } - else if( ! HB_ISSPACE( szText[ ulPos ] ) ) - break; - } - - /* Build the number */ - - for(; ulPos < ulLen; ulPos++ ) - { - if( szText[ ulPos ] == '.' && ulDecPos == 0 ) - { - ulDecPos++; - ldScale = 0.1L; - } - else if( szText[ ulPos ] >= '0' && szText[ ulPos ] <= '9' ) - { - if( ulDecPos ) - { - ldValue += ldScale * ( long double )( szText[ ulPos ] - '0' ); - ldScale *= 0.1L; - } - else - ldValue = ( ldValue * 10.0L ) + ( long double )( szText[ ulPos ] - '0' ); - } - else - break; - } - - - return ( double )( bNegative && ldValue != 0.0L ? -ldValue : ldValue ); -} - /* returns the numeric value of a character string representation of a number */ HB_FUNC( VAL ) {