From eafad66714248636ec73e1abca2e782adf701baa Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 6 Mar 2000 03:43:05 +0000 Subject: [PATCH] 20000306-04:43 GMT+1 Victor Szakats --- harbour/ChangeLog | 25 +++++++++++++++++++++++ harbour/config/rules.cf | 2 +- harbour/doc/en/hvm.txt | 26 ++++++++++++++++++++++++ harbour/makefile.bc | 2 +- harbour/makefile.vc | 2 +- harbour/source/compiler/cmdcheck.c | 15 ++++++++++++++ harbour/source/rdd/dbf1.c | 3 +++ harbour/source/rtl/transfrm.c | 6 ++++-- harbour/source/tools/hb_f.c | 9 +++------ harbour/source/vm/debug.c | 32 ------------------------------ harbour/source/vm/hvm.c | 31 +++++++++++++++-------------- harbour/source/vm/memvars.c | 3 ++- 12 files changed, 97 insertions(+), 59 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index bc35587bc5..4401b6336b 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,28 @@ +20000306-04:43 GMT+1 Victor Szakats + * source/rtl/cmdcheck.c + ! -gc0 switch got removed. Added again. + * config/rules.cf + makefile.bc + makefile.vc + % -gc0 switch added to speed up make process. + The size of the obj/b32 dir after a make was 8.9MB before, + and 7.7MB after. + * source/vm/debug.c + doc/en/hvm.txt + ! One $DOC$ left in the source moved to the docs dir. + * source/vm/hvm.c + ! One variable name standardized and made static. + * source/rdd/dbf1.c + ! Unused variable warning fixed. + * source/rtl/transfrm.c + ! Borland warning fixed. + ! TRANSFORM(,"@") case fixed. Three more tests pass in RT_MAIN. + * source/vm/memvars.c + ! hb_memvarValueNew() Borland warning fixed. Comment added. + * source\tools\hb_f.c + ! Borland warning fixed. + % IT_NUMBER changed to the standard IT_NUMERIC + 20000305-13:47 GMT+1 Victor Szakats * source/rtl/empty.c source/rtl/valtype.c diff --git a/harbour/config/rules.cf b/harbour/config/rules.cf index 84b7541153..5d8ced9f31 100644 --- a/harbour/config/rules.cf +++ b/harbour/config/rules.cf @@ -20,7 +20,7 @@ HB := $(HB_BIN_COMPILE)/ endif HB := $(HB)harbour$(EXE_EXT) -HB_FLAGS = -n -q0 -w -es2 -I$(TOP) -I$(HB_INC_COMPILE) +HB_FLAGS = -n -q0 -w -es2 -gc0 -I$(TOP) -I$(HB_INC_COMPILE) # The rule to link an executable. ifeq ($(LD_RULE),) diff --git a/harbour/doc/en/hvm.txt b/harbour/doc/en/hvm.txt index d77b86a76e..da0ddc0f54 100644 --- a/harbour/doc/en/hvm.txt +++ b/harbour/doc/en/hvm.txt @@ -356,3 +356,29 @@ * * $END$ */ + +/* $DOC$ + * $FUNCNAME$ + * __VMVARLGET() + * $CATEGORY$ + * Variable management + * $ONELINER$ + * $SYNTAX$ + * __VMVARLGET( , ) + * $ARGUMENTS$ + * Is the procedure level, same as used in ProcName() + * and ProcLine(), from which a local variable containts is going to + * be retrieved. + * Is the index of the local variable to retrieve. + * $RETURNS$ + * The containts of a specific local variable + * $DESCRIPTION$ + * This function is used from the debugger + * $STATUS$ + * + * $COMPLIANCE$ + * + * $SEEALSO$ + * + * $END$ + */ diff --git a/harbour/makefile.bc b/harbour/makefile.bc index 20f1adedbb..d2f762be63 100644 --- a/harbour/makefile.bc +++ b/harbour/makefile.bc @@ -7,7 +7,7 @@ # Merge duplicate strings BCC_OPT = $(BCC_OPT) -d -HARBOUR_OPT = $(HARBOUR_OPT) -q0 -w -es2 +HARBOUR_OPT = $(HARBOUR_OPT) -q0 -w -es2 -gc0 !if $d(B16) diff --git a/harbour/makefile.vc b/harbour/makefile.vc index dd5dcc6dbf..2ac19b8371 100644 --- a/harbour/makefile.vc +++ b/harbour/makefile.vc @@ -69,7 +69,7 @@ RUNNER_DLL=$(BIN_DIR)\runjava.dll MACRO_LIB=$(LIB_DIR)\macro.lib REGRESS_EXE=$(BIN_DIR)\rt_main.exe HBDOC_EXE=$(BIN_DIR)\hbdoc.exe -HARBOURFLAGS=-iinclude -n -q0 -w -es2 +HARBOURFLAGS=-iinclude -n -q0 -w -es2 -gc0 LIBS=$(HARBOUR_LIB) $(MACRO_LIB) $(TERMINAL_LIB) $(TOOLS_LIB) $(DEBUG_LIB) $(PP_LIB) $(DBFNTX_LIB) $(DBFCDX_LIB) $(RUNNER_LIB) $(MACRO_LIB) diff --git a/harbour/source/compiler/cmdcheck.c b/harbour/source/compiler/cmdcheck.c index 5a85151fb3..a2caa49a58 100644 --- a/harbour/source/compiler/cmdcheck.c +++ b/harbour/source/compiler/cmdcheck.c @@ -281,6 +281,21 @@ void hb_compChkEnvironVar( char * szSwitch ) case 'c': case 'C': hb_comp_iLanguage = LANG_C; + + switch( *( s + 2 ) ) + { + case '\0': + case '1': + hb_comp_bGenCVerbose = TRUE; + break; + + case '0': + hb_comp_bGenCVerbose = FALSE; + break; + + default: + hb_compGenError( hb_comp_szErrors, 'F', ERR_BADOPTION, s, NULL ); + } break; #ifdef HARBOUR_OBJ_GENERATION diff --git a/harbour/source/rdd/dbf1.c b/harbour/source/rdd/dbf1.c index 553d9fc783..a25186fcad 100644 --- a/harbour/source/rdd/dbf1.c +++ b/harbour/source/rdd/dbf1.c @@ -1009,6 +1009,7 @@ static ERRCODE dbfGetValueFile( AREAP pArea, USHORT uiIndex, void * pFile ) LPFIELD pField; HB_TRACE(HB_TR_DEBUG, ("dbfGetValueFile(%p, %hu, %p)", pArea, uiIndex, pFile)); + HB_SYMBOL_UNUSED( pFile ); if( uiIndex > pArea->uiFieldCount ) @@ -1614,6 +1615,8 @@ static ERRCODE dbfPutValueFile( AREAP pArea, USHORT uiIndex, void * pFile ) HB_TRACE(HB_TR_DEBUG, ("dbfPutValueFile(%p, %hu, %p)", pArea, uiIndex, pFile)); + HB_SYMBOL_UNUSED( pFile ); + if( uiIndex > pArea->uiFieldCount ) return FAILURE; diff --git a/harbour/source/rtl/transfrm.c b/harbour/source/rtl/transfrm.c index b634de25c0..222e36813e 100644 --- a/harbour/source/rtl/transfrm.c +++ b/harbour/source/rtl/transfrm.c @@ -241,7 +241,7 @@ static char * NumPicture( char * szPic, ULONG ulPicLen, USHORT * puiPicFlags, do /* Pad with Zero's */ if( uiPicFlags & PF_ZERO ) { - for( i = 0; szStr[ i ] == ' ' && i < iWidth; i++ ) + for( i = 0; szStr[ i ] == ' ' && i < ( ULONG ) iWidth; i++ ) szStr[ i ] = '0'; } @@ -295,7 +295,7 @@ static char * NumPicture( char * szPic, ULONG ulPicLen, USHORT * puiPicFlags, do { if( isdigit( *szResult ) ) /* Overflow */ { - for( iCount = 1; iCount < i; iCount++ ) + for( iCount = 1; ( ULONG ) iCount < i; iCount++ ) { if( isdigit( szResult[ iCount ] ) ) szResult[ iCount ] = '*'; @@ -517,6 +517,8 @@ HARBOUR HB_TRANSFORM( void ) } } } + else + *szResult = hb_itemGetL( pExp ) ? 'T' : 'F'; /* Any chars left */ if( ( uiPicFlags & PF_REMAIN ) && ulPicLen ) diff --git a/harbour/source/tools/hb_f.c b/harbour/source/tools/hb_f.c index a2bd59bb4a..a9bffa73ff 100644 --- a/harbour/source/tools/hb_f.c +++ b/harbour/source/tools/hb_f.c @@ -39,7 +39,6 @@ #define b_size 1024 #define c_size 4096 -#define IT_NUMBER (IT_INTEGER|IT_LONG|IT_DOUBLE) static long hb_hbfskip( int recs ); @@ -59,7 +58,7 @@ HARBOUR HB_HB_FUSE( void ) { PHB_ITEM arg1_it = hb_param(1,IT_STRING); - PHB_ITEM arg2_it = hb_param(2,IT_NUMBER); + PHB_ITEM arg2_it = hb_param(2,IT_NUMERIC); int open_flags; if ( arg1_it ) { @@ -104,7 +103,7 @@ HARBOUR HB_HB_FSKIP( void ) { - PHB_ITEM arg1_it = hb_param(1,IT_NUMBER); + PHB_ITEM arg1_it = hb_param(1,IT_NUMERIC); int nskip; if( arg1_it ) @@ -117,11 +116,9 @@ HARBOUR HB_HB_FSKIP( void ) } static long hb_hbfskip( int recs ) - { - long read_pos; - size_t read_len; + long read_len; long x, y; diff --git a/harbour/source/vm/debug.c b/harbour/source/vm/debug.c index f226a4fd81..97bfa0c6b3 100644 --- a/harbour/source/vm/debug.c +++ b/harbour/source/vm/debug.c @@ -62,7 +62,6 @@ static void AddToArray( PHB_ITEM pItem, PHB_ITEM pReturn, ULONG ulPos ) hb_itemArrayPut( pReturn, ulPos, pItem ); } - /* $Doc$ * $FuncName$ __vmStkGCount() * $Description$ Returns the length of the global stack @@ -84,7 +83,6 @@ HARBOUR HB___VMSTKGCOUNT( void ) hb_retni( hb_stackLenGlobal() ); } - /* $Doc$ * $FuncName$ __vmStkGList() * $Description$ Returns the global stack @@ -106,7 +104,6 @@ HARBOUR HB___VMSTKGLIST( void ) hb_itemRelease( pReturn ); } - /* $Doc$ * $FuncName$ __vmStkLCount() * $Description$ Returns the length of the stack of the calling function @@ -129,7 +126,6 @@ HARBOUR HB___VMSTKLCOUNT( void ) hb_retni( StackLen() ); } - /* $Doc$ * $FuncName$ __vmStkLList() * $Description$ Returns the stack of the calling function @@ -157,7 +153,6 @@ HARBOUR HB___VMSTKLLIST( void ) hb_itemRelease( pReturn ); } - /* $Doc$ * $FuncName$ __vmParLGet() * $Description$ Returns the passed parameters of the calling function @@ -183,33 +178,6 @@ HARBOUR HB___VMPARLLIST( void ) hb_itemRelease( pReturn ); } -/* -------------------------------------------------------------------------- */ -/* $DOC$ - * $FUNCNAME$ - * __VMVARLGET() - * $CATEGORY$ - * Variable management - * $ONELINER$ - * $SYNTAX$ - * __VMVARLGET( , ) - * $ARGUMENTS$ - * Is the procedure level, same as used in ProcName() - * and ProcLine(), from which a local variable containts is going to - * be retrieved. - * Is the index of the local variable to retrieve. - * $RETURNS$ - * The containts of a specific local variable - * $DESCRIPTION$ - * This function is used from the debugger - * $STATUS$ - * - * $COMPLIANCE$ - * - * $SEEALSO$ - * - * $END$ - */ - HARBOUR HB___VMVARLGET( void ) { int iLevel = hb_parni( 1 ) + 1; diff --git a/harbour/source/vm/hvm.c b/harbour/source/vm/hvm.c index 988267b664..c18c011c46 100644 --- a/harbour/source/vm/hvm.c +++ b/harbour/source/vm/hvm.c @@ -199,17 +199,17 @@ extern POBJSYMBOLS HB_FIRSTSYMBOL, HB_LASTSYMBOL; /* virtual machine state */ HB_STACK hb_stack; -HB_SYMB hb_symEval = { "__EVAL", FS_PUBLIC, hb_vmDoBlock, 0 }; /* symbol to evaluate codeblocks */ - -BOOL hb_DebuggerIsWorking = FALSE; /* to know when __DBGENTRY is beeing invoked */ +HB_SYMB hb_symEval = { "__EVAL", FS_PUBLIC, hb_vmDoBlock, NULL }; /* symbol to evaluate codeblocks */ static HB_ITEM s_aStatics; /* Harbour array to hold all application statics variables */ -static BOOL s_bDebugging = FALSE; -static BOOL s_bDebugShowLines = FALSE; /* update source code line on the debugger display */ static PHB_SYMB s_pSymStart = NULL; /* start symbol of the application. MAIN() is not required */ static PSYMBOLS s_pSymbols = NULL; /* to hold a linked list of all different modules symbol tables */ static BYTE s_byErrorLevel = 0; /* application exit errorlevel */ +static BOOL s_bDebugging = FALSE; +static BOOL s_bDebugShowLines = FALSE; /* update source code line on the debugger display */ +static BOOL s_bDebuggerIsWorking = FALSE; /* to know when __DBGENTRY is beeing invoked */ + /* Stores the position on the stack of current SEQUENCE envelope or 0 if no * SEQUENCE is active */ @@ -257,7 +257,7 @@ void hb_vmInit( BOOL bStartMainProc ) hb_vmDoInitFunctions(); /* process defined INIT functions */ /* This is undocumented CA-Clipper, if there's a function called _APPMAIN - it will be executed first. */ + it will be executed first. [vszakats] */ { PHB_DYNS pDynSym = hb_dynsymFind( "_APPMAIN" ); @@ -2649,9 +2649,9 @@ static void hb_vmModuleName( char * szModuleName ) /* PRG and function name info hb_vmPushSymbol( hb_dynsymFind( "__DBGENTRY" )->pSymbol ); hb_vmPushNil(); hb_vmPushString( szModuleName, strlen( szModuleName ) ); - hb_DebuggerIsWorking = TRUE; + s_bDebuggerIsWorking = TRUE; hb_vmDo( 1 ); - hb_DebuggerIsWorking = FALSE; + s_bDebuggerIsWorking = FALSE; s_bDebugShowLines = TRUE; } @@ -2724,9 +2724,9 @@ static void hb_vmDebuggerEndProc( void ) s_bDebugShowLines = FALSE; hb_vmPushSymbol( hb_dynsymFind( "__DBGENTRY" )->pSymbol ); hb_vmPushNil(); - hb_DebuggerIsWorking = TRUE; + s_bDebuggerIsWorking = TRUE; hb_vmDo( 0 ); - hb_DebuggerIsWorking = FALSE; + s_bDebuggerIsWorking = FALSE; s_bDebugShowLines = TRUE; hb_itemCopy( &hb_stack.Return, &item ); /* restores the previous returned value */ @@ -2741,9 +2741,9 @@ static void hb_vmDebuggerShowLine( USHORT uiLine ) /* makes the debugger shows a hb_vmPushSymbol( hb_dynsymFind( "__DBGENTRY" )->pSymbol ); hb_vmPushNil(); hb_vmPushInteger( uiLine ); - hb_DebuggerIsWorking = TRUE; + s_bDebuggerIsWorking = TRUE; hb_vmDo( 1 ); - hb_DebuggerIsWorking = FALSE; + s_bDebuggerIsWorking = FALSE; s_bDebugShowLines = TRUE; } @@ -3737,8 +3737,9 @@ static void hb_vmDoInitFunctions( void ) } while( pLastSymbols ); } -/* NOTE: We should make sure that these get linked. */ -/* Don't make this function static, because it's not called from this file. */ +/* NOTE: We should make sure that these get linked. + Don't make this function static, because it's not called from + this file. */ void hb_vmForceLink( void ) { HB_TRACE(HB_TR_DEBUG, ("hb_vmForceLink()")); @@ -3753,7 +3754,7 @@ HARBOUR HB_ERRORLEVEL( void ) hb_retni( s_byErrorLevel ); /* NOTE: This should be ISNUM( 1 ), but it's sort of a Clipper bug that it - accepts other types also and consider them zero. [vszakats] */ + accepts other types also and considers them zero. [vszakats] */ if( hb_pcount() >= 1 ) /* Only replace the error level if a parameter was passed */ diff --git a/harbour/source/vm/memvars.c b/harbour/source/vm/memvars.c index 00f237c057..1117dd8718 100644 --- a/harbour/source/vm/memvars.c +++ b/harbour/source/vm/memvars.c @@ -156,7 +156,8 @@ HB_VALUE_PTR *hb_memvarValueBaseAddress( void ) HB_HANDLE hb_memvarValueNew( HB_ITEM_PTR pSource, BOOL bTrueMemvar ) { HB_VALUE_PTR pValue; - HB_HANDLE hValue = 1; /* handle 0 is reserved */ + HB_HANDLE hValue; /* handle 0 is reserved */ + /* = 1 removed, since it's initialized in all branches. Caused a warning with Borland C++ */ HB_TRACE(HB_TR_DEBUG, ("hb_memvarValueNew(%p, %d)", pSource, (int) bTrueMemvar));