From fba9560639ff761439d3031e1e90a084b4da6137 Mon Sep 17 00:00:00 2001 From: Przemyslaw Czerpak Date: Mon, 2 Aug 2010 10:35:15 +0000 Subject: [PATCH] 2010-08-02 12:34 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/contrib/xhb/xhbqself.c * do not use depreciated symbol hb_symEval in HB_QSELF() function --- harbour/ChangeLog | 4 ++++ harbour/contrib/xhb/xhbqself.c | 21 +++++++++++++++++---- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 4e1b18955d..67d2f80a16 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,10 @@ The license applies to all entries newer than 2009-04-28. */ +2010-08-02 12:34 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/contrib/xhb/xhbqself.c + * do not use depreciated symbol hb_symEval in HB_QSELF() function + 2010-08-02 12:12 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/src/rdd/dbcmd53.c * removed one redundant casting diff --git a/harbour/contrib/xhb/xhbqself.c b/harbour/contrib/xhb/xhbqself.c index d64548805d..5e90efa0ae 100644 --- a/harbour/contrib/xhb/xhbqself.c +++ b/harbour/contrib/xhb/xhbqself.c @@ -52,6 +52,7 @@ #include "hbvmint.h" #include "hbapi.h" +#include "hbvm.h" #include "hbapiitm.h" #include "hbapierr.h" #include "hbstack.h" @@ -64,11 +65,23 @@ HB_FUNC( HB_QSELF ) { PHB_ITEM pSelf = hb_stackItem( nOffset + 1 ); - if( nOffset > 0 && HB_IS_BLOCK( pSelf ) && - hb_itemGetSymbol( hb_stackItem( nOffset ) ) == &hb_symEval ) + if( nOffset > 0 && HB_IS_BLOCK( pSelf ) ) { - pSelf = hb_stackItem( hb_stackItem( nOffset )-> - item.asSymbol.stackstate->nBaseItem + 1 ); + static PHB_SYMB s_pSymEval = NULL; + + if( s_pSymEval == NULL ) + { + hb_vmPushEvalSym(); + s_pSymEval = hb_itemGetSymbol( hb_stackItemFromTop( -1 ) ); + hb_stackPop(); + } + + if( s_pSymEval && + hb_itemGetSymbol( hb_stackItem( nOffset ) ) == s_pSymEval ) + { + pSelf = hb_stackItem( hb_stackItem( nOffset )-> + item.asSymbol.stackstate->nBaseItem + 1 ); + } } hb_itemReturn( pSelf ); }