diff --git a/harbour/ChangeLog b/harbour/ChangeLog index c552349520..1db7fa5b63 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,37 @@ 2008-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org) */ +2008-10-27 22:39 UTC+0200 Viktor Szakats (harbour.01 syenar hu) + * tests/db_brows.prg + * contrib/hbmysql/tmysql.prg + * contrib/hbnf/miltime.prg + * contrib/hbnf/mouse1.prg + * contrib/hbnf/sleep.prg + * contrib/hbnf/d2e.prg + * contrib/hbnf/easter.prg + * '&&' comments changed to '//' for all Harbour SVN. + + * contrib/gtwvg/wvgclass.prg + * source/rdd/hbsix/sxcompat.prg + ! Fixed '&&' being used instead of '.AND.' in code. + ; NOTE: This '&&' comment compatibility is a lot more + dangerous than it's useful. It'd vote for + a compiler warnings switch for any of it's + occurences. + + * source/rtl/tbcolumn.prg + * source/rtl/tget.prg + * source/rtl/tbrowse.prg + * contrib/xhb/hbcompat.ch + ! Fixed '&&' being used instead of '.AND.' in #ifs. + + * source/rdd/hbsix/sxini.prg + * source/rdd/hbsix/sxcompat.prg + * source/rdd/hbsix/sxtrig.prg + * 'end' -> 'endswitch' + % 'ValType() == "x"' -> 'IS*()' + ; TODO: Reformat to Harbour standards. + 2008-10-27 21:43 UTC+0200 Viktor Szakats (harbour.01 syenar hu) * contrib/Makefile * contrib/make_vc_all.bat diff --git a/harbour/contrib/gtwvg/wvgclass.prg b/harbour/contrib/gtwvg/wvgclass.prg index 182af5b8ec..a2fe83176d 100644 --- a/harbour/contrib/gtwvg/wvgclass.prg +++ b/harbour/contrib/gtwvg/wvgclass.prg @@ -3388,7 +3388,7 @@ METHOD DelItem( nItemNum ) CLASS wvtMenu METHOD EnableItem( nItemNum ) CLASS wvtMenu LOCAL nPrevious:= -1 - IF !EMPTY( ::hMenu ) && !EMPTY( nItemNum ) + IF !EMPTY( ::hMenu ) .AND. !EMPTY( nItemNum ) nPrevious:= Wvt_EnableMenuItem( ::hMenu, nItemNum-1, MF_BYPOSITION + MF_ENABLED ) ENDIF @@ -3399,7 +3399,7 @@ METHOD EnableItem( nItemNum ) CLASS wvtMenu METHOD DisableItem( nItemNum ) CLASS wvtMenu LOCAL nPrevious:= -1 - IF !EMPTY( ::hMenu ) && !EMPTY( nItemNum ) + IF !EMPTY( ::hMenu ) .AND. !EMPTY( nItemNum ) nPrevious:= Wvt_EnableMenuItem( ::hMenu, nItemNum-1, MF_BYPOSITION + MF_GRAYED ) ENDIF diff --git a/harbour/contrib/hbmysql/tmysql.prg b/harbour/contrib/hbmysql/tmysql.prg index 8ba7db3e5b..bd1bb59682 100644 --- a/harbour/contrib/hbmysql/tmysql.prg +++ b/harbour/contrib/hbmysql/tmysql.prg @@ -1426,10 +1426,10 @@ METHOD SelectDB(cDBName) CLASS TMySQLServer ::lError := .F. - if sqlSelectD(::nSocket, cDBName) != 0 && tabela nao existe + if sqlSelectD(::nSocket, cDBName) != 0 /* tabela nao existe */ ::cDBName :="" ::lError := .T. - else && tabela existe + else /* tabela existe */ ::cDBName :=cDBName ::lError := .F. return .T. diff --git a/harbour/contrib/hbnf/d2e.prg b/harbour/contrib/hbnf/d2e.prg index 06c9000b44..a1528b5a25 100644 --- a/harbour/contrib/hbnf/d2e.prg +++ b/harbour/contrib/hbnf/d2e.prg @@ -79,8 +79,8 @@ function ft_d2e( nDec, nPrecision ) elseif abs( nDec ) < 1 nExp := int( log10( nDec ) ) - 1 else - nExp := int( log10( abs(nDec)+0.00001 ) ) && 0.00001 == kludge - endif && for imprecise logs + nExp := int( log10( abs(nDec)+0.00001 ) ) /* 0.00001 == kludge */ + endif /* for imprecise logs */ nDec /= 10 ^ nExp diff --git a/harbour/contrib/hbnf/easter.prg b/harbour/contrib/hbnf/easter.prg index 0c6ad908ac..6e4945ae1b 100644 --- a/harbour/contrib/hbnf/easter.prg +++ b/harbour/contrib/hbnf/easter.prg @@ -49,7 +49,7 @@ * This function can be useful in calender type programs that indicate * when holidays occur. * $EXAMPLES$ - * dEdate := FT_EASTER( 1990 ) && returns 04/15/1990 + * dEdate := FT_EASTER( 1990 ) // returns 04/15/1990 * $END$ */ diff --git a/harbour/contrib/hbnf/miltime.prg b/harbour/contrib/hbnf/miltime.prg index 2624c4d088..598a5afb0c 100644 --- a/harbour/contrib/hbnf/miltime.prg +++ b/harbour/contrib/hbnf/miltime.prg @@ -169,7 +169,7 @@ function FT_MIL2CIV(cMILTIME) else cCIVTIME = "12:" + cMINS + " pm" endif - case (nHRS < 12) && AM + case (nHRS < 12) // AM if nHRS == 0 cHRS = "12" else @@ -177,7 +177,7 @@ function FT_MIL2CIV(cMILTIME) endif cCIVTIME = cHRS + ":" + cMINS + " am" - otherwise && PM + otherwise // PM cCIVTIME = right(" " + ltrim(str(int(nHRS - 12))), 2) + ; ":" + cMINS + " pm" endcase @@ -233,26 +233,26 @@ endif cKEY = substr(ltrim(cTIME), 7, 1) do case -case upper(cKEY) == "N" && noon +case upper(cKEY) == "N" // noon if left(cTIME,2) + substr(cTIME,4,2) == "0000" cMILTIME = "1200" else cMILTIME = " " endif - case upper(cKEY) == "M" && midnight + case upper(cKEY) == "M" // midnight if left(cTIME,2) + substr(cTIME,4,2) == "0000" cMILTIME = "0000" else cMILTIME = " " endif - case upper(cKEY) == "A" && am + case upper(cKEY) == "A" // am cMILTIME = right("00" + ltrim(str(val(left(cTIME,2)))),2) + ; substr(cTIME,4,2) - case upper(cKEY) == "P" && pm + case upper(cKEY) == "P" // pm cMILTIME = right("00" + ltrim(str(val(left(cTIME,2))+12)),2) + ; substr(cTIME,4,2) otherwise - cMILTIME = " " && error + cMILTIME = " " // error endcase return cMILTIME diff --git a/harbour/contrib/hbnf/mouse1.prg b/harbour/contrib/hbnf/mouse1.prg index 0b86d7ece7..8bc5523a7f 100644 --- a/harbour/contrib/hbnf/mouse1.prg +++ b/harbour/contrib/hbnf/mouse1.prg @@ -286,9 +286,9 @@ RETURN NIL // no function output * of a double click. * $EXAMPLES$ * IF FT_MISREGION( 10, 10, 11, 20 ) .AND.; - * FT_MDBLCLK(0,1,,FT_MGETX(),FT_MGETY()) && double click, right button - * && at current location with - * && default interval + * FT_MDBLCLK(0,1,,FT_MGETX(),FT_MGETY()) // double click, right button + * // at current location with + * // default interval * * MnuItem1() * ENDIF diff --git a/harbour/contrib/hbnf/sleep.prg b/harbour/contrib/hbnf/sleep.prg index a162f1ce49..71fa741ab9 100644 --- a/harbour/contrib/hbnf/sleep.prg +++ b/harbour/contrib/hbnf/sleep.prg @@ -72,15 +72,15 @@ * work for more than 24 hours. * $EXAMPLES$ * Example 1: - * FT_SLEEP(10.0) && Sleep for 10.0 seconds + * FT_SLEEP(10.0) // Sleep for 10.0 seconds * Example 2: - * nTime := SECONDS() && usually after some interupt from mouse or - * && keyboard + * nTime := SECONDS() // usually after some interupt from mouse or + * // keyboard * * ... intervening code ... * - * FT_SLEEP(0.5, nTime) && Sleep until the sytem clock is - * && nTime+0.5 seconds. + * FT_SLEEP(0.5, nTime) // Sleep until the sytem clock is + * // nTime+0.5 seconds. * * $END$ */ diff --git a/harbour/contrib/xhb/hbcompat.ch b/harbour/contrib/xhb/hbcompat.ch index ca31db087e..108ddaab54 100644 --- a/harbour/contrib/xhb/hbcompat.ch +++ b/harbour/contrib/xhb/hbcompat.ch @@ -57,10 +57,10 @@ #include "gtinfo.ch" #include "gfx.ch" - #if defined(__PLATFORM__Windows) && !defined(__PLATFORM__WINDOWS) + #if defined(__PLATFORM__Windows) .AND. !defined(__PLATFORM__WINDOWS) #define __PLATFORM__WINDOWS #endif - #if defined(__PLATFORM__Linux) && !defined(__PLATFORM__LINUX) + #if defined(__PLATFORM__Linux) .AND. !defined(__PLATFORM__LINUX) #define __PLATFORM__LINUX #endif @@ -138,10 +138,10 @@ #include "hbgtinfo.ch" #include "hbgfx.ch" - #if defined(__PLATFORM__WINDOWS) && !defined(__PLATFORM__Windows) + #if defined(__PLATFORM__WINDOWS) .AND. !defined(__PLATFORM__Windows) #define __PLATFORM__Windows #endif - #if defined(__PLATFORM__LINUX) && !defined(__PLATFORM__Linux) + #if defined(__PLATFORM__LINUX) .AND. !defined(__PLATFORM__Linux) #define __PLATFORM__Linux #endif diff --git a/harbour/source/rdd/hbsix/sxcompat.prg b/harbour/source/rdd/hbsix/sxcompat.prg index d3d47a6361..bd44cee2b8 100644 --- a/harbour/source/rdd/hbsix/sxcompat.prg +++ b/harbour/source/rdd/hbsix/sxcompat.prg @@ -102,11 +102,11 @@ function sxChar( nLen, xKeyVal ) xKeyVal := iif( xKeyVal, "T", "F" ) exit otherwise - xKeyVal := iif( valType( nLen ) == "N", "", space( 10 ) ) + xKeyVal := iif( ISNUMBER( nLen ), "", space( 10 ) ) exit endswitch -return iif( valType( nLen ) == "N", padr( ltrim( xKeyVal ), nLen ), xKeyVal ) +return iif( ISNUMBER( nLen ), padr( ltrim( xKeyVal ), nLen ), xKeyVal ) function sxNum( xKeyVal ) @@ -204,9 +204,9 @@ return xRetVal function Sx_TagInfo( cIndex ) local aInfo, nOrds, nFirst, i - if Used() && ( nOrds := OrdCount( cIndex ) ) > 0 + if Used() .AND. ( nOrds := OrdCount( cIndex ) ) > 0 aInfo := array( nOrds, 6 ) - if valType( cIndex ) == "C" + if ISCHARACTER( cIndex ) nFirst := dbOrderInfo( DBOI_BAGORDER, cIndex ) nOrds += nFirst - 1 else @@ -228,12 +228,12 @@ return aInfo function Sx_TagCount( xIndex ) local nTags := 0, cIndex, nOrder if Used() - if valtype( xIndex ) == "N" + if ISNUMBER( xIndex ) nOrder := Sx_TagOrder( 1, xIndex ) if nOrder != 0 cIndex := dbOrderInfo( DBOI_FULLPATH,, nOrder ) endif - elseif valtype( xIndex ) == "C" .and. !Empty( xIndex ) + elseif ISCHARACTER( xIndex ) .and. !Empty( xIndex ) cIndex := xIndex else cIndex := dbOrderInfo( DBOI_FULLPATH ) @@ -247,9 +247,9 @@ return nTags function Sx_Tags( xIndex ) local aTagNames := {}, nOrder, nTags if Used() - if valtype( xIndex ) == "N" + if ISNUMBER( xIndex ) nOrder := Sx_TagOrder( 1, xIndex ) - elseif valtype( xIndex ) == "C" .and. !Empty( xIndex ) + elseif ISCHARACTER( xIndex ) .and. !Empty( xIndex ) nOrder := dbOrderInfo( DBOI_BAGORDER, xIndex ) else nOrder := OrdNumber() @@ -266,10 +266,10 @@ return aTagNames function Sx_SetTag( xTag, xIndex ) local lRet := .f., nOrder := 0, nOldOrd, cIndex if Used() .and. valtype( xTag ) $ "CN" - if valtype( xTag ) == "N" + if ISNUMBER( xTag ) if empty( xIndex ) .or. !valtype( xIndex ) $ "CN" nOrder := xTag - elseif valtype( xIndex ) == "C" + elseif ISCHARACTER( xIndex ) if xTag >= 1 .and. xTag <= ordCount( xIndex ) nOrder := dbOrderInfo( DBOI_BAGORDER, xIndex ) + xTag - 1 endif @@ -279,7 +279,7 @@ function Sx_SetTag( xTag, xIndex ) else if empty( xIndex ) .or. !valtype( xIndex ) $ "CN" nOrder := OrdNumber( xTag ) - elseif valtype( xIndex ) == "C" + elseif ISCHARACTER( xIndex ) nOrder := Sx_TagOrder( xTag, xIndex ) else nOrder := Sx_TagOrder( 1, xIndex ) @@ -309,13 +309,13 @@ return lRet function Sx_KillTag( xTag, xIndex ) local lRet := .f., nOrder, cIndex - if valtype( xTag ) == "L" + if ISLOGICAL( xTag ) if xTag if empty( xIndex ) cIndex := Sx_IndexName() - elseif valtype( xIndex ) == "N" + elseif ISNUMBER( xIndex ) cIndex := Sx_IndexName( 1, xIndex ) - elseif valtype( xIndex ) == "C" + elseif ISCHARACTER( xIndex ) nOrder := dbOrderInfo( DBOI_BAGORDER, xIndex ) if nOrder != 0 cIndex := dbOrderInfo( DBOI_FULLPATH,, nOrder ) @@ -328,10 +328,10 @@ function Sx_KillTag( xTag, xIndex ) endif endif else - if valtype( xTag ) == "N" + if ISNUMBER( xTag ) if empty( xIndex ) .or. !valtype( xIndex ) $ "CN" nOrder := xTag - elseif valtype( xIndex ) == "C" + elseif ISCHARACTER( xIndex ) if xTag >= 1 .and. xTag <= ordCount( xIndex ) nOrder := dbOrderInfo( DBOI_BAGORDER, xIndex ) + xTag - 1 else @@ -343,7 +343,7 @@ function Sx_KillTag( xTag, xIndex ) else if empty( xIndex ) .or. !valtype( xIndex ) $ "CN" nOrder := OrdNumber( xTag ) - elseif valtype( xIndex ) == "C" + elseif ISCHARACTER( xIndex ) nOrder := Sx_TagOrder( xTag, xIndex ) else nOrder := Sx_TagOrder( 1, xIndex ) @@ -367,7 +367,7 @@ function Sx_FileOrder() return dbOrderInfo( DBOI_BAGNUMBER ) function Sx_SetFileOrd( nIndex ) -return iif( valtype( nIndex ) == "N", ; +return iif( ISNUMBER( nIndex ), ; OrdSetFocus( Sx_TagOrder( 1, nIndex ) ), ; OrdSetFocus() ) @@ -377,7 +377,7 @@ return len( RDDList() ) function RDD_Name( nRDD ) local aRDD - if valType( nRDD ) == "N" .and. nRDD >= 1 + if ISNUMBER( nRDD ) .and. nRDD >= 1 aRDD := RDDList() if nRDD <= len( aRDD ) return aRDD[ nRDD ] @@ -388,11 +388,11 @@ return "" function RDD_Info( xID ) local aInfo, cRDD - if valType( xID ) == "N" + if ISNUMBER( xID ) if !empty( alias( xID ) ) ( xID )->( RDDName() ) endif - elseif valType( xID ) == "C" + elseif ISCHARACTER( xID ) cRDD := upper( alltrim( xID ) ) if ascan( RDDList(), {|x| upper( x ) == cRDD } ) == 0 cRDD := NIL @@ -470,7 +470,7 @@ function Sx_dbCreate( cFileName, aStruct, cRDD ) aField[ 2 ] := "V" endif exit - end + endswitch next return dbCreate( cFileName, aDbStruct, cRDD ) @@ -479,9 +479,9 @@ function Sx_VSigLen( xField ) local nResult := 0, nField := 0 if Used() - if valtype( xField ) == "C" + if ISCHARACTER( xField ) nField := FieldPos( xField ) - elseif valtype( xField ) == "N" + elseif ISNUMBER( xField ) nField := xField endif if nField >= 1 .and. nField <= FCount() @@ -527,9 +527,9 @@ return lResult function Sx_SetTrigger( nAction, cTriggerName, cRDD /* Harbour extensions */ ) local cPrevTrigger := "" - if valtype( nAction ) == "N" + if ISNUMBER( nAction ) if nAction == TRIGGER_PENDING - if valtype( cTriggerName ) == "C" + if ISCHARACTER( cTriggerName ) rddInfo( RDDI_PENDINGTRIGGER, cTriggerName, cRDD ) endif elseif Used() @@ -545,11 +545,11 @@ function Sx_SetTrigger( nAction, cTriggerName, cRDD /* Harbour extensions */ ) dbInfo( DBI_TRIGGER, "" ) exit case TRIGGER_INSTALL - if valtype( cTriggerName ) == "C" + if ISCHARACTER( cTriggerName ) dbInfo( DBI_TRIGGER, cTriggerName ) endif exit - end + endswitch endif endif diff --git a/harbour/source/rdd/hbsix/sxini.prg b/harbour/source/rdd/hbsix/sxini.prg index 7d602881d4..28cdf60c02 100644 --- a/harbour/source/rdd/hbsix/sxini.prg +++ b/harbour/source/rdd/hbsix/sxini.prg @@ -72,7 +72,7 @@ static function _sx_INIlogical( cVal ) case "NO" case "OFF" return .F. - end + endswitch return NIL function _sx_INIinit( nArea ) @@ -116,7 +116,7 @@ function _sx_INIinit( nArea ) case "TRIGGER" xTrigger := item exit - end + endswitch next if xTrigger != NIL ( nArea )->( Sx_SetTrigger( TRIGGER_INSTALL, xTrigger ) ) diff --git a/harbour/source/rdd/hbsix/sxtrig.prg b/harbour/source/rdd/hbsix/sxtrig.prg index a67300dbd1..18a4a87ad2 100644 --- a/harbour/source/rdd/hbsix/sxtrig.prg +++ b/harbour/source/rdd/hbsix/sxtrig.prg @@ -91,6 +91,6 @@ function Sx_DefTrigger( nEvent, nArea, nFieldPos, xTrigVal ) exit case EVENT_POSTMEMOPACK exit - end + endswitch return .T. diff --git a/harbour/source/rtl/tbcolumn.prg b/harbour/source/rtl/tbcolumn.prg index c8b6364058..6cbaebf7b9 100644 --- a/harbour/source/rtl/tbcolumn.prg +++ b/harbour/source/rtl/tbcolumn.prg @@ -60,7 +60,7 @@ and there is no public class function like TBColumn(). There is in XPP though. */ -#if defined( HB_C52_STRICT ) && !defined( HB_COMPAT_XPP ) +#if defined( HB_C52_STRICT ) .AND. !defined( HB_COMPAT_XPP ) CREATE CLASS TBColumn STATIC #else CREATE CLASS TBColumn diff --git a/harbour/source/rtl/tbrowse.prg b/harbour/source/rtl/tbrowse.prg index 25b84bbf3c..5a1b3b4725 100644 --- a/harbour/source/rtl/tbrowse.prg +++ b/harbour/source/rtl/tbrowse.prg @@ -112,7 +112,7 @@ /* NOTE: In CA-Cl*pper TBROWSE class does not inherit from any other classes and there is no public class function like TBrowse(). There is in XPP though. */ -#if defined( HB_C52_STRICT ) && !defined( HB_COMPAT_XPP ) +#if defined( HB_C52_STRICT ) .AND. !defined( HB_COMPAT_XPP ) CREATE CLASS TBrowse STATIC #else CREATE CLASS TBrowse diff --git a/harbour/source/rtl/tget.prg b/harbour/source/rtl/tget.prg index 350f2f29da..44e299eb8a 100644 --- a/harbour/source/rtl/tget.prg +++ b/harbour/source/rtl/tget.prg @@ -72,7 +72,7 @@ and there is no public class function like Get(). There is in XPP though. */ -#if defined( HB_C52_STRICT ) && !defined( HB_COMPAT_XPP ) +#if defined( HB_C52_STRICT ) .AND. !defined( HB_COMPAT_XPP ) CREATE CLASS Get STATIC #else CREATE CLASS Get diff --git a/harbour/tests/db_brows.prg b/harbour/tests/db_brows.prg index 9b9e9ec858..2cbe4a0164 100644 --- a/harbour/tests/db_brows.prg +++ b/harbour/tests/db_brows.prg @@ -222,7 +222,7 @@ PRIVATE str_bar := "- SETCOLOR( LI_CLR ) EVAL( LI_B1, mslist ) // IF predit>1 - // SETCOLOR(LI_CLRV+"*") && Выделить строку + // SETCOLOR(LI_CLRV+"*") // Выделить строку // ELSE SETCOLOR( LI_CLRV ) // ENDIF