2006-03-28 13:00 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)

* harbour/include/hbcomp.h
    + added hb_compPCodeSize() and hb_compStrongType() declarations

  * harbour/include/hbpp.h
    * formatting

  * harbour/source/compiler/Makefile
  + harbour/source/compiler/hbstrong.c
  * harbour/source/compiler/hbpcode.c
    * moved strong typing code to separate file

  * harbour/source/compiler/hbpcode.c
    + added hb_compPCodeSize() function
    + added support for automatic size checking of variable size PCODEs
      in hb_compPCodeEval()

  * harbour/source/compiler/gencc.c
    * added escaping of '?' character in generated strings to
      avoid possible conflicts with trigraph sequences which
      are part of ANSI C standard
    * force .0 at the end of double numbers to avoid possible range
      conflicts in generated .c files
    * removed unnecessary HB_SYMBOL_UNUSED()

  * harbour/source/compiler/harbour.l
  * harbour/source/compiler/harbour.y
  * harbour/source/macro/macro.l
  * harbour/source/macro/macro.y
    * added #define realloc hb_xrealloc

  * harbour/source/compiler/hbdead.c
  * harbour/source/compiler/hbfix.c
  * harbour/source/compiler/hblbl.c
  * harbour/source/compiler/hbstripl.c
    * use hb_compPCodeSize() function
    * removed not longer necessary functions for checking the real size
      of variable size PCODEs

  * harbour/source/vm/hvm.c
    * fixed RT error number in hb_vmAddInt() for negative values to be
      Clipper compatible
This commit is contained in:
Przemyslaw Czerpak
2006-03-28 11:00:49 +00:00
parent 167ef1f0c5
commit fbd8b70d4b
16 changed files with 3261 additions and 3254 deletions

View File

@@ -8,6 +8,49 @@
2002-12-01 13:30 UTC+0100 Foo Bar <foo.bar@foobar.org>
*/
* source/pp/ppcore.c
* harbour/makefile.bc
* fixed calculation of length of stringify expressions
2006-03-28 13:46 UTC+0200 Jacek Kubica (kubica/at/wssk.wroc.pl)
* harbour/makefile.bc
* harbour/makefile.nt
* harbour/makefile.vc
* harbour/makefile64.nt
+ added references for harbour/source/compiler/hbstrong.c
2006-03-28 13:00 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbcomp.h
+ added hb_compPCodeSize() and hb_compStrongType() declarations
* harbour/include/hbpp.h
* formatting
* harbour/source/compiler/Makefile
+ harbour/source/compiler/hbstrong.c
* harbour/source/compiler/hbpcode.c
* moved strong typing code to separate file
* harbour/source/compiler/hbpcode.c
+ added hb_compPCodeSize() function
+ added support for automatic size checking of variable size PCODEs
in hb_compPCodeEval()
* harbour/source/compiler/gencc.c
* added escaping of '?' character in generated strings to
avoid possible conflicts with trigraph sequences which
are part of ANSI C standard
* force .0 at the end of double numbers to avoid possible range
conflicts in generated .c files
* removed unnecessary HB_SYMBOL_UNUSED()
* harbour/source/compiler/harbour.l
* harbour/source/compiler/harbour.y
* harbour/source/macro/macro.l
* harbour/source/macro/macro.y
* added #define realloc hb_xrealloc
* harbour/source/compiler/hbdead.c
* harbour/source/compiler/hbfix.c
* harbour/source/compiler/hblbl.c

View File

@@ -271,6 +271,7 @@ typedef void * HB_VOID_PTR;
typedef HB_PCODE_FUNC( HB_PCODE_FUNC_, HB_VOID_PTR );
typedef HB_PCODE_FUNC_ * HB_PCODE_FUNC_PTR;
extern LONG hb_compPCodeSize( PFUNCTION, ULONG );
extern void hb_compPCodeEval( PFUNCTION, HB_PCODE_FUNC_PTR *, void * );
extern void hb_compPCodeTrace( PFUNCTION, HB_PCODE_FUNC_PTR *, void * );
@@ -419,6 +420,11 @@ extern void hb_compGenPCode3( BYTE, BYTE, BYTE, BOOL ); /* generates 3 bytes of
extern void hb_compGenPCode4( BYTE, BYTE, BYTE, BYTE, BOOL ); /* generates 4 bytes of pcode + flag for optional StrongType() */
extern void hb_compGenPCodeN( BYTE * pBuffer, ULONG ulSize, BOOL ); /* copy bytes to a pcode buffer + flag for optional StrongType() */
#if defined(HB_COMP_STRONG_TYPES)
extern void hb_compStrongType( int iSize );
#endif
extern ULONG hb_compSequenceBegin( void );
extern ULONG hb_compSequenceEnd( void );
extern void hb_compSequenceFinish( ULONG, int );
@@ -553,9 +559,6 @@ extern PHB_FNAME hb_comp_pPpoPath;
extern BOOL hb_comp_bCredits;
extern BOOL hb_comp_bBuildInfo;
/* Andi Jahja */
extern BOOL hb_comp_bFileVersionInfo;
extern BOOL hb_comp_bLogo;
extern BOOL hb_comp_bSyntaxCheckOnly;
extern int hb_comp_iLanguage;

View File

@@ -85,7 +85,7 @@ typedef struct _COMMANDS
#define HB_PP_STR_SIZE 12288
#define HB_PP_BUFF_SIZE 4096
#define HB_SKIPTABSPACES( sptr ) while( *sptr == ' ' || *sptr == '\t' ) ( sptr )++
#define HB_SKIPTABSPACES( sptr ) while( *( sptr ) == ' ' || *( sptr ) == '\t' ) ( sptr )++
/* PPCORE.C exported functions and variables */

View File

@@ -52,6 +52,7 @@ C_SOURCES=\
hbdead.c \
hblbl.c \
hbstripl.c \
hbstrong.c \
hbusage.c \
hbident.c \
expropta.c \

View File

@@ -62,8 +62,11 @@ static void hb_gencc_string_put( FILE * yyc, BYTE * pText, USHORT usLen )
* into a string containing nonprintable characters.
*
* TODO: add switch to use hexadecimal format "%#04x"
*
* ? is escaped to avoid conflicts with trigraph sequences which
* are part of ANSI C standard
*/
if( uchr == '"' || uchr == '\\' )
if( uchr == '"' || uchr == '\\' || uchr == '?' )
fprintf( yyc, "\\%c", uchr );
else if( uchr < ( BYTE ) ' ' || uchr >= 127 )
fprintf( yyc, "\\%03o", uchr );
@@ -96,8 +99,6 @@ static int hb_gencc_checkNumAhead( LONG lValue, PFUNCTION pFunc, ULONG lPCodePos
static HB_GENC_FUNC( hb_p_and )
{
HB_SYMBOL_UNUSED( pFunc );
HB_GENC_LABEL();
fprintf( cargo->yyc, "\tif( hb_xvmAnd() ) break;\n" );
@@ -106,8 +107,6 @@ static HB_GENC_FUNC( hb_p_and )
static HB_GENC_FUNC( hb_p_arraypush )
{
HB_SYMBOL_UNUSED( pFunc );
HB_GENC_LABEL();
fprintf( cargo->yyc, "\tif( hb_xvmArrayPush() ) break;\n" );
@@ -116,8 +115,6 @@ static HB_GENC_FUNC( hb_p_arraypush )
static HB_GENC_FUNC( hb_p_arraypop )
{
HB_SYMBOL_UNUSED( pFunc );
HB_GENC_LABEL();
fprintf( cargo->yyc, "\tif( hb_xvmArrayPop() ) break;\n" );
@@ -126,8 +123,6 @@ static HB_GENC_FUNC( hb_p_arraypop )
static HB_GENC_FUNC( hb_p_dec )
{
HB_SYMBOL_UNUSED( pFunc );
HB_GENC_LABEL();
fprintf( cargo->yyc, "\tif( hb_xvmDec() ) break;\n" );
@@ -145,8 +140,6 @@ static HB_GENC_FUNC( hb_p_arraydim )
static HB_GENC_FUNC( hb_p_divide )
{
HB_SYMBOL_UNUSED( pFunc );
HB_GENC_LABEL();
fprintf( cargo->yyc, "\tif( hb_xvmDivide() ) break;\n" );
@@ -155,8 +148,6 @@ static HB_GENC_FUNC( hb_p_divide )
static HB_GENC_FUNC( hb_p_do )
{
HB_SYMBOL_UNUSED( pFunc );
HB_GENC_LABEL();
fprintf( cargo->yyc, "\tif( hb_xvmDo( %hu ) ) break;\n",
@@ -175,8 +166,6 @@ static HB_GENC_FUNC( hb_p_doshort )
static HB_GENC_FUNC( hb_p_duplicate )
{
HB_SYMBOL_UNUSED( pFunc );
HB_GENC_LABEL();
fprintf( cargo->yyc, "\thb_xvmDuplicate();\n" );
@@ -185,8 +174,6 @@ static HB_GENC_FUNC( hb_p_duplicate )
static HB_GENC_FUNC( hb_p_dupltwo )
{
HB_SYMBOL_UNUSED( pFunc );
HB_GENC_LABEL();
fprintf( cargo->yyc, "\thb_xvmDuplTwo();\n" );
@@ -195,8 +182,6 @@ static HB_GENC_FUNC( hb_p_dupltwo )
static HB_GENC_FUNC( hb_p_equal )
{
HB_SYMBOL_UNUSED( pFunc );
HB_GENC_LABEL();
fprintf( cargo->yyc, "\tif( hb_xvmEqual( FALSE ) ) break;\n" );
@@ -205,8 +190,6 @@ static HB_GENC_FUNC( hb_p_equal )
static HB_GENC_FUNC( hb_p_exactlyequal )
{
HB_SYMBOL_UNUSED( pFunc );
HB_GENC_LABEL();
fprintf( cargo->yyc, "\tif( hb_xvmEqual( TRUE ) ) break;\n" );
@@ -215,8 +198,6 @@ static HB_GENC_FUNC( hb_p_exactlyequal )
static HB_GENC_FUNC( hb_p_endblock )
{
HB_SYMBOL_UNUSED( pFunc );
HB_GENC_LABEL();
HB_GENC_ERROR( "HB_P_ENDBLOCK" );
@@ -240,8 +221,6 @@ static HB_GENC_FUNC( hb_p_endproc )
static HB_GENC_FUNC( hb_p_false )
{
HB_SYMBOL_UNUSED( pFunc );
HB_GENC_LABEL();
fprintf( cargo->yyc, "\thb_xvmPushLogical( FALSE );\n" );
@@ -250,8 +229,6 @@ static HB_GENC_FUNC( hb_p_false )
static HB_GENC_FUNC( hb_p_fortest )
{
HB_SYMBOL_UNUSED( pFunc );
HB_GENC_LABEL();
fprintf( cargo->yyc, "\tif( hb_xvmForTest() ) break;\n" );
@@ -269,8 +246,6 @@ static HB_GENC_FUNC( hb_p_frame )
static HB_GENC_FUNC( hb_p_funcptr )
{
HB_SYMBOL_UNUSED( pFunc );
HB_GENC_LABEL();
fprintf( cargo->yyc, "\thb_xvmFuncPtr();\n" );
@@ -306,8 +281,6 @@ static HB_GENC_FUNC( hb_p_arraygen )
static HB_GENC_FUNC( hb_p_greater )
{
HB_SYMBOL_UNUSED( pFunc );
HB_GENC_LABEL();
fprintf( cargo->yyc, "\tif( hb_xvmGreater() ) break;\n" );
@@ -316,8 +289,6 @@ static HB_GENC_FUNC( hb_p_greater )
static HB_GENC_FUNC( hb_p_greaterequal )
{
HB_SYMBOL_UNUSED( pFunc );
HB_GENC_LABEL();
fprintf( cargo->yyc, "\tif( hb_xvmGreaterEqual() ) break;\n" );
@@ -326,8 +297,6 @@ static HB_GENC_FUNC( hb_p_greaterequal )
static HB_GENC_FUNC( hb_p_inc )
{
HB_SYMBOL_UNUSED( pFunc );
HB_GENC_LABEL();
fprintf( cargo->yyc, "\tif( hb_xvmInc() ) break;\n" );
@@ -336,8 +305,6 @@ static HB_GENC_FUNC( hb_p_inc )
static HB_GENC_FUNC( hb_p_instring )
{
HB_SYMBOL_UNUSED( pFunc );
HB_GENC_LABEL();
fprintf( cargo->yyc, "\tif( hb_xvmInstring() ) break;\n" );
@@ -445,8 +412,6 @@ static HB_GENC_FUNC( hb_p_jumptruefar )
static HB_GENC_FUNC( hb_p_less )
{
HB_SYMBOL_UNUSED( pFunc );
HB_GENC_LABEL();
fprintf( cargo->yyc, "\tif( hb_xvmLess() ) break;\n" );
@@ -455,8 +420,6 @@ static HB_GENC_FUNC( hb_p_less )
static HB_GENC_FUNC( hb_p_lessequal )
{
HB_SYMBOL_UNUSED( pFunc );
HB_GENC_LABEL();
fprintf( cargo->yyc, "\tif( hb_xvmLessEqual() ) break;\n" );
@@ -514,8 +477,6 @@ static HB_GENC_FUNC( hb_p_macropush )
static HB_GENC_FUNC( hb_p_macropushref )
{
HB_SYMBOL_UNUSED( pFunc );
HB_GENC_LABEL();
fprintf( cargo->yyc, "\tif( hb_xvmMacroPushRef() ) break;\n" );
@@ -555,8 +516,6 @@ static HB_GENC_FUNC( hb_p_macropushlist )
static HB_GENC_FUNC( hb_p_macropushindex )
{
HB_SYMBOL_UNUSED( pFunc );
HB_GENC_LABEL();
fprintf( cargo->yyc, "\tif( hb_xvmMacroPushIndex( %d ) ) break;\n",
@@ -566,8 +525,6 @@ static HB_GENC_FUNC( hb_p_macropushindex )
static HB_GENC_FUNC( hb_p_macropushpare )
{
HB_SYMBOL_UNUSED( pFunc );
HB_GENC_LABEL();
fprintf( cargo->yyc, "\tif( hb_xvmMacroPushPare( %d ) ) break;\n",
@@ -577,8 +534,6 @@ static HB_GENC_FUNC( hb_p_macropushpare )
static HB_GENC_FUNC( hb_p_macropushaliased )
{
HB_SYMBOL_UNUSED( pFunc );
HB_GENC_LABEL();
fprintf( cargo->yyc, "\tif( hb_xvmMacroPushAliased( %d ) ) break;\n",
@@ -588,8 +543,6 @@ static HB_GENC_FUNC( hb_p_macropushaliased )
static HB_GENC_FUNC( hb_p_macrosymbol )
{
HB_SYMBOL_UNUSED( pFunc );
HB_GENC_LABEL();
fprintf( cargo->yyc, "\tif( hb_xvmMacroSymbol() ) break;\n" );
@@ -598,8 +551,6 @@ static HB_GENC_FUNC( hb_p_macrosymbol )
static HB_GENC_FUNC( hb_p_macrotext )
{
HB_SYMBOL_UNUSED( pFunc );
HB_GENC_LABEL();
fprintf( cargo->yyc, "\tif( hb_xvmMacroText() ) break;\n" );
@@ -617,8 +568,6 @@ static HB_GENC_FUNC( hb_p_message )
static HB_GENC_FUNC( hb_p_minus )
{
HB_SYMBOL_UNUSED( pFunc );
HB_GENC_LABEL();
fprintf( cargo->yyc, "\tif( hb_xvmMinus() ) break;\n" );
@@ -640,8 +589,6 @@ static HB_GENC_FUNC( hb_p_modulename )
static HB_GENC_FUNC( hb_p_modulus )
{
HB_SYMBOL_UNUSED( pFunc );
HB_GENC_LABEL();
fprintf( cargo->yyc, "\tif( hb_xvmModulus() ) break;\n" );
@@ -650,8 +597,6 @@ static HB_GENC_FUNC( hb_p_modulus )
static HB_GENC_FUNC( hb_p_mult )
{
HB_SYMBOL_UNUSED( pFunc );
HB_GENC_LABEL();
fprintf( cargo->yyc, "\tif( hb_xvmMult() ) break;\n" );
@@ -660,8 +605,6 @@ static HB_GENC_FUNC( hb_p_mult )
static HB_GENC_FUNC( hb_p_negate )
{
HB_SYMBOL_UNUSED( pFunc );
HB_GENC_LABEL();
fprintf( cargo->yyc, "\tif( hb_xvmNegate() ) break;\n" );
@@ -670,8 +613,6 @@ static HB_GENC_FUNC( hb_p_negate )
static HB_GENC_FUNC( hb_p_not )
{
HB_SYMBOL_UNUSED( pFunc );
HB_GENC_LABEL();
fprintf( cargo->yyc, "\tif( hb_xvmNot() ) break;\n" );
@@ -680,8 +621,6 @@ static HB_GENC_FUNC( hb_p_not )
static HB_GENC_FUNC( hb_p_notequal )
{
HB_SYMBOL_UNUSED( pFunc );
HB_GENC_LABEL();
fprintf( cargo->yyc, "\tif( hb_xvmNotEqual() ) break;\n" );
@@ -690,8 +629,6 @@ static HB_GENC_FUNC( hb_p_notequal )
static HB_GENC_FUNC( hb_p_or )
{
HB_SYMBOL_UNUSED( pFunc );
HB_GENC_LABEL();
fprintf( cargo->yyc, "\tif( hb_xvmOr() ) break;\n" );
@@ -710,8 +647,6 @@ static HB_GENC_FUNC( hb_p_parameter )
static HB_GENC_FUNC( hb_p_plus )
{
HB_SYMBOL_UNUSED( pFunc );
HB_GENC_LABEL();
fprintf( cargo->yyc, "\tif( hb_xvmPlus() ) break;\n" );
@@ -720,8 +655,6 @@ static HB_GENC_FUNC( hb_p_plus )
static HB_GENC_FUNC( hb_p_pop )
{
HB_SYMBOL_UNUSED( pFunc );
HB_GENC_LABEL();
fprintf( cargo->yyc, "\thb_stackPop();\n" );
@@ -730,8 +663,6 @@ static HB_GENC_FUNC( hb_p_pop )
static HB_GENC_FUNC( hb_p_popalias )
{
HB_SYMBOL_UNUSED( pFunc );
HB_GENC_LABEL();
fprintf( cargo->yyc, "\tif( hb_xvmPopAlias() ) break;\n" );
@@ -821,8 +752,6 @@ static HB_GENC_FUNC( hb_p_popvariable )
static HB_GENC_FUNC( hb_p_power )
{
HB_SYMBOL_UNUSED( pFunc );
HB_GENC_LABEL();
fprintf( cargo->yyc, "\tif( hb_xvmPower() ) break;\n" );
@@ -831,8 +760,6 @@ static HB_GENC_FUNC( hb_p_power )
static HB_GENC_FUNC( hb_p_pushalias )
{
HB_SYMBOL_UNUSED( pFunc );
HB_GENC_LABEL();
fprintf( cargo->yyc, "\tif( hb_xvmPushAlias() ) break;\n" );
@@ -919,7 +846,7 @@ static HB_GENC_FUNC( hb_p_pushdouble )
HB_GENC_LABEL();
fprintf( cargo->yyc, "\thb_xvmPushDouble( %.*f, %d, %d );\n",
pFunc->pCode[ lPCodePos + 1 + sizeof( double ) + sizeof( BYTE ) ],
pFunc->pCode[ lPCodePos + 1 + sizeof( double ) + sizeof( BYTE ) ] + 1,
HB_PCODE_MKDOUBLE( &pFunc->pCode[ lPCodePos + 1 ] ),
pFunc->pCode[ lPCodePos + 1 + sizeof( double ) ],
pFunc->pCode[ lPCodePos + 1 + sizeof( double ) + sizeof( BYTE ) ] );
@@ -1035,8 +962,6 @@ static HB_GENC_FUNC( hb_p_pushmemvarref )
static HB_GENC_FUNC( hb_p_pushnil )
{
HB_SYMBOL_UNUSED( pFunc );
HB_GENC_LABEL();
fprintf( cargo->yyc, "\thb_xvmPushNil();\n" );
@@ -1045,8 +970,6 @@ static HB_GENC_FUNC( hb_p_pushnil )
static HB_GENC_FUNC( hb_p_pushself )
{
HB_SYMBOL_UNUSED( pFunc );
HB_GENC_LABEL();
fprintf( cargo->yyc, "\thb_xvmPushSelf();\n" );
@@ -1126,8 +1049,6 @@ static HB_GENC_FUNC( hb_p_pushvariable )
static HB_GENC_FUNC( hb_p_retvalue )
{
HB_SYMBOL_UNUSED( pFunc );
HB_GENC_LABEL();
fprintf( cargo->yyc, "\thb_xvmRetValue();\n" );
@@ -1154,8 +1075,6 @@ static HB_GENC_FUNC( hb_p_sendshort )
static HB_GENC_FUNC( hb_p_seqbegin )
{
HB_SYMBOL_UNUSED( pFunc );
HB_GENC_LABEL();
fprintf( cargo->yyc, "\thb_xvmSeqBegin();\n\tdo {\n" );
@@ -1180,8 +1099,6 @@ static HB_GENC_FUNC( hb_p_seqend )
static HB_GENC_FUNC( hb_p_seqrecover )
{
HB_SYMBOL_UNUSED( pFunc );
HB_GENC_LABEL();
fprintf( cargo->yyc, "\thb_xvmSeqRecover( %s );\n",
@@ -1225,8 +1142,6 @@ static HB_GENC_FUNC( hb_p_staticname )
static HB_GENC_FUNC( hb_p_swapalias )
{
HB_SYMBOL_UNUSED( pFunc );
HB_GENC_LABEL();
fprintf( cargo->yyc, "\tif( hb_xvmSwapAlias() ) break;\n" );
@@ -1235,8 +1150,6 @@ static HB_GENC_FUNC( hb_p_swapalias )
static HB_GENC_FUNC( hb_p_true )
{
HB_SYMBOL_UNUSED( pFunc );
HB_GENC_LABEL();
fprintf( cargo->yyc, "\thb_xvmPushLogical( TRUE );\n" );
@@ -1257,18 +1170,18 @@ static HB_GENC_FUNC( hb_p_one )
static HB_GENC_FUNC( hb_p_zero )
{
HB_SYMBOL_UNUSED( pFunc );
int iSkip;
HB_GENC_LABEL();
fprintf( cargo->yyc, "\thb_xvmPushInteger( 0 );\n" );
return 1;
iSkip = hb_gencc_checkNumAhead( 0, pFunc, lPCodePos + 1, cargo );
if( iSkip == 0 )
fprintf( cargo->yyc, "\thb_xvmPushInteger( 0 );\n" );
return 1 + iSkip;
}
static HB_GENC_FUNC( hb_p_noop )
{
HB_SYMBOL_UNUSED( pFunc );
HB_GENC_LABEL();
return 1;
@@ -1284,8 +1197,6 @@ static HB_GENC_FUNC( hb_p_dummy )
static HB_GENC_FUNC( hb_p_macrolist )
{
HB_SYMBOL_UNUSED( pFunc );
HB_GENC_LABEL();
fprintf( cargo->yyc, "\thb_xvmMacroList();\n" );
@@ -1294,8 +1205,6 @@ static HB_GENC_FUNC( hb_p_macrolist )
static HB_GENC_FUNC( hb_p_macrolistend )
{
HB_SYMBOL_UNUSED( pFunc );
HB_GENC_LABEL();
fprintf( cargo->yyc, "\thb_xvmMacroListEnd();\n" );
@@ -1313,8 +1222,6 @@ static HB_GENC_FUNC( hb_p_enumstart )
static HB_GENC_FUNC( hb_p_enumnext )
{
HB_SYMBOL_UNUSED( pFunc );
HB_GENC_LABEL();
fprintf( cargo->yyc, "\tif( hb_xvmEnumNext() ) break;\n" );
@@ -1323,8 +1230,6 @@ static HB_GENC_FUNC( hb_p_enumnext )
static HB_GENC_FUNC( hb_p_enumprev )
{
HB_SYMBOL_UNUSED( pFunc );
HB_GENC_LABEL();
fprintf( cargo->yyc, "\tif( hb_xvmEnumPrev() ) break;\n" );
@@ -1333,8 +1238,6 @@ static HB_GENC_FUNC( hb_p_enumprev )
static HB_GENC_FUNC( hb_p_enumend )
{
HB_SYMBOL_UNUSED( pFunc );
HB_GENC_LABEL();
fprintf( cargo->yyc, "\thb_xvmEnumEnd( &lForEachBase );\n" );
@@ -1422,8 +1325,6 @@ static HB_GENC_FUNC( hb_p_localnearaddint )
static HB_GENC_FUNC( hb_p_pluseqpop )
{
HB_SYMBOL_UNUSED( pFunc );
HB_GENC_LABEL();
fprintf( cargo->yyc, "\tif( hb_xvmPlusEqPop() ) break;\n" );
@@ -1432,8 +1333,6 @@ static HB_GENC_FUNC( hb_p_pluseqpop )
static HB_GENC_FUNC( hb_p_minuseqpop )
{
HB_SYMBOL_UNUSED( pFunc );
HB_GENC_LABEL();
fprintf( cargo->yyc, "\tif( hb_xvmMinusEqPop() ) break;\n" );
@@ -1442,8 +1341,6 @@ static HB_GENC_FUNC( hb_p_minuseqpop )
static HB_GENC_FUNC( hb_p_multeqpop )
{
HB_SYMBOL_UNUSED( pFunc );
HB_GENC_LABEL();
fprintf( cargo->yyc, "\tif( hb_xvmMultEqPop() ) break;\n" );
@@ -1452,8 +1349,6 @@ static HB_GENC_FUNC( hb_p_multeqpop )
static HB_GENC_FUNC( hb_p_diveqpop )
{
HB_SYMBOL_UNUSED( pFunc );
HB_GENC_LABEL();
fprintf( cargo->yyc, "\tif( hb_xvmDivEqPop() ) break;\n" );
@@ -1462,8 +1357,6 @@ static HB_GENC_FUNC( hb_p_diveqpop )
static HB_GENC_FUNC( hb_p_pluseq )
{
HB_SYMBOL_UNUSED( pFunc );
HB_GENC_LABEL();
fprintf( cargo->yyc, "\tif( hb_xvmPlusEq() ) break;\n" );
@@ -1472,8 +1365,6 @@ static HB_GENC_FUNC( hb_p_pluseq )
static HB_GENC_FUNC( hb_p_minuseq )
{
HB_SYMBOL_UNUSED( pFunc );
HB_GENC_LABEL();
fprintf( cargo->yyc, "\tif( hb_xvmMinusEq() ) break;\n" );
@@ -1482,8 +1373,6 @@ static HB_GENC_FUNC( hb_p_minuseq )
static HB_GENC_FUNC( hb_p_multeq )
{
HB_SYMBOL_UNUSED( pFunc );
HB_GENC_LABEL();
fprintf( cargo->yyc, "\tif( hb_xvmMultEq() ) break;\n" );
@@ -1492,8 +1381,6 @@ static HB_GENC_FUNC( hb_p_multeq )
static HB_GENC_FUNC( hb_p_diveq )
{
HB_SYMBOL_UNUSED( pFunc );
HB_GENC_LABEL();
fprintf( cargo->yyc, "\tif( hb_xvmDivEq() ) break;\n" );

View File

@@ -47,8 +47,10 @@
#define alloca hb_xgrab
#undef malloc
#define malloc hb_xgrab
#undef realloc
#define realloc hb_xrealloc
#undef free
#define free hb_xfree
#define free hb_xfree
/* helper functions */
static int yy_ConvertNumber( char * szBuffer );

View File

@@ -38,8 +38,10 @@
#define alloca hb_xgrab
#undef malloc
#define malloc hb_xgrab
#undef realloc
#define realloc hb_xrealloc
#undef free
#define free hb_xfree
#define free hb_xfree
/* Compile using: bison -d -v harbour.y */

View File

@@ -122,78 +122,12 @@ static void hb_compCodeTraceMark( PHB_CODETRACE_INFO pInfo, ULONG ulPCodePos, UL
static HB_CODETRACE_FUNC( hb_p_default )
{
ULONG ulSize = hb_comp_pcode_len[ pFunc->pCode[ lPCodePos ] ];
ULONG ulSize = hb_compPCodeSize( pFunc, lPCodePos );
hb_compCodeTraceMark( cargo, lPCodePos, ulSize );
return hb_compCodeTraceNextPos( cargo, lPCodePos + ulSize );
}
static HB_CODETRACE_FUNC( hb_p_pushstr )
{
BYTE * pAddr = &pFunc->pCode[ lPCodePos + 1 ];
ULONG ulSize = 3 + HB_PCODE_MKUSHORT( pAddr );
hb_compCodeTraceMark( cargo, lPCodePos, ulSize );
return hb_compCodeTraceNextPos( cargo, lPCodePos + ulSize );
}
static HB_CODETRACE_FUNC( hb_p_pushstrshort )
{
ULONG ulSize = 2 + pFunc->pCode[ lPCodePos + 1 ];
hb_compCodeTraceMark( cargo, lPCodePos, ulSize );
return hb_compCodeTraceNextPos( cargo, lPCodePos + ulSize );
}
static HB_CODETRACE_FUNC( hb_p_pushblock )
{
BYTE * pAddr = &pFunc->pCode[ lPCodePos + 1 ];
ULONG ulSize = HB_PCODE_MKUSHORT( pAddr );
hb_compCodeTraceMark( cargo, lPCodePos, ulSize );
return hb_compCodeTraceNextPos( cargo, lPCodePos + ulSize );
}
static HB_CODETRACE_FUNC( hb_p_pushblockshort )
{
ULONG ulSize = pFunc->pCode[ lPCodePos + 1 ];
hb_compCodeTraceMark( cargo, lPCodePos, ulSize );
return hb_compCodeTraceNextPos( cargo, lPCodePos + ulSize );
}
static HB_CODETRACE_FUNC( hb_p_localname )
{
ULONG ulStart = lPCodePos;
lPCodePos += 3;
while( pFunc->pCode[ lPCodePos++ ] );
hb_compCodeTraceMark( cargo, ulStart, lPCodePos - ulStart );
return hb_compCodeTraceNextPos( cargo, lPCodePos );
}
static HB_CODETRACE_FUNC( hb_p_modulename )
{
ULONG ulStart = lPCodePos;
while( pFunc->pCode[ lPCodePos++ ] );
hb_compCodeTraceMark( cargo, ulStart, lPCodePos - ulStart );
return hb_compCodeTraceNextPos( cargo, lPCodePos );
}
static HB_CODETRACE_FUNC( hb_p_staticname )
{
ULONG ulStart = lPCodePos;
lPCodePos += 4;
while( pFunc->pCode[ lPCodePos++ ] );
hb_compCodeTraceMark( cargo, ulStart, lPCodePos - ulStart );
return hb_compCodeTraceNextPos( cargo, lPCodePos );
}
static HB_CODETRACE_FUNC( hb_p_jumpnear )
{
ULONG ulNewPos = lPCodePos + ( signed char ) pFunc->pCode[ lPCodePos + 1 ];
@@ -410,7 +344,7 @@ static PHB_CODETRACE_FUNC s_codeTraceFuncTable[ HB_P_LAST_PCODE ] =
hb_p_default, /* HB_P_LESSEQUAL, */
hb_p_default, /* HB_P_LESS, */
hb_p_default, /* HB_P_LINE, */
hb_p_localname, /* HB_P_LOCALNAME, */
hb_p_default, /* HB_P_LOCALNAME, */
hb_p_default, /* HB_P_MACROPOP, */
hb_p_default, /* HB_P_MACROPOPALIASED, */
hb_p_default, /* HB_P_MACROPUSH, */
@@ -424,7 +358,7 @@ static PHB_CODETRACE_FUNC s_codeTraceFuncTable[ HB_P_LAST_PCODE ] =
hb_p_default, /* HB_P_MESSAGE, */
hb_p_default, /* HB_P_MINUS, */
hb_p_default, /* HB_P_MODULUS, */
hb_p_modulename, /* HB_P_MODULENAME, */
hb_p_default, /* HB_P_MODULENAME, */
/* start: pcodes generated by macro compiler */
hb_p_default, /* HB_P_MMESSAGE, */
hb_p_default, /* HB_P_MPOPALIASEDFIELD, */
@@ -464,8 +398,8 @@ static PHB_CODETRACE_FUNC s_codeTraceFuncTable[ HB_P_LAST_PCODE ] =
hb_p_default, /* HB_P_PUSHALIASEDFIELD, */
hb_p_default, /* HB_P_PUSHALIASEDFIELDNEAR, */
hb_p_default, /* HB_P_PUSHALIASEDVAR, */
hb_p_pushblock, /* HB_P_PUSHBLOCK, */
hb_p_pushblockshort, /* HB_P_PUSHBLOCKSHORT, */
hb_p_default, /* HB_P_PUSHBLOCK, */
hb_p_default, /* HB_P_PUSHBLOCKSHORT, */
hb_p_default, /* HB_P_PUSHFIELD, */
hb_p_default, /* HB_P_PUSHBYTE, */
hb_p_default, /* HB_P_PUSHINT, */
@@ -480,8 +414,8 @@ static PHB_CODETRACE_FUNC s_codeTraceFuncTable[ HB_P_LAST_PCODE ] =
hb_p_default, /* HB_P_PUSHSELF, */
hb_p_default, /* HB_P_PUSHSTATIC, */
hb_p_default, /* HB_P_PUSHSTATICREF, */
hb_p_pushstr, /* HB_P_PUSHSTR, */
hb_p_pushstrshort, /* HB_P_PUSHSTRSHORT, */
hb_p_default, /* HB_P_PUSHSTR, */
hb_p_default, /* HB_P_PUSHSTRSHORT, */
hb_p_default, /* HB_P_PUSHSYM, */
hb_p_default, /* HB_P_PUSHSYMNEAR, */
hb_p_default, /* HB_P_PUSHVARIABLE, */
@@ -493,7 +427,7 @@ static PHB_CODETRACE_FUNC s_codeTraceFuncTable[ HB_P_LAST_PCODE ] =
hb_p_default, /* HB_P_SEQRECOVER, */
hb_p_default, /* HB_P_SFRAME, */
hb_p_default, /* HB_P_STATICS, */
hb_p_staticname, /* HB_P_STATICNAME, */
hb_p_default, /* HB_P_STATICNAME, */
hb_p_default, /* HB_P_SWAPALIAS, */
hb_p_default, /* HB_P_TRUE, */
hb_p_default, /* HB_P_ZERO, */

View File

@@ -65,18 +65,6 @@ typedef HB_FIX_FUNC( HB_FIX_FUNC_ );
typedef HB_FIX_FUNC_ * HB_FIX_FUNC_PTR;
static HB_FIX_FUNC( hb_p_pushstr )
{
HB_SYMBOL_UNUSED( cargo );
return 3 + HB_PCODE_MKUSHORT( &( pFunc->pCode[ lPCodePos + 1 ] ) );
}
static HB_FIX_FUNC( hb_p_pushstrshort )
{
HB_SYMBOL_UNUSED( cargo );
return 2 + pFunc->pCode[ lPCodePos + 1 ];
}
static HB_FIX_FUNC( hb_p_endblock )
{
HB_SYMBOL_UNUSED( pFunc );
@@ -128,30 +116,6 @@ static HB_FIX_FUNC( hb_p_pushblockshort )
return 2;
}
static HB_FIX_FUNC( hb_p_localname )
{
ULONG ulStart = lPCodePos;
HB_SYMBOL_UNUSED( cargo );
lPCodePos += 3;
while( pFunc->pCode[ lPCodePos ] )
++lPCodePos;
return (lPCodePos - ulStart + 1);
}
static HB_FIX_FUNC( hb_p_modulename )
{
ULONG ulStart = lPCodePos;
HB_SYMBOL_UNUSED( cargo );
lPCodePos += 3;
while( pFunc->pCode[ lPCodePos ] )
++lPCodePos;
return (lPCodePos - ulStart + 1);
}
static HB_FIX_FUNC( hb_p_poplocal )
{
/* only local variables used outside of a codeblock need fixing
@@ -271,18 +235,6 @@ static HB_FIX_FUNC( hb_p_pushlocalnear )
return 2;
}
static HB_FIX_FUNC( hb_p_staticname )
{
ULONG ulStart = lPCodePos;
HB_SYMBOL_UNUSED( cargo );
lPCodePos += 4;
while( pFunc->pCode[ lPCodePos ] )
++lPCodePos;
return (lPCodePos - ulStart + 1) ;
}
static HB_FIX_FUNC( hb_p_localnearaddint )
{
/* only local variables used outside of a codeblock need fixing
@@ -509,7 +461,7 @@ static HB_FIX_FUNC_PTR s_fixlocals_table[] =
NULL, /* HB_P_LESSEQUAL, */
NULL, /* HB_P_LESS, */
NULL, /* HB_P_LINE, */
hb_p_localname, /* HB_P_LOCALNAME, */
NULL, /* HB_P_LOCALNAME, */
NULL, /* HB_P_MACROPOP, */
NULL, /* HB_P_MACROPOPALIASED, */
NULL, /* HB_P_MACROPUSH, */
@@ -523,7 +475,7 @@ static HB_FIX_FUNC_PTR s_fixlocals_table[] =
NULL, /* HB_P_MESSAGE, */
NULL, /* HB_P_MINUS, */
NULL, /* HB_P_MODULUS, */
hb_p_modulename, /* HB_P_MODULENAME, */
NULL, /* HB_P_MODULENAME, */
/* start: pcodes generated by macro compiler */
NULL, /* HB_P_MMESSAGE, */
NULL, /* HB_P_MPOPALIASEDFIELD, */
@@ -579,8 +531,8 @@ static HB_FIX_FUNC_PTR s_fixlocals_table[] =
NULL, /* HB_P_PUSHSELF, */
NULL, /* HB_P_PUSHSTATIC, */
NULL, /* HB_P_PUSHSTATICREF, */
hb_p_pushstr, /* HB_P_PUSHSTR, */
hb_p_pushstrshort, /* HB_P_PUSHSTRSHORT, */
NULL, /* HB_P_PUSHSTR, */
NULL, /* HB_P_PUSHSTRSHORT, */
NULL, /* HB_P_PUSHSYM, */
NULL, /* HB_P_PUSHSYMNEAR, */
NULL, /* HB_P_PUSHVARIABLE, */
@@ -592,7 +544,7 @@ static HB_FIX_FUNC_PTR s_fixlocals_table[] =
NULL, /* HB_P_SEQRECOVER, */
NULL, /* HB_P_SFRAME, */
NULL, /* HB_P_STATICS, */
hb_p_staticname, /* HB_P_STATICNAME, */
NULL, /* HB_P_STATICNAME, */
NULL, /* HB_P_SWAPALIAS, */
hb_p_true, /* HB_P_TRUE, */
NULL, /* HB_P_ZERO, */

View File

@@ -58,66 +58,6 @@
typedef HB_LABEL_FUNC( HB_LABEL_FUNC_ );
typedef HB_LABEL_FUNC_ * PHB_LABEL_FUNC;
/*
* function for variable size PCODE tracing
*/
static HB_LABEL_FUNC( hb_p_pushstr )
{
HB_SYMBOL_UNUSED( cargo );
return 3 + HB_PCODE_MKUSHORT( &( pFunc->pCode[ lPCodePos + 1 ] ) );
}
static HB_LABEL_FUNC( hb_p_pushstrshort )
{
HB_SYMBOL_UNUSED( cargo );
return 2 + pFunc->pCode[ lPCodePos + 1 ];
}
static HB_LABEL_FUNC( hb_p_pushblock )
{
HB_SYMBOL_UNUSED( cargo );
return HB_PCODE_MKUSHORT( &pFunc->pCode[ lPCodePos + 1 ] );
}
static HB_LABEL_FUNC( hb_p_pushblockshort )
{
HB_SYMBOL_UNUSED( cargo );
return pFunc->pCode[ lPCodePos + 1 ];
}
static HB_LABEL_FUNC( hb_p_localname )
{
ULONG ulStart = lPCodePos;
HB_SYMBOL_UNUSED( cargo );
lPCodePos += 3;
while( pFunc->pCode[ lPCodePos++ ] );
return ( lPCodePos - ulStart );
}
static HB_LABEL_FUNC( hb_p_modulename )
{
ULONG ulStart = lPCodePos;
HB_SYMBOL_UNUSED( cargo );
lPCodePos += 3;
while( pFunc->pCode[ lPCodePos++ ]);
return ( lPCodePos - ulStart );
}
static HB_LABEL_FUNC( hb_p_staticname )
{
ULONG ulStart = lPCodePos;
HB_SYMBOL_UNUSED( cargo );
lPCodePos += 4;
while( pFunc->pCode[ lPCodePos++ ] );
return ( lPCodePos - ulStart );
}
/*
* jump functions
*/
@@ -285,7 +225,7 @@ static PHB_LABEL_FUNC s_GenLabelFuncTable[ HB_P_LAST_PCODE ] =
NULL, /* HB_P_LESSEQUAL, */
NULL, /* HB_P_LESS, */
NULL, /* HB_P_LINE, */
hb_p_localname, /* HB_P_LOCALNAME, */
NULL, /* HB_P_LOCALNAME, */
NULL, /* HB_P_MACROPOP, */
NULL, /* HB_P_MACROPOPALIASED, */
NULL, /* HB_P_MACROPUSH, */
@@ -299,7 +239,7 @@ static PHB_LABEL_FUNC s_GenLabelFuncTable[ HB_P_LAST_PCODE ] =
NULL, /* HB_P_MESSAGE, */
NULL, /* HB_P_MINUS, */
NULL, /* HB_P_MODULUS, */
hb_p_modulename, /* HB_P_MODULENAME, */
NULL, /* HB_P_MODULENAME, */
/* start: pcodes generated by macro compiler */
NULL, /* HB_P_MMESSAGE, */
NULL, /* HB_P_MPOPALIASEDFIELD, */
@@ -339,8 +279,8 @@ static PHB_LABEL_FUNC s_GenLabelFuncTable[ HB_P_LAST_PCODE ] =
NULL, /* HB_P_PUSHALIASEDFIELD, */
NULL, /* HB_P_PUSHALIASEDFIELDNEAR, */
NULL, /* HB_P_PUSHALIASEDVAR, */
hb_p_pushblock, /* HB_P_PUSHBLOCK, */
hb_p_pushblockshort, /* HB_P_PUSHBLOCKSHORT, */
NULL, /* HB_P_PUSHBLOCK, */
NULL, /* HB_P_PUSHBLOCKSHORT, */
NULL, /* HB_P_PUSHFIELD, */
NULL, /* HB_P_PUSHBYTE, */
NULL, /* HB_P_PUSHINT, */
@@ -355,8 +295,8 @@ static PHB_LABEL_FUNC s_GenLabelFuncTable[ HB_P_LAST_PCODE ] =
NULL, /* HB_P_PUSHSELF, */
NULL, /* HB_P_PUSHSTATIC, */
NULL, /* HB_P_PUSHSTATICREF, */
hb_p_pushstr, /* HB_P_PUSHSTR, */
hb_p_pushstrshort, /* HB_P_PUSHSTRSHORT, */
NULL, /* HB_P_PUSHSTR, */
NULL, /* HB_P_PUSHSTRSHORT, */
NULL, /* HB_P_PUSHSYM, */
NULL, /* HB_P_PUSHSYMNEAR, */
NULL, /* HB_P_PUSHVARIABLE, */
@@ -368,7 +308,7 @@ static PHB_LABEL_FUNC s_GenLabelFuncTable[ HB_P_LAST_PCODE ] =
NULL, /* HB_P_SEQRECOVER, */
NULL, /* HB_P_SFRAME, */
NULL, /* HB_P_STATICS, */
hb_p_staticname, /* HB_P_STATICNAME, */
NULL, /* HB_P_STATICNAME, */
NULL, /* HB_P_SWAPALIAS, */
NULL, /* HB_P_TRUE, */
NULL, /* HB_P_ZERO, */

File diff suppressed because it is too large Load Diff

View File

@@ -60,63 +60,6 @@ typedef void HB_STRIP_INFO, * PHB_STRIP_INFO;
typedef HB_STRIP_FUNC( HB_STRIP_FUNC_ );
typedef HB_STRIP_FUNC_ * PHB_STRIP_FUNC;
static HB_STRIP_FUNC( hb_p_pushstr )
{
HB_SYMBOL_UNUSED( cargo );
return 3 + HB_PCODE_MKUSHORT( &( pFunc->pCode[ lPCodePos + 1 ] ) );
}
static HB_STRIP_FUNC( hb_p_pushstrshort )
{
HB_SYMBOL_UNUSED( cargo );
return 2 + pFunc->pCode[ lPCodePos + 1 ];
}
static HB_STRIP_FUNC( hb_p_pushblock )
{
HB_SYMBOL_UNUSED( cargo );
return HB_PCODE_MKUSHORT( &pFunc->pCode[ lPCodePos + 1 ] );
}
static HB_STRIP_FUNC( hb_p_pushblockshort )
{
HB_SYMBOL_UNUSED( cargo );
return pFunc->pCode[ lPCodePos + 1 ];
}
static HB_STRIP_FUNC( hb_p_localname )
{
ULONG ulStart = lPCodePos;
HB_SYMBOL_UNUSED( cargo );
lPCodePos += 3;
while( pFunc->pCode[ lPCodePos++ ] );
return ( lPCodePos - ulStart );
}
static HB_STRIP_FUNC( hb_p_modulename )
{
ULONG ulStart = lPCodePos;
HB_SYMBOL_UNUSED( cargo );
lPCodePos += 3;
while( pFunc->pCode[ lPCodePos++ ]);
return ( lPCodePos - ulStart );
}
static HB_STRIP_FUNC( hb_p_staticname )
{
ULONG ulStart = lPCodePos;
HB_SYMBOL_UNUSED( cargo );
lPCodePos += 4;
while( pFunc->pCode[ lPCodePos++ ] );
return ( lPCodePos - ulStart );
}
static HB_STRIP_FUNC( hb_p_line )
{
HB_SYMBOL_UNUSED( cargo );
@@ -170,7 +113,7 @@ static PHB_STRIP_FUNC s_stripLines_table[] =
NULL, /* HB_P_LESSEQUAL, */
NULL, /* HB_P_LESS, */
hb_p_line, /* HB_P_LINE, */
hb_p_localname, /* HB_P_LOCALNAME, */
NULL, /* HB_P_LOCALNAME, */
NULL, /* HB_P_MACROPOP, */
NULL, /* HB_P_MACROPOPALIASED, */
NULL, /* HB_P_MACROPUSH, */
@@ -184,7 +127,7 @@ static PHB_STRIP_FUNC s_stripLines_table[] =
NULL, /* HB_P_MESSAGE, */
NULL, /* HB_P_MINUS, */
NULL, /* HB_P_MODULUS, */
hb_p_modulename, /* HB_P_MODULENAME, */
NULL, /* HB_P_MODULENAME, */
/* start: pcodes generated by macro compiler */
NULL, /* HB_P_MMESSAGE, */
NULL, /* HB_P_MPOPALIASEDFIELD, */
@@ -224,8 +167,8 @@ static PHB_STRIP_FUNC s_stripLines_table[] =
NULL, /* HB_P_PUSHALIASEDFIELD, */
NULL, /* HB_P_PUSHALIASEDFIELDNEAR, */
NULL, /* HB_P_PUSHALIASEDVAR, */
hb_p_pushblock, /* HB_P_PUSHBLOCK, */
hb_p_pushblockshort, /* HB_P_PUSHBLOCKSHORT, */
NULL, /* HB_P_PUSHBLOCK, */
NULL, /* HB_P_PUSHBLOCKSHORT, */
NULL, /* HB_P_PUSHFIELD, */
NULL, /* HB_P_PUSHBYTE, */
NULL, /* HB_P_PUSHINT, */
@@ -240,8 +183,8 @@ static PHB_STRIP_FUNC s_stripLines_table[] =
NULL, /* HB_P_PUSHSELF, */
NULL, /* HB_P_PUSHSTATIC, */
NULL, /* HB_P_PUSHSTATICREF, */
hb_p_pushstr, /* HB_P_PUSHSTR, */
hb_p_pushstrshort, /* HB_P_PUSHSTRSHORT, */
NULL, /* HB_P_PUSHSTR, */
NULL, /* HB_P_PUSHSTRSHORT, */
NULL, /* HB_P_PUSHSYM, */
NULL, /* HB_P_PUSHSYMNEAR, */
NULL, /* HB_P_PUSHVARIABLE, */
@@ -253,7 +196,7 @@ static PHB_STRIP_FUNC s_stripLines_table[] =
NULL, /* HB_P_SEQRECOVER, */
NULL, /* HB_P_SFRAME, */
NULL, /* HB_P_STATICS, */
hb_p_staticname, /* HB_P_STATICNAME, */
NULL, /* HB_P_STATICNAME, */
NULL, /* HB_P_SWAPALIAS, */
NULL, /* HB_P_TRUE, */
NULL, /* HB_P_ZERO, */

File diff suppressed because it is too large Load Diff

View File

@@ -86,8 +86,10 @@ NOTE: -C controls the speed/size ratio of generated scanner
#define alloca hb_xgrab
#undef malloc
#define malloc hb_xgrab
#undef realloc
#define realloc hb_xrealloc
#undef free
#define free hb_xfree
#define free hb_xfree
/* declaration of yylex function

View File

@@ -74,8 +74,16 @@
#define alloca hb_xgrab
#undef malloc
#define malloc hb_xgrab
#undef realloc
#define realloc hb_xrealloc
#undef free
#define free hb_xfree
#define free hb_xfree
#undef YYFREE
#define YYFREE hb_xfree
#undef YYMALLOC
#define YYMALLOC hb_xgrab
/* This is workaround of yyparse() declaration bug in bison.simple
*/

View File

@@ -2015,8 +2015,16 @@ static void hb_vmAddInt( HB_ITEM_PTR pResult, int iAdd )
{
PHB_ITEM pSubst, pAdd = hb_stackTopItem();
hb_vmPushInteger( iAdd );
pSubst = hb_errRT_BASE_Subst( EG_ARG, 1081, NULL, "+", 2, pResult, pAdd );
if( iAdd > 0 )
{
hb_vmPushInteger( iAdd );
pSubst = hb_errRT_BASE_Subst( EG_ARG, 1081, NULL, "+", 2, pResult, pAdd );
}
else
{
hb_vmPushInteger( -iAdd );
pSubst = hb_errRT_BASE_Subst( EG_ARG, 1082, NULL, "-", 2, pResult, pAdd );
}
if( pSubst )
{
@@ -6938,7 +6946,7 @@ HB_EXPORT BOOL hb_xvmArrayPush( void )
HB_EXPORT BOOL hb_xvmArrayItemPush( ULONG ulIndex )
{
HB_TRACE(HB_TR_DEBUG, ("hb_xvmArrayPush(%lu)", ulIndex));
HB_TRACE(HB_TR_DEBUG, ("hb_xvmArrayItemPush(%lu)", ulIndex));
hb_vmArrayItemPush( ulIndex );
@@ -6956,7 +6964,7 @@ HB_EXPORT BOOL hb_xvmArrayPop( void )
HB_EXPORT BOOL hb_xvmArrayItemPop( ULONG ulIndex )
{
HB_TRACE(HB_TR_DEBUG, ("hb_xvmArrayPop(%lu)", ulIndex));
HB_TRACE(HB_TR_DEBUG, ("hb_xvmArrayItemPop(%lu)", ulIndex));
hb_vmArrayItemPop( ulIndex );