From 937d61640545d4eadd1b7137cbcde97d0c4be21d Mon Sep 17 00:00:00 2001 From: Przemyslaw Czerpak Date: Tue, 19 Jan 2010 08:42:19 +0000 Subject: [PATCH] 2010-01-19 09:40 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/src/pp/ppcore.c * pacified BCC warning * harbour/src/compiler/harbour.yyc * harbour/src/compiler/harbour.yyh * regenerated with patched bison to pacify BCC warnings * harbour/include/hbwinuni.h + added HB_ITEMCOPYSTR() macro * harbour/src/common/hbwince.c * redirected Beep() to MessageBeep() - it does not allow to set time and duration but should generate some default system voice signal - please test the results with real devices using WinCE/ Win Mobile TODO: New MinGW support LockFileEx() and UnlockFileEx() but they are part of coredll6 library not coredll. I guess it's designed to use with Windows Mobile 6.x. Add compile and link time support for it. TODO: Add link time support for MinGWCE and non ARM processors. New MinGWCE supports x86 compatible Intel CPUs for pocket devices. --- harbour/ChangeLog | 24 ++++++++++++++++++++++++ harbour/include/hbwinuni.h | 2 ++ harbour/src/common/hbwince.c | 31 ++++++++++++++++++------------- harbour/src/compiler/harbour.yyc | 16 ++++++++++++---- harbour/src/compiler/harbour.yyh | 5 ++++- harbour/src/pp/ppcore.c | 2 +- 6 files changed, 61 insertions(+), 19 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 80dada1a47..950eeecf6c 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,30 @@ past entries belonging to author(s): Viktor Szakats. */ +2010-01-19 09:40 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/src/pp/ppcore.c + * pacified BCC warning + + * harbour/src/compiler/harbour.yyc + * harbour/src/compiler/harbour.yyh + * regenerated with patched bison to pacify BCC warnings + + * harbour/include/hbwinuni.h + + added HB_ITEMCOPYSTR() macro + + * harbour/src/common/hbwince.c + * redirected Beep() to MessageBeep() - it does not allow to set + time and duration but should generate some default system voice + signal - please test the results with real devices using WinCE/ + Win Mobile + + TODO: New MinGW support LockFileEx() and UnlockFileEx() but they are + part of coredll6 library not coredll. I guess it's designed to + use with Windows Mobile 6.x. Add compile and link time support + for it. + TODO: Add link time support for MinGWCE and non ARM processors. + New MinGWCE supports x86 compatible Intel CPUs for pocket devices. + 2010-01-18 17:52 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) * contrib/hbqt/hbqt_base.cpp * contrib/hbqt/hbqt_hbevents.cpp diff --git a/harbour/include/hbwinuni.h b/harbour/include/hbwinuni.h index ce6a4c6e6c..3d479ff1e7 100644 --- a/harbour/include/hbwinuni.h +++ b/harbour/include/hbwinuni.h @@ -69,6 +69,7 @@ #define HB_ARRAYGETSTR( arr, n, phstr, plen ) hb_arrayGetStrU16( arr, n, HB_CDP_ENDIAN_NATIVE, phstr, plen ) #define HB_ARRAYSETSTR( arr, n, str ) hb_arraySetStrU16( arr, n, HB_CDP_ENDIAN_NATIVE, str ) #define HB_ARRAYSETSTRLEN( arr, n, str, len ) hb_arraySetStrLenU16( arr, n, HB_CDP_ENDIAN_NATIVE, str, len ) + #define HB_ITEMCOPYSTR( itm, str, len ) hb_itemCopyStrU16( itm, HB_CDP_ENDIAN_NATIVE, str, len ) #define HB_ITEMGETSTR( itm, phstr, plen ) hb_itemGetStrU16( itm, HB_CDP_ENDIAN_NATIVE, phstr, plen ) #define HB_ITEMPUTSTR( itm, str ) hb_itemPutStrU16( itm, HB_CDP_ENDIAN_NATIVE, str ) #define HB_ITEMPUTSTRLEN( itm, str, len ) hb_itemPutStrLenU16( itm, HB_CDP_ENDIAN_NATIVE, str, len ) @@ -83,6 +84,7 @@ #define HB_ARRAYGETSTR( arr, n, phstr, plen ) hb_arrayGetStr( arr, n, hb_setGetOSCP(), phstr, plen ) #define HB_ARRAYSETSTR( arr, n, str ) hb_arraySetStr( arr, n, hb_setGetOSCP(), str ) #define HB_ARRAYSETSTRLEN( arr, n, str, len ) hb_arraySetStrLen( arr, n, hb_setGetOSCP(), str, len ) + #define HB_ITEMCOPYSTR( itm, str, len ) hb_itemCopyStr( itm, hb_setGetOSCP(), str, len ) #define HB_ITEMGETSTR( itm, phstr, plen ) hb_itemGetStr( itm, hb_setGetOSCP(), phstr, plen ) #define HB_ITEMPUTSTR( itm, str ) hb_itemPutStr( itm, hb_setGetOSCP(), str ) #define HB_ITEMPUTSTRLEN( itm, str, len ) hb_itemPutStrLen( itm, hb_setGetOSCP(), str, len ) diff --git a/harbour/src/common/hbwince.c b/harbour/src/common/hbwince.c index 38869f4e04..16cf55328b 100644 --- a/harbour/src/common/hbwince.c +++ b/harbour/src/common/hbwince.c @@ -228,6 +228,21 @@ BOOL WINAPI LockFile( HANDLE hFile, return TRUE; } +BOOL WINAPI UnlockFile( HANDLE hFile, + DWORD dwFileOffsetLow, DWORD dwFileOffsetHigh, + DWORD nNumberOfBytesToUnlockLow, DWORD nNumberOfBytesToUnlockHigh ) +{ + HB_SYMBOL_UNUSED( hFile ); + HB_SYMBOL_UNUSED( dwFileOffsetLow ); + HB_SYMBOL_UNUSED( dwFileOffsetHigh ); + HB_SYMBOL_UNUSED( nNumberOfBytesToUnlockLow ); + HB_SYMBOL_UNUSED( nNumberOfBytesToUnlockHigh ); + + return TRUE; +} + +/* LockFileEx() and UnlockFileEx() functions are present in COREDLL6 + */ BOOL WINAPI LockFileEx( HANDLE hFile, DWORD dwFlags, DWORD dwReserved, DWORD nNumberOfBytesToLockLow, @@ -243,19 +258,6 @@ BOOL WINAPI LockFileEx( HANDLE hFile, return TRUE; } -BOOL WINAPI UnlockFile( HANDLE hFile, - DWORD dwFileOffsetLow, DWORD dwFileOffsetHigh, - DWORD nNumberOfBytesToUnlockLow, DWORD nNumberOfBytesToUnlockHigh ) -{ - HB_SYMBOL_UNUSED( hFile ); - HB_SYMBOL_UNUSED( dwFileOffsetLow ); - HB_SYMBOL_UNUSED( dwFileOffsetHigh ); - HB_SYMBOL_UNUSED( nNumberOfBytesToUnlockLow ); - HB_SYMBOL_UNUSED( nNumberOfBytesToUnlockHigh ); - - return TRUE; -} - BOOL WINAPI UnlockFileEx( HANDLE hFile, DWORD dwReserved, DWORD nNumberOfBytesToUnlockLow, DWORD nNumberOfBytesToUnlockHigh, LPOVERLAPPED lpOverlapped ) @@ -269,6 +271,7 @@ BOOL WINAPI UnlockFileEx( HANDLE hFile, DWORD dwReserved, return TRUE; } + UINT WINAPI SetErrorMode( UINT mode ) { HB_SYMBOL_UNUSED( mode ); @@ -295,6 +298,8 @@ BOOL WINAPI Beep( DWORD dwFreq, DWORD dwDurat ) HB_SYMBOL_UNUSED( dwFreq ); HB_SYMBOL_UNUSED( dwDurat ); + MessageBeep( 0xFFFFFFFF ); + return FALSE; } diff --git a/harbour/src/compiler/harbour.yyc b/harbour/src/compiler/harbour.yyc index d27e6fc0b2..839696ea82 100644 --- a/harbour/src/compiler/harbour.yyc +++ b/harbour/src/compiler/harbour.yyc @@ -4046,6 +4046,7 @@ yydestruct (yymsg, yytype, yyvaluep, pComp) if (!yymsg) yymsg = "Deleting"; + YYUSE (yymsg); YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); switch (yytype) @@ -4053,12 +4054,12 @@ yydestruct (yymsg, yytype, yyvaluep, pComp) case 19: /* "LITERAL" */ #line 281 "harbour.y" { if( (yyvaluep->valChar).dealloc ) hb_xfree( (yyvaluep->valChar).string ); }; -#line 4057 "harboury.c" +#line 4058 "harboury.c" break; case 96: /* "CBSTART" */ #line 280 "harbour.y" { if( (yyvaluep->asCodeblock).string ) hb_xfree( (yyvaluep->asCodeblock).string ); }; -#line 4062 "harboury.c" +#line 4063 "harboury.c" break; default: @@ -4244,6 +4245,7 @@ int yynerrs; goto yyexhaustedlab; YYSTACK_RELOCATE (yyss); YYSTACK_RELOCATE (yyvs); + YYUSE (yyptr); # undef YYSTACK_RELOCATE if (yyss1 != yyssa) @@ -6942,8 +6944,8 @@ yyreduce: break; -/* Line 1267 of yacc.c. */ -#line 6947 "harboury.c" +/* Line 1268 of yacc.c. */ +#line 6949 "harboury.c" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); @@ -6978,6 +6980,7 @@ yyerrlab: if (!yyerrstatus) { ++yynerrs; + YYUSE (yynerrs); #if ! YYERROR_VERBOSE yyerror (pComp, YY_("syntax error")); #else @@ -7044,13 +7047,16 @@ yyerrlab: /*---------------------------------------------------. | yyerrorlab -- error raised explicitly by YYERROR. | `---------------------------------------------------*/ +#ifndef NO_YYERROR yyerrorlab: /* Pacify compilers like GCC when the user code never invokes YYERROR and the label yyerrorlab therefore never appears in user code. */ +#if ! defined( __BORLANDC__ ) && ! defined( __WATCOMC__ ) if (/*CONSTCOND*/ 0) goto yyerrorlab; +#endif /* Do not reclaim the symbols of the rule which action triggered this YYERROR. */ @@ -7059,6 +7065,7 @@ yyerrorlab: YY_STACK_PRINT (yyss, yyssp); yystate = *yyssp; goto yyerrlab1; +#endif /* NO_YYERROR */ /*-------------------------------------------------------------. @@ -8059,3 +8066,4 @@ void yyerror( HB_COMP_DECL, const char * s ) else hb_compGenError( HB_COMP_PARAM, hb_comp_szErrors, 'E', HB_COMP_ERR_YACC, s, HB_COMP_PARAM->pLex->lasttok ); } + diff --git a/harbour/src/compiler/harbour.yyh b/harbour/src/compiler/harbour.yyh index f74b495599..8359b96ec1 100644 --- a/harbour/src/compiler/harbour.yyh +++ b/harbour/src/compiler/harbour.yyh @@ -314,10 +314,13 @@ typedef union YYSTYPE } asMessage; PHB_VARTYPE asVarType; } -/* Line 1489 of yacc.c. */ +/* Line 1495 of yacc.c. */ #line 319 "harboury.h" YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_TRIVIAL 1 #endif + + + diff --git a/harbour/src/pp/ppcore.c b/harbour/src/pp/ppcore.c index 8d6ef022d7..b900b4737e 100644 --- a/harbour/src/pp/ppcore.c +++ b/harbour/src/pp/ppcore.c @@ -4270,7 +4270,7 @@ static void hb_pp_processCondDefined( PHB_PP_STATE pState, PHB_PP_TOKEN pToken ) if( pToken->value[ 0 ] == '_' ) { - const char * szSwitch = NULL; + const char * szSwitch; if( hb_pp_tokenValueCmp( pNext->pNext, "AUTOMEMVAR", HB_PP_CMP_DBASE ) ) szSwitch = "a";