From 6d7f1caa4d45d05bd3d8269ef134c38b18885dc1 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 5 Mar 2013 10:58:10 +0000 Subject: [PATCH] 2013-03-05 11:57 UTC+0100 Viktor Szakats (harbour syenar.net) * utils/hbmk2/hbmk2.prg + described internal/developer options in '-longhelp' * contrib/hbct/tempfile.prg ! TEMPFILE() to append a dirsep to parameter, when missing Thanks to Tony Quick for the report and fix suggestion (not required after 2013-03-05 11:53 UTC+0100, but I'm committing anyway to document this requirement in source code, and to make it work with low-level implementations that don't do it) * contrib/hbnf/fttext.c * minor cleanup to last modifications * contrib/hbnf/video2.prg * extras/hbxlsxml/xlsxml.prg % use hb_default() * contrib/hbnf/wda.prg * minor --- harbour/ChangeLog.txt | 24 +++++++++++++++++++++++- harbour/contrib/hbct/tempfile.prg | 4 ++++ harbour/contrib/hbnf/fttext.c | 3 +++ harbour/contrib/hbnf/video2.prg | 12 +++--------- harbour/contrib/hbnf/wda.prg | 3 +-- harbour/extras/hbxlsxml/xlsxml.prg | 16 ++++++---------- harbour/utils/hbmk2/hbmk2.prg | 20 ++++++++++++++++++++ 7 files changed, 60 insertions(+), 22 deletions(-) diff --git a/harbour/ChangeLog.txt b/harbour/ChangeLog.txt index 9f3a807af5..3bebd26843 100644 --- a/harbour/ChangeLog.txt +++ b/harbour/ChangeLog.txt @@ -6,10 +6,32 @@ YYYY-MM-DD HH:MM UTC[-|+]hhmm Your Full Name (your_email address) 2013-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org) See copyright/license at the end of the file. - Encoding: UTF-8 (No BOM) Notation (in 5th column): + Encoding: UTF-8 (No BOM) Notation (in 5th position): * Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment */ +2013-03-05 11:57 UTC+0100 Viktor Szakats (harbour syenar.net) + * utils/hbmk2/hbmk2.prg + + described internal/developer options in '-longhelp' + + * contrib/hbct/tempfile.prg + ! TEMPFILE() to append a dirsep to parameter, when missing + Thanks to Tony Quick for the report and fix suggestion + (not required after 2013-03-05 11:53 UTC+0100, but I'm + committing anyway to document this requirement in source code, + and to make it work with low-level implementations that + don't do it) + + * contrib/hbnf/fttext.c + * minor cleanup to last modifications + + * contrib/hbnf/video2.prg + * extras/hbxlsxml/xlsxml.prg + % use hb_default() + + * contrib/hbnf/wda.prg + * minor + 2013-03-05 11:53 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) * harbour/src/rtl/fstemp.c ! fixed hb_fsCreateTempEx() to add dir separator if necessary diff --git a/harbour/contrib/hbct/tempfile.prg b/harbour/contrib/hbct/tempfile.prg index aa3c3fe581..e1ae9b2303 100644 --- a/harbour/contrib/hbct/tempfile.prg +++ b/harbour/contrib/hbct/tempfile.prg @@ -57,6 +57,10 @@ FUNCTION TempFile( cDir, cExt, nAttr ) LOCAL cName LOCAL fhnd + IF HB_ISSTRING( cDir ) + cDir := hb_DirSepAdd( cDir ) + ENDIF + IF HB_ISSTRING( cExt ) .AND. !( Left( cExt, 1 ) == "." ) cExt := "." + cExt ENDIF diff --git a/harbour/contrib/hbnf/fttext.c b/harbour/contrib/hbnf/fttext.c index 16511d1d7f..2389a03c4f 100644 --- a/harbour/contrib/hbnf/fttext.c +++ b/harbour/contrib/hbnf/fttext.c @@ -855,6 +855,9 @@ static HB_ISIZ _findeol( char * buf, HB_ISIZ buf_len, HB_ISIZ * eol_len ) } } + if( eol_len ) + *eol_len = 0; + return 0; } diff --git a/harbour/contrib/hbnf/video2.prg b/harbour/contrib/hbnf/video2.prg index 404ddcdc8b..e335b5c759 100644 --- a/harbour/contrib/hbnf/video2.prg +++ b/harbour/contrib/hbnf/video2.prg @@ -52,24 +52,18 @@ FUNCTION ft_CLS( nTop, nLeft, nBottom, nRight, nColor ) - IF ! HB_ISNUMERIC( nColor ) - nColor := 0 - ENDIF + hb_default( @nColor, 0 ) RETURN hb_Scroll( nTop, nLeft, nBottom, nRight,,, nColor ) FUNCTION ft_VidStr( nRow, nCol, cString, nColor ) - IF ! HB_ISNUMERIC( nColor ) - nColor := 0 - ENDIF + hb_default( @nColor, 0 ) RETURN hb_DispOutAt( nRow, nCol, cString, nColor ) FUNCTION ft_WrtChr( nRow, nCol, cChar, nColor ) - IF ! HB_ISNUMERIC( nColor ) - nColor := 0 - ENDIF + hb_default( @nColor, 0 ) RETURN hb_DispOutAt( nRow, nCol, Left( cChar, 1 ), nColor ) diff --git a/harbour/contrib/hbnf/wda.prg b/harbour/contrib/hbnf/wda.prg index bd913723e3..62327af939 100644 --- a/harbour/contrib/hbnf/wda.prg +++ b/harbour/contrib/hbnf/wda.prg @@ -26,5 +26,4 @@ FUNCTION ft_AddWkDy( dStart, nDys ) RETURN iif( nDc == 7, ; ( nDys - 1 ) % 5 + 7 * Int( ( nDys - 1 ) / 5 ) + 2, ; - ( nDys + nDc - 2 ) % 5 + 7 * Int( ( nDys + nDc - 2 ) / 5 ) + 2 - nDc ; - ) + ( nDys + nDc - 2 ) % 5 + 7 * Int( ( nDys + nDc - 2 ) / 5 ) + 2 - nDc ) diff --git a/harbour/extras/hbxlsxml/xlsxml.prg b/harbour/extras/hbxlsxml/xlsxml.prg index 1956ee24ed..b32b20a0b2 100644 --- a/harbour/extras/hbxlsxml/xlsxml.prg +++ b/harbour/extras/hbxlsxml/xlsxml.prg @@ -113,21 +113,17 @@ METHOD ExcelWriterXML:new( fileName ) METHOD ExcelWriterXML:setOverwriteFile( overwrite ) - IF HB_ISLOGICAL( overwrite ) - ::overwriteFile := overwrite - ELSE - ::overwriteFile := .F. - ENDIF + hb_default( @overwrite, .F. ) + + ::overwriteFile := overwrite RETURN NIL METHOD ExcelWriterXML:showErrorSheet( show ) - IF HB_ISLOGICAL( show ) - ::lShowErrorSheet := show - ELSE - ::lShowErrorSheet := .T. - ENDIF + hb_default( @show, .T. ) + + ::lShowErrorSheet := show RETURN NIL diff --git a/harbour/utils/hbmk2/hbmk2.prg b/harbour/utils/hbmk2/hbmk2.prg index 2c2f1180a0..c9be11e53b 100644 --- a/harbour/utils/hbmk2/hbmk2.prg +++ b/harbour/utils/hbmk2/hbmk2.prg @@ -15673,6 +15673,22 @@ STATIC PROCEDURE ShowHelp( hbmk, lMore, lLong ) { "-build" , I_( "Harbour compiler build information" ) }, ; { "-version" , I_( "display version header only" ) } } + /* Internal option descriptions intentionally not marked as translatable */ + LOCAL aHdr_Opt_Internal := { ; + "", ; + "Options below are internal/developer ones (compatibility not guaranteed):" } + + /* Internal option descriptions intentionally not marked as translatable */ + LOCAL aLst_Opt_Internal := { ; + NIL, ; + { "-debugtime" , "measure time spent on the build" }, ; + { "-debuginc" , "display internals of incremental build" }, ; + { "-debugstub" , "display content of all internally generated source files" }, ; + { "-debugi18n" , "display internals on translation file generation" }, ; + { "-debugdepd" , "display internals of dependency detection" }, ; + { "-debugpars" , "display all input parameters in processing order" }, ; + { "-debugrte" , "generate a runtime error" } } + LOCAL aHdr_Opt_Self := { ; "", ; { "", hb_StrFormat( I_( "You can sym-link/copy/rename %1$s to the following names to alter default mode of operation:" ), _SELF_NAME_ ) } } @@ -16180,6 +16196,10 @@ STATIC PROCEDURE ShowHelp( hbmk, lMore, lLong ) AEval( aLst_Opt_Long, {| tmp | OutOpt( hbmk, tmp ) } ) AEval( aHdr_Opt_LongCmd, {| tmp | OutHdr( hbmk, tmp + _OUT_EOL ) } ) AEval( aLst_Opt_LongCmd, {| tmp | OutOpt( hbmk, tmp ) } ) + IF lLong + AEval( aHdr_Opt_Internal, {| tmp | OutHdr( hbmk, tmp + _OUT_EOL ) } ) + AEval( aLst_Opt_Internal, {| tmp | OutOpt( hbmk, tmp ) } ) + ENDIF AEval( aHdr_Opt_Self, {| tmp | OutOpt( hbmk, tmp, 0 ) } ) AEval( aLst_Opt_Self, {| tmp | OutOpt( hbmk, tmp ) } ) AEval( aHdr_File, {| tmp | OutHdr( hbmk, tmp + _OUT_EOL ) } )