From ce6fc90ab43aac22cd02f33377dccec25fdfdc54 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sun, 14 Sep 2008 14:11:27 +0000 Subject: [PATCH] 2008-09-14 16:10 UTC+0200 Viktor Szakats (harbour.01 syenar hu) * bin/hb-func.sh * source/vm/hvm.c * source/rtl/hbgtcore.c * source/rtl/gtchrmap.c ! Global vars given std names: s_pszLinkedMain -> hb_vm_pszLinkedMain s_defaultGT -> hb_gt_szNameDefault s_szDefaultCharMapFile -> hb_gt_szCharMapFileDefault --- harbour/ChangeLog | 10 ++++++++++ harbour/bin/hb-func.sh | 8 ++++---- harbour/source/rtl/gtchrmap.c | 12 ++++-------- harbour/source/rtl/hbgtcore.c | 21 +++++++++------------ harbour/source/vm/hvm.c | 17 +++++++---------- 5 files changed, 34 insertions(+), 34 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index f994261179..f7deb24c29 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,16 @@ 2008-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org) */ +2008-09-14 16:10 UTC+0200 Viktor Szakats (harbour.01 syenar hu) + * bin/hb-func.sh + * source/vm/hvm.c + * source/rtl/hbgtcore.c + * source/rtl/gtchrmap.c + ! Global vars given std names: + s_pszLinkedMain -> hb_vm_pszLinkedMain + s_defaultGT -> hb_gt_szNameDefault + s_szDefaultCharMapFile -> hb_gt_szCharMapFileDefault + 2008-09-14 15:56 UTC+0200 Viktor Szakats (harbour.01 syenar hu) * include/hbsetup.ch * Turned off HB_LEGACY_LEVEL by default. diff --git a/harbour/bin/hb-func.sh b/harbour/bin/hb-func.sh index b3b2f95b50..db8057598c 100755 --- a/harbour/bin/hb-func.sh +++ b/harbour/bin/hb-func.sh @@ -596,15 +596,15 @@ hb_lnk_request() if [ -n "\$gt" ] || [ -n "\${HB_MAIN_FUNC}" ]; then echo "#include \\"hbinit.h\\"" echo "HB_EXTERN_BEGIN" - echo "extern \${HB_LNK_ATTR} const char * s_defaultGT;" - echo "extern \${HB_LNK_ATTR} const char * s_pszLinkedMain;" + echo "extern \${HB_LNK_ATTR} const char * hb_gt_szNameDefault;" + echo "extern \${HB_LNK_ATTR} const char * hb_vm_pszLinkedMain;" echo "HB_EXTERN_END" echo "HB_CALL_ON_STARTUP_BEGIN( hb_lnk_SetDefault_build )" if [ -n "\$gt" ]; then - echo " s_defaultGT = \\"\$gt\\";" + echo " hb_gt_szNameDefault = \\"\$gt\\";" fi if [ -n "\${HB_MAIN_FUNC}" ]; then - echo " s_pszLinkedMain = \\"\${HB_MAIN_FUNC}\\";" + echo " hb_vm_pszLinkedMain = \\"\${HB_MAIN_FUNC}\\";" fi echo "HB_CALL_ON_STARTUP_END( hb_lnk_SetDefault_build )" fi diff --git a/harbour/source/rtl/gtchrmap.c b/harbour/source/rtl/gtchrmap.c index 6675f6aca9..064bd8f2cb 100644 --- a/harbour/source/rtl/gtchrmap.c +++ b/harbour/source/rtl/gtchrmap.c @@ -62,11 +62,7 @@ #define MAX_CHAR_VAL 0xff #define HB_CHRMAP(a,c) ( ( (a) << 16 ) | (c) ) -/* TOFIX: s_szDefaultCharMapFile is violating namespace, so it should be - renamed to hb_gt_szCharMapFileDefault, or wrapped into an - official API ASAP. [vszakats] */ - -char * s_szDefaultCharMapFile = "/etc/harbour/hb-charmap.def"; +char * hb_gt_szCharMapFileDefault = "/etc/harbour/hb-charmap.def"; static void chrmap_init( int *piTransTbl ) { @@ -432,17 +428,17 @@ int hb_gt_chrmapinit( int *piTransTbl, const char *pszTerm, BOOL fSetACSC ) hb_xfree( pszFile ); pszFile = hb_getenv( "HB_ROOT" ); if( pszFile != NULL && sizeof( szFile ) > - strlen( pszFile ) + strlen( s_szDefaultCharMapFile ) ) + strlen( pszFile ) + strlen( hb_gt_szCharMapFileDefault ) ) { hb_strncpy( szFile, pszFile, sizeof( szFile ) - 1 ); - hb_strncat( szFile, s_szDefaultCharMapFile, sizeof( szFile ) - 1 ); + hb_strncat( szFile, hb_gt_szCharMapFileDefault, sizeof( szFile ) - 1 ); nRet = hb_gt_chrmapread( szFile, pszTerm, piTransTbl ); } } if( pszFile ) hb_xfree( pszFile ); if( nRet == -1 ) - nRet = hb_gt_chrmapread( s_szDefaultCharMapFile, pszTerm, piTransTbl ); + nRet = hb_gt_chrmapread( hb_gt_szCharMapFileDefault, pszTerm, piTransTbl ); } if( pszFree ) diff --git a/harbour/source/rtl/hbgtcore.c b/harbour/source/rtl/hbgtcore.c index 9bf1414116..fb32c9c8cb 100644 --- a/harbour/source/rtl/hbgtcore.c +++ b/harbour/source/rtl/hbgtcore.c @@ -3026,23 +3026,20 @@ static HB_GT_FUNCS s_gtCoreFunc = static char s_gtNameBuf[ HB_GT_NAME_MAX_ + 1 ]; -/* TOFIX: s_defaultGT is violating namespace, so it should be - renamed to hb_gt_szNameDefault ASAP. [vszakats] */ - #if defined(HB_GT_DEFAULT) - HB_EXPORT const char * s_defaultGT = HB_GT_DRVNAME( HB_GT_DEFAULT ); + HB_EXPORT const char * hb_gt_szNameDefault = HB_GT_DRVNAME( HB_GT_DEFAULT ); #elif defined(HB_GT_LIB) - HB_EXPORT const char * s_defaultGT = HB_GT_DRVNAME( HB_GT_LIB ); + HB_EXPORT const char * hb_gt_szNameDefault = HB_GT_DRVNAME( HB_GT_LIB ); #elif defined(HB_OS_LINUX) - HB_EXPORT const char * s_defaultGT = "crs"; + HB_EXPORT const char * hb_gt_szNameDefault = "crs"; #elif defined(HB_OS_WIN_32) - HB_EXPORT const char * s_defaultGT = "win"; + HB_EXPORT const char * hb_gt_szNameDefault = "win"; #elif defined(HB_OS_DOS) - HB_EXPORT const char * s_defaultGT = "dos"; + HB_EXPORT const char * hb_gt_szNameDefault = "dos"; #elif defined(HB_OS_OS2) - HB_EXPORT const char * s_defaultGT = "os2"; + HB_EXPORT const char * hb_gt_szNameDefault = "os2"; #else - HB_EXPORT const char * s_defaultGT = "std"; + HB_EXPORT const char * hb_gt_szNameDefault = "std"; #endif static const HB_GT_INIT * s_gtInit[ HB_GT_MAX_ ]; @@ -3089,7 +3086,7 @@ static int hb_gt_FindEntry( const char * pszID ) HB_EXPORT void hb_gtSetDefault( const char * szGtName ) { hb_strncpy( s_gtNameBuf, szGtName, sizeof( s_gtNameBuf ) - 1 ); - s_defaultGT = s_gtNameBuf; + hb_gt_szNameDefault = s_gtNameBuf; } HB_EXPORT BOOL hb_gtRegister( const HB_GT_INIT * gtInit ) @@ -3185,7 +3182,7 @@ HB_EXPORT void hb_gtStartupInit( void ) } if( hb_gtLoad( hb_gt_FindDefault(), &s_gtCoreFunc ) ) return; - if( hb_gtLoad( s_defaultGT, &s_gtCoreFunc ) ) + if( hb_gtLoad( hb_gt_szNameDefault, &s_gtCoreFunc ) ) return; if( hb_dynsymFind( "HB_GT_NUL" ) ) /* GTNUL was explicitly requsted */ diff --git a/harbour/source/vm/hvm.c b/harbour/source/vm/hvm.c index ef664d6d57..3bfc579173 100644 --- a/harbour/source/vm/hvm.c +++ b/harbour/source/vm/hvm.c @@ -236,10 +236,7 @@ static BOOL hb_bTracePrgCalls = FALSE; /* prg tracing is off */ # define HB_TRACE_PRG( _TRMSG_ ) if( hb_bTracePrgCalls ) HB_TRACE( HB_TR_ALWAYS, _TRMSG_ ) #endif -/* TOFIX: s_pszLinkedMain is violating namespace, so it should be - renamed to hb_vm_pszLinkedMain ASAP. [vszakats] */ - -HB_EXPORT const char * s_pszLinkedMain = NULL; /* name of startup function set by linker */ +HB_EXPORT const char * hb_vm_pszLinkedMain = NULL; /* name of startup function set by linker */ /* virtual machine state */ @@ -830,14 +827,14 @@ HB_EXPORT void hb_vmInit( BOOL bStartMainProc ) in other case it's the name of first public function in first linked moudule which is used if there is no HB_START_PROCEDURE in code */ - if( s_pszLinkedMain && *s_pszLinkedMain == '@' ) - pDynSym = hb_dynsymFind( s_pszLinkedMain + 1 ); + if( hb_vm_pszLinkedMain && *hb_vm_pszLinkedMain == '@' ) + pDynSym = hb_dynsymFind( hb_vm_pszLinkedMain + 1 ); else { pDynSym = hb_dynsymFind( HB_START_PROCEDURE ); - if( ! ( pDynSym && pDynSym->pSymbol->value.pFunPtr ) && s_pszLinkedMain ) - pDynSym = hb_dynsymFind( s_pszLinkedMain ); + if( ! ( pDynSym && pDynSym->pSymbol->value.pFunPtr ) && hb_vm_pszLinkedMain ) + pDynSym = hb_dynsymFind( hb_vm_pszLinkedMain ); } if( pDynSym && pDynSym->pSymbol->value.pFunPtr ) @@ -846,9 +843,9 @@ HB_EXPORT void hb_vmInit( BOOL bStartMainProc ) hb_errInternal( HB_EI_VMBADSTARTUP, NULL, HB_START_PROCEDURE, NULL ); } #else - else if( s_pszLinkedMain ) + else if( hb_vm_pszLinkedMain ) { - pDynSym = hb_dynsymFind( s_pszLinkedMain + ( *s_pszLinkedMain == '@' ? 1 : 0 ) ); + pDynSym = hb_dynsymFind( hb_vm_pszLinkedMain + ( *hb_vm_pszLinkedMain == '@' ? 1 : 0 ) ); if( pDynSym && pDynSym->pSymbol->value.pFunPtr ) s_pSymStart = pDynSym->pSymbol; }