From 26c63dfa4e729fe55c885b898410a728f4f1341b Mon Sep 17 00:00:00 2001 From: Ron Pinkas Date: Tue, 29 Aug 2000 00:09:35 +0000 Subject: [PATCH] 2000-08-28 17:00 UTC+0800 Ron Pinkas * source/compiler/harbour.y - Removed 1 un-needed hb_comp_szDeclaredFun = NULL * source/compiler/hbpcode.c ! Completed declared parameter checking, for method applied to Adapted Type Variable. --- harbour/ChangeLog | 7 +++++++ harbour/source/compiler/harbour.y | 2 +- harbour/source/compiler/hbpcode.c | 19 ++++++++++++++----- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index afdd5e799e..78be692b30 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,10 @@ +2000-08-28 17:00 UTC+0800 Ron Pinkas + * source/compiler/harbour.y + - Removed 1 un-needed hb_comp_szDeclaredFun = NULL + + * source/compiler/hbpcode.c + ! Completed declared parameter checking, for method applied to Adapted Type Variable. + 2000-08-28 15:00 UTC+0800 Ron Pinkas * include/hbcomp.h + Added: extern void hb_compDeclaredParameterAdd( char * szVarName, BYTE cValueType ); diff --git a/harbour/source/compiler/harbour.y b/harbour/source/compiler/harbour.y index 5136c3147d..011e3c571a 100644 --- a/harbour/source/compiler/harbour.y +++ b/harbour/source/compiler/harbour.y @@ -1190,7 +1190,7 @@ Declaration: DECLARE IdentName '(' { hb_compDeclaredAdd( $2 ); hb_comp_szDeclare hb_comp_cVarType = ' '; hb_comp_iVarScope = VS_NONE; } - | DECLARE IdentName { hb_comp_pLastClass = hb_compClassAdd( $2 ); } ClassInfo Crlf { hb_comp_iVarScope = VS_NONE; hb_comp_szDeclaredFun == NULL } + | DECLARE IdentName { hb_comp_pLastClass = hb_compClassAdd( $2 ); } ClassInfo Crlf { hb_comp_iVarScope = VS_NONE; } ; ClassInfo : DecMethod diff --git a/harbour/source/compiler/hbpcode.c b/harbour/source/compiler/hbpcode.c index 5c48ece02c..5a28ebcb88 100644 --- a/harbour/source/compiler/hbpcode.c +++ b/harbour/source/compiler/hbpcode.c @@ -525,13 +525,16 @@ void hb_compStrongType( int iSize ) if( pFunc->iStackIndex < ( wVar + 1 ) ) break; - if( pFunc->pStack[ pFunc->iStackIndex - ( wVar + 1 ) ] == 'S' && - pFunc->iStackFunctions > 0 && pFunc->pStackFunctions[ --pFunc->iStackFunctions ] ) + cType = pFunc->pStack[ pFunc->iStackIndex - ( wVar + 1 ) ]; + if( cType >= ( 'A' + VT_OFFSET_VARIANT ) ) + cType -= VT_OFFSET_VARIANT; + + if( cType == 'S' && pFunc->iStackFunctions > 0 && pFunc->pStackFunctions[ pFunc->iStackFunctions - 1 ] ) { int hb_comp_iParamCount, iParamCount, iOptionals = 0; BYTE * hb_comp_cParamTypes; - hb_comp_cParamTypes = pFunc->pStackFunctions[ pFunc->iStackFunctions ]->cParamTypes; + hb_comp_cParamTypes = pFunc->pStackFunctions[ --pFunc->iStackFunctions ]->cParamTypes; hb_comp_iParamCount = pFunc->pStackFunctions[ pFunc->iStackFunctions ]->iParamCount; iParamCount = hb_comp_iParamCount; @@ -635,11 +638,15 @@ void hb_compStrongType( int iSize ) hb_compGenWarning( hb_comp_szWarnings, 'W', HB_COMP_WARN_PARAM_COUNT, ( char * ) szType1, ( char * ) szType2 ); } } + else if( pFunc->iStackFunctions ) + { + pFunc->pStackFunctions[ --pFunc->iStackFunctions ] = NULL; + } /* Removing all the parameters.*/ pFunc->iStackIndex -= wVar; - if( pFunc->pStack[ pFunc->iStackIndex - 1 ] == 'S' && pFunc->pStackFunctions[ pFunc->iStackFunctions ] ) + if( cType == 'S' && pFunc->pStackFunctions[ pFunc->iStackFunctions ] ) { pFunc->pStack[ pFunc->iStackIndex - 1 ] = pFunc->pStackFunctions[ pFunc->iStackFunctions ]->cType; @@ -652,7 +659,9 @@ void hb_compStrongType( int iSize ) } } else - pFunc->pStack[ pFunc->iStackIndex - 1 ] = ' '; + { + pFunc->pStack[ pFunc->iStackIndex - 1 ] = ' '; + } break;