From 8f26186de1b62cd55c5baab6acddb1c92aaf5170 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Wed, 11 May 2011 16:17:29 +0000 Subject: [PATCH] 2011-05-11 18:16 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * contrib/hbnf/rand1.prg * contrib/hbnf/mouse1.prg * contrib/hbnf/pegs.prg * contrib/hbnf/menu1.prg * contrib/hbnf/popadder.prg * contrib/hbnf/scregion.prg * contrib/hbnf/mouse2.prg * contrib/hbnf/menutonf.prg * contrib/hbnf/pvid.prg * contrib/hbnf/datecnfg.prg * contrib/hbnf/ntow.prg * contrib/hbnf/pending.prg ! fixed STATICs for MT * marked const STATICs as such --- harbour/ChangeLog | 16 +++++++++++++ harbour/contrib/hbnf/datecnfg.prg | 2 +- harbour/contrib/hbnf/menu1.prg | 4 ++-- harbour/contrib/hbnf/menutonf.prg | 38 +++++++++++++++---------------- harbour/contrib/hbnf/mouse1.prg | 4 ++-- harbour/contrib/hbnf/mouse2.prg | 6 ++--- harbour/contrib/hbnf/ntow.prg | 34 +++++++++++++-------------- harbour/contrib/hbnf/pegs.prg | 2 +- harbour/contrib/hbnf/pending.prg | 4 ++-- harbour/contrib/hbnf/popadder.prg | 4 ++-- harbour/contrib/hbnf/pvid.prg | 2 +- harbour/contrib/hbnf/rand1.prg | 2 +- harbour/contrib/hbnf/scregion.prg | 4 ++-- 13 files changed, 69 insertions(+), 53 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index a35fa9e579..a700d36c74 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,22 @@ The license applies to all entries newer than 2009-04-28. */ +2011-05-11 18:16 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * contrib/hbnf/rand1.prg + * contrib/hbnf/mouse1.prg + * contrib/hbnf/pegs.prg + * contrib/hbnf/menu1.prg + * contrib/hbnf/popadder.prg + * contrib/hbnf/scregion.prg + * contrib/hbnf/mouse2.prg + * contrib/hbnf/menutonf.prg + * contrib/hbnf/pvid.prg + * contrib/hbnf/datecnfg.prg + * contrib/hbnf/ntow.prg + * contrib/hbnf/pending.prg + ! fixed STATICs for MT + * marked const STATICs as such + 2011-05-11 18:04 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * contrib/hbnf/scancode.prg * contrib/hbnf/vidmode.prg diff --git a/harbour/contrib/hbnf/datecnfg.prg b/harbour/contrib/hbnf/datecnfg.prg index 04f1783dc0..b4eb10f811 100644 --- a/harbour/contrib/hbnf/datecnfg.prg +++ b/harbour/contrib/hbnf/datecnfg.prg @@ -231,7 +231,7 @@ FUNCTION FT_DATECNFG( cFYStart ,nDow ) - STATIC aDatePar := { "1980.01.01", 1 } + THREAD STATIC aDatePar := { "1980.01.01", 1 } LOCAL dCheck, cDateFormat := SET(_SET_DATEFORMAT) diff --git a/harbour/contrib/hbnf/menu1.prg b/harbour/contrib/hbnf/menu1.prg index 2045e43eca..15e84fd3de 100644 --- a/harbour/contrib/hbnf/menu1.prg +++ b/harbour/contrib/hbnf/menu1.prg @@ -62,8 +62,8 @@ #define SCNONE 0 #define SCNORMAL 1 -STATIC ACHOICES := {}, AVALIDKEYS := {} -STATIC NHPOS, NVPOS, NMAXROW, NMAXCOL +THREAD STATIC ACHOICES := {}, AVALIDKEYS := {} +THREAD STATIC NHPOS, NVPOS, NMAXROW, NMAXCOL // BEGINNING OF DEMO PROGRAM #IFDEF FT_TEST diff --git a/harbour/contrib/hbnf/menutonf.prg b/harbour/contrib/hbnf/menutonf.prg index de16266757..c946ac594b 100644 --- a/harbour/contrib/hbnf/menutonf.prg +++ b/harbour/contrib/hbnf/menutonf.prg @@ -59,25 +59,25 @@ // These arrays hold information about each menu item -static aRow := {{}} -static aCol := {{}} -static aPrompt := {{}} -static aColor := {{}} -static aMsgRow := {{}} -static aMsgCol := {{}} -static aMessage := {{}} -static aMsgColor := {{}} -static aTrigger := {{}} -static aTriggerInkey := {{}} -static aTriggerColor := {{}} -static aHome := {{}} -static aEnd := {{}} -static aUp := {{}} -static aDown := {{}} -static aLeft := {{}} -static aRight := {{}} -static aExecute := {{}} -static nLevel := 1 +THREAD static aRow := {{}} +THREAD static aCol := {{}} +THREAD static aPrompt := {{}} +THREAD static aColor := {{}} +THREAD static aMsgRow := {{}} +THREAD static aMsgCol := {{}} +THREAD static aMessage := {{}} +THREAD static aMsgColor := {{}} +THREAD static aTrigger := {{}} +THREAD static aTriggerInkey := {{}} +THREAD static aTriggerColor := {{}} +THREAD static aHome := {{}} +THREAD static aEnd := {{}} +THREAD static aUp := {{}} +THREAD static aDown := {{}} +THREAD static aLeft := {{}} +THREAD static aRight := {{}} +THREAD static aExecute := {{}} +THREAD static nLevel := 1 function FT_Prompt( nRow, nCol, cPrompt, cColor, ; nMsgRow, nMsgCol, cMessage, cMsgColor, ; diff --git a/harbour/contrib/hbnf/mouse1.prg b/harbour/contrib/hbnf/mouse1.prg index 771284832f..7233981db2 100644 --- a/harbour/contrib/hbnf/mouse1.prg +++ b/harbour/contrib/hbnf/mouse1.prg @@ -2,8 +2,8 @@ * $Id$ */ -static s_lCrsState:=.F. -static s_lMinit:=.F. +THREAD static s_lCrsState:=.F. +THREAD static s_lMinit:=.F. #ifdef FT_TEST diff --git a/harbour/contrib/hbnf/mouse2.prg b/harbour/contrib/hbnf/mouse2.prg index 1acf3ed9b5..9b7a10b6cb 100644 --- a/harbour/contrib/hbnf/mouse2.prg +++ b/harbour/contrib/hbnf/mouse2.prg @@ -66,9 +66,9 @@ #include "ftint86.ch" -static aReg[10] -static lCrsState:=.F. -static lMinit:=.F. +THREAD static aReg[10] +THREAD static lCrsState:=.F. +THREAD static lMinit:=.F. #ifdef FT_TEST diff --git a/harbour/contrib/hbnf/ntow.prg b/harbour/contrib/hbnf/ntow.prg index 7d39360098..24ce5823b4 100644 --- a/harbour/contrib/hbnf/ntow.prg +++ b/harbour/contrib/hbnf/ntow.prg @@ -21,20 +21,20 @@ * */ -static ones := { "", " One", " Two", " Three", " Four", " Five", ; - " Six", " Seven", " Eight", " Nine" ; - } +static sc_ones := { "", " One", " Two", " Three", " Four", " Five", ; + " Six", " Seven", " Eight", " Nine" ; + } -static teens := { " Ten", " Eleven", " Twelve", ; - " Thirteen", " Fourteen", " Fifteen", ; - " Sixteen", " Seventeen", " Eighteen", ; - " Nineteen" ; - } +static sc_teens := { " Ten", " Eleven", " Twelve", ; + " Thirteen", " Fourteen", " Fifteen", ; + " Sixteen", " Seventeen", " Eighteen", ; + " Nineteen" ; + } -static tens := { "", "", " Twenty", " Thirty", " Forty", " Fifty", ; - " Sixty", " Seventy", " Eighty", " Ninety" } +static sc_tens := { "", "", " Twenty", " Thirty", " Forty", " Fifty", ; + " Sixty", " Seventy", " Eighty", " Ninety" } -static qualifiers := { "", " Thousand", " Million", " Billion", " Trillion" } +static sc_qualifiers := { "", " Thousand", " Million", " Billion", " Trillion" } #ifdef FT_TEST function main( cNum ) @@ -48,7 +48,7 @@ function ft_ntow(nAmount) nTemp := int(nAmount % nDiv) nAmount := int(nAmount / nDiv) nQualNo := int( sol10( nDiv ) / 3 ) + 1 - sResult += grp_to_words(nAmount, qualifiers[ nQualNo ] ) + sResult += grp_to_words(nAmount, sc_qualifiers[ nQualNo ] ) if nTemp > (nDiv /= 1000) .and. (nDiv > 1) sResult += ft_ntow( nTemp, nDiv ) @@ -62,16 +62,16 @@ static function grp_to_words(nGrp, sQual) nTemp := int(nGrp % 100) nGrp := int(nGrp / 100) - sResult += ones[ nGrp + 1 ] + iif( nGrp > 0, " Hundred", "") + sResult += sc_ones[ nGrp + 1 ] + iif( nGrp > 0, " Hundred", "") do case case nTemp > 19 - sResult += tens[ int( nTemp / 10 ) + 1 ] - sResult += ones[ int( nTemp % 10 ) + 1 ] + sResult += sc_tens[ int( nTemp / 10 ) + 1 ] + sResult += sc_ones[ int( nTemp % 10 ) + 1 ] case nTemp < 20 .and. nTemp > 9 - sResult += teens[ int( nTemp % 10 ) + 1 ] + sResult += sc_teens[ int( nTemp % 10 ) + 1 ] case nTemp < 10 .and. nTemp > 0 - sResult += ones[ int( nTemp) + 1 ] + sResult += sc_ones[ int( nTemp) + 1 ] endcase return sResult + sQual diff --git a/harbour/contrib/hbnf/pegs.prg b/harbour/contrib/hbnf/pegs.prg index d27e4ce7e3..b9e014a630 100644 --- a/harbour/contrib/hbnf/pegs.prg +++ b/harbour/contrib/hbnf/pegs.prg @@ -46,7 +46,7 @@ memvar getlist board_[xx, 3] - subarray containing all target locations board_[xx, 4] - is the location occupied or not? .T. -> Yes, .F. -> No */ -static board_ := { { {0, 29, 2, 34}, {2, 4}, {3, 9}, .T. } , ; +THREAD static board_ := { { {0, 29, 2, 34}, {2, 4}, {3, 9}, .T. } , ; { {0, 37, 2, 42}, {5}, {10}, .T.} , ; { {0, 45, 2, 50}, {2, 6}, {1, 11}, .T. } , ; { {3, 29, 5, 34}, {5, 9}, {6, 16}, .T. } , ; diff --git a/harbour/contrib/hbnf/pending.prg b/harbour/contrib/hbnf/pending.prg index 1cd0e44456..fc0c95f810 100644 --- a/harbour/contrib/hbnf/pending.prg +++ b/harbour/contrib/hbnf/pending.prg @@ -34,8 +34,8 @@ #endif FUNCTION FT_PENDING (cMsg, nRow, nCol, nWait, cColor) - STATIC nLast_Time := 0, nRow1 := 24, nCol1 := 0 - STATIC nWait1 := 5, cColor1 := 'W+/R,X' + THREAD STATIC nLast_Time := 0, nRow1 := 24, nCol1 := 0 + THREAD STATIC nWait1 := 5, cColor1 := 'W+/R,X' LOCAL nThis_Time, nTiny := 0.1, cSavColor * diff --git a/harbour/contrib/hbnf/popadder.prg b/harbour/contrib/hbnf/popadder.prg index d5058bc9e9..c246ad02ba 100644 --- a/harbour/contrib/hbnf/popadder.prg +++ b/harbour/contrib/hbnf/popadder.prg @@ -120,7 +120,7 @@ #define cTapeScr aAdder[23] // I still use a few of STATICS, but most are set to NIL when quiting... -STATIC lAdderOpen := .F., ; +THREAD STATIC lAdderOpen := .F., ; aKeys, aWindow, nWinColor, aWinColor, aStdColor #ifdef FT_TEST @@ -1255,7 +1255,7 @@ RETURN xVarVal */ FUNCTION _ftAdderTapeUDF(mode,cur_elem,rel_pos) LOCAL nKey,nRtnVal - STATIC ac_exit_ok := .F. + THREAD STATIC ac_exit_ok := .F. HB_SYMBOL_UNUSED( cur_elem ) HB_SYMBOL_UNUSED( rel_pos ) diff --git a/harbour/contrib/hbnf/pvid.prg b/harbour/contrib/hbnf/pvid.prg index 1e953f674c..2861a93ac6 100644 --- a/harbour/contrib/hbnf/pvid.prg +++ b/harbour/contrib/hbnf/pvid.prg @@ -33,7 +33,7 @@ #define PV_MAXCOL 9 #define PV_SCORE 10 -static aVideo := {} +THREAD static aVideo := {} function FT_PushVid() diff --git a/harbour/contrib/hbnf/rand1.prg b/harbour/contrib/hbnf/rand1.prg index 388aad9724..9484f86487 100644 --- a/harbour/contrib/hbnf/rand1.prg +++ b/harbour/contrib/hbnf/rand1.prg @@ -42,7 +42,7 @@ #endif function ft_rand1(nMax) - static nSeed + THREAD static nSeed local m := 100000000, b := 31415621 nSeed := iif( nSeed == NIL, seconds(), nSeed ) // init_seed() diff --git a/harbour/contrib/hbnf/scregion.prg b/harbour/contrib/hbnf/scregion.prg index 45922b1c2e..b4bef4f2b2 100644 --- a/harbour/contrib/hbnf/scregion.prg +++ b/harbour/contrib/hbnf/scregion.prg @@ -24,7 +24,7 @@ * */ -STATIC aRgnStack := {} +THREAD STATIC aRgnStack := {} FUNCTION FT_SAVRGN(nTop, nLeft, nBottom, nRight) @@ -50,7 +50,7 @@ FUNCTION FT_RSTRGN(cScreen, nTop, nLeft) FUNCTION FT_RGNSTACK(cAction, nTop, nLeft, nBottom, nRight) - STATIC nStackPtr := 0 + THREAD STATIC nStackPtr := 0 LOCAL nPopTop IF cAction == "push"