From 37d653a9dadf9cad61e7fb0f00f647030fa68cdb Mon Sep 17 00:00:00 2001 From: Ryszard Glab Date: Fri, 4 Feb 2000 19:32:38 +0000 Subject: [PATCH] ChangeLog 20000204-20:45 GMT+1 --- harbour/ChangeLog | 10 ++++++++++ harbour/source/compiler/harbour.c | 14 ++++++++++++-- harbour/source/compiler/harbour.y | 2 +- harbour/source/rtl/inkey.c | 20 ++++++++++++++++++-- 4 files changed, 41 insertions(+), 5 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index e585c4019e..f0cb96f2ed 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,13 @@ +20000204-20:45 GMT+1 Ryszard Glab + + *source/compiler/harbour.y + *source/compiler/harbour.c + * fixed initialization of static variable with dimmed array + STATIC var[ 2 ] + + *source/rtl/inkey.c + * fixed s_iMouseCol/s_iMouseRow if compiled with GCC/LINUX + 20000204-22:12 GMT+3 Alexander Kresin * source/rdd/dbcmd.c + added hb_rddGetCurrentWorkAreaPointer() function diff --git a/harbour/source/compiler/harbour.c b/harbour/source/compiler/harbour.c index 2102bfb20a..a9b087fb8f 100644 --- a/harbour/source/compiler/harbour.c +++ b/harbour/source/compiler/harbour.c @@ -1449,13 +1449,23 @@ void hb_compGenPopVar( char * szVarName ) /* generates the pcode to pop a value } else { - iVar = hb_compStaticGetPos( szVarName, hb_comp_functions.pLast ); + PFUNCTION pFunc; + + /* Check if we are generating a pop code for static variable + * initialization function - if YES then we have to switch to a function + * where the static variable was declared + */ + if( ( hb_comp_functions.pLast->cScope & (FS_INIT | FS_EXIT) ) == (FS_INIT | FS_EXIT) ) + pFunc = hb_comp_functions.pLast->pOwner; + else + pFunc = hb_comp_functions.pLast; + iVar = hb_compStaticGetPos( szVarName, pFunc ); if( iVar ) { /* Static variable declared in current function */ hb_compGenPCode3( HB_P_POPSTATIC, HB_LOBYTE( iVar ), HB_HIBYTE( iVar ) ); - hb_comp_functions.pLast->bFlags |= FUN_USES_STATICS; + pFunc->bFlags |= FUN_USES_STATICS; } else { diff --git a/harbour/source/compiler/harbour.y b/harbour/source/compiler/harbour.y index 8802c34593..f956e78e7c 100644 --- a/harbour/source/compiler/harbour.y +++ b/harbour/source/compiler/harbour.y @@ -1838,9 +1838,9 @@ static void hb_compVariableDim( char * szName, HB_EXPR_PTR pInitValue ) HB_EXPR_PTR pVar = hb_compExprNewVar( szName ); HB_EXPR_PTR pAssign; - hb_compStaticDefStart(); /* switch to statics pcode buffer */ /* create a static variable */ hb_compVariableAdd( szName, 'A' ); + hb_compStaticDefStart(); /* switch to statics pcode buffer */ /* create an array */ hb_compExprGenPush( pInitValue ); hb_compGenPCode3( HB_P_ARRAYDIM, HB_LOBYTE( uCount ), HB_HIBYTE( uCount ) ); diff --git a/harbour/source/rtl/inkey.c b/harbour/source/rtl/inkey.c index 4fabc2a67a..d502ef54ff 100644 --- a/harbour/source/rtl/inkey.c +++ b/harbour/source/rtl/inkey.c @@ -1152,7 +1152,15 @@ HARBOUR HB___KEYPUT( void ) HARBOUR HB_MCOL( void ) { - hb_retnl( s_iMouseCol ); +#if defined(_WINDOWS_) || defined(WINNT) + #if ! defined(HARBOUR_USE_CRS_GTAPI) && ! defined(HARBOUR_USE_SLN_GTAPI) + hb_retnl( s_iMouseCol ); + #else + hb_retnl( 0 ); + #endif +#else + hb_retnl( 0 ); +#endif } /* $DOC$ @@ -1185,7 +1193,15 @@ HARBOUR HB_MCOL( void ) HARBOUR HB_MROW( void ) { - hb_retnl( s_iMouseRow ); +#if defined(_WINDOWS_) || defined(WINNT) + #if ! defined(HARBOUR_USE_CRS_GTAPI) && ! defined(HARBOUR_USE_SLN_GTAPI) + hb_retnl( s_iMouseRow ); + #else + hb_retnl( 0 ); + #endif +#else + hb_retnl( 0 ); +#endif } /* $DOC$