diff --git a/harbour/ChangeLog b/harbour/ChangeLog index fe194da754..0da243eacd 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,20 @@ The license applies to all entries newer than 2009-04-28. */ +2012-11-14 02:27 UTC+0100 Viktor Szakats (harbour syenar.net) + * ChangeLog + * another note missed, this time from 2012-11-13 19:00 UTC+0100 + (FI_SETOUTPUTMESSAGE() gained MT support.) + + * config/postinst.hb + * utils/hbmk2/hbmk2.prg + * use HB_DEFAULT() instead of 'IF ! HB_IS*()' + + * contrib/hbgd/gdchart.prg + + use HB_DEFAULT() instead of __DEFAULTNIL() after + verifying that in no case they are expecting multiple + types. + 2012-11-14 01:58 UTC+0100 Viktor Szakats (harbour syenar.net) * ChangeLog * added a missed incompatibity note to previous entry. @@ -108,7 +122,8 @@ * contrib/hbfimage/tests/fitest.prg ! FI_SETOUTPUTMESSAGE(): fixed/implemented error callback. In previous version it was not working. Now the function - accepts both function pointer and codeblock. + accepts both function pointer and codeblock. Also + fixed for MT apps. * adapted/fixed error callback setting in test + added test for error callback diff --git a/harbour/config/postinst.hb b/harbour/config/postinst.hb index d273342ca4..3c4c42bbd5 100644 --- a/harbour/config/postinst.hb +++ b/harbour/config/postinst.hb @@ -404,9 +404,7 @@ STATIC PROCEDURE mk_hb_FCopy( cSrc, cDst, l644 ) LOCAL cDir, cName, cExt - IF ! HB_ISLOGICAL( l644 ) - l644 := .F. - ENDIF + hb_default( @l644, .F. ) cSrc := hb_DirSepToOS( cSrc ) cDst := hb_DirSepToOS( cDst ) diff --git a/harbour/contrib/hbgd/gdchart.prg b/harbour/contrib/hbgd/gdchart.prg index e119093449..da0f07199f 100644 --- a/harbour/contrib/hbgd/gdchart.prg +++ b/harbour/contrib/hbgd/gdchart.prg @@ -89,8 +89,8 @@ ENDCLASS METHOD New( sx, sy ) CLASS GDChart - __defaultNIL( @sx, 320 ) - __defaultNIL( @sy, 200 ) + hb_default( @sx, 320 ) + hb_default( @sy, 200 ) ::cTitle := "Chart" ::aSeries := {} @@ -154,10 +154,10 @@ METHOD PieChart() CLASS GDChart nWidth := __HGetValue( hDefs, "WIDTH" ) cFontPitch := __HGetValue( hDefs, "FONTPITCH" ) - __defaultNIL( @x , ::CenterWidth() ) - __defaultNIL( @y , ::CenterHeight() ) - __defaultNIL( @nWidth , Min( ::Width(), ::Height() ) ) - __defaultNIL( @cFontPitch, "TINY" ) + hb_default( @x , ::CenterWidth() ) + hb_default( @y , ::CenterHeight() ) + hb_default( @nWidth , Min( ::Width(), ::Height() ) ) + hb_default( @cFontPitch, "TINY" ) DO CASE CASE cFontPitch == "TINY" @@ -201,9 +201,9 @@ METHOD PieChart() CLASS GDChart colorp := __HGetValue( hElement, "COLOR" ) nVal := hElement[ "VALUE" ] nDim := 360 * ( ( nVal / nTot ) * 100 ) / 100 - __defaultNIL( @lFilled , .F. ) - __defaultNIL( @nExtrude, 0 ) - __defaultNIL( @colorp , ::SetColor( 0, 0, 0 ) ) + hb_default( @lFilled, .F. ) + hb_default( @nExtrude, 0 ) + hb_default( @colorp, ::SetColor( 0, 0, 0 ) ) IF lExtruded nPosX := x + nExtrude * Cos( ::Radians( nDegree + nDim / 2 ) ) nPosY := y + nExtrude * Sin( ::Radians( nDegree + nDim / 2 ) ) @@ -237,9 +237,9 @@ METHOD PieChart() CLASS GDChart nPitch := __HGetValue( hFont, "PITCH" ) nAngle := __HGetValue( hFont, "ANGLE" ) textcolor := __HGetValue( hFont, "COLOR" ) - __defaultNIL( @cFontName, "Arial" ) - __defaultNIL( @nPitch , 8 ) - __defaultNIL( @nAngle , 0 ) + hb_default( @cFontName, "Arial" ) + hb_default( @nPitch , 8 ) + hb_default( @nAngle , 0 ) ENDIF nPosX := nPosX + ( ( nExtrude + nWidth ) / 4 ) * Cos( ::Radians( nDegree + nDim / 2 ) ) nPosY := nPosY + ( ( nExtrude + nWidth ) / 4 ) * Sin( ::Radians( nDegree + nDim / 2 ) ) @@ -300,17 +300,17 @@ METHOD VerticalBarChart() CLASS GDChart cAxisPict := __HGetValue( hDefs, "AXISPICT" ) cFontPitch := __HGetValue( hDefs, "FONTPITCH" ) - __defaultNIL( @x , 0 ) - __defaultNIL( @y , 0 ) - __defaultNIL( @nWidth , ::Width() ) - __defaultNIL( @nHeight , ::Height() ) - __defaultNIL( @color , ::GetColor() ) - __defaultNIL( @lShowAxis , .T. ) - __defaultNIL( @lShowGrid , .T. ) - __defaultNIL( @cAxisPict , "@E 9,999.99" ) - __defaultNIL( @cFontPitch, "TINY" ) + hb_default( @x , 0 ) + hb_default( @y , 0 ) + hb_default( @nWidth , ::Width() ) + hb_default( @nHeight , ::Height() ) + hb_default( @color , ::GetColor() ) + hb_default( @lShowAxis , .T. ) + hb_default( @lShowGrid , .T. ) + hb_default( @cAxisPict , "@E 9,999.99" ) + hb_default( @cFontPitch, "TINY" ) - __defaultNIL( @nBorder, 4 ) + hb_default( @nBorder, 4 ) /* hData := ["TITLE"], ["VALUE"], ["FILLED"], ["COLOR"], ["TILE"], ["EXTRUDE"] @@ -330,7 +330,6 @@ METHOD VerticalBarChart() CLASS GDChart ENDCASE - // Before sum of values to determine perentual nMaxLabel := 0 nMax := 0 @@ -355,7 +354,7 @@ METHOD VerticalBarChart() CLASS GDChart nBottomLabelSpace := nBorder + nMaxLabel * ::GetFontWidth() + nBorder ENDIF - __defaultNIL( @nMaxValue, nMax ) + hb_default( @nMaxValue, nMax ) IF lShowAxis IF lShowLabelLeft @@ -428,12 +427,13 @@ METHOD VerticalBarChart() CLASS GDChart nVal := hElement[ "VALUE" ] nDim := ( nVal / nMaxValue ) * nHeight - __defaultNIL( @lFilled , .F. ) - // __defaultNIL( @nExtrude, 0 ) - __defaultNIL( @colorp , ::SetColor( 0, 0, 0 ) ) + hb_default( @lFilled, .F. ) + // hb_default( @nExtrude, 0 ) + hb_default( @colorp, ::SetColor( 0, 0, 0 ) ) nPosX := x + ( nSize * ( hElement:__enumIndex() - 1 ) ) nPosY := y + IF pTile != NIL ::SetTile( pTile ) colorp := gdTiled @@ -493,17 +493,17 @@ METHOD HorizontalBarChart() CLASS GDChart cAxisPict := __HGetValue( hDefs, "AXISPICT" ) cFontPitch := __HGetValue( hDefs, "FONTPITCH" ) - __defaultNIL( @x , 0 ) - __defaultNIL( @y , 0 ) - __defaultNIL( @nWidth , ::Width() ) - __defaultNIL( @nHeight , ::Height() ) - __defaultNIL( @color , ::GetColor() ) - __defaultNIL( @lShowAxis , .T. ) - __defaultNIL( @lShowGrid , .T. ) - __defaultNIL( @cAxisPict , "@E 9,999.99" ) - __defaultNIL( @cFontPitch, "TINY" ) + hb_default( @x , 0 ) + hb_default( @y , 0 ) + hb_default( @nWidth , ::Width() ) + hb_default( @nHeight , ::Height() ) + hb_default( @color , ::GetColor() ) + hb_default( @lShowAxis , .T. ) + hb_default( @lShowGrid , .T. ) + hb_default( @cAxisPict , "@E 9,999.99" ) + hb_default( @cFontPitch, "TINY" ) - __defaultNIL( @nBorder, 4 ) + hb_default( @nBorder, 4 ) /* hData := ["TITLE"], ["VALUE"], ["FILLED"], ["COLOR"], ["TILE"], ["EXTRUDE"] @@ -549,7 +549,7 @@ METHOD HorizontalBarChart() CLASS GDChart nBottomLabelSpace := nTopLabelSpace // nBorder + ::GetFontHeight() + nBorder ENDIF - __defaultNIL( @nMaxValue, nMax ) + hb_default( @nMaxValue, nMax ) IF lShowAxis IF lShowLabelLeft @@ -621,9 +621,9 @@ METHOD HorizontalBarChart() CLASS GDChart colorp := __HGetValue( hElement, "COLOR" ) nVal := hElement[ "VALUE" ] nDim := ( nVal / nMaxValue ) * nWidth - __defaultNIL( @lFilled , .F. ) - // __defaultNIL( @nExtrude, 0 ) - __defaultNIL( @colorp , ::SetColor( 0, 0, 0 ) ) + hb_default( @lFilled, .F. ) + // hb_default( @nExtrude, 0 ) + hb_default( @colorp, ::SetColor( 0, 0, 0 ) ) nPosX := x nPosY := y + ( nSize * ( hElement:__enumIndex() - 1 ) ) @@ -689,17 +689,17 @@ METHOD LineChart() CLASS GDChart cAxisPict := __HGetValue( hDefs, "AXISPICT" ) cFontPitch := __HGetValue( hDefs, "FONTPITCH" ) - __defaultNIL( @x , 0 ) - __defaultNIL( @y , 0 ) - __defaultNIL( @nWidth , ::Width() ) - __defaultNIL( @nHeight , ::Height() ) - __defaultNIL( @colorp , ::GetColor() ) - __defaultNIL( @lShowAxis , .T. ) - __defaultNIL( @lShowGrid , .T. ) - __defaultNIL( @cAxisPict , "@E 9,999.99" ) - __defaultNIL( @cFontPitch, "TINY" ) + hb_default( @x , 0 ) + hb_default( @y , 0 ) + hb_default( @nWidth , ::Width() ) + hb_default( @nHeight , ::Height() ) + hb_default( @colorp , ::GetColor() ) + hb_default( @lShowAxis , .T. ) + hb_default( @lShowGrid , .T. ) + hb_default( @cAxisPict , "@E 9,999.99" ) + hb_default( @cFontPitch, "TINY" ) - __defaultNIL( @nBorder, 4 ) + hb_default( @nBorder, 4 ) /* hData := ["TITLE"], ["VALUE"], ["FILLED"], ["COLOR"], ["TILE"], ["EXTRUDE"] @@ -754,8 +754,8 @@ METHOD LineChart() CLASS GDChart nBottomLabelSpace := nBorder + nMaxLabel * ::GetFontWidth() + nBorder ENDIF - __defaultNIL( @nMaxValue, nMax ) - __defaultNIL( @nMinValue, nMin ) + hb_default( @nMaxValue, nMax ) + hb_default( @nMinValue, nMin ) IF lShowAxis IF lShowLabelLeft @@ -855,12 +855,13 @@ METHOD LineChart() CLASS GDChart nVal := hElement[ "VALUE" ] nDim := ( ( nVal + Abs( nMinValue ) ) / nTotRange ) * nHeight - // __defaultNIL( @lFilled, .F. ) - // __defaultNIL( @nExtrude, 0 ) - __defaultNIL( @colorp, ::SetColor( 0, 0, 0 ) ) + // hb_default( @lFilled, .F. ) + // hb_default( @nExtrude, 0 ) + hb_default( @colorp, ::SetColor( 0, 0, 0 ) ) nPosX := x + ( nSize * ( hElement:__enumIndex() - 1 ) ) nPosY := y + IF pTile != NIL ::SetTile( pTile ) colorp := gdTiled diff --git a/harbour/utils/hbmk2/hbmk2.prg b/harbour/utils/hbmk2/hbmk2.prg index 25baa6c704..0498c5faea 100644 --- a/harbour/utils/hbmk2/hbmk2.prg +++ b/harbour/utils/hbmk2/hbmk2.prg @@ -8880,9 +8880,7 @@ FUNCTION hbmk_ArrayToList( array, cSeparator ) LOCAL cString := "" LOCAL tmp - IF ! HB_ISSTRING( cSeparator ) - cSeparator := " " - ENDIF + hb_default( @cSeparator, " " ) FOR tmp := 1 TO Len( array ) cString += array[ tmp ] @@ -9034,9 +9032,7 @@ FUNCTION hbmk_AddInput_INSTFILE( ctx, cFileName, cGroup ) LOCAL hbmk := ctx_to_hbmk( ctx ) IF hbmk != NIL .AND. HB_ISSTRING( cFileName ) - IF ! HB_ISSTRING( cGroup ) - cGroup := "" - ENDIF + hb_default( @cGroup, "" ) AAddNewINST( hbmk[ _HBMK_aINSTFILE ], { cGroup, PathSepToSelf( cFileName ) } ) ENDIF @@ -9553,9 +9549,7 @@ STATIC FUNCTION PathSepToSelf( cFileName, nStart ) STATIC FUNCTION PathSepToTarget( hbmk, cFileName, nStart ) - IF ! HB_ISNUMERIC( nStart ) - nStart := 1 - ENDIF + hb_default( @nStart, 1 ) IF HBMK_ISPLAT( "win|wce|dos|os2" ) .AND. ! HBMK_ISCOMP( "mingw|mingw64|mingwarm" ) RETURN Left( cFileName, nStart - 1 ) + StrTran( SubStr( cFileName, nStart ), "/", "\" ) @@ -9567,18 +9561,15 @@ STATIC FUNCTION FNameEscape( cFileName, nEscapeMode, nFNNotation ) LOCAL cDir, cName, cExt, cDrive - IF ! HB_ISNUMERIC( nEscapeMode ) - nEscapeMode := _ESC_NONE - ENDIF - IF ! HB_ISNUMERIC( nFNNotation ) + hb_default( @nEscapeMode, _ESC_NONE ) + #if defined( __PLATFORM__WINDOWS ) .OR. ; defined( __PLATFORM__DOS ) .OR. ; defined( __PLATFORM__OS2 ) - nFNNotation := _FNF_BCKSLASH + hb_default( @nFNNotation, _FNF_BCKSLASH ) #else - nFNNotation := _FNF_FWDSLASH + hb_default( @nFNNotation, _FNF_FWDSLASH ) #endif - ENDIF SWITCH nFNNotation CASE _FNF_BCKSLASH @@ -10824,9 +10815,7 @@ STATIC FUNCTION MacroGet( hbmk, cMacro, cFileName ) ENDIF ENDSWITCH - IF ! HB_ISSTRING( cMacro ) - cMacro := "" - ENDIF + hb_default( @cMacro, "" ) RETURN cMacro @@ -11252,9 +11241,9 @@ STATIC FUNCTION rtlnk_process( hbmk, cCommands, cFileOut, aFileList, aLibList, ; cCommands := StrTran( StrTran( cCommands, Chr( 13 ) ), "//", "# " ) nMode := RTLNK_MODE_NONE - IF ! HB_ISARRAY( aPrevFiles ) - aPrevFiles := {} - ENDIF + + hb_default( @aPrevFiles, {} ) + FOR EACH cLine IN hb_ATokens( cCommands, Chr( 10 ) ) cLine := AllTrim( cLine ) IF ! Empty( cLine ) @@ -13745,9 +13734,8 @@ FUNCTION hbshell_ProgName() FUNCTION hbshell_gtSelect( cGT ) - IF ! HB_ISSTRING( cGT ) - cGT := __hbshell_gtDefault() - ENDIF + hb_default( @cGT, __hbshell_gtDefault() ) + IF !( "GT" + hb_gtVersion( 0 ) == cGT ) hb_gtSelect( hb_gtCreate( cGT ) ) hb_SetTermCP( hb_cdpTerm() )