diff --git a/harbour/ChangeLog b/harbour/ChangeLog index ce54bd74f0..96f461d11b 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,15 @@ +2001-01-08 22:18 GMT+0100 JFL (mafact) + * harbour/makefile.vc + Added estack.obj + * harbour/source/compiler/harbour.l + Added Type Casting needed by VC++ + * harbour/source/vm/estack.c + Added Type Casting needed by VC++ + * harbour/source/vm/hvm.c + Added Type Casting needed by VC++ + * harbour/source/vm/classes.c + Temporary released the HIDDEN Check on scooping + 2001-01-08 12:35 UTC-0800 Ron Pinkas * contrib/dot/pp.prg * Added support for leading and traing WS before/after #. diff --git a/harbour/makefile.vc b/harbour/makefile.vc index 674db50bf5..a1cb2a6cad 100644 --- a/harbour/makefile.vc +++ b/harbour/makefile.vc @@ -545,6 +545,7 @@ VM_LIB_OBJS = \ $(OBJ_DIR)\codebloc.obj \ $(OBJ_DIR)\debug.obj \ $(OBJ_DIR)\dynsym.obj \ + $(OBJ_DIR)\estack.obj \ $(OBJ_DIR)\eval.obj \ $(OBJ_DIR)\extend.obj \ $(OBJ_DIR)\fm.obj \ diff --git a/harbour/source/compiler/harbour.l b/harbour/source/compiler/harbour.l index 9a6b3306fc..1bb1e843e5 100644 --- a/harbour/source/compiler/harbour.l +++ b/harbour/source/compiler/harbour.l @@ -201,7 +201,7 @@ Separator {SpaceTab} } [^\"\n]*\n { BEGIN 0; - unput( '\n' ); + unput( '\n' ); yytext[--yyleng] = '\0'; hb_compGenError( hb_comp_szErrors, 'E', HB_COMP_ERR_STRING_TERMINATOR, yytext, NULL ); hb_comp_iState = LOOKUP; @@ -314,14 +314,14 @@ Separator {SpaceTab} /* ************************************************************************ */ %} ; { - #ifdef DEBUG_NEWLINE - printf( "New Line\n" ); - #endif + #ifdef DEBUG_NEWLINE + printf( "New Line\n" ); + #endif yy_set_bol(1); hb_comp_iState = LOOKUP; return ';'; - } + } %{ /* ************************************************************************ */ %} @@ -761,91 +761,91 @@ Separator {SpaceTab} %} "hb_inline" { - char sBuffer[ YY_BUF_SIZE ], *pBuffer, sInlineSym[] = "HB_INLINE_0"; - int iSize, iBraces = 0; - extern BOOL hb_pp_bInline; + char sBuffer[ YY_BUF_SIZE ], *pBuffer, sInlineSym[] = "HB_INLINE_0"; + int iSize, iBraces = 0; + extern BOOL hb_pp_bInline; PINLINE pInline; hb_pp_bInline = TRUE; - sInlineSym[10] = hb_comp_cInlineID++; + sInlineSym[10] = hb_comp_cInlineID++; - switch( sInlineSym[10] ) - { - case '9' + 1 : - sInlineSym[10] = 'A'; - break; + switch( sInlineSym[10] ) + { + case '9' + 1 : + sInlineSym[10] = 'A'; + break; - case 'Z' + 1 : + case 'Z' + 1 : hb_compGenError( hb_comp_szErrors, 'F', HB_COMP_ERR_TOOMANY_INLINE, NULL, NULL ); - break; - } + break; + } pInline = hb_compInlineAdd( hb_compIdentifierNew( sInlineSym, TRUE ) ); - DigestInline : + DigestInline : YY_INPUT( (char*) sBuffer, iSize, YY_BUF_SIZE ); - if( iSize == 0 ) - { + if( iSize == 0 ) + { hb_compGenError( hb_comp_szErrors, 'F', HB_COMP_ERR_INVALID_INLINE, hb_comp_functions.pLast->szName, NULL ); - hb_pp_bInline = FALSE; - return '\n'; - } - pBuffer = (char*) sBuffer; + hb_pp_bInline = FALSE; + return '\n'; + } + pBuffer = (char*) sBuffer; - while( *pBuffer && ( *pBuffer == ' ' || *pBuffer == '\t' ) ) - { + while( *pBuffer && ( *pBuffer == ' ' || *pBuffer == '\t' ) ) + { pBuffer++; - } + } - if( *pBuffer == '\0' ) - { - goto DigestInline; - } - else if( *pBuffer == '{' ) - { - iBraces++; - } - else if( *pBuffer == '}' && iBraces > 1 ) - { - iBraces--; - } - else if( *pBuffer == '}' ) - { - if( pInline->pCode == NULL ) - { - pInline->pCode = hb_xgrab( ( iSize = strlen( (char*) sBuffer ) ) + 1 ); - strcpy( pInline->pCode, (char*) sBuffer ); - } - else - { - pInline->pCode = hb_xrealloc( pInline->pCode, pInline->lPCodeSize + ( iSize = strlen( (char*) sBuffer ) ) + 1 ); - strcpy( pInline->pCode + pInline->lPCodeSize, (char*) sBuffer ); - } + if( *pBuffer == '\0' ) + { + goto DigestInline; + } + else if( *pBuffer == '{' ) + { + iBraces++; + } + else if( *pBuffer == '}' && iBraces > 1 ) + { + iBraces--; + } + else if( *pBuffer == '}' ) + { + if( pInline->pCode == NULL ) + { + pInline->pCode = (unsigned char *) hb_xgrab( ( iSize = strlen( (char*) sBuffer ) ) + 1 ); + strcpy( (char *) pInline->pCode, (char *) sBuffer ); + } + else + { + pInline->pCode = (unsigned char *) hb_xrealloc( pInline->pCode, pInline->lPCodeSize + ( iSize = strlen( (char*) sBuffer ) ) + 1 ); + strcpy( (char *) (pInline->pCode + pInline->lPCodeSize), (char *) sBuffer ); + } - pInline->lPCodeSize += iSize; + pInline->lPCodeSize += iSize; - hb_pp_bInline = FALSE; + hb_pp_bInline = FALSE; yylval.string = hb_compIdentifierNew( sInlineSym, TRUE ); return IDENTIFIER; - } + } - if( pInline->pCode == NULL ) - { - pInline->pCode = hb_xgrab( ( iSize = strlen( (char*) sBuffer ) ) + 1 ); - strcpy( pInline->pCode, (char*) sBuffer ); - } - else - { - pInline->pCode = hb_xrealloc( pInline->pCode, pInline->lPCodeSize + ( iSize = strlen( (char*) sBuffer ) ) + 1 ); - strcpy( pInline->pCode + pInline->lPCodeSize, (char*) sBuffer ); - } + if( pInline->pCode == NULL ) + { + pInline->pCode = (unsigned char *) hb_xgrab( ( iSize = strlen( (char*) sBuffer ) ) + 1 ); + strcpy( (char *) pInline->pCode, (char *) sBuffer ); + } + else + { + pInline->pCode = (unsigned char *) hb_xrealloc( pInline->pCode, pInline->lPCodeSize + ( iSize = strlen( (char*) sBuffer ) ) + 1 ); + strcpy( (char *) (pInline->pCode + pInline->lPCodeSize), (char *) sBuffer ); + } - pInline->lPCodeSize += iSize; + pInline->lPCodeSize += iSize; - goto DigestInline; - } + goto DigestInline; + } %{ /* ************************************************************************ */ @@ -1395,15 +1395,15 @@ Separator {SpaceTab} [\(] ++_iOpenBracket; hb_comp_iState =LSEPARATOR; return yytext[ 0 ]; [\)] --_iOpenBracket; hb_comp_iState =RSEPARATOR; return yytext[ 0 ]; -[\x00-\x1F] return yytext[ 0 ]; /* see below */ +[\x00-\x1F] return yytext[ 0 ]; /* see below */ [\~\`\?\_\\] return yytext[ 0 ]; /* see below */ -[\x7F-\xFF] { +[\x7F-\xFF] { /* This have to be the last rule - any nonstandard and not handled - * characters should go to grammar analyser instead of printing it - * on stdout. - */ + * characters should go to grammar analyser instead of printing it + * on stdout. + */ return yytext[ 0 ]; - } + } %{ /* ************************************************************************ */ diff --git a/harbour/source/vm/classes.c b/harbour/source/vm/classes.c index ea56476fb0..f6d72ac2e1 100644 --- a/harbour/source/vm/classes.c +++ b/harbour/source/vm/classes.c @@ -70,7 +70,6 @@ * Multiple datas declaration fully supported * Super msg correctly respond by a super object * Scoping : working for protected, hidden and readonly - * Define of HB_MASKHIDDEN allow subclass to not inherit of hidden message * This implie a message not found error in place of protection error hidden * * 06/07/2000 @@ -393,8 +392,13 @@ void hb_clsScope( PHB_ITEM pObject, PMETHOD pMethod ) char * szNameBase; char * szNameObject; +/* We have to rethink about hidden, in the meantime, better to do nothing :( */ +/* if ( (( uiScope & HB_OO_CLSTP_PROTECTED ) == HB_OO_CLSTP_PROTECTED ) || */ +/* (( uiScope & HB_OO_CLSTP_HIDDEN ) == HB_OO_CLSTP_HIDDEN ) || */ +/* (( uiScope & HB_OO_CLSTP_READONLY ) == HB_OO_CLSTP_READONLY ) */ +/* ) */ + if ( (( uiScope & HB_OO_CLSTP_PROTECTED ) == HB_OO_CLSTP_PROTECTED ) || - (( uiScope & HB_OO_CLSTP_HIDDEN ) == HB_OO_CLSTP_HIDDEN ) || (( uiScope & HB_OO_CLSTP_READONLY ) == HB_OO_CLSTP_READONLY ) ) { @@ -428,26 +432,22 @@ void hb_clsScope( PHB_ITEM pObject, PMETHOD pMethod ) hb_errRT_BASE( EG_NOMETHOD, 1004, "Scope violation (protected)", szName ); } } - - /* if HB_CLS_MASKHIDDEN defined, a call to a hidden msg will result to a msg not found error. */ - -#ifndef HB_CLS_MASKHIDDEN - if( ( uiScope & HB_OO_CLSTP_HIDDEN ) == HB_OO_CLSTP_HIDDEN ) - { - if( ( uiScope & HB_OO_CLSTP_SUPER ) == HB_OO_CLSTP_SUPER ) - bRetVal = TRUE; - else - bRetVal = ( strcmp( szNameBase, szNameObject ) != 0 ); - - if( bRetVal ) - { - strcpy( szName, szNameObject ); - strcat( szName, ":" ); - strcat( szName, pMessage->pSymbol->szName ); - hb_errRT_BASE( EG_NOMETHOD, 1004, "Scope violation (hidden)", szName ); - } - } -#endif +/* We have to rethink about hidden, in the meantime, better to do nothing :( */ +/* if( ( uiScope & HB_OO_CLSTP_HIDDEN ) == HB_OO_CLSTP_HIDDEN ) */ +/* { */ +/* if( ( uiScope & HB_OO_CLSTP_SUPER ) == HB_OO_CLSTP_SUPER ) */ +/* bRetVal = TRUE; */ +/* else */ +/* bRetVal = ( strcmp( szNameBase, szNameObject ) != 0 ); */ +/* */ +/* if( bRetVal ) */ +/* { */ +/* strcpy( szName, szNameObject ); */ +/* strcat( szName, ":" ); */ +/* strcat( szName, pMessage->pSymbol->szName ); */ +/* hb_errRT_BASE( EG_NOMETHOD, 1004, "Scope violation (hidden)", szName ); */ +/* } */ +/* } */ } else if( ( uiScope & HB_OO_CLSTP_PROTECTED ) == HB_OO_CLSTP_PROTECTED ) { @@ -456,15 +456,14 @@ void hb_clsScope( PHB_ITEM pObject, PMETHOD pMethod ) strcat( szName, pMessage->pSymbol->szName ); hb_errRT_BASE( EG_NOMETHOD, 1004, "Scope violation (protected)", szName ); } -#ifndef HB_CLS_MASKHIDDEN - else if( ( uiScope & HB_OO_CLSTP_HIDDEN ) == HB_OO_CLSTP_HIDDEN ) - { - strcpy( szName, szNameObject ); - strcat( szName, ":" ); - strcat( szName, pMessage->pSymbol->szName ); - hb_errRT_BASE( EG_NOMETHOD, 1004, "Scope violation (hidden)", szName ); - } -#endif +/* We have to rethink about hidden, in the meantime, better to do nothing :( */ +/* else if( ( uiScope & HB_OO_CLSTP_HIDDEN ) == HB_OO_CLSTP_HIDDEN ) */ +/* { */ +/* strcpy( szName, szNameObject ); */ +/* strcat( szName, ":" ); */ +/* strcat( szName, pMessage->pSymbol->szName ); */ +/* hb_errRT_BASE( EG_NOMETHOD, 1004, "Scope violation (hidden)", szName ); */ +/* } */ #ifdef HB_CLS_ENFORCERO /* Not enabled by default */ if( ( uiScope & HB_OO_CLSTP_READONLY ) == HB_OO_CLSTP_READONLY ) diff --git a/harbour/source/vm/estack.c b/harbour/source/vm/estack.c index b6dfea06af..954a00f5cf 100644 --- a/harbour/source/vm/estack.c +++ b/harbour/source/vm/estack.c @@ -104,7 +104,7 @@ void hb_stackPush( void ) hb_stack.pBase = hb_stack.pItems + BaseIndex; hb_stack.wItems += STACK_EXPANDHB_ITEMS; for( i=CurrIndex; i < hb_stack.wItems; ++i ) - hb_stack.pItems[ i ] = hb_xgrab( sizeof( HB_ITEM ) ); + hb_stack.pItems[ i ] = (_HB_ITEM *) hb_xgrab( sizeof( HB_ITEM ) ); /* hb_stackDispLocal(); */ } @@ -115,7 +115,7 @@ void hb_stackPush( void ) void hb_stackInit( void ) { - ULONG i; + LONG i; HB_TRACE(HB_TR_DEBUG, ("hb_stackInit()")); @@ -125,7 +125,7 @@ void hb_stackInit( void ) hb_stack.wItems = STACK_INITHB_ITEMS; for( i=0; i < hb_stack.wItems; ++i ) - hb_stack.pItems[ i ] = hb_xgrab( sizeof( HB_ITEM ) ); + hb_stack.pItems[ i ] = (_HB_ITEM *) hb_xgrab( sizeof( HB_ITEM ) ); } void hb_stackRemove( LONG lUntilPos ) diff --git a/harbour/source/vm/hvm.c b/harbour/source/vm/hvm.c index b01e40c274..6f9eefb541 100644 --- a/harbour/source/vm/hvm.c +++ b/harbour/source/vm/hvm.c @@ -2559,7 +2559,7 @@ static void hb_vmArrayGen( ULONG ulElements ) /* generates an ulElements Array a itArray.type = HB_IT_NIL; hb_arrayNew( &itArray, ulElements ); for( ulPos = 0; ulPos < ulElements; ulPos++ ) - hb_itemCopy( itArray.item.asArray.value->pItems + ulPos, hb_stackItemFromTop( - ulElements + ulPos ) ); + hb_itemCopy( itArray.item.asArray.value->pItems + ulPos, hb_stackItemFromTop( ulPos - ulElements ) ); for( ulPos = 0; ulPos < ulElements; ulPos++ ) hb_stackPop();