diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 9e9e61c4ec..1fb6018b6a 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,22 @@ 2008-12-31 13:59 UTC+0100 Foo Bar */ +2008-05-30 00:15 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/source/vm/estack.c + * declare hb_stack as static variable when HB_STACK_MACROS is + disabled to be sure that non extern code will access hb_stack + It's very important to eliminate such code before we add MT + support. + + * harbour/source/vm/hvm.c + * changed hb_vmFrame() to work in the same way as hb_vmVFrame() + + * harbour/source/rtl/hbgtcore.c + ! fixed wrong clear column in right horizontal scrolling + + * harbour/source/rtl/memoedit.prg + * use hb_inkeySetLast( n ) instead of KEYBOARD Chr( n ) ; InKey() + 2008-05-29 20:56 UTC+0100 Viktor Szakats (harbour.01 syenar hu) * make_b32.mak - HB_NO_BCC_MAX_OPENFILES_HACK - no longer used. diff --git a/harbour/source/rtl/hbgtcore.c b/harbour/source/rtl/hbgtcore.c index d287cc2684..ea164d95e0 100644 --- a/harbour/source/rtl/hbgtcore.c +++ b/harbour/source/rtl/hbgtcore.c @@ -1071,7 +1071,7 @@ static void hb_gt_def_Scroll( PHB_GT pGT, int iTop, int iLeft, int iBottom, int { iColOld += iCols; iColSize -= iCols; - iColClear = iColOld + iColSize - 1; + iColClear = iColNew + iColSize + 1; iClrs = iCols; } else @@ -1145,7 +1145,7 @@ static void hb_gt_def_ScrollArea( PHB_GT pGT, int iTop, int iLeft, int iBottom, { iColOld += iCols; iColSize -= iCols; - iColClear = iColOld + iColSize - 1; + iColClear = iColNew + iColSize + 1; iClrs = iCols; } else diff --git a/harbour/source/rtl/memoedit.prg b/harbour/source/rtl/memoedit.prg index aaa018b8f1..52ee88915a 100644 --- a/harbour/source/rtl/memoedit.prg +++ b/harbour/source/rtl/memoedit.prg @@ -303,8 +303,7 @@ FUNCTION MemoEdit( cString,; IF oEd:Changed() cString := oEd:GetText() // dbu tests for LastKey() == K_CTRL_END, so I try to make it happy - KEYBOARD Chr( K_CTRL_END ) - Inkey() + HB_SetLastKey( K_CTRL_END ) ENDIF ENDIF diff --git a/harbour/source/vm/estack.c b/harbour/source/vm/estack.c index 102b783bd8..3dd95ec85a 100644 --- a/harbour/source/vm/estack.c +++ b/harbour/source/vm/estack.c @@ -67,7 +67,11 @@ #define STACK_EXPANDHB_ITEMS 20 #endif -HB_STACK hb_stack; +#if defined( HB_STACK_MACROS ) + HB_STACK hb_stack; +#else + static HB_STACK hb_stack; +#endif static HB_SYMB s_initSymbol = { "hb_stackInit", { HB_FS_STATIC }, { NULL }, NULL }; @@ -259,7 +263,7 @@ HB_ITEM_PTR hb_stackNewFrame( PHB_STACK_STATE pStack, USHORT uiParams ) pItem->item.asSymbol.stackstate = pStack; pItem->item.asSymbol.paramcnt = uiParams; /* set default value of 'paramdeclcnt' - it will be updated - * in hb_vmVFrame only + * in hb_vm[V]Frame only */ pItem->item.asSymbol.paramdeclcnt = uiParams; hb_stack.pBase = pBase; diff --git a/harbour/source/vm/hvm.c b/harbour/source/vm/hvm.c index 546120c5e5..118b879d6b 100644 --- a/harbour/source/vm/hvm.c +++ b/harbour/source/vm/hvm.c @@ -5285,48 +5285,71 @@ static void hb_vmDebuggerShowLine( USHORT uiLine ) /* makes the debugger shows a static void hb_vmFrame( USHORT usLocals, BYTE bParams ) { - int iTotal, iExtra; - int ipcount = hb_pcount(); + PHB_ITEM pBase; + int iTotal; HB_TRACE(HB_TR_DEBUG, ("hb_vmFrame(%d, %d)", (int) usLocals, (int) bParams)); - iExtra = ipcount - bParams; + pBase = hb_stackBaseItem(); - if( iExtra > 0 ) +#if 0 + /* This old code which clears additional parameters to make space for + * local variables without updating pBase->item.asSymbol.paramdeclcnt + */ + iTotal = pBase->item.asSymbol.paramcnt - bParams; + if( iTotal > 0 ) { - hb_stackBaseItem()->item.asSymbol.paramcnt = bParams; - while( iExtra > 0 ) - { - hb_itemClear( hb_stackItemFromTop( -iExtra ) ); - iExtra--; - } + pBase->item.asSymbol.paramcnt = bParams; + do + hb_itemClear( hb_stackItemFromTop( -iTotal ) ); + while( --iTotal > 0 ); } iTotal = usLocals + bParams; if( iTotal ) { - iTotal -= ipcount; + iTotal -= pBase->item.asSymbol.paramcnt; while( --iTotal >= 0 ) hb_vmPushNil(); } +#else + pBase->item.asSymbol.paramdeclcnt = bParams; + + iTotal = bParams - pBase->item.asSymbol.paramcnt; + if( iTotal < 0 ) + iTotal = 0; + iTotal += usLocals; + + if( iTotal ) + { + do + hb_vmPushNil(); + while( --iTotal > 0 ); + } +#endif } static void hb_vmVFrame( USHORT usLocals, BYTE bParams ) { + PHB_ITEM pBase; int iTotal; HB_TRACE(HB_TR_DEBUG, ("hb_vmVFrame(%d, %d)", (int) usLocals, (int) bParams)); - hb_stackBaseItem()->item.asSymbol.paramdeclcnt = bParams; + pBase = hb_stackBaseItem(); + + pBase->item.asSymbol.paramdeclcnt = bParams; + + iTotal = bParams - pBase->item.asSymbol.paramcnt; + if( iTotal < 0 ) + iTotal = 0; + iTotal += usLocals; - if( hb_pcount() < bParams ) - iTotal = usLocals + bParams - hb_pcount(); - else - iTotal = usLocals; if( iTotal ) { - while( --iTotal >= 0 ) + do hb_vmPushNil(); + while( --iTotal > 0 ); } }