From 9744fb04fd270ff426287474dcc0097962408f9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20Czerpak?= Date: Mon, 16 Jan 2023 14:35:47 +0100 Subject: [PATCH] 2023-01-16 14:35 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) * contrib/hbwin/wapi_shellapi.c ! replaced struct = { 0 } with memset( &struct, 0, sizeof( struct ) ) Such BCC syntax does not clear the whole structure body in most of other C compilers. * src/pp/hbpp.c ! fixed compilation for compilers using "i64" to format long long numbers, thanks to Toninho for the information. --- ChangeLog.txt | 10 ++++++++++ contrib/hbwin/wapi_shellapi.c | 10 ++++++---- src/pp/hbpp.c | 2 +- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index f56935782a..d2b73e95ab 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -7,6 +7,16 @@ Entries may not always be in chronological/commit order. See license at the end of file. */ +2023-01-16 14:35 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) + * contrib/hbwin/wapi_shellapi.c + ! replaced struct = { 0 } with memset( &struct, 0, sizeof( struct ) ) + Such BCC syntax does not clear the whole structure body in most of + other C compilers. + + * src/pp/hbpp.c + ! fixed compilation for compilers using "i64" to format long long numbers, + thanks to Toninho for the information. + 2023-01-15 11:17 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) * contrib/hbwin/win_prn1.c ! fixed parameter type in font enum callback diff --git a/contrib/hbwin/wapi_shellapi.c b/contrib/hbwin/wapi_shellapi.c index b3bd1f7419..cb96925791 100644 --- a/contrib/hbwin/wapi_shellapi.c +++ b/contrib/hbwin/wapi_shellapi.c @@ -85,8 +85,10 @@ HB_FUNC( WAPI_SHELLEXECUTE_WAIT ) void * hDirectory; BOOL retVal; MSG msg; - SHELLEXECUTEINFO ShExecInfo = {0}; - ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO); + SHELLEXECUTEINFO ShExecInfo; + + memset( &ShExecInfo, 0, sizeof( ShExecInfo ) ); + ShExecInfo.cbSize = sizeof( SHELLEXECUTEINFO ); ShExecInfo.fMask = SEE_MASK_NOCLOSEPROCESS; ShExecInfo.hwnd = ( HWND ) hb_parptr( 1 ); ShExecInfo.lpVerb = HB_PARSTR( 2, &hOperation, NULL ); @@ -95,9 +97,9 @@ HB_FUNC( WAPI_SHELLEXECUTE_WAIT ) ShExecInfo.lpDirectory = HB_PARSTR( 5, &hDirectory, NULL ); ShExecInfo.nShow = hb_parnidef( 6, SW_SHOWNORMAL ); ShExecInfo.hInstApp = NULL; - retVal = ShellExecuteEx(&ShExecInfo); + retVal = ShellExecuteEx( &ShExecInfo ); hb_retl( retVal ); - while( WaitForSingleObject(ShExecInfo.hProcess,1000) != WAIT_OBJECT_0 ) + while( WaitForSingleObject( ShExecInfo.hProcess, 1000 ) != WAIT_OBJECT_0 ) { while( PeekMessage( &msg, ( HWND ) NULL, 0, 0, PM_REMOVE ) ) { diff --git a/src/pp/hbpp.c b/src/pp/hbpp.c index 39fbd98290..d7482aac98 100644 --- a/src/pp/hbpp.c +++ b/src/pp/hbpp.c @@ -350,7 +350,7 @@ static int hb_pp_generateVerInfo( char * szVerFile, " * and is covered by the same license as Harbour PP\n" " */\n\n" ); - fprintf( fout, "#define HB_VER_REVID %" PFHL "u" PFHL "u\n", nRevID ); + fprintf( fout, "#define HB_VER_REVID %" PFHL "ulu\n", nRevID ); if( szChangeLogID ) {