From 0ce94714e629f5a2264d35478fe446c64d542dca Mon Sep 17 00:00:00 2001 From: Przemyslaw Czerpak Date: Fri, 5 Oct 2007 21:44:46 +0000 Subject: [PATCH] 2007-10-05 23:44 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/include/hbsetup.h * minor cleanup comment * harbour/source/vm/hvm.c * save/restore return value in extended references --- harbour/ChangeLog | 6 ++++++ harbour/include/hbsetup.h | 17 ++++++++++------- harbour/source/vm/hvm.c | 8 ++++++++ 3 files changed, 24 insertions(+), 7 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index e0b786d00d..88392ac9ae 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,12 @@ 2002-12-01 13:30 UTC+0100 Foo Bar */ +2007-10-05 23:44 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/include/hbsetup.h + * minor cleanup comment + * harbour/source/vm/hvm.c + * save/restore return value in extended references + 2007-10-05 14:00 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/source/vm/dynsym.c * added some additional comments. I still do not know MSVC behavior diff --git a/harbour/include/hbsetup.h b/harbour/include/hbsetup.h index 71397c57ea..730524051b 100644 --- a/harbour/include/hbsetup.h +++ b/harbour/include/hbsetup.h @@ -413,20 +413,23 @@ */ /* *********************************************************************** - * Fix DJGPP in call to: toupper(), tolower(), is...() - * -*/ -#if defined(__DJGPP__) + * some fixes in compiler header files + */ + +#if defined( __DJGPP__ ) + /* Fix DJGPP in call to: toupper(), tolower(), is...() + */ #include "hbfixdj.h" /* Substitute snprintf() by sprintf() for DJGPP <= 2.03. - * This is a temporary hack, should implement a C99 snprintf() ourselves. */ + * This is a temporary hack, should implement a C99 snprintf() ourselves. + */ #if ( __DJGPP__ < 2 || ( __DJGPP__ == 2 && __DJGPP_MINOR__ <= 3 ) ) #define snprintf(s, len, args...) sprintf( (s), ##args ) #endif -#elif defined( _MSC_VER ) && !defined(__XCC__) +#elif defined( _MSC_VER ) && !defined( __XCC__ ) #define snprintf _snprintf -#elif defined(__WATCOMC__) +#elif defined( __WATCOMC__ ) #if __WATCOMC__ < 1200 #define snprintf _bprintf #endif diff --git a/harbour/source/vm/hvm.c b/harbour/source/vm/hvm.c index d89c5bd029..af79f449b1 100644 --- a/harbour/source/vm/hvm.c +++ b/harbour/source/vm/hvm.c @@ -6769,6 +6769,7 @@ static PHB_ITEM hb_vmMsgRefRead( PHB_ITEM pRefer ) if( hb_vmRequestQuery() == 0 ) { + hb_stackPushReturn(); if( !pMsgRef->access ) pMsgRef->access = hb_dynsymGetCase( pMsgRef->assign->pSymbol->szName + 1 ); hb_vmPushDynSym( pMsgRef->access ); @@ -6776,6 +6777,7 @@ static PHB_ITEM hb_vmMsgRefRead( PHB_ITEM pRefer ) hb_vmSend( 0 ); hb_itemMove( &pMsgRef->value, hb_stackReturnItem() ); pMsgRef->value.type |= HB_IT_DEFAULT; + hb_stackPopReturn(); } return &pMsgRef->value; } @@ -6786,12 +6788,14 @@ static PHB_ITEM hb_vmMsgRefWrite( PHB_ITEM pRefer, PHB_ITEM pSource ) if( hb_vmRequestQuery() == 0 ) { + hb_stackPushReturn(); hb_vmPushDynSym( pMsgRef->assign ); hb_vmPush( &pMsgRef->object ); hb_vmPush( pSource ); hb_vmSend( 1 ); hb_itemCopy( &pMsgRef->value, pSource ); pMsgRef->value.type |= HB_IT_DEFAULT; + hb_stackPopReturn(); } return NULL; /*&pMsgIdxRef->value;*/ } @@ -6889,10 +6893,12 @@ static PHB_ITEM hb_vmMsgIdxRefRead( PHB_ITEM pRefer ) if( hb_vmRequestQuery() == 0 ) { + hb_stackPushReturn(); hb_objOperatorCall( HB_OO_OP_ARRAYINDEX, &pMsgIdxRef->value, HB_IS_BYREF( &pMsgIdxRef->object ) ? hb_itemUnRef( &pMsgIdxRef->object ) : &pMsgIdxRef->object, &pMsgIdxRef->index, NULL ); + hb_stackPopReturn(); pMsgIdxRef->value.type |= HB_IT_DEFAULT; } return &pMsgIdxRef->value; @@ -6907,8 +6913,10 @@ static PHB_ITEM hb_vmMsgIdxRefWrite( PHB_ITEM pRefer, PHB_ITEM pSource ) PHB_ITEM pObject = HB_IS_BYREF( &pMsgIdxRef->object ) ? hb_itemUnRef( &pMsgIdxRef->object ) : &pMsgIdxRef->object; + hb_stackPushReturn(); hb_objOperatorCall( HB_OO_OP_ARRAYINDEX, pObject, pObject, &pMsgIdxRef->index, pSource ); + hb_stackPopReturn(); pMsgIdxRef->value.type |= HB_IT_DEFAULT; }