From 42e8244ff040246b4d77d7000c2ba3fa8b4745b5 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 25 Jun 2010 18:52:12 +0000 Subject: [PATCH] 2010-06-25 20:51 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * external/patchup.prg + Added patch by Tamas Tevesz: - if rediffing, patchup will now proceed even if there's no DIFF. this helps when creating the very first diff. - new file name defaults to $(component).dif - if a rediff produces no result (no differences between upstream and hb), no zero-length .dif will be written, and a possibly pre-existing diff will be removed. there's still some room for improvement for patchup to articulate what it is doing, but hopefully not even the current one is confusing. + contrib/hbwin/hbwin.hbp + Added hbmk2 build file * contrib/hbwin/legacycd.c * contrib/hbwin/wapi_winbase.c * contrib/hbwin/win_evnt.c ! Fixed msvc cast warnings (when building using hbmk2) Two of them were long time notorious ones. --- harbour/ChangeLog | 21 +++++++++ harbour/contrib/hbwin/hbwin.hbp | 66 ++++++++++++++++++++++++++++ harbour/contrib/hbwin/legacycd.c | 2 +- harbour/contrib/hbwin/wapi_winbase.c | 2 +- harbour/contrib/hbwin/win_evnt.c | 2 +- harbour/external/patchup.prg | 34 ++++++++++---- 6 files changed, 115 insertions(+), 12 deletions(-) create mode 100644 harbour/contrib/hbwin/hbwin.hbp diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 99ebb59051..db844e5368 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,27 @@ The license applies to all entries newer than 2009-04-28. */ +2010-06-25 20:51 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * external/patchup.prg + + Added patch by Tamas Tevesz: + - if rediffing, patchup will now proceed even if there's no DIFF. this + helps when creating the very first diff. + - new file name defaults to $(component).dif + - if a rediff produces no result (no differences between upstream and + hb), no zero-length .dif will be written, and a possibly + pre-existing diff will be removed. + there's still some room for improvement for patchup to articulate what + it is doing, but hopefully not even the current one is confusing. + + + contrib/hbwin/hbwin.hbp + + Added hbmk2 build file + + * contrib/hbwin/legacycd.c + * contrib/hbwin/wapi_winbase.c + * contrib/hbwin/win_evnt.c + ! Fixed msvc cast warnings (when building using hbmk2) + Two of them were long time notorious ones. + 2010-06-25 19:25 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * external/png/Makefile ! Fixed one MAP entry. Patch by Tamas Tevesz. diff --git a/harbour/contrib/hbwin/hbwin.hbp b/harbour/contrib/hbwin/hbwin.hbp new file mode 100644 index 0000000000..b516866224 --- /dev/null +++ b/harbour/contrib/hbwin/hbwin.hbp @@ -0,0 +1,66 @@ +# +# $Id$ +# + +-hblib +-inc +-nohbc + +-o${hb_name} + +-w3 -es2 + +-stop{!allwin} + +-cflag=-DWIN32_LEAN_AND_MEAN + +-depkeyhead=png:png.h +-depcontrol=png:${HB_WITH_PNG} +-depincpath=png:/usr/include +-depincpath=png:/opt/local/include +-depincpathlocal=png:../../external/png + +axcore.c +legacycd.c +legacyco.c +legacycp.c +mapi.c +olecore.c +oleinit.c +hbolesrv.c +wapi_alloc.c +wapi_commctrl.c +wapi_err.c +wapi_mmsystem.c +wapi_shellapi.c +wapi_winbase.c +wapi_winbase_mutex.c +wapi_wingdi.c +wapi_wingdi_font.c +wapi_winnls.c +wapi_winuser.c +wce_simc.c +wce_smsc.c +win_bmp.c +win_bmpd.c +win_com.c +win_dlg.c +win_evnt.c +win_misc.c +win_osc.c +win_prn1.c +win_prn2.c +win_prn3.c +win_regc.c +win_shell.c +win_svc.c + +legacy.prg +oleauto.prg +axfunc.prg +wce_sim.prg +win_os.prg +win_reg.prg +win_tbmp.prg +win_tcom.prg +win_tprn.prg diff --git a/harbour/contrib/hbwin/legacycd.c b/harbour/contrib/hbwin/legacycd.c index 6200200820..c2a970d973 100644 --- a/harbour/contrib/hbwin/legacycd.c +++ b/harbour/contrib/hbwin/legacycd.c @@ -152,7 +152,7 @@ HB_FUNC( GETPROCADDRESS ) hb_xfree( pszFuncName ); } - hb_retptr( ( void * ) lpFunction ); + hb_retptr( ( void * ) ( HB_PTRDIFF ) lpFunction ); } else hb_retptr( NULL ); diff --git a/harbour/contrib/hbwin/wapi_winbase.c b/harbour/contrib/hbwin/wapi_winbase.c index 5a95728244..d31971fb00 100644 --- a/harbour/contrib/hbwin/wapi_winbase.c +++ b/harbour/contrib/hbwin/wapi_winbase.c @@ -229,7 +229,7 @@ HB_FUNC( WAPI_GETPROCADDRESS ) hb_parc( 2 ) : ( LPCSTR ) ( HB_PTRDIFF ) hb_parnint( 2 ) ); dwLastError = GetLastError(); hbwapi_SetLastError( dwLastError ); - hb_retptr( ( void * ) pProc ); + hb_retptr( ( void * ) ( HB_PTRDIFF ) pProc ); } /* HMODULE WINAPI GetModuleHandle( __in_opt LPCTSTR lpModuleName ); */ diff --git a/harbour/contrib/hbwin/win_evnt.c b/harbour/contrib/hbwin/win_evnt.c index 74c9c4b309..fa0c23aca0 100644 --- a/harbour/contrib/hbwin/win_evnt.c +++ b/harbour/contrib/hbwin/win_evnt.c @@ -114,7 +114,7 @@ HB_FUNC( WIN_REPORTEVENT ) hb_strfree( hStrings[ --wNumStrings ] ); hb_xfree( hStrings ); - hb_xfree( lpStrings ); + hb_xfree( ( void * ) lpStrings ); } DeregisterEventSource( hEventLog ); diff --git a/harbour/external/patchup.prg b/harbour/external/patchup.prg index 7be604ea17..de2c8ec89d 100644 --- a/harbour/external/patchup.prg +++ b/harbour/external/patchup.prg @@ -110,7 +110,14 @@ * If patchup is called with the `-rediff' command line argument, it switches * to a `local diff refresh' mode. This mode is used to refresh the local diff * after Harbour-specific modifications have been made to the component's - * source. + * source. In order to help with the initial diff creation, patchup will proceed + * even if no `DIFF' is specified amongst the meta data, and defaults to + * creating a diff named `$(component).dif'). + * + * If no differences between the original and the Harbour trees were found, + * a possibly pre-existing diff file is removed. Following this change up + * in the component's Makefile is left for the operator -- patchup will communicate + * if there is a likely need to perform this action. * * It is strongly advised not to try to mix the two modes. If there are any * pending local modifications, a rediff should be done before a component @@ -332,11 +339,6 @@ PROCEDURE Main( ... ) ENDIF NEXT - IF lRediff .AND. cDiffFile == NIL - OutStd( "Requested rediff mode with no local diff, nothing to do." + OSNL ) - QUIT - ENDIF - IF Empty( s_aChangeMap ) .AND. cDiffFile == NIL OutStd( "No file name changes and no local diff, nothing to do." + OSNL ) QUIT @@ -359,6 +361,11 @@ PROCEDURE Main( ... ) MakeDir( CombinePath( s_cTempDir, cThisComponent + ".orig" ) ) MakeDir( CombinePath( s_cTempDir, "root" ) ) + IF lRediff .AND. cDiffFile == NIL + OutStd( "Requested rediff mode with no existing local diff, attempting to create one." + OSNL ) + cDiffFile := cThisComponent + ".dif" + ENDIF + IF ! FetchAndExtract( cArchiveURL ) OutStd( "E: Fetching or extracting the source archive failed." + OSNL ) OutStd( " Inspect `" + s_cTempDir + "' for further clues." + OSNL ) @@ -435,9 +442,18 @@ PROCEDURE Main( ... ) SaveLog( "diff", NIL, cStdErr ) - nDiffFD := FCreate( cDiffFile ) - FWrite( nDiffFD, cDiffText ) - FClose( nDiffFD ) + IF Len( cDiffText ) > 0 + nDiffFD := FCreate( cDiffFile ) + FWrite( nDiffFD, cDiffText ) + FClose( nDiffFD ) + OutStd( "Local changes saved to `" + cDiffFile + "'; you may need to adjust `DIFF'." + OSNL ) + ELSE + OutStd( "No local changes; you may need to adjust `DIFF'." + OSNL ) + IF hb_FileExists( cDiffFile ) + FErase( cDiffFile ) + OutStd( "Removed existing `" + cDiffFile + "'." + OSNL ) + ENDIF + ENDIF ENDIF