diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 0efd15056b..37c3d1b95f 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,21 @@ The license applies to all entries newer than 2009-04-28. */ +2012-10-15 01:58 UTC+0200 Viktor Szakats (harbour syenar.net) + * contrib/gtwvg/genrc.prg + * contrib/gtwvg/tests/dyndlgs.prg + * contrib/gtwvg/tests/tbrowser.prg + * contrib/xhb/hbcomprs.prg + * src/debug/dbgtmenu.prg + * src/debug/debugger.prg + * tests/mt/mttest05.prg + * tests/mt/mttest12.prg + * renamed THREAD STATIC vars to start with 't_' + * minor formatting + + * tests/mousetst.prg + * END IF -> ENDIF + 2012-10-15 01:39 UTC+0200 Viktor Szakats (harbour syenar.net) * contrib/hbmisc/hb_f.c + added MT compatibility by moving static vars to a structure diff --git a/harbour/contrib/gtwvg/genrc.prg b/harbour/contrib/gtwvg/genrc.prg index cc36564dcc..40095632cd 100644 --- a/harbour/contrib/gtwvg/genrc.prg +++ b/harbour/contrib/gtwvg/genrc.prg @@ -76,15 +76,15 @@ // - THREAD STATIC s_oCrt := NIL +THREAD STATIC t_oCrt := NIL // - EXIT PROCEDURE KillGTChildren() +EXIT PROCEDURE KillGTChildren() - IF HB_ISOBJECT( s_oCrt ) .AND. __objGetClsName( s_oCrt ) == "WVGCRT" .AND. s_oCrt:isGT - s_oCrt:destroy() - s_oCrt := NIL + IF HB_ISOBJECT( t_oCrt ) .AND. __objGetClsName( t_oCrt ) == "WVGCRT" .AND. t_oCrt:isGT + t_oCrt:destroy() + t_oCrt := NIL ENDIF RETURN @@ -93,19 +93,19 @@ FUNCTION WvgSetAppWindow( oCrt ) - LOCAL ooCrt := s_oCrt + LOCAL ooCrt := t_oCrt IF Empty( oCrt ) - IF Empty( s_oCrt ) - s_oCrt := WvgCrt():new() - s_oCrt:hWnd := Wvt_GetWindowHandle() - s_oCrt:pWnd := Win_N2P( s_oCrt:hWnd ) - hb_gtInfo( HB_GTI_NOTIFIERBLOCKGUI, {| nEvent, ... | s_oCrt:notifier( nEvent, ... ) } ) - s_oCrt:isGT := .T. - RETURN s_oCrt + IF Empty( t_oCrt ) + t_oCrt := WvgCrt():new() + t_oCrt:hWnd := Wvt_GetWindowHandle() + t_oCrt:pWnd := Win_N2P( t_oCrt:hWnd ) + hb_gtInfo( HB_GTI_NOTIFIERBLOCKGUI, {| nEvent, ... | t_oCrt:notifier( nEvent, ... ) } ) + t_oCrt:isGT := .T. + RETURN t_oCrt ENDIF ELSE - s_oCrt := oCrt + t_oCrt := oCrt ENDIF RETURN ooCrt diff --git a/harbour/contrib/gtwvg/tests/dyndlgs.prg b/harbour/contrib/gtwvg/tests/dyndlgs.prg index 194afa6f38..c676380a27 100644 --- a/harbour/contrib/gtwvg/tests/dyndlgs.prg +++ b/harbour/contrib/gtwvg/tests/dyndlgs.prg @@ -142,7 +142,7 @@ FUNCTION DynDlgProc( hDlg, nMsg, wParam, lParam ) LOCAL lClicked, cPrompt, nIndex, hFont, aHFonts - Switch ( nMsg ) + SWITCH nMsg CASE WM_TIMER WVG_SetDlgItemText( hDlg, ID_EDT_TIME, Time() ) @@ -269,7 +269,7 @@ FUNCTION DynDlgProc( hDlg, nMsg, wParam, lParam ) /* cText := */ WVG_GetDlgItemText( hDlg, ID_MLE ) EXIT - END + ENDSWITCH RETURN 0 @@ -326,7 +326,7 @@ FUNCTION DlgSlideShow() FUNCTION DlgSlideShowProc( hDlg, nMsg, wParam, lParam ) - THREAD STATIC nSlide := 1 + THREAD STATIC t_nSlide := 1 HB_SYMBOL_UNUSED( wParam ) HB_SYMBOL_UNUSED( lParam ) @@ -334,22 +334,22 @@ FUNCTION DlgSlideShowProc( hDlg, nMsg, wParam, lParam ) SWITCH nMsg CASE WM_INITDIALOG - DrawSlide( hDlg, nSlide ) + DrawSlide( hDlg, t_nSlide ) EXIT CASE WM_PAINT - DrawSlide( hDlg, nSlide ) + DrawSlide( hDlg, t_nSlide ) EXIT CASE WM_TIMER - nSlide++ - IF nSlide > Len( t_aSlides ) - nSlide := 1 + t_nSlide++ + IF t_nSlide > Len( t_aSlides ) + t_nSlide := 1 ENDIF - DrawSlide( hDlg, nSlide ) + DrawSlide( hDlg, t_nSlide ) EXIT - END + ENDSWITCH RETURN 0 diff --git a/harbour/contrib/gtwvg/tests/tbrowser.prg b/harbour/contrib/gtwvg/tests/tbrowser.prg index 1ba8fa9bdc..4ad6300dca 100644 --- a/harbour/contrib/gtwvg/tests/tbrowser.prg +++ b/harbour/contrib/gtwvg/tests/tbrowser.prg @@ -79,8 +79,8 @@ FUNCTION ExecBrowser( oCrt ) STATIC nStyle := 0 - THREAD STATIC nFactor := 200 - THREAD STATIC lActiveX := .F. + THREAD STATIC t_nFactor := 200 + THREAD STATIC t_lActiveX := .F. IF oCrt == NIL cScr := SaveScreen( 0, 0, MaxRow(), MaxCol() ) @@ -151,7 +151,7 @@ FUNCTION ExecBrowser( oCrt ) hb_DispOutAt( oBrowse:nTop - 2, oBrowse:nleft - 2, PadC( cFileDbf, oBrowse:nRight - oBrowse:nLeft + 5 ), "W+/B*" ) oCom := BrwBuildActiveX( oCrt, oBrowse ) - oChk := BrwBuildCheckBox( oCrt, oBrowse, @lActiveX ) + oChk := BrwBuildCheckBox( oCrt, oBrowse, @t_lActiveX ) oSLE := BrwBuildSLE( oCrt, oBrowse ) aNvg := BrwBuildNvg( oCrt, oBrowse, oCom ) oLBx := BrwBuildListBox( oCrt, oBrowse ) @@ -176,12 +176,12 @@ FUNCTION ExecBrowser( oCrt ) DO CASE CASE nKey == K_F12 - nFactor-- - hb_gtInfo( HB_GTI_SPEC, HB_GTS_FACTOR, nFactor ) + t_nFactor-- + hb_gtInfo( HB_GTI_SPEC, HB_GTS_FACTOR, t_nFactor ) CASE nKey == K_F11 - nFactor++ - hb_gtInfo( HB_GTI_SPEC, HB_GTS_FACTOR, nFactor ) + t_nFactor++ + hb_gtInfo( HB_GTI_SPEC, HB_GTS_FACTOR, t_nFactor ) CASE nKey == K_F6 hb_gtInfo( HB_GTI_RESIZABLE, .F. ) @@ -208,10 +208,10 @@ FUNCTION ExecBrowser( oCrt ) CASE BrwHandleKey( oBrowse, nKey, @lEnd ) CASE nKey == HB_K_RESIZE - BrwHandleResize( oCrt, oBrowse, oVBar, oHBar, oCom, oSLE, oLBx, oTre, oChk, aNvg, oIdx, lActiveX, cFileDbf ) + BrwHandleResize( oCrt, oBrowse, oVBar, oHBar, oCom, oSLE, oLBx, oTre, oChk, aNvg, oIdx, t_lActiveX, cFileDbf ) ENDCASE - END + ENDDO Wvt_SetPen( 0 ) WvtSetBlocks( aLastPaint ) @@ -899,7 +899,7 @@ FUNCTION Vou_BrwSetVScroll( mp1, oBrowse ) STATIC FUNCTION BrwOnEvent( oWvtBrw, cPaintID, oBrowse, nKey ) - LOCAL lRet := .T. , lRefAll := .F. + LOCAL lRet := .T., lRefAll := .F. HB_SYMBOL_UNUSED( cPaintID ) diff --git a/harbour/contrib/xhb/hbcomprs.prg b/harbour/contrib/xhb/hbcomprs.prg index f65eb1a067..4cfc457f5e 100644 --- a/harbour/contrib/xhb/hbcomprs.prg +++ b/harbour/contrib/xhb/hbcomprs.prg @@ -54,7 +54,7 @@ #include "hbzlib.ch" -THREAD STATIC s_nLastError := HB_ZLIB_RES_OK +THREAD STATIC t_nLastError := HB_ZLIB_RES_OK /****** COMPRESSOR WRAPPER ***** * HB_COMPRESS( cSource [,nSourceLen ] ) --> cDest @@ -109,22 +109,22 @@ FUNCTION HB_COMPRESS( xPar1, xPar2, xPar3, xPar4, xPar5 ) IF lReturnByRef IF HB_ISNUMERIC( xPar1 ) - xPar4 := HB_ZCOMPRESS( cSource, nDestLen, @s_nLastError, nComprFactor ) + xPar4 := HB_ZCOMPRESS( cSource, nDestLen, @t_nLastError, nComprFactor ) IF ! HB_ISSTRING( xPar4 ) xPar4 := "" ENDIF xPar5 := Len( xPar4 ) ELSE - xPar3 := HB_ZCOMPRESS( cSource, nDestLen, @s_nLastError, nComprFactor ) + xPar3 := HB_ZCOMPRESS( cSource, nDestLen, @t_nLastError, nComprFactor ) IF ! HB_ISSTRING( xPar3 ) xPar3 := "" ENDIF xPar4 := Len( xPar3 ) ENDIF - RETURN s_nLastError + RETURN t_nLastError ENDIF - RETURN HB_ZCOMPRESS( cSource, nDestLen, @s_nLastError, nComprFactor ) + RETURN HB_ZCOMPRESS( cSource, nDestLen, @t_nLastError, nComprFactor ) /****** DECOMPRESSOR WRAPPER ***** * HB_UNCOMPRESS( nDestLen, cSource [, nSourceLen ] ) --> cDest @@ -153,17 +153,17 @@ FUNCTION HB_UNCOMPRESS( nDestLen, cSource, nSourceLen, /* @ */ cDest ) ENDIF IF PCount() >= 4 - cDest := HB_ZUNCOMPRESS( cSource, nDestLen, @s_nLastError ) - RETURN s_nLastError + cDest := HB_ZUNCOMPRESS( cSource, nDestLen, @t_nLastError ) + RETURN t_nLastError ENDIF - RETURN HB_ZUNCOMPRESS( cSource, nDestLen, @s_nLastError ) + RETURN HB_ZUNCOMPRESS( cSource, nDestLen, @t_nLastError ) /********************************* * HB_COMPRESSERROR() --> nError */ FUNCTION HB_COMPRESSERROR() - RETURN s_nLastError + RETURN t_nLastError /********************************* * HB_COMPRESSERRORDESC( nErrorCode ) --> cDesc diff --git a/harbour/src/debug/dbgtmenu.prg b/harbour/src/debug/dbgtmenu.prg index 566c9e1e4c..517c366d3c 100644 --- a/harbour/src/debug/dbgtmenu.prg +++ b/harbour/src/debug/dbgtmenu.prg @@ -109,13 +109,13 @@ ENDCLASS METHOD aMenus( xNewVal ) CLASS HBDbMenu - THREAD STATIC ts_aMenus + THREAD STATIC t_aMenus IF PCount() > 0 - ts_aMenus := xNewVal + t_aMenus := xNewVal ENDIF - RETURN ts_aMenus + RETURN t_aMenus METHOD New() CLASS HBDbMenu diff --git a/harbour/src/debug/debugger.prg b/harbour/src/debug/debugger.prg index 810352a34b..c90bde64ee 100644 --- a/harbour/src/debug/debugger.prg +++ b/harbour/src/debug/debugger.prg @@ -118,7 +118,7 @@ #define DEBUGGER_MAXROW 22 #define DEBUGGER_MAXCOL 77 -THREAD STATIC s_oDebugger +THREAD STATIC t_oDebugger PROCEDURE __dbgAltDEntry() @@ -142,22 +142,22 @@ PROCEDURE __dbgEntry( nMode, uParam1, uParam2, uParam3, uParam4, uParam5 ) CASE nMode == HB_DBG_ACTIVATE - IF ( lStartup := ( s_oDebugger == NIL ) ) - s_oDebugger := HBDebugger():New() - s_oDebugger:pInfo := uParam1 + IF ( lStartup := ( t_oDebugger == NIL ) ) + t_oDebugger := HBDebugger():New() + t_oDebugger:pInfo := uParam1 ENDIF - s_oDebugger:nProcLevel := uParam2 - s_oDebugger:aCallStack := uParam3 - s_oDebugger:aModules := uParam4 - s_oDebugger:aBreakPoints := uParam5 + t_oDebugger:nProcLevel := uParam2 + t_oDebugger:aCallStack := uParam3 + t_oDebugger:aModules := uParam4 + t_oDebugger:aBreakPoints := uParam5 IF lStartup - IF s_oDebugger:lRunAtStartup + IF t_oDebugger:lRunAtStartup __dbgSetGo( uParam1 ) RETURN ENDIF ENDIF - s_oDebugger:lGo := .F. - s_oDebugger:Activate() + t_oDebugger:lGo := .F. + t_oDebugger:Activate() ENDCASE @@ -378,7 +378,7 @@ ENDCLASS METHOD New() CLASS HBDebugger - s_oDebugger := Self + t_oDebugger := Self /* default the search path for files to the current directory that way if the source is in the same directory it will still be found even if the application @@ -1294,7 +1294,7 @@ METHOD HandleEvent() CLASS HBDebugger DO CASE CASE nKey == K_ALT_X - s_oDebugger:Quit() + t_oDebugger:Quit() CASE ::oPullDown:IsOpen() ::oPullDown:ProcessKey( nKey ) @@ -1356,7 +1356,7 @@ METHOD HandleEvent() CLASS HBDebugger /* CASE nKey == K_ESC ::RestoreAppStatus() - s_oDebugger := NIL + t_oDebugger := NIL s_lExit := .T. DispEnd() ::Exit() @@ -2003,7 +2003,7 @@ METHOD Quit() CLASS HBDebugger ::Exit() ::Hide() __dbgSetQuit( ::pInfo ) - s_oDebugger := NIL + t_oDebugger := NIL __QUIT() @@ -3202,11 +3202,11 @@ STATIC PROCEDURE SetsKeyPressed( nKey, oBrwSets, nSets, oWnd, cCaption, bEdit ) FUNCTION __DbgColors() - RETURN s_oDebugger:GetColors() + RETURN t_oDebugger:GetColors() FUNCTION __Dbg() - RETURN s_oDebugger + RETURN t_oDebugger STATIC PROCEDURE RefreshVarsS( oBrowse ) diff --git a/harbour/tests/mousetst.prg b/harbour/tests/mousetst.prg index a97defbead..1bba68bf76 100644 --- a/harbour/tests/mousetst.prg +++ b/harbour/tests/mousetst.prg @@ -149,15 +149,15 @@ PROCEDURE TEST2( nR, nC ) @ nR + 10, nC SAY "| mouse |" @ nR + 11, nC SAY "+-------------------+" - SET( _SET_EVENTMASK, INKEY_ALL ) + Set( _SET_EVENTMASK, INKEY_ALL ) IF ! Empty( cSkip ) IF Upper( cSkip ) == "BREAK" SetCancel( .T. ) ELSE SetCancel( .F. ) - END IF - END IF + ENDIF + ENDIF MUPDATE() diff --git a/harbour/tests/mt/mttest05.prg b/harbour/tests/mt/mttest05.prg index 31b15e6789..70591710e5 100644 --- a/harbour/tests/mt/mttest05.prg +++ b/harbour/tests/mt/mttest05.prg @@ -15,12 +15,12 @@ #define N_COUNT 1000000 #define N_INIT 100 -thread static s_var := N_INIT +thread static t_var := N_INIT proc main() local aThreads := {}, i, nSum ? Version() - s_var := N_INIT * 25 + t_var := N_INIT * 25 ? "Starting threads: " for i := 1 to N_THREADS aadd( aThreads, hb_threadStart( @thFunc() ) ) @@ -38,6 +38,6 @@ return func thFunc() local i for i := 1 to N_COUNT - ++s_var + ++t_var next -return s_var +return t_var diff --git a/harbour/tests/mt/mttest12.prg b/harbour/tests/mt/mttest12.prg index b6d42fd170..14019e630a 100644 --- a/harbour/tests/mt/mttest12.prg +++ b/harbour/tests/mt/mttest12.prg @@ -11,17 +11,17 @@ * */ -thread static s_var1 := { "A", "B", "C" } -thread static s_var2 := { "A" => "qwe", "B" => "asd" } -thread static s_var3 := 1235.567 -thread static s_var4 := "text" +thread static t_var1 := { "A", "B", "C" } +thread static t_var2 := { "A" => "qwe", "B" => "asd" } +thread static t_var3 := 1235.567 +thread static t_var4 := "text" proc main() testvar("initial main thread values") -aadd( s_var1, "X" ) -s_var2[ "X" ] := "zxc" -s_var3 += 100000 -s_var4 := upper( s_var4 ) +aadd( t_var1, "X" ) +t_var2[ "X" ] := "zxc" +t_var3 += 100000 +t_var4 := upper( t_var4 ) testvar("modified main thread values") hb_threadJoin( hb_threadStart( @thFunc() ) ) testvar("modified main thread values") @@ -29,19 +29,19 @@ return proc testvar( cMsg ) ? cMsg -? "s_var1:", hb_valtoExp( s_var1 ) -? "s_var2:", hb_valtoExp( s_var2 ) -? "s_var3:", hb_valtoExp( s_var3 ) -? "s_var4:", hb_valtoExp( s_var4 ) +? "t_var1:", hb_valtoExp( t_var1 ) +? "t_var2:", hb_valtoExp( t_var2 ) +? "t_var3:", hb_valtoExp( t_var3 ) +? "t_var4:", hb_valtoExp( t_var4 ) wait ? return proc thFunc() testvar("initial child thread values") -aadd( s_var1, "Y" ) -s_var2[ "Y" ] := "abc" -s_var3 -= 500000 -s_var4 += " CHANGED" +aadd( t_var1, "Y" ) +t_var2[ "Y" ] := "abc" +t_var3 -= 500000 +t_var4 += " CHANGED" testvar("modified child thread values") return