19990910-11:10 GMT+1

This commit is contained in:
Viktor Szakats
1999-09-10 09:33:03 +00:00
parent fe5cc77607
commit a44e3d51fb
11 changed files with 1063 additions and 994 deletions

View File

@@ -1,3 +1,33 @@
19990910-11:10 GMT+1 Victor Szel <info@szelvesz.hu>
* tests/working/rtl_test.prg
+ Enabled some alias tests which fail. (Ryszard, could you take a look
at it ?)
* source/vm/hvm.c
! hb_vmSwapAlias() - Fixed mistyped variable name, pItem was accessed
instead of pWorkarea. (Is this OK, Ryszard ?)
* source/rtl/itemapi.c
! hb_itemStrCmp() - Fixed a bug, when the character were compared as a
signed value instead of unsigned. ( BYTE ) casts added where needed.
This caused four regr.tests to fail.
* source/rtl/gtapi.c
! hb_gtSetColorStr() is now using toupper instead of a platform
dependent bit operation.
* tests/working/rtl_test.prg
+ Code added to test the :Args feature of error handling, this is commented
out, since Harbour doesn't support it yet.
* include/error.api
! Zero bytes (!) removed from some places, so now the comptaibility header
files are working fine.
* source/compiler/harbour.y
source/rtl/dir.c
source/memvars.c
* Some formatting corrections.
* include/ctoharb.h
* Opcode functions grouped by type. Later on the same thing should be
done in HVM.C. If similar code fragments are close to each other, bugs are easier to spot.
* include/pcode.h
* Comments aligned.
19990910-11:05 GMT+2 Ryszard Glab <rglab@imim.med.pl>
*source/compiler/harbour.y
@@ -162,7 +192,7 @@
* hb_arrayFill(), hb_arrayScan(), hb_arrayEval(), hb_arrayCopy() changed
to parameter to implement the previous change.
* source/rtl/environ.c
! __RUN() now checks for the parameter type, not the number,
! __RUN() now checks for the parameter type, not the number.
+ __RUN() funtionality enabled for __CYGWIN__
+ __RUN() will now throw an "operation not supported" runtime error on
platforms where it's not supported, this is IMO better than silently

View File

@@ -32,83 +32,103 @@
/* Harbour virtual machine functions */
extern void hb_vmExecute( BYTE * pCode, PHB_SYMB pSymbols ); /* invokes the virtual machine */
extern void hb_vmProcessSymbols( PHB_SYMB pSymbols, WORD wSymbols ); /* statics symbols initialization */
extern void hb_vmSymbolInit_RT( void ); /* initialization of runtime support symbols */
/* Harbour virtual machine escaping API */
extern void hb_vmRequestQuit( void );
extern void hb_vmRequestCancel( void );
extern void hb_vmRequestBreak( PHB_ITEM pItem );
extern WORD hb_vmRequestQuery( void );
extern void hb_vmQuit( void ); /* Immediately quits the virtual machine */
extern void hb_vmSymbolInit_RT( void ); /* initialization of runtime support symbols */
/* Return values of hb_vmRequestQuery() */
#define HB_QUIT_REQUESTED 1 /* immediately quit the application */
#define HB_BREAK_REQUESTED 2 /* break to nearest RECOVER/END sequence */
/* PCode functions */
extern void hb_vmAnd( void ); /* performs the logical AND on the latest two values, removes them and leaves result on the stack */
extern void hb_vmArrayAt( void ); /* pushes an array element to the stack, removing the array and the index from the stack */
extern void hb_vmArrayPut( void ); /* sets an array value and pushes the value on to the stack */
extern void hb_vmDec( void ); /* decrements the latest numeric value on the stack */
extern void hb_vmDimArray( WORD wDimensions ); /* generates a wDimensions Array and initialize those dimensions from the stack values */
/* Operators ( mathematical / character / misc ) */
extern void hb_vmMult( void ); /* multiplies the latest two values on the stack, removes them and leaves the result */
extern void hb_vmDivide( void ); /* divides the latest two values on the stack, removes them and leaves the result */
extern void hb_vmDo( WORD WParams ); /* invoke the virtual machine */
extern HARBOUR hb_vmDoBlock( void ); /* executes a codeblock */
extern void hb_vmDuplicate( void ); /* duplicates the latest value on the stack */
extern void hb_vmDuplTwo( void ); /* duplicates the latest two value on the stack */
extern void hb_vmEndBlock( void ); /* copies the last codeblock pushed value into the return value */
extern void hb_vmEqual( BOOL bExact ); /* checks if the two latest values on the stack are equal, removes both and leaves result */
extern void hb_vmForTest( void ); /* test for end condition of for */
extern void hb_vmFrame( BYTE bLocals, BYTE bParams ); /* increases the stack pointer for the amount of locals and params suplied */
extern void hb_vmPlus( void ); /* sums the latest two values on the stack, removes them and leaves the result */
extern void hb_vmMinus( void ); /* substracts the latest two values on the stack, removes them and leaves the result */
extern void hb_vmPower( void ); /* power the latest two values on the stack, removes them and leaves the result */
extern void hb_vmModulus( void ); /* calculates the modulus of latest two values on the stack, removes them and leaves the result */
extern void hb_vmInc( void ); /* increment the latest numeric value on the stack */
extern void hb_vmDec( void ); /* decrements the latest numeric value on the stack */
extern void hb_vmNegate( void ); /* negates (-) the latest value on the stack */
extern void hb_vmFuncPtr( void ); /* pushes a function address pointer. Removes the symbol from the satck */
extern void hb_vmFunction( WORD wParams ); /* executes a function saving its result */
extern void hb_vmGenArray( WORD wElements ); /* generates a wElements Array and fills it from the stack values */
/* Operators (relational) */
extern void hb_vmEqual( BOOL bExact ); /* checks if the two latest values on the stack are equal, removes both and leaves result */
extern void hb_vmNotEqual( void ); /* checks if the two latest values on the stack are not equal, removes both and leaves result */
extern void hb_vmGreater( void ); /* checks if the latest - 1 value is greater than the latest, removes both and leaves result */
extern void hb_vmGreaterEqual( void ); /* checks if the latest - 1 value is greater than or equal the latest, removes both and leaves result */
extern void hb_vmInc( void ); /* increment the latest numeric value on the stack */
extern void hb_vmInstring( void ); /* check whether string 1 is contained in string 2 */
extern void hb_vmLess( void ); /* checks if the latest - 1 value is less than the latest, removes both and leaves result */
extern void hb_vmLessEqual( void ); /* checks if the latest - 1 value is less than or equal the latest, removes both and leaves result */
extern void hb_vmLocalName( WORD wLocal, char * szLocalName ); /* locals and parameters index and name information for the debugger */
extern void hb_vmMessage( PHB_SYMB pSymMsg ); /* sends a message to an object */
extern void hb_vmMinus( void ); /* substracts the latest two values on the stack, removes them and leaves the result */
extern void hb_vmModuleName( char * szModuleName ); /* PRG and function name information for the debugger */
extern void hb_vmModulus( void ); /* calculates the modulus of latest two values on the stack, removes them and leaves the result */
extern void hb_vmMult( void ); /* multiplies the latest two values on the stack, removes them and leaves the result */
extern void hb_vmNegate( void ); /* negates (-) the latest value on the stack */
extern void hb_vmNot( void ); /* changes the latest logical value on the stack */
extern void hb_vmNotEqual( void ); /* checks if the two latest values on the stack are not equal, removes both and leaves result */
extern void hb_vmOperatorCall( PHB_ITEM, PHB_ITEM, char *); /* call an overloaded operator */
extern void hb_vmInstring( void ); /* check whether string 1 is contained in string 2 */
/* Operators (logical) */
extern void hb_vmAnd( void ); /* performs the logical AND on the latest two values, removes them and leaves result on the stack */
extern void hb_vmOr( void ); /* performs the logical OR on the latest two values, removes them and leaves result on the stack */
extern void hb_vmPlus( void ); /* sums the latest two values on the stack, removes them and leaves the result */
extern long hb_vmPopDate( void ); /* pops the stack latest value and returns its date value as a LONG */
extern void hb_vmPopDefStat( WORD wStatic ); /* pops the stack latest value onto a static as default init */
extern double hb_vmPopDouble( WORD * ); /* pops the stack latest value and returns its double numeric format value */
extern void hb_vmPopLocal( SHORT wLocal ); /* pops the stack latest value onto a local */
extern BOOL hb_vmPopLogical( void ); /* pops the stack latest value and returns its logical value */
extern void hb_vmPopMemvar( PHB_SYMB ); /* pops a value of memvar variable */
extern double hb_vmPopNumber( void ); /* pops the stack latest value and returns its numeric value */
extern void hb_vmPopParameter( PHB_SYMB, BYTE ); /* creates a PRIVATE variable and sets it with parameter's value */
extern void hb_vmPopStatic( WORD wStatic ); /* pops the stack latest value onto a static */
extern void hb_vmPower( void ); /* power the latest two values on the stack, removes them and leaves the result */
extern void hb_vmPush( PHB_ITEM pItem ); /* pushes a generic item onto the stack */
extern void hb_vmPushBlock( BYTE * pCode, PHB_SYMB pSymbols ); /* creates a codeblock */
extern void hb_vmPushDate( LONG lDate ); /* pushes a long date onto the stack */
extern void hb_vmPushDouble( double lNumber, WORD wDec ); /* pushes a double number onto the stack */
extern void hb_vmPushLocal( SHORT iLocal ); /* pushes the containts of a local onto the stack */
extern void hb_vmPushLocalByRef( SHORT iLocal ); /* pushes a local by refrence onto the stack */
extern void hb_vmPushLogical( BOOL bValue ); /* pushes a logical value onto the stack */
extern void hb_vmPushLong( long lNumber ); /* pushes a long number onto the stack */
extern void hb_vmPushMemvar( PHB_SYMB ); /* pushes a value of memvar variable */
extern void hb_vmPushMemvarByRef( PHB_SYMB ); /* pushes a reference to a memvar variable */
extern void hb_vmPushNil( void ); /* in this case it places nil at self */
extern void hb_vmPushNumber( double dNumber, WORD wDec ); /* pushes a number on to the stack and decides if it is integer, long or double */
extern void hb_vmPushStatic( WORD wStatic ); /* pushes the containts of a static onto the stack */
extern void hb_vmPushStaticByRef( WORD iLocal ); /* pushes a static by refrence onto the stack */
extern void hb_vmPushString( char * szText, ULONG length ); /* pushes a string on to the stack */
extern void hb_vmPushSymbol( PHB_SYMB pSym ); /* pushes a function pointer onto the stack */
extern void hb_vmPushInteger( int iNumber ); /* pushes a integer number onto the stack */
extern void hb_vmRetValue( void ); /* pops the latest stack value into stack.Return */
extern void hb_vmNot( void ); /* changes the latest logical value on the stack */
/* Array */
extern void hb_vmArrayAt( void ); /* pushes an array element to the stack, removing the array and the index from the stack */
extern void hb_vmArrayPut( void ); /* sets an array value and pushes the value on to the stack */
extern void hb_vmDimArray( WORD wDimensions ); /* generates a wDimensions Array and initialize those dimensions from the stack values */
extern void hb_vmGenArray( WORD wElements ); /* generates a wElements Array and fills it from the stack values */
/* Object */
extern void hb_vmMessage( PHB_SYMB pSymMsg ); /* sends a message to an object */
extern void hb_vmOperatorCall( PHB_ITEM, PHB_ITEM, char *); /* call an overloaded operator */
/* Execution */
extern void hb_vmFrame( BYTE bLocals, BYTE bParams ); /* increases the stack pointer for the amount of locals and params suplied */
extern void hb_vmLocalName( WORD wLocal, char * szLocalName ); /* locals and parameters index and name information for the debugger */
extern void hb_vmModuleName( char * szModuleName ); /* PRG and function name information for the debugger */
extern void hb_vmSFrame( PHB_SYMB pSym ); /* sets the statics frame for a function */
extern void hb_vmStatics( PHB_SYMB pSym ); /* increases the the global statics array to hold a PRG statics */
extern void hb_vmRetValue( void ); /* pops the latest stack value into stack.Return */
extern void hb_vmEndBlock( void ); /* copies the last codeblock pushed value into the return value */
/* Misc */
extern void hb_vmDo( WORD WParams ); /* invoke the virtual machine */
extern HARBOUR hb_vmDoBlock( void ); /* executes a codeblock */
extern void hb_vmFunction( WORD wParams ); /* executes a function saving its result */
extern void hb_vmDuplicate( void ); /* duplicates the latest value on the stack */
extern void hb_vmDuplTwo( void ); /* duplicates the latest two value on the stack */
extern void hb_vmForTest( void ); /* test for end condition of for */
/* Push */
extern void hb_vmPush( PHB_ITEM pItem ); /* pushes a generic item onto the stack */
extern void hb_vmPushNil( void ); /* in this case it places nil at self */
extern void hb_vmPushNumber( double dNumber, WORD wDec ); /* pushes a number on to the stack and decides if it is integer, long or double */
extern void hb_vmPushInteger( int iNumber ); /* pushes a integer number onto the stack */
extern void hb_vmPushLong( long lNumber ); /* pushes a long number onto the stack */
extern void hb_vmPushDouble( double lNumber, WORD wDec ); /* pushes a double number onto the stack */
extern void hb_vmPushLogical( BOOL bValue ); /* pushes a logical value onto the stack */
extern void hb_vmPushString( char * szText, ULONG length ); /* pushes a string on to the stack */
extern void hb_vmPushDate( LONG lDate ); /* pushes a long date onto the stack */
extern void hb_vmPushBlock( BYTE * pCode, PHB_SYMB pSymbols ); /* creates a codeblock */
extern void hb_vmPushSymbol( PHB_SYMB pSym ); /* pushes a function pointer onto the stack */
extern void hb_vmPushMemvar( PHB_SYMB ); /* pushes a value of memvar variable */
extern void hb_vmPushMemvarByRef( PHB_SYMB ); /* pushes a reference to a memvar variable */
extern void hb_vmPushLocal( SHORT iLocal ); /* pushes the containts of a local onto the stack */
extern void hb_vmPushLocalByRef( SHORT iLocal ); /* pushes a local by refrence onto the stack */
extern void hb_vmPushStatic( WORD wStatic ); /* pushes the containts of a static onto the stack */
extern void hb_vmPushStaticByRef( WORD iLocal ); /* pushes a static by refrence onto the stack */
/* Pop */
extern long hb_vmPopDate( void ); /* pops the stack latest value and returns its date value as a LONG */
extern double hb_vmPopNumber( void ); /* pops the stack latest value and returns its numeric value */
extern double hb_vmPopDouble( WORD * ); /* pops the stack latest value and returns its double numeric format value */
extern BOOL hb_vmPopLogical( void ); /* pops the stack latest value and returns its logical value */
extern void hb_vmPopParameter( PHB_SYMB, BYTE ); /* creates a PRIVATE variable and sets it with parameter's value */
extern void hb_vmPopLocal( SHORT wLocal ); /* pops the stack latest value onto a local */
extern void hb_vmPopMemvar( PHB_SYMB ); /* pops a value of memvar variable */
extern void hb_vmPopStatic( WORD wStatic ); /* pops the stack latest value onto a static */
extern void hb_vmPopDefStat( WORD wStatic ); /* pops the stack latest value onto a static as default init */
/* stack management functions */
extern void hb_stackDec( void ); /* pops an item from the stack without clearing it's contents */
@@ -119,7 +139,7 @@ extern void hb_stackInit( void ); /* initializes the stack */
extern void hb_stackDispLocal( void ); /* show the types of the items on the stack for debugging purposes */
extern void hb_stackDispCall( void ); /* show the procedure names of the call stack for internal errors use */
#define STACK_INITHB_ITEMS 100
#define STACK_EXPANDHB_ITEMS 20
#define STACK_INITHB_ITEMS 100
#define STACK_EXPANDHB_ITEMS 20
#endif /* HB_CTOHARB_H_ */

Binary file not shown.

View File

@@ -29,82 +29,82 @@
typedef enum
{
HB_P_AND, /* peforms the logical AND of two latest stack values, removes them and places result */
HB_P_ARRAYAT, /* places on the virtual machine stack an array element */
HB_P_ARRAYPUT, /* sets array element, the array and the index are both on the stack */
HB_P_EQUAL, /* check if the latest two values on the stack are equal, removing them and leaving there the result */
HB_P_ENDBLOCK, /* end of a codeblock definition */
HB_P_ENDPROC, /* instructs the virtual machine to end execution */
HB_P_EXACTLYEQUAL, /* check if the latest two values on the stack are exactly equal, removing them and leaving there the result */
HB_P_FALSE, /* pushes false on the virtual machine stack */
HB_P_FORTEST, /* For STEP. If step > 1 less. If step < 1 greater. */
HB_P_FUNCTION, /* instructs the virtual machine to execute a function saving its result */
HB_P_FRAME, /* instructs the virtual machine about how many parameters and locals a function uses */
HB_P_FUNCPTR, /* returns a function address pointer */
HB_P_GENARRAY, /* instructs the virtual machine to build an array and load elemnst from the stack */
HB_P_GREATER, /* checks if the second latest value on the stack is greater that the lastest one */
HB_P_GREATEREQUAL, /* checks if the second latest value on the stack is greater equal that the latest one, leaves the result only */
HB_P_DEC, /* decrements the latest value on the virtual machine stack */
HB_P_DIMARRAY, /* instructs the virtual machine to build an array with some specific dimensions */
HB_P_DIVIDE, /* divides the latest two values on the stack, removing them and leaving there the result */
HB_P_DO, /* instructs the virtual machine to execute a function discarding its result */
HB_P_DUPLICATE, /* places a copy of the latest virtual machine stack value on to the stack */
HB_P_DUPLTWO, /* places a copy of the latest two virtual machine stack value on to the stack */
HB_P_INC, /* increments the latest value on the virtual machine stack */
HB_P_INSTRING, /* checks if the second latest value on the stack is a substring of the latest one */
HB_P_JUMP, /* jumps to a relative offset */
HB_P_JUMPFALSE, /* checks a logic expression of the stack and jumps to a relative offset */
HB_P_JUMPTRUE, /* checks a logic expression of the stack and jumps to a relative offset */
HB_P_LESSEQUAL, /* checks if the second latest value on the stack is less equal that the latest one, leaves the result only */
HB_P_LESS, /* checks if the second latest value on the stack is less that the lastest one */
HB_P_LINE, /* currently compiled source code line number */
HB_P_LOCALNAME, /* sets the name of local variable */
HB_P_MESSAGE, /* sends a message to an object */
HB_P_MINUS, /* subs the latest two values on the stack, removing them and leaving there the result */
HB_P_MODULUS, /* calculates the modulus of the two values on the stack, removing them and leaving there the result */
HB_P_MODULENAME, /* sets the name of debugged module */
HB_P_MULT, /* multiplies the latest two values on the stack, removing them and leaving there the result */
HB_P_NEGATE, /* numerically negates the latest value on the stack */
HB_P_NOOP, /* no operation */
HB_P_NOT, /* logically negates the latest value on the stack */
HB_P_NOTEQUAL, /* checks if the latest two stack values are equal, leaves just the result */
HB_P_OR, /* peforms the logical OR of two latest stack values, removes them and places result */
HB_P_PARAMETER, /* creates PRIVATE variables and assigns values to functions paramaters */
HB_P_PLUS, /* adds the latest two values on the stack, removing them and leaving there the result */
HB_P_POP, /* removes the latest value from the stack */
HB_P_POPALIAS, /* pops the item from the eval stack and selects the current workarea */
HB_P_POPALIASEDFIELD,/* pops aliased field */
HB_P_POPFIELD, /* pops unaliased field */
HB_P_POPLOCAL, /* pops the contains of the virtual machine stack onto a local variable */
HB_P_POPMEMVAR, /* pops the contains of a memvar variable to the virtual machine stack */
HB_P_POPSTATIC, /* pops the contains of the virtual machine stack onto a static variable */
HB_P_POWER, /* calculates the power of the two values on the stack, removing them and leaving there the result */
HB_P_PUSHALIAS, /* saves the current workarea number on the eval stack */
HB_P_AND, /* peforms the logical AND of two latest stack values, removes them and places result */
HB_P_ARRAYAT, /* places on the virtual machine stack an array element */
HB_P_ARRAYPUT, /* sets array element, the array and the index are both on the stack */
HB_P_EQUAL, /* check if the latest two values on the stack are equal, removing them and leaving there the result */
HB_P_ENDBLOCK, /* end of a codeblock definition */
HB_P_ENDPROC, /* instructs the virtual machine to end execution */
HB_P_EXACTLYEQUAL, /* check if the latest two values on the stack are exactly equal, removing them and leaving there the result */
HB_P_FALSE, /* pushes false on the virtual machine stack */
HB_P_FORTEST, /* For STEP. If step > 1 less. If step < 1 greater. */
HB_P_FUNCTION, /* instructs the virtual machine to execute a function saving its result */
HB_P_FRAME, /* instructs the virtual machine about how many parameters and locals a function uses */
HB_P_FUNCPTR, /* returns a function address pointer */
HB_P_GENARRAY, /* instructs the virtual machine to build an array and load elemnst from the stack */
HB_P_GREATER, /* checks if the second latest value on the stack is greater that the lastest one */
HB_P_GREATEREQUAL, /* checks if the second latest value on the stack is greater equal that the latest one, leaves the result only */
HB_P_DEC, /* decrements the latest value on the virtual machine stack */
HB_P_DIMARRAY, /* instructs the virtual machine to build an array with some specific dimensions */
HB_P_DIVIDE, /* divides the latest two values on the stack, removing them and leaving there the result */
HB_P_DO, /* instructs the virtual machine to execute a function discarding its result */
HB_P_DUPLICATE, /* places a copy of the latest virtual machine stack value on to the stack */
HB_P_DUPLTWO, /* places a copy of the latest two virtual machine stack value on to the stack */
HB_P_INC, /* increments the latest value on the virtual machine stack */
HB_P_INSTRING, /* checks if the second latest value on the stack is a substring of the latest one */
HB_P_JUMP, /* jumps to a relative offset */
HB_P_JUMPFALSE, /* checks a logic expression of the stack and jumps to a relative offset */
HB_P_JUMPTRUE, /* checks a logic expression of the stack and jumps to a relative offset */
HB_P_LESSEQUAL, /* checks if the second latest value on the stack is less equal that the latest one, leaves the result only */
HB_P_LESS, /* checks if the second latest value on the stack is less that the lastest one */
HB_P_LINE, /* currently compiled source code line number */
HB_P_LOCALNAME, /* sets the name of local variable */
HB_P_MESSAGE, /* sends a message to an object */
HB_P_MINUS, /* subs the latest two values on the stack, removing them and leaving there the result */
HB_P_MODULUS, /* calculates the modulus of the two values on the stack, removing them and leaving there the result */
HB_P_MODULENAME, /* sets the name of debugged module */
HB_P_MULT, /* multiplies the latest two values on the stack, removing them and leaving there the result */
HB_P_NEGATE, /* numerically negates the latest value on the stack */
HB_P_NOOP, /* no operation */
HB_P_NOT, /* logically negates the latest value on the stack */
HB_P_NOTEQUAL, /* checks if the latest two stack values are equal, leaves just the result */
HB_P_OR, /* peforms the logical OR of two latest stack values, removes them and places result */
HB_P_PARAMETER, /* creates PRIVATE variables and assigns values to functions paramaters */
HB_P_PLUS, /* adds the latest two values on the stack, removing them and leaving there the result */
HB_P_POP, /* removes the latest value from the stack */
HB_P_POPALIAS, /* pops the item from the eval stack and selects the current workarea */
HB_P_POPALIASEDFIELD, /* pops aliased field */
HB_P_POPFIELD, /* pops unaliased field */
HB_P_POPLOCAL, /* pops the contains of the virtual machine stack onto a local variable */
HB_P_POPMEMVAR, /* pops the contains of a memvar variable to the virtual machine stack */
HB_P_POPSTATIC, /* pops the contains of the virtual machine stack onto a static variable */
HB_P_POWER, /* calculates the power of the two values on the stack, removing them and leaving there the result */
HB_P_PUSHALIAS, /* saves the current workarea number on the eval stack */
HB_P_PUSHALIASEDFIELD, /* pushes aliased field */
HB_P_PUSHBLOCK, /* start of a codeblock definition */
HB_P_PUSHFIELD, /* pushes unaliased field */
HB_P_PUSHINT, /* places an integer number on the virtual machine stack */
HB_P_PUSHLOCAL, /* pushes the contains of a local variable to the virtual machine stack */
HB_P_PUSHLOCALREF, /* pushes a local variable by reference to the virtual machine stack */
HB_P_PUSHLONG, /* places an integer number on the virtual machine stack */
HB_P_PUSHMEMVAR, /* pushes the contains of a memvar variable to the virtual machine stack */
HB_P_PUSHMEMVARREF, /* pushes the a memvar variable by reference to the virtual machine stack */
HB_P_PUSHNIL, /* places a nil on the virtual machine stack */
HB_P_PUSHDOUBLE, /* places a double number on the virtual machine stack */
HB_P_PUSHSELF, /* pushes Self for the current processed method */
HB_P_PUSHSTATIC, /* pushes the contains of a static variable to the virtual machine stack */
HB_P_PUSHSTATICREF, /* pushes the a static variable by reference to the virtual machine stack */
HB_P_PUSHSTR, /* places a string on the virtual machine stack */
HB_P_PUSHSYM, /* places a symbol on the virtual machine stack */
HB_P_RETVALUE, /* instructs the virtual machine to return the latest stack value */
HB_P_SEQBEGIN, /* BEGIN SEQUENCE */
HB_P_SEQEND, /* END SEQUENCE */
HB_P_SEQRECOVER, /* RECOVER statement */
HB_P_SFRAME, /* sets the statics frame for a function */
HB_P_STATICS, /* defines the number of statics variables for a PRG */
HB_P_SWAPALIAS, /* restores the current workarea number from the eval stack */
HB_P_TRUE, /* pushes true on the virtual machine stack */
HB_P_ZERO /* places a zero on the virtual machine stack */
HB_P_PUSHBLOCK, /* start of a codeblock definition */
HB_P_PUSHFIELD, /* pushes unaliased field */
HB_P_PUSHINT, /* places an integer number on the virtual machine stack */
HB_P_PUSHLOCAL, /* pushes the contains of a local variable to the virtual machine stack */
HB_P_PUSHLOCALREF, /* pushes a local variable by reference to the virtual machine stack */
HB_P_PUSHLONG, /* places an integer number on the virtual machine stack */
HB_P_PUSHMEMVAR, /* pushes the contains of a memvar variable to the virtual machine stack */
HB_P_PUSHMEMVARREF, /* pushes the a memvar variable by reference to the virtual machine stack */
HB_P_PUSHNIL, /* places a nil on the virtual machine stack */
HB_P_PUSHDOUBLE, /* places a double number on the virtual machine stack */
HB_P_PUSHSELF, /* pushes Self for the current processed method */
HB_P_PUSHSTATIC, /* pushes the contains of a static variable to the virtual machine stack */
HB_P_PUSHSTATICREF, /* pushes the a static variable by reference to the virtual machine stack */
HB_P_PUSHSTR, /* places a string on the virtual machine stack */
HB_P_PUSHSYM, /* places a symbol on the virtual machine stack */
HB_P_RETVALUE, /* instructs the virtual machine to return the latest stack value */
HB_P_SEQBEGIN, /* BEGIN SEQUENCE */
HB_P_SEQEND, /* END SEQUENCE */
HB_P_SEQRECOVER, /* RECOVER statement */
HB_P_SFRAME, /* sets the statics frame for a function */
HB_P_STATICS, /* defines the number of statics variables for a PRG */
HB_P_SWAPALIAS, /* restores the current workarea number from the eval stack */
HB_P_TRUE, /* pushes true on the virtual machine stack */
HB_P_ZERO /* places a zero on the virtual machine stack */
} HB_PCODE;
#endif /* HB_PCODE_H_ */

File diff suppressed because it is too large Load Diff

View File

@@ -265,11 +265,11 @@ HARBOUR HB_DIRECTORY( void )
#if defined(__WATCOMC__)
/* opendir in Watcom doesn't like the path delimiter at the end of a string */
dirname[ iDirnameLen ] = '.';
dirname[ iDirnameLen+1 ] = '\x0';
dirname[ iDirnameLen+1 ] = '\0';
#endif
dir = opendir( dirname );
#if defined(__WATCOMC__)
dirname[ iDirnameLen ] = '\x0';
dirname[ iDirnameLen ] = '\0';
#endif
if( NULL == dir )
{

View File

@@ -64,6 +64,7 @@
* changed to allow unlimited color pairs.
*/
#include <ctype.h>
#include "set.h"
#include "gtapi.h"
@@ -332,7 +333,7 @@ int hb_gtGetColorStr( char * fpColorString )
do
{
if( ( s_Color[ i ] & ( j ? 0x8000 : 0x800 ) ) != 0 )
if( ( s_Color[ i ] & ( j ? 0x8000 : 0x0800 ) ) != 0 )
sColors[ k++ ] = 'U';
else
{
@@ -407,8 +408,7 @@ int hb_gtSetColorStr( char * fpColorString )
do
{
c = *fpColorString++;
if( c > 'A' )
c &= 0x5f; /* convert to upper case */
c = toupper( c );
while( c <= '9' && c >= '0' && i < 6 )
{
@@ -429,7 +429,7 @@ int hb_gtSetColorStr( char * fpColorString )
if( buff[ i ] != '\0')
nColor += ( ( buff[ i ] - '0' ) * y );
}
nColor &= 0xf;
nColor &= 0x0F;
i = 0;
++nCount;
}
@@ -471,7 +471,7 @@ int hb_gtSetColorStr( char * fpColorString )
if( bHasU )
{
bHasU = FALSE;
nFore |= 0x800; /* foreground underline bit */
nFore |= 0x0800; /* foreground underline bit */
}
else if( bHasX )
{
@@ -502,24 +502,24 @@ int hb_gtSetColorStr( char * fpColorString )
nFore &= 0x88F8;
if( bHasU ) /* background if slash, else foreground */
nColor |= 0x800;
nColor |= 0x0800;
if( bHasI )
{
if( bSlash )
{
nColor &= 0x88F;
nColor |= 0x007;
nColor &= 0x088F;
nColor |= 0x0007;
nFore &= 0x88F8;
}
else
{
nColor &= 0x8F8;
nColor |= 0x070;
nColor &= 0x08F8;
nColor |= 0x0070;
nFore &= 0x888F;
}
}
if( ( nFore & 0x8800 ) != 0 && ( ( nFore | nColor ) & 0x77 ) == 0)
if( ( nFore & 0x8800 ) != 0 && ( ( nFore | nColor ) & 0x0077 ) == 0)
nFore |= 1;
if( bSlash )
@@ -699,8 +699,8 @@ int hb_gtWrite( char * fpStr, ULONG length )
{
int iRow, iCol, iMaxCol, iMaxRow;
ULONG size = length;
char attr = s_Color[ s_uiColorIndex ] & 0xff,
*fpPointer = fpStr;
char attr = s_Color[ s_uiColorIndex ] & 0xFF;
char *fpPointer = fpStr;
/* TODO: this is doing more work than needed */

View File

@@ -819,7 +819,7 @@ int hb_itemStrCmp( PHB_ITEM pFirst, PHB_ITEM pSecond, BOOL bForceExact )
{
/* Difference found */
if( *szFirst != *szSecond )
iRet = ( *szFirst < *szSecond ) ? -1 : 1;
iRet = ( ( BYTE ) *szFirst < ( BYTE ) *szSecond ) ? -1 : 1;
else /* TODO : #define some constants */
{
szFirst++;

View File

@@ -735,7 +735,7 @@ static HB_DYNS_PTR hb_memvarFindSymbol( HB_ITEM_PTR pName )
char * szName = ( char * ) hb_xgrab( ulLen + 1 );
char * szArg = pName->item.asString.value;
szName[ ulLen ] = '\x0';
szName[ ulLen ] = '\0';
do
{
--ulLen;

View File

@@ -899,7 +899,7 @@ void hb_vmDec( void )
/* This function creates an array item using 'wDimension' as an index
* to retrieve the number of elements from the stack
*/
*/
static void hb_vmArrayNew( HB_ITEM_PTR pArray, WORD wDimension )
{
ULONG ulElements;
@@ -921,7 +921,7 @@ static void hb_vmArrayNew( HB_ITEM_PTR pArray, WORD wDimension )
break;
default:
/* NOTE: Clipper creates empty array if non-numeric value is
/* NOTE: Clipper creates empty array if non-numeric value is
* specified as dimension and stops further processing.
* There is no runtime error generated.
*/
@@ -934,7 +934,7 @@ static void hb_vmArrayNew( HB_ITEM_PTR pArray, WORD wDimension )
if( --wDimension )
{
/* call self recursively to create next dimensions
/* call self recursively to create next dimensions
*/
while( ulElements )
hb_vmArrayNew( hb_arrayGetItemPointer( pArray, ulElements-- ), wDimension );
@@ -2700,7 +2700,7 @@ static void hb_vmSwapAlias( void )
case IT_SYMBOL:
/* Alias was specified using alias identifier, for example: al->field
*/
hb_rddSelectWorkAreaSymbol( pItem->item.asSymbol.value );
hb_rddSelectWorkAreaSymbol( pWorkArea->item.asSymbol.value );
break;
case IT_STRING:

View File

@@ -578,9 +578,14 @@ STATIC FUNCTION Main_HVM()
TEST_CALL( '(.T.)->(Eof())' , {|| (.T.)->(Eof()) } , .T. )
TEST_CALL( '(.F.)->(Eof())' , {|| (.F.)->(Eof()) } , .T. )
TEST_CALL( '(NIL)->(Eof())' , {|| (NIL)->(Eof()) } , .T. )
#ifndef __HARBOUR__
TEST_LINE( NOTHERE->NOFIELD , "E BASE 1002 Alias does not exist NOTHERE F:R" )
#endif
TEST_LINE( NOTHERE->("NOFIELD") , "E BASE 1002 Alias does not exist NOTHERE F:R" )
TEST_LINE( NOTHERE->(NIL) , "E BASE 1002 Alias does not exist NOTHERE F:R" )
TEST_LINE( NOTHERE->(1) , "E BASE 1002 Alias does not exist NOTHERE F:R" )
TEST_LINE( NOTHERE->(1.5) , "E BASE 1002 Alias does not exist NOTHERE F:R" )
TEST_LINE( NOTHERE->({}) , "E BASE 1002 Alias does not exist NOTHERE F:R" )
TEST_LINE( NOTHERE->({|| NIL }) , "E BASE 1002 Alias does not exist NOTHERE F:R" )
TEST_LINE( NOTHERE->(.T.) , "E BASE 1002 Alias does not exist NOTHERE F:R" )
TEST_LINE( 200->NOFIELD , "E BASE 1003 Variable does not exist NOFIELD F:R" )
TEST_LINE( 200->("NOFIELD") , "NOFIELD" )
TEST_LINE( 200->(NIL) , NIL )
@@ -2138,6 +2143,7 @@ STATIC FUNCTION XToStr( xValue )
STATIC FUNCTION ErrorMessage( oError )
LOCAL cMessage := ""
LOCAL tmp
IF ValType( oError:severity ) == "N"
DO CASE
@@ -2163,6 +2169,20 @@ STATIC FUNCTION ErrorMessage( oError )
cMessage += oError:filename + " "
ENDIF
#ifdef _COMMENT_
IF ValType( oError:Args ) == "A"
cMessage += "A:"
FOR tmp := 1 TO Len( oError:Args )
cMessage += ValType( oError:Args[ tmp ] )
// cMessage += XToStr( oError:Args[ tmp ] )
// IF tmp < Len( oError:Args )
// cMessage += ";"
// ENDIF
NEXT
cMessage += " "
ENDIF
#endif
IF oError:canDefault .OR. ;
oError:canRetry .OR. ;
oError:canSubstitute