From a81d08b044696b7a2496eb5ebe3d30acf865f191 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 19 Oct 2012 19:23:36 +0000 Subject: [PATCH] 2012-10-19 21:21 UTC+0200 Viktor Szakats (harbour syenar.net) * utils/hbmk2/hbmk2.prg * avoid splitting branching statements with #if branches to make it easy for hbformat to do its job. (patched hbformat still fails around line 3900) * contrib/xhb/htmutil.prg + TOFIX added for unicode incompatible Greek CP conversion (from what to what it's not marked) --- harbour/ChangeLog | 10 +++++++++ harbour/contrib/xhb/htmutil.prg | 38 +++++++++++++++------------------ harbour/utils/hbmk2/hbmk2.prg | 20 ++++++----------- 3 files changed, 34 insertions(+), 34 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 032d53a6c7..e07d22994c 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,16 @@ The license applies to all entries newer than 2009-04-28. */ +2012-10-19 21:21 UTC+0200 Viktor Szakats (harbour syenar.net) + * utils/hbmk2/hbmk2.prg + * avoid splitting branching statements with #if branches + to make it easy for hbformat to do its job. + (patched hbformat still fails around line 3900) + + * contrib/xhb/htmutil.prg + + TOFIX added for unicode incompatible Greek CP conversion + (from what to what it's not marked) + 2012-10-19 15:18 UTC+0200 Viktor Szakats (harbour syenar.net) * contrib/hbct/ctchksum.c * contrib/hbct/ctcrypt.c diff --git a/harbour/contrib/xhb/htmutil.prg b/harbour/contrib/xhb/htmutil.prg index f759fab191..51f4944e8b 100644 --- a/harbour/contrib/xhb/htmutil.prg +++ b/harbour/contrib/xhb/htmutil.prg @@ -47,7 +47,7 @@ #include "html.ch" #include "hbclass.ch" -STATIC s_aGreek := {} +THREAD STATIC t_aGreek := {} /**** * @@ -178,7 +178,7 @@ PROCEDURE htmlBrowse( oHtm, cAction, lUseLinks ) oHtm:TableHead( aFlds[ i, 1 ] ) NEXT - WHILE !( EOF() ) + WHILE ! EOF() // each row has a different color... IF n == 0 @@ -733,10 +733,19 @@ METHOD ImageURL( cImage, cUrl, nHeight, nBorder, ; RETURN Self -//*** EOF ***// +/**** +* +* InitGreek() +* +* Initializes the international languages support. +* +* Uses GREEK_ALPHABET array as a match pattern. Replace with your +* own character set. +*/ +FUNCTION initGreek() -#define GREEK_ALPHABET {; + LOCAL aGreek := { ; hb_BChar( 193 ), ; hb_BChar( 194 ), ; hb_BChar( 195 ), ; @@ -806,22 +815,9 @@ METHOD ImageURL( cImage, cUrl, nHeight, nBorder, ; hb_BChar( 219 ) ; } -/**** -* -* InitGreek() -* -* Initializes the international languages support. -* -* Uses GREEK_ALPHABET array as a match pattern. Replace with your -* own character set. -*/ - -FUNCTION initGreek() - LOCAL i LOCAL n - LOCAL aGreek := GREEK_ALPHABET - LOCAL aArr := Array( 255 ) + LOCAL aArr := Array( 255 ) FOR i := 1 TO 255 aArr[ i ] := hb_BChar( i ) @@ -855,11 +851,11 @@ FUNCTION Greek2Html( cText ) LOCAL i LOCAL cStr := "" - IF Empty( s_aGreek ) - s_aGreek := initGreek() + IF Empty( t_aGreek ) + t_aGreek := initGreek() ENDIF FOR I := 1 TO Len( cText ) - cStr += s_aGreek[ Asc( Substr( cText, i, 1 ) ) ] + cStr += t_aGreek[ Asc( Substr( cText, i, 1 ) ) ] /* TOFIX: for unicode */ NEXT RETURN cStr diff --git a/harbour/utils/hbmk2/hbmk2.prg b/harbour/utils/hbmk2/hbmk2.prg index 8eb367b385..75c8dc2cba 100644 --- a/harbour/utils/hbmk2/hbmk2.prg +++ b/harbour/utils/hbmk2/hbmk2.prg @@ -1015,6 +1015,7 @@ STATIC FUNCTION hbmk_harbour_dirlayout_detect( hbmk, /* @ */ l_cHB_INSTALL_PREFI /* This stage needs COMP and PLAT to be filled */ STATIC PROCEDURE hbmk_harbour_dirlayout_init( hbmk, l_cHB_INSTALL_PREFIX ) LOCAL tmp + LOCAL lDOSWinTokens IF Empty( hbmk[ _HBMK_cHB_INSTALL_BIN ] ) /* Autodetect multi-compiler/platform bin structure (also .dlls are in bin dir on non-*nix platforms) */ @@ -1086,10 +1087,11 @@ STATIC PROCEDURE hbmk_harbour_dirlayout_init( hbmk, l_cHB_INSTALL_PREFIX ) #if defined( __PLATFORM__WINDOWS ) .OR. ; defined( __PLATFORM__DOS ) .OR. ; defined( __PLATFORM__OS2 ) - FOR EACH tmp IN hb_ATokens( hbmk[ _HBMK_cHB_INSTALL_ADD ], hb_osPathListSeparator(), .T., .T. ) + lDOSWinTokens := .T. #else - FOR EACH tmp IN hb_ATokens( hbmk[ _HBMK_cHB_INSTALL_ADD ], hb_osPathListSeparator() ) + lDOSWinTokens := NIL #endif + FOR EACH tmp IN hb_ATokens( hbmk[ _HBMK_cHB_INSTALL_ADD ], hb_osPathListSeparator(), lDOSWinTokens, lDOSWinTokens ) IF ! Empty( tmp ) AAdd( hbmk[ _HBMK_aLIBPATH ], hb_PathNormalize( hb_DirSepAdd( PathSepToSelf( tmp ) ) ) + "%{hb_name}" ) ENDIF @@ -10373,9 +10375,7 @@ STATIC FUNCTION ArchCompFilter( hbmk, cItem, cFileName ) LOCAL cChar LOCAL lSkipQuote LOCAL cRetVal -#ifndef USE_FOREACH_ON_STRINGS LOCAL nPos -#endif LOCAL cExpr := "hbmk_KEYW( hbmk, cFileName, '%1' )" LOCAL cExprWithValue := "hbmk_KEYW( hbmk, cFileName, '%1', '%2', '%3' )" @@ -10409,22 +10409,16 @@ STATIC FUNCTION ArchCompFilter( hbmk, cItem, cFileName ) cValue := NIL cOperator := "" lSkipQuote := .F. -#ifdef USE_FOREACH_ON_STRINGS - FOR EACH cChar IN cFilterSrc -#else - FOR nPos := 1 TO Len( cFilterSrc ) + + FOR nPos := 1 TO Len( cFilterSrc ) /* USE_FOREACH_ON_STRINGS */ cChar := SubStr( cFilterSrc, nPos, 1 ) -#endif + IF cValue == NIL IF iif( Empty( cKeyword ),; HB_ISFIRSTIDCHAR( cChar ),; HB_ISNEXTIDCHAR( cChar ) ) cKeyword += cChar -#ifdef USE_FOREACH_ON_STRINGS - ELSEIF cChar $ "=<>" .AND. SubStr( cFilterSrc, cChar:__enumIndex() + 1, 1 ) == "'" -#else ELSEIF cChar $ "=<>" .AND. SubStr( cFilterSrc, nPos + 1, 1 ) == "'" -#endif cOperator := cChar cValue := "" lSkipQuote := .T.