From 8a8f786af25604ed3bcc9a8fc6eabd9eeb993bff Mon Sep 17 00:00:00 2001 From: Przemyslaw Czerpak Date: Fri, 6 Aug 2010 11:30:27 +0000 Subject: [PATCH] 2010-08-06 13:29 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/include/hbcomp.h ! fixed description of HB_VS_CBLOCAL_VAR macro * harbour/src/compiler/hbmain.c ! fixed wrongly generated E0047 compile time error for codeblocks with early evaluated macros accessing local parameters. It should fix problem reported by Itamar. * harbour/src/vm/hvm.c * modified one #if condition to pacify ICC warning reported by Andi --- harbour/ChangeLog | 13 +++++++++++++ harbour/include/hbcomp.h | 6 +++--- harbour/src/compiler/hbmain.c | 4 ++-- harbour/src/vm/hvm.c | 3 +-- 4 files changed, 19 insertions(+), 7 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 86a5045146..506a655cea 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,19 @@ The license applies to all entries newer than 2009-04-28. */ +2010-08-06 13:29 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/include/hbcomp.h + ! fixed description of HB_VS_CBLOCAL_VAR macro + + * harbour/src/compiler/hbmain.c + ! fixed wrongly generated E0047 compile time error for + codeblocks with early evaluated macros accessing local + parameters. It should fix problem reported by Itamar. + + * harbour/src/vm/hvm.c + * modified one #if condition to pacify ICC warning + reported by Andi + 2010-08-06 12:49 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + config/symbian + config/symbian/libs.mk diff --git a/harbour/include/hbcomp.h b/harbour/include/hbcomp.h index f1b7762637..29042e1eac 100644 --- a/harbour/include/hbcomp.h +++ b/harbour/include/hbcomp.h @@ -106,13 +106,13 @@ extern void hb_compParserRun( HB_COMP_DECL ); extern int hb_compVariableScope( HB_COMP_DECL, const char * ); #define HB_VS_UNDECLARED 0 /* variables declared in a current codeblock/function/procedure */ -#define HB_VS_CBLOCAL_VAR 1 /* local parameter of a codeblock */ -#define HB_VS_LOCAL_VAR 2 +#define HB_VS_CBLOCAL_VAR 1 /* func/proc local variables and parameters used in codeblock (detached) */ +#define HB_VS_LOCAL_VAR 2 /* local variables and parameters */ #define HB_VS_LOCAL_MEMVAR 4 #define HB_VS_LOCAL_FIELD 8 #define HB_VS_STATIC_VAR 16 -#define HB_VS_FILEWIDE 32 /* variables declared outside of a current function/procedure */ +#define HB_VS_FILEWIDE 32 #define HB_VS_GLOBAL_MEMVAR ( HB_VS_FILEWIDE | HB_VS_LOCAL_MEMVAR ) #define HB_VS_GLOBAL_FIELD ( HB_VS_FILEWIDE | HB_VS_LOCAL_FIELD ) #define HB_VS_GLOBAL_STATIC ( HB_VS_FILEWIDE | HB_VS_STATIC_VAR ) diff --git a/harbour/src/compiler/hbmain.c b/harbour/src/compiler/hbmain.c index 79c307519d..dc280c0f4d 100644 --- a/harbour/src/compiler/hbmain.c +++ b/harbour/src/compiler/hbmain.c @@ -753,7 +753,7 @@ PVAR hb_compVariableFind( HB_COMP_DECL, const char * szVarName, int * piPos, int /* Use negative order to signal that we are accessing a local * variable from a codeblock */ - *piPos = -hb_compVarListAdd( &pOutBlock->pDetached, pVar ); + *piPos = - hb_compVarListAdd( &pOutBlock->pDetached, pVar ); } *piScope = HB_VS_CBLOCAL_VAR; } @@ -2558,7 +2558,7 @@ static void hb_compCheckEarlyMacroEval( HB_COMP_DECL, const char *szVarName ) int iScope = hb_compVariableScope( HB_COMP_PARAM, szVarName ); if( iScope == HB_VS_CBLOCAL_VAR || - iScope == HB_VS_LOCAL_VAR || + /* iScope == HB_VS_LOCAL_VAR || */ iScope == HB_VS_STATIC_VAR || iScope == HB_VS_GLOBAL_STATIC || iScope == HB_VS_LOCAL_FIELD || diff --git a/harbour/src/vm/hvm.c b/harbour/src/vm/hvm.c index 1c69aa2417..f93598d676 100644 --- a/harbour/src/vm/hvm.c +++ b/harbour/src/vm/hvm.c @@ -3375,8 +3375,7 @@ static void hb_vmMult( HB_ITEM_PTR pResult, HB_ITEM_PTR pItem1, HB_ITEM_PTR pIte { HB_TRACE(HB_TR_DEBUG, ("hb_vmMult(%p,%p,%p)", pResult, pItem1, pItem2)); -#if HB_VMLONG_MAX / HB_VMINT_MAX >= HB_VMINT_MAX && \ - HB_VMLONG_MIN / HB_VMINT_MIN >= -HB_VMINT_MIN && 1 +#if - ( HB_VMLONG_MAX / HB_VMINT_MIN ) >= HB_VMINT_MAX && 1 if( HB_IS_INTEGER( pItem1 ) && HB_IS_INTEGER( pItem2 ) ) { HB_MAXINT nResult = ( HB_MAXINT ) pItem1->item.asInteger.value *