From eefe474f982fdab5bcbc796ad41fadce3d332a91 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sun, 8 Feb 2009 17:07:38 +0000 Subject: [PATCH] 2009-02-08 18:06 UTC+0100 Viktor Szakats (harbour.01 syenar hu) * source/rtl/gtwvt/gtwvt.c * BYTE -> CHAR (Windows) * contrib/hbct/ctwin.c * contrib/hbct/ctwin.h + Added hb_ctwGetPosWindows() to find out which window is visible on a given physical screen coordinate. * make_b32.mak * make_gcc.mak * make_vc.mak * Formatting. * include/hbdefs.h + Added type HB_COLOR to replace current BYTE. * Minor formatting. * contrib/rddsql/sddfb/make_b32.bat * contrib/rddsql/sddfb/make_vc.bat * contrib/rddsql/sddmy/make_b32.bat * contrib/rddsql/sddmy/make_vc.bat * contrib/rddsql/sddpg/make_b32.bat * contrib/rddsql/sddpg/make_vc.bat * Minor cleanup. * source/vm/hvm.c * source/vm/memvars.c * Added varnames to prototypes. --- harbour/ChangeLog | 33 +++++++++++++++++++++-- harbour/contrib/hbct/ctwin.c | 17 ++++++++++++ harbour/contrib/hbct/ctwin.h | 1 + harbour/contrib/rddsql/sddfb/make_b32.bat | 1 - harbour/contrib/rddsql/sddfb/make_vc.bat | 1 - harbour/contrib/rddsql/sddmy/make_b32.bat | 1 - harbour/contrib/rddsql/sddmy/make_vc.bat | 1 - harbour/contrib/rddsql/sddpg/make_b32.bat | 1 - harbour/contrib/rddsql/sddpg/make_vc.bat | 1 - harbour/include/hbdefs.h | 33 ++++++++++++----------- harbour/make_b32.mak | 6 ++--- harbour/make_gcc.mak | 6 ++--- harbour/make_vc.mak | 6 ++--- harbour/source/rtl/gtwvt/gtwvt.c | 6 ++--- harbour/source/vm/hvm.c | 2 +- harbour/source/vm/memvars.c | 2 +- 16 files changed, 80 insertions(+), 38 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 8b7accfb83..5487b93dba 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -5,9 +5,39 @@ /* Use this format for the entry headers: YYYY-MM-DD HH:MM UTC[-|+]hhmm Your Full Name (your_email address) For example: - 2008-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org) + 2009-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org) */ +2009-02-08 18:06 UTC+0100 Viktor Szakats (harbour.01 syenar hu) + * source/rtl/gtwvt/gtwvt.c + * BYTE -> CHAR (Windows) + + * contrib/hbct/ctwin.c + * contrib/hbct/ctwin.h + + Added hb_ctwGetPosWindows() to find out which window + is visible on a given physical screen coordinate. + + * make_b32.mak + * make_gcc.mak + * make_vc.mak + * Formatting. + + * include/hbdefs.h + + Added type HB_COLOR to replace current BYTE. + * Minor formatting. + + * contrib/rddsql/sddfb/make_b32.bat + * contrib/rddsql/sddfb/make_vc.bat + * contrib/rddsql/sddmy/make_b32.bat + * contrib/rddsql/sddmy/make_vc.bat + * contrib/rddsql/sddpg/make_b32.bat + * contrib/rddsql/sddpg/make_vc.bat + * Minor cleanup. + + * source/vm/hvm.c + * source/vm/memvars.c + * Added varnames to prototypes. + 2009-02-07 02:15 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/source/rtl/fstemp.c * casting for C++ mode @@ -466,7 +496,6 @@ * config/lib.cf * removed unnecessary double quotes around TOP definition - 2009-02-06 00:05 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/include/hbstack.h * harbour/source/vm/estack.c diff --git a/harbour/contrib/hbct/ctwin.c b/harbour/contrib/hbct/ctwin.c index 8a1df9f55d..9dc484d221 100644 --- a/harbour/contrib/hbct/ctwin.c +++ b/harbour/contrib/hbct/ctwin.c @@ -2355,6 +2355,23 @@ int hb_ctwSwapWindows( int iWindow1, int iWindow2 ) return iResult; } +int hb_ctwGetPosWindow( int iRow, int iCol ) +{ + int iResult = -1; + PHB_GTCTW pCTW = hb_ctw_base(); + if( pCTW ) + { + if( iRow >= pCTW->iBoardTop && iRow <= pCTW->iBoardBottom && + iCol >= pCTW->iBoardLeft && iCol <= pCTW->iBoardRight ) + { + long lIndex = ( long ) iRow * pCTW->iMapWidth + iCol; + iResult = pCTW->pWindowMap[ lIndex ]; + } + hb_gt_BaseFree( pCTW->pGT ); + } + return iResult; +} + int hb_ctwLastKey( void ) { /* keyread() in CT3 uses 64512 bytes length buffer diff --git a/harbour/contrib/hbct/ctwin.h b/harbour/contrib/hbct/ctwin.h index f5cc7ffc08..b089eca970 100644 --- a/harbour/contrib/hbct/ctwin.h +++ b/harbour/contrib/hbct/ctwin.h @@ -91,6 +91,7 @@ extern int hb_ctwMoveWindow( int iWindow, int iRow, int iCol ); extern int hb_ctwCenterWindow( int iWindow, BOOL fCenter ); extern int hb_ctwAddWindowBox( int iWindow, UCHAR * szBox, int iColor ); extern int hb_ctwSwapWindows( int iWindow1, int iWindow2 ); +extern int hb_ctwGetPosWindow( int iRow, int iCol ); extern int hb_ctwLastKey( void ); HB_EXTERN_END diff --git a/harbour/contrib/rddsql/sddfb/make_b32.bat b/harbour/contrib/rddsql/sddfb/make_b32.bat index 4c663f6c77..6873d8145a 100644 --- a/harbour/contrib/rddsql/sddfb/make_b32.bat +++ b/harbour/contrib/rddsql/sddfb/make_b32.bat @@ -18,7 +18,6 @@ goto POST_EXIT :DIR_OK if "%HB_INC_FIREBIRD%" == "" set HB_INC_FIREBIRD=%HB_DIR_FIREBIRD%\include -set CFLAGS=-I"%HB_INC_FIREBIRD%" set _HB_DLL_NAME=fbclient set HB_MAKEFILE=..\..\mtpl_b32.mak set HB_ROOT = ..\..\.. diff --git a/harbour/contrib/rddsql/sddfb/make_vc.bat b/harbour/contrib/rddsql/sddfb/make_vc.bat index e5df0d5a14..b3a91e896a 100644 --- a/harbour/contrib/rddsql/sddfb/make_vc.bat +++ b/harbour/contrib/rddsql/sddfb/make_vc.bat @@ -18,7 +18,6 @@ goto POST_EXIT :DIR_OK if "%HB_INC_FIREBIRD%" == "" set HB_INC_FIREBIRD=%HB_DIR_FIREBIRD%\include -set CFLAGS=-I"%HB_INC_FIREBIRD%" set _HB_DLL_NAME=fbclient set HB_MAKEFILE=..\..\mtpl_b32.mak set HB_ROOT = ..\..\.. diff --git a/harbour/contrib/rddsql/sddmy/make_b32.bat b/harbour/contrib/rddsql/sddmy/make_b32.bat index 6c59a6ae0e..1be6e03d80 100644 --- a/harbour/contrib/rddsql/sddmy/make_b32.bat +++ b/harbour/contrib/rddsql/sddmy/make_b32.bat @@ -18,7 +18,6 @@ goto POST_EXIT :DIR_OK if "%HB_INC_MYSQL%" == "" set HB_INC_MYSQL=%HB_DIR_MYSQL%\include -set CFLAGS=-I"%HB_INC_MYSQL%" set _HB_DLL_NAME=libmySQL set _HB_DLL_DIR=%HB_DIR_MYSQL%\bin set HB_MAKEFILE=..\..\mtpl_b32.mak diff --git a/harbour/contrib/rddsql/sddmy/make_vc.bat b/harbour/contrib/rddsql/sddmy/make_vc.bat index 3b852b00ac..56c757a8dd 100644 --- a/harbour/contrib/rddsql/sddmy/make_vc.bat +++ b/harbour/contrib/rddsql/sddmy/make_vc.bat @@ -18,7 +18,6 @@ goto POST_EXIT :DIR_OK if "%HB_INC_MYSQL%" == "" set HB_INC_MYSQL=%HB_DIR_MYSQL%\include -set CFLAGS=-I"%HB_INC_MYSQL%" set _HB_DLL_NAME=libmySQL set HB_MAKEFILE=..\..\mtpl_b32.mak set HB_ROOT = ..\..\.. diff --git a/harbour/contrib/rddsql/sddpg/make_b32.bat b/harbour/contrib/rddsql/sddpg/make_b32.bat index 1d8d76fedf..5be6edafa5 100644 --- a/harbour/contrib/rddsql/sddpg/make_b32.bat +++ b/harbour/contrib/rddsql/sddpg/make_b32.bat @@ -18,7 +18,6 @@ goto POST_EXIT :DIR_OK if "%HB_INC_PGSQL%" == "" set HB_INC_PGSQL=%HB_DIR_PGSQL%\include -set CFLAGS=-I"%HB_INC_PGSQL%" set _HB_DLL_NAME=libpq set HB_MAKEFILE=..\..\mtpl_b32.mak set HB_ROOT = ..\..\.. diff --git a/harbour/contrib/rddsql/sddpg/make_vc.bat b/harbour/contrib/rddsql/sddpg/make_vc.bat index fde2b5a0bf..622e38c5bd 100644 --- a/harbour/contrib/rddsql/sddpg/make_vc.bat +++ b/harbour/contrib/rddsql/sddpg/make_vc.bat @@ -18,7 +18,6 @@ goto POST_EXIT :DIR_OK if "%HB_INC_PGSQL%" == "" set HB_INC_PGSQL=%HB_DIR_PGSQL%\include -set CFLAGS=-I"%HB_INC_PGSQL%" set _HB_DLL_NAME=libpq set HB_MAKEFILE=..\..\mtpl_b32.mak set HB_ROOT = ..\..\.. diff --git a/harbour/include/hbdefs.h b/harbour/include/hbdefs.h index 6405962891..239529b5e7 100644 --- a/harbour/include/hbdefs.h +++ b/harbour/include/hbdefs.h @@ -1288,6 +1288,7 @@ typedef SHORT HB_SYMBOLSCOPE; /* stores symbol's scope */ typedef BYTE HB_CHAR; typedef BYTE HB_ATTR; +typedef BYTE HB_COLOR; /* Some common character constants */ @@ -1310,21 +1311,21 @@ typedef BYTE HB_ATTR; #define HB_CHAR_SOFT1 ( ( char ) 141 ) #define HB_CHAR_SOFT2 ( ( char ) HB_CHAR_LF ) -#define HB_ISUPPER( c ) ( ( c ) >= 'A' && ( c ) <= 'Z' ) -#define HB_ISLOWER( c ) ( ( c ) >= 'a' && ( c ) <= 'z' ) -#define HB_TOUPPER( c ) ( ( c ) >= 'a' && ( c ) <= 'z' ? ( c ) - ( 'a' - 'A' ) : ( c ) ) -#define HB_TOLOWER( c ) ( ( c ) >= 'A' && ( c ) <= 'Z' ? ( c ) + ( 'a' - 'A' ) : ( c ) ) -#define HB_ISDIGIT( c ) ( ( c ) >= '0' && ( c ) <= '9' ) -#define HB_ISALPHA( c ) ( HB_ISUPPER( c ) || HB_ISLOWER( c ) ) -#define HB_ISALNUM( c ) ( HB_ISALPHA( c ) || HB_ISDIGIT( c ) ) -#define HB_ISXDIGIT( c ) ( HB_ISDIGIT(c) || \ - ( (c) >= 'A' && (c) <= 'F' ) || \ - ( (c) >= 'a' && (c) <= 'f' ) ) -#define HB_ISSPACE( c ) ( ( c ) == ' ' || \ - ( c ) == HB_CHAR_HT || \ - ( c ) == HB_CHAR_LF || \ - ( c ) == HB_CHAR_CR ) -#define HB_ISFIRSTIDCHAR( c ) ( HB_ISALPHA( c ) || ( c ) == '_' ) -#define HB_ISNEXTIDCHAR( c ) ( HB_ISFIRSTIDCHAR(c) || HB_ISDIGIT( c ) ) +#define HB_ISUPPER( c ) ( ( c ) >= 'A' && ( c ) <= 'Z' ) +#define HB_ISLOWER( c ) ( ( c ) >= 'a' && ( c ) <= 'z' ) +#define HB_TOUPPER( c ) ( ( c ) >= 'a' && ( c ) <= 'z' ? ( c ) - ( 'a' - 'A' ) : ( c ) ) +#define HB_TOLOWER( c ) ( ( c ) >= 'A' && ( c ) <= 'Z' ? ( c ) + ( 'a' - 'A' ) : ( c ) ) +#define HB_ISDIGIT( c ) ( ( c ) >= '0' && ( c ) <= '9' ) +#define HB_ISALPHA( c ) ( HB_ISUPPER( c ) || HB_ISLOWER( c ) ) +#define HB_ISALNUM( c ) ( HB_ISALPHA( c ) || HB_ISDIGIT( c ) ) +#define HB_ISXDIGIT( c ) ( HB_ISDIGIT(c) || \ + ( (c) >= 'A' && (c) <= 'F' ) || \ + ( (c) >= 'a' && (c) <= 'f' ) ) +#define HB_ISSPACE( c ) ( ( c ) == ' ' || \ + ( c ) == HB_CHAR_HT || \ + ( c ) == HB_CHAR_LF || \ + ( c ) == HB_CHAR_CR ) +#define HB_ISFIRSTIDCHAR( c ) ( HB_ISALPHA( c ) || ( c ) == '_' ) +#define HB_ISNEXTIDCHAR( c ) ( HB_ISFIRSTIDCHAR(c) || HB_ISDIGIT( c ) ) #endif /* HB_DEFS_H_ */ diff --git a/harbour/make_b32.mak b/harbour/make_b32.mak index f6bc488cc2..999bac4096 100644 --- a/harbour/make_b32.mak +++ b/harbour/make_b32.mak @@ -21,9 +21,9 @@ # NOTE: You can use these envvars to configure the make process: # (note that these are all optional) # -# HB_USER_CFLAGS - Extra C compiler options for libraries and for executables -# HB_USER_LDFLAGS - Extra linker options for libraries -# HB_USER_PRGFLAGS - Extra Harbour compiler options +# HB_USER_CFLAGS - Extra C compiler options for libraries and for executables +# HB_USER_LDFLAGS - Extra linker options for libraries +# HB_USER_PRGFLAGS - Extra Harbour compiler options # # HB_BUILD_DLL - If set to yes enables building harbour VM+RTL # dll in addition to normal static build diff --git a/harbour/make_gcc.mak b/harbour/make_gcc.mak index 81ba5c6137..19f97d5b38 100644 --- a/harbour/make_gcc.mak +++ b/harbour/make_gcc.mak @@ -21,9 +21,9 @@ # NOTE: You can use these envvars to configure the make process: # (note that these are all optional) # -# HB_USER_CFLAGS - Extra C compiler options for libraries and for executables -# HB_USER_LDFLAGS - Extra linker options for libraries -# HB_USER_PRGFLAGS - Extra Harbour compiler options +# HB_USER_CFLAGS - Extra C compiler options for libraries and for executables +# HB_USER_LDFLAGS - Extra linker options for libraries +# HB_USER_PRGFLAGS - Extra Harbour compiler options # # HB_BUILD_DLL - If set to yes enables building harbour VM+RTL # dll in addition to normal static build (currently not working) diff --git a/harbour/make_vc.mak b/harbour/make_vc.mak index d12b12dd03..808276d820 100644 --- a/harbour/make_vc.mak +++ b/harbour/make_vc.mak @@ -21,9 +21,9 @@ # NOTE: You can use these envvars to configure the make process: # (note that these are all optional) # -# HB_USER_CFLAGS - Extra C compiler options for libraries and for executables -# HB_USER_LDFLAGS - Extra linker options for libraries -# HB_USER_PRGFLAGS - Extra Harbour compiler options +# HB_USER_CFLAGS - Extra C compiler options for libraries and for executables +# HB_USER_LDFLAGS - Extra linker options for libraries +# HB_USER_PRGFLAGS - Extra Harbour compiler options # # HB_BUILD_DLL - If set to yes enables building harbour VM+RTL # dll in addition to normal static build diff --git a/harbour/source/rtl/gtwvt/gtwvt.c b/harbour/source/rtl/gtwvt/gtwvt.c index a998e82413..0982eb07ba 100644 --- a/harbour/source/rtl/gtwvt/gtwvt.c +++ b/harbour/source/rtl/gtwvt/gtwvt.c @@ -534,10 +534,10 @@ static void hb_gt_wvt_TranslateKey( PHB_GTWVT pWVT, int key, int shiftkey, int a static int hb_gt_wvt_key_ansi_to_oem( int c ) { - BYTE pszAnsi[ 2 ]; - BYTE pszOem[ 2 ]; + CHAR pszAnsi[ 2 ]; + CHAR pszOem[ 2 ]; - pszAnsi[ 0 ] = ( BYTE ) c; + pszAnsi[ 0 ] = ( CHAR ) c; pszAnsi[ 1 ] = 0; CharToOemBuffA( ( LPCSTR ) pszAnsi, ( LPSTR ) pszOem, 1 ); diff --git a/harbour/source/vm/hvm.c b/harbour/source/vm/hvm.c index d18b7dd0af..efb76bbc1a 100644 --- a/harbour/source/vm/hvm.c +++ b/harbour/source/vm/hvm.c @@ -124,7 +124,7 @@ static void hb_vmInstring( void ); /* check whether string 1 is contai static void hb_vmForTest( void ); /* test for end condition of for */ static void hb_vmSeqBlock( void ); /* set begin sequence WITH codeblock */ static void hb_vmWithObjectStart( void ); /* prepare WITH OBJECT block */ -static void hb_vmEnumStart( BYTE, BYTE ); /* prepare FOR EACH loop */ +static void hb_vmEnumStart( BYTE nVars, BYTE nDescend ); /* prepare FOR EACH loop */ static void hb_vmEnumNext( void ); /* increment FOR EACH loop counter */ static void hb_vmEnumPrev( void ); /* decrement FOR EACH loop counter */ static void hb_vmEnumEnd( void ); /* rewind the stack after FOR EACH loop counter */ diff --git a/harbour/source/vm/memvars.c b/harbour/source/vm/memvars.c index ea326ef3bf..cf5121cb1b 100644 --- a/harbour/source/vm/memvars.c +++ b/harbour/source/vm/memvars.c @@ -100,7 +100,7 @@ struct mv_memvarArray_info int iScope; }; -static void hb_memvarCreateFromDynSymbol( PHB_DYNS, BYTE, PHB_ITEM ); +static void hb_memvarCreateFromDynSymbol( PHB_DYNS pDynVar, BYTE bScope, PHB_ITEM pValue ); static PHB_ITEM hb_memvarValueNew( void ) {