From e1f892788e4b23ff5a6c3622236d28bf35c6c5cd Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 14 Dec 2001 09:32:52 +0000 Subject: [PATCH] 2001-12-14 10:17 UTC+0100 Viktor Szakats --- harbour/ChangeLog | 29 ++++++ harbour/include/Makefile | 1 + harbour/include/hbapi.h | 7 +- harbour/include/hbapifs.h | 18 ++-- harbour/include/hbcomp.h | 144 ++++++++++++++-------------- harbour/include/hblang.ch | 59 ++++++++++++ harbour/include/hbpp.h | 2 +- harbour/include/hbset.h | 2 +- harbour/source/common/hbfhnd.c | 5 +- harbour/source/common/hbfsapi.c | 14 ++- harbour/source/compiler/harbour.c | 116 +++++++++++----------- harbour/source/compiler/harbour.sly | 2 +- harbour/source/compiler/harbour.y | 2 +- harbour/source/pp/ppcore.c | 4 +- harbour/source/pp/pplib.c | 44 ++++----- harbour/source/rtl/set.c | 8 +- harbour/source/rtl/spfiles.c | 31 ++---- harbour/source/vm/classes.c | 3 - harbour/source/vm/hvm.c | 24 ++--- harbour/utils/hbpp/hbpp.c | 18 ++-- 20 files changed, 311 insertions(+), 222 deletions(-) create mode 100644 harbour/include/hblang.ch diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 1bbd4fdb8f..99c7f1cc09 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,35 @@ 2002-12-01 23:12 UTC+0100 Foo Bar */ +2001-12-14 10:17 UTC+0100 Viktor Szakats + + * include/hbapifs.h + * source/common/hbfhnd.c + * source/common/hbfsapi.c + * source/rtl/spfiles.c + * include/hbset.h + * include/hbcomp.h + * include/hbpp.h + * source/compiler/harbour.c + * source/compiler/harbour.y + * source/compiler/harbour.sly + * source/rtl/set.c + * source/pp/pplib.c + * source/pp/ppcore.c + * utils/hbpp/hbpp.c + * source/vm/hvm.c + * source/vm/classes.c + * Some cleanups. + * PATHNAMES -> HB_PATHNAMES + ! Removed some warnings. + + * include/Makefile + * include/hbapi.h + + include/hblang.ch + + Added HB_I_() define for translatable strings. + In Harbour sources which contains translatable + strings #include "hblang.ch" must be added. + 2001-12-13 16:40 UTC+0100 Antonio Linares * source/vm/eval.c + New function HB_DLLDO() added diff --git a/harbour/include/Makefile b/harbour/include/Makefile index fce228cd3b..a690d2c433 100644 --- a/harbour/include/Makefile +++ b/harbour/include/Makefile @@ -60,6 +60,7 @@ PRG_HEADERS=\ hbextern.ch \ hbgetcmt.ch \ hbinkey.ch \ + hblang.ch \ hbmemory.ch \ hbmemvar.ch \ hboo.ch \ diff --git a/harbour/include/hbapi.h b/harbour/include/hbapi.h index 8e62367c7e..4f447bd32f 100644 --- a/harbour/include/hbapi.h +++ b/harbour/include/hbapi.h @@ -581,8 +581,13 @@ extern void hb_verBuildInfo( void ); /* display harbour, compiler, and platfor /* WARNING: This returned pointer must be freed using hb_xfree( ( void * ) ptr ); */ extern char * hb_getenv( const char * name ); +/* Translation related things */ + +/* Dummy define for start */ +#define HB_I_( x ) x + #if defined(HB_EXTERN_C) } #endif -#endif /* HB_APIEXT_H_ */ \ No newline at end of file +#endif /* HB_APIEXT_H_ */ diff --git a/harbour/include/hbapifs.h b/harbour/include/hbapifs.h index 47c4f0957a..6802be44d9 100644 --- a/harbour/include/hbapifs.h +++ b/harbour/include/hbapifs.h @@ -132,16 +132,18 @@ extern PHB_FNAME hb_fsFNameSplit( char * pszFileName ); /* Split given filename extern char * hb_fsFNameMerge( char * pszFileName, PHB_FNAME pFileName ); /* This function joins path, name and extension into a string with a filename */ /* Searchable path support */ -typedef struct _PATHNAMES +typedef struct _HB_PATHNAMES { char * szPath; - struct _PATHNAMES * pNext; -} PATHNAMES; -void hb_fsAddSearchPath( char * szPath, PATHNAMES * * pSearchList ); -BOOL hb_spFile( BYTE * pFilename ); -FHANDLE hb_spOpen( BYTE * pFilename, USHORT uiFlags ); -FHANDLE hb_spCreate( BYTE * pFilename, USHORT uiAttr ); -FHANDLE hb_spCreateEx( BYTE * pFilename, USHORT uiAttr, USHORT uiFlags ); + struct _HB_PATHNAMES * pNext; +} HB_PATHNAMES; + +extern void hb_fsAddSearchPath( char * szPath, HB_PATHNAMES * * pSearchList ); + +extern BOOL hb_spFile( BYTE * pFilename ); +extern FHANDLE hb_spOpen( BYTE * pFilename, USHORT uiFlags ); +extern FHANDLE hb_spCreate( BYTE * pFilename, USHORT uiAttr ); +extern FHANDLE hb_spCreateEx( BYTE * pFilename, USHORT uiAttr, USHORT uiFlags ); #if defined(HB_EXTERN_C) } diff --git a/harbour/include/hbcomp.h b/harbour/include/hbcomp.h index 44188aa871..2817736bd6 100644 --- a/harbour/include/hbcomp.h +++ b/harbour/include/hbcomp.h @@ -404,7 +404,7 @@ extern void hb_compFixFuncPCode( PFUNCTION ); #if 0 extern int hb_compYACCMain( char * szName ); #endif -extern BOOL hb_compInclude( char * szFileName, PATHNAMES * pSearchPath ); /* end #include support */ +extern BOOL hb_compInclude( char * szFileName, HB_PATHNAMES * pSearchPath ); /* end #include support */ extern char * hb_comp_buffer; /* yacc input buffer */ @@ -422,77 +422,77 @@ extern void hb_compIdentifierClose( void ); /* release the table of identifiers /* variable used by compiler */ -extern int hb_comp_iLine; -extern FUNCTIONS hb_comp_functions; -extern FUNCTIONS hb_comp_funcalls; -extern SYMBOLS hb_comp_symbols; -extern PCOMDECLARED hb_comp_pFirstDeclared; -extern PCOMDECLARED hb_comp_pLastDeclared; -extern PCOMDECLARED hb_comp_pReleaseDeclared; -extern PCOMCLASS hb_comp_pFirstClass; -extern PCOMCLASS hb_comp_pLastClass; -extern PCOMCLASS hb_comp_pReleaseClass; -extern char * hb_comp_szFromClass; -extern PCOMDECLARED hb_comp_pLastMethod; -extern PATHNAMES * hb_comp_pIncludePath; -extern PFUNCTION hb_comp_pInitFunc; -extern PHB_FNAME hb_comp_pFileName; -extern BOOL hb_comp_bPPO; -extern FILE * hb_comp_yyppo; -extern BOOL hb_comp_bStartProc; -extern BOOL hb_comp_bLineNumbers; -extern BOOL hb_comp_bQuiet; -extern BOOL hb_comp_bShortCuts; -extern int hb_comp_iWarnings; -extern BOOL hb_comp_bAnyWarning; -extern BOOL hb_comp_bAutoMemvarAssume; -extern BOOL hb_comp_bForceMemvars; -extern BOOL hb_comp_bDebugInfo; -extern char hb_comp_szPrefix[ 20 ]; -extern int hb_comp_iGenCOutput; -extern int hb_comp_iExitLevel; -extern int hb_comp_iFunctionCnt; -extern char hb_comp_cVarType; -extern char hb_comp_cDataListType; -extern char hb_comp_cCastType; -extern int hb_comp_iVarScope; -extern BOOL hb_comp_bDontGenLineNum; -extern FILES hb_comp_files; -extern int hb_comp_iStaticCnt; -extern int hb_comp_iErrorCount; - -extern char * hb_comp_szAnnounce; - -extern PHB_FNAME hb_comp_pOutPath; -extern BOOL hb_comp_bCredits; -extern BOOL hb_comp_bBuildInfo; -extern BOOL hb_comp_bLogo; -extern BOOL hb_comp_bSyntaxCheckOnly; -extern int hb_comp_iLanguage; - -extern USHORT hb_comp_wSeqCounter; -extern USHORT hb_comp_wForCounter; -extern USHORT hb_comp_wIfCounter; -extern USHORT hb_comp_wWhileCounter; -extern USHORT hb_comp_wCaseCounter; - -extern char * hb_comp_szDeclaredFun; - -extern char * hb_comp_szLastMethod; - -extern char * hb_comp_szErrors[]; -extern char * hb_comp_szWarnings[]; - -extern char * hb_pp_STD_CH; -extern BOOL hb_comp_bAutoOpen; -extern BOOL hb_comp_bError; -extern char hb_comp_cInlineID; - -extern INLINES hb_comp_inlines; -extern int hb_comp_iLineINLINE; -extern int hb_comp_iLinePRG; - -extern ULONG hb_comp_Supported; +extern int hb_comp_iLine; +extern FUNCTIONS hb_comp_functions; +extern FUNCTIONS hb_comp_funcalls; +extern SYMBOLS hb_comp_symbols; +extern PCOMDECLARED hb_comp_pFirstDeclared; +extern PCOMDECLARED hb_comp_pLastDeclared; +extern PCOMDECLARED hb_comp_pReleaseDeclared; +extern PCOMCLASS hb_comp_pFirstClass; +extern PCOMCLASS hb_comp_pLastClass; +extern PCOMCLASS hb_comp_pReleaseClass; +extern char * hb_comp_szFromClass; +extern PCOMDECLARED hb_comp_pLastMethod; +extern HB_PATHNAMES * hb_comp_pIncludePath; +extern PFUNCTION hb_comp_pInitFunc; +extern PHB_FNAME hb_comp_pFileName; +extern BOOL hb_comp_bPPO; +extern FILE * hb_comp_yyppo; +extern BOOL hb_comp_bStartProc; +extern BOOL hb_comp_bLineNumbers; +extern BOOL hb_comp_bQuiet; +extern BOOL hb_comp_bShortCuts; +extern int hb_comp_iWarnings; +extern BOOL hb_comp_bAnyWarning; +extern BOOL hb_comp_bAutoMemvarAssume; +extern BOOL hb_comp_bForceMemvars; +extern BOOL hb_comp_bDebugInfo; +extern char hb_comp_szPrefix[ 20 ]; +extern int hb_comp_iGenCOutput; +extern int hb_comp_iExitLevel; +extern int hb_comp_iFunctionCnt; +extern char hb_comp_cVarType; +extern char hb_comp_cDataListType; +extern char hb_comp_cCastType; +extern int hb_comp_iVarScope; +extern BOOL hb_comp_bDontGenLineNum; +extern FILES hb_comp_files; +extern int hb_comp_iStaticCnt; +extern int hb_comp_iErrorCount; + +extern char * hb_comp_szAnnounce; + +extern PHB_FNAME hb_comp_pOutPath; +extern BOOL hb_comp_bCredits; +extern BOOL hb_comp_bBuildInfo; +extern BOOL hb_comp_bLogo; +extern BOOL hb_comp_bSyntaxCheckOnly; +extern int hb_comp_iLanguage; + +extern USHORT hb_comp_wSeqCounter; +extern USHORT hb_comp_wForCounter; +extern USHORT hb_comp_wIfCounter; +extern USHORT hb_comp_wWhileCounter; +extern USHORT hb_comp_wCaseCounter; + +extern char * hb_comp_szDeclaredFun; + +extern char * hb_comp_szLastMethod; + +extern char * hb_comp_szErrors[]; +extern char * hb_comp_szWarnings[]; + +extern char * hb_pp_STD_CH; +extern BOOL hb_comp_bAutoOpen; +extern BOOL hb_comp_bError; +extern char hb_comp_cInlineID; + +extern INLINES hb_comp_inlines; +extern int hb_comp_iLineINLINE; +extern int hb_comp_iLinePRG; + +extern ULONG hb_comp_Supported; /* /GC command line setting types */ #define HB_COMPGENC_COMPACT 0 diff --git a/harbour/include/hblang.ch b/harbour/include/hblang.ch new file mode 100644 index 0000000000..861c60b7cd --- /dev/null +++ b/harbour/include/hblang.ch @@ -0,0 +1,59 @@ +/* + * $Id$ + */ + +/* + * Harbour Project source code: + * Header file for Class commands + * + * Copyright 2001-2002 Viktor Szakats + * www - http://www.harbour-project.org + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this software; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/). + * + * As a special exception, the Harbour Project gives permission for + * additional uses of the text contained in its release of Harbour. + * + * The exception is that, if you link the Harbour libraries with other + * files to produce an executable, this does not by itself cause the + * resulting executable to be covered by the GNU General Public License. + * Your use of that executable is in no way restricted on account of + * linking the Harbour library code into it. + * + * This exception does not however invalidate any other reasons why + * the executable file might be covered by the GNU General Public License. + * + * This exception applies only to the code released by the Harbour + * Project under the name Harbour. If you copy code from other + * Harbour Project or Free Software Foundation releases into a copy of + * Harbour, as the General Public License permits, the exception does + * not apply to the code that you add in this way. To avoid misleading + * anyone as to the status of such modified files, you must delete + * this exception notice from them. + * + * If you write modifications of your own for Harbour, it is your choice + * whether to permit this exception to apply to your modifications. + * If you do not wish that, delete this exception notice. + * + */ + +#ifndef HB_LANG_CH_ +#define HB_LANG_CH_ + +/* Dummy define for start */ +#define HB_I_( x ) x + +#endif /* HB_LANG_CH_ */ diff --git a/harbour/include/hbpp.h b/harbour/include/hbpp.h index aaee5658d0..ab7114f01a 100644 --- a/harbour/include/hbpp.h +++ b/harbour/include/hbpp.h @@ -89,7 +89,7 @@ typedef struct _COMMANDS /* PPCORE.C exported functions and variables */ -#define HB_INCLUDE_FUNC_( hbFunc ) BOOL hbFunc( char *, PATHNAMES * ) +#define HB_INCLUDE_FUNC_( hbFunc ) BOOL hbFunc( char *, HB_PATHNAMES * ) typedef HB_INCLUDE_FUNC_( HB_INCLUDE_FUNC ); typedef HB_INCLUDE_FUNC * HB_INCLUDE_FUNC_PTR; diff --git a/harbour/include/hbset.h b/harbour/include/hbset.h index ca02f15531..65f8bf9bae 100644 --- a/harbour/include/hbset.h +++ b/harbour/include/hbset.h @@ -190,7 +190,7 @@ extern HB_SET_STRUCT hb_set; extern void hb_setInitialize( void ); extern void hb_setRelease( void ); -extern PATHNAMES * hb_setGetFirstSetPath( void ); +extern HB_PATHNAMES * hb_setGetFirstSetPath( void ); typedef enum { diff --git a/harbour/source/common/hbfhnd.c b/harbour/source/common/hbfhnd.c index 3f56574acc..207d30cb8d 100644 --- a/harbour/source/common/hbfhnd.c +++ b/harbour/source/common/hbfhnd.c @@ -62,11 +62,15 @@ #include #include #include + #ifdef __cplusplus extern "C" { #endif + unsigned _RTLENTRY _EXPDATA _nfile = _NFILE_; + void hb_files_setup( void ); + extern void _RTLENTRY _init_handles( void ); extern void _RTLENTRY _init_streams( void ); @@ -101,7 +105,6 @@ FILE _RTLENTRY _EXPDATA _streams [_NFILE_] = { NULL, NULL, 0, 0, 0, _F_STDERR, 0, 2, 0 } }; - unsigned int _RTLENTRY _openfd[_NFILE_] = { O_RDONLY | O_TEXT | O_DEVICE, diff --git a/harbour/source/common/hbfsapi.c b/harbour/source/common/hbfsapi.c index c4af9d99f5..e0a6a478e2 100644 --- a/harbour/source/common/hbfsapi.c +++ b/harbour/source/common/hbfsapi.c @@ -53,24 +53,27 @@ #include "hbapi.h" #include "hbapifs.h" +/* NOTE: Not really belongs here, but until we can't find a better place + it will do it. [vszakats] */ extern void hb_fhnd_ForceLink( void ); + /* * Function that adds at most one path to a list of pathnames to search */ -static void AddSearchPath( char * szPath, PATHNAMES * * pSearchList ) +static void AddSearchPath( char * szPath, HB_PATHNAMES * * pSearchList ) { - PATHNAMES * pPath = *pSearchList; + HB_PATHNAMES * pPath = *pSearchList; if( pPath ) { while( pPath->pNext ) pPath = pPath->pNext; - pPath->pNext = ( PATHNAMES * ) hb_xgrab( sizeof( PATHNAMES ) ); + pPath->pNext = ( HB_PATHNAMES * ) hb_xgrab( sizeof( HB_PATHNAMES ) ); pPath = pPath->pNext; } else - *pSearchList = pPath = ( PATHNAMES * ) hb_xgrab( sizeof( PATHNAMES ) ); + *pSearchList = pPath = ( HB_PATHNAMES * ) hb_xgrab( sizeof( HB_PATHNAMES ) ); pPath->pNext = NULL; pPath->szPath = szPath; @@ -79,7 +82,7 @@ static void AddSearchPath( char * szPath, PATHNAMES * * pSearchList ) /* * Function that adds zero or more paths to a list of pathnames to search */ -void hb_fsAddSearchPath( char * szPath, PATHNAMES * * pSearchList ) +void hb_fsAddSearchPath( char * szPath, HB_PATHNAMES * * pSearchList ) { char * pPath; char * pDelim; @@ -91,6 +94,7 @@ void hb_fsAddSearchPath( char * szPath, PATHNAMES * * pSearchList ) AddSearchPath( pPath, pSearchList ); pPath = pDelim + 1; } + AddSearchPath( pPath, pSearchList ); } diff --git a/harbour/source/compiler/harbour.c b/harbour/source/compiler/harbour.c index e48089356c..5c607c7e3d 100644 --- a/harbour/source/compiler/harbour.c +++ b/harbour/source/compiler/harbour.c @@ -81,68 +81,68 @@ static void hb_compOptimizeFrames( PFUNCTION pFunc ); static void hb_compDeclaredInit( void ); /* global variables */ -FILES hb_comp_files; -FUNCTIONS hb_comp_functions; -FUNCTIONS hb_comp_funcalls; -SYMBOLS hb_comp_symbols; -PCOMDECLARED hb_comp_pFirstDeclared; -PCOMDECLARED hb_comp_pLastDeclared; -PCOMDECLARED hb_comp_pReleaseDeclared; +FILES hb_comp_files; +FUNCTIONS hb_comp_functions; +FUNCTIONS hb_comp_funcalls; +SYMBOLS hb_comp_symbols; +PCOMDECLARED hb_comp_pFirstDeclared; +PCOMDECLARED hb_comp_pLastDeclared; +PCOMDECLARED hb_comp_pReleaseDeclared; + +PCOMCLASS hb_comp_pFirstClass; +PCOMCLASS hb_comp_pLastClass; +PCOMCLASS hb_comp_pReleaseClass; +char * hb_comp_szFromClass; +PCOMDECLARED hb_comp_pLastMethod; + +int hb_comp_iLine; /* currently processed line number (globaly) */ +char * hb_comp_szFile; /* File Name of last compiled line */ +PFUNCTION hb_comp_pInitFunc; +PHB_FNAME hb_comp_pFileName = NULL; + +BOOL hb_comp_bPPO = FALSE; /* flag indicating, is ppo output needed */ +FILE * hb_comp_yyppo = NULL; /* output .ppo file */ +BOOL hb_comp_bStartProc = TRUE; /* holds if we need to create the starting procedure */ +BOOL hb_comp_bLineNumbers = TRUE; /* holds if we need pcodes with line numbers */ +BOOL hb_comp_bQuiet = FALSE; /* quiet mode */ +BOOL hb_comp_bShortCuts = TRUE; /* .and. & .or. expressions shortcuts */ +int hb_comp_iWarnings = 0; /* enable parse warnings */ +BOOL hb_comp_bAnyWarning = FALSE; /* holds if there was any warning during the compilation process */ +BOOL hb_comp_bAutoMemvarAssume = FALSE; /* holds if undeclared variables are automatically assumed MEMVAR (-a)*/ +BOOL hb_comp_bForceMemvars = FALSE; /* holds if memvars are assumed when accesing undeclared variable (-v)*/ +BOOL hb_comp_bDebugInfo = FALSE; /* holds if generate debugger required info */ +char hb_comp_szPrefix[ 20 ] = { '\0' }; /* holds the prefix added to the generated symbol init function name (in C output currently) */ +int hb_comp_iGenCOutput = HB_COMPGENC_VERBOSE; /* C code generation should be verbose (use comments) or not */ +int hb_comp_iExitLevel = HB_EXITLEVEL_DEFAULT; /* holds if there was any warning during the compilation process */ +HB_PATHNAMES * hb_comp_pIncludePath = NULL; +int hb_comp_iFunctionCnt; +int hb_comp_iErrorCount; +char hb_comp_cVarType; /* current declared variable type */ +char hb_comp_cDataListType; /* current declared variable list type */ +char hb_comp_cCastType; /* current casting type */ +BOOL hb_comp_bDontGenLineNum = FALSE; /* suppress line number generation */ +ULONG hb_comp_ulLastLinePos; /* position of last opcode with line number */ +int hb_comp_iStaticCnt; /* number of defined statics variables on the PRG */ +int hb_comp_iVarScope; /* holds the scope for next variables to be defined */ +PHB_FNAME hb_comp_pOutPath = NULL; +BOOL hb_comp_bCredits = FALSE; /* print credits */ +BOOL hb_comp_bBuildInfo = FALSE; /* print build info */ +BOOL hb_comp_bLogo = TRUE; /* print logo */ +BOOL hb_comp_bSyntaxCheckOnly = FALSE; /* syntax check only */ +int hb_comp_iLanguage = LANG_C; /* default Harbour generated output language */ +int hb_comp_iJumpOptimize = 1; +char * hb_comp_szDeclaredFun = NULL; -PCOMCLASS hb_comp_pFirstClass; -PCOMCLASS hb_comp_pLastClass; -PCOMCLASS hb_comp_pReleaseClass; -char * hb_comp_szFromClass; -PCOMDECLARED hb_comp_pLastMethod; +BOOL hb_comp_bAutoOpen = TRUE; +BOOL hb_comp_bError = FALSE; +char hb_comp_cInlineID = '0'; -int hb_comp_iLine; /* currently processed line number (globaly) */ -char * hb_comp_szFile; /* File Name of last compiled line */ -PFUNCTION hb_comp_pInitFunc; -PHB_FNAME hb_comp_pFileName = NULL; - -BOOL hb_comp_bPPO = FALSE; /* flag indicating, is ppo output needed */ -FILE * hb_comp_yyppo = NULL; /* output .ppo file */ -BOOL hb_comp_bStartProc = TRUE; /* holds if we need to create the starting procedure */ -BOOL hb_comp_bLineNumbers = TRUE; /* holds if we need pcodes with line numbers */ -BOOL hb_comp_bQuiet = FALSE; /* quiet mode */ -BOOL hb_comp_bShortCuts = TRUE; /* .and. & .or. expressions shortcuts */ -int hb_comp_iWarnings = 0; /* enable parse warnings */ -BOOL hb_comp_bAnyWarning = FALSE; /* holds if there was any warning during the compilation process */ -BOOL hb_comp_bAutoMemvarAssume = FALSE; /* holds if undeclared variables are automatically assumed MEMVAR (-a)*/ -BOOL hb_comp_bForceMemvars = FALSE; /* holds if memvars are assumed when accesing undeclared variable (-v)*/ -BOOL hb_comp_bDebugInfo = FALSE; /* holds if generate debugger required info */ -char hb_comp_szPrefix[ 20 ] = { '\0' }; /* holds the prefix added to the generated symbol init function name (in C output currently) */ -int hb_comp_iGenCOutput = HB_COMPGENC_VERBOSE; /* C code generation should be verbose (use comments) or not */ -int hb_comp_iExitLevel = HB_EXITLEVEL_DEFAULT; /* holds if there was any warning during the compilation process */ -PATHNAMES * hb_comp_pIncludePath = NULL; -int hb_comp_iFunctionCnt; -int hb_comp_iErrorCount; -char hb_comp_cVarType; /* current declared variable type */ -char hb_comp_cDataListType; /* current declared variable list type */ -char hb_comp_cCastType; /* current casting type */ -BOOL hb_comp_bDontGenLineNum = FALSE; /* suppress line number generation */ -ULONG hb_comp_ulLastLinePos; /* position of last opcode with line number */ -int hb_comp_iStaticCnt; /* number of defined statics variables on the PRG */ -int hb_comp_iVarScope; /* holds the scope for next variables to be defined */ -PHB_FNAME hb_comp_pOutPath = NULL; -BOOL hb_comp_bCredits = FALSE; /* print credits */ -BOOL hb_comp_bBuildInfo = FALSE; /* print build info */ -BOOL hb_comp_bLogo = TRUE; /* print logo */ -BOOL hb_comp_bSyntaxCheckOnly = FALSE; /* syntax check only */ -int hb_comp_iLanguage = LANG_C; /* default Harbour generated output language */ -int hb_comp_iJumpOptimize = 1; -char * hb_comp_szDeclaredFun = NULL; - -BOOL hb_comp_bAutoOpen = TRUE; -BOOL hb_comp_bError = FALSE; -char hb_comp_cInlineID = '0'; - -int hb_comp_iLineINLINE = 0; -int hb_comp_iLinePRG; -INLINES hb_comp_inlines; +int hb_comp_iLineINLINE = 0; +int hb_comp_iLinePRG; +INLINES hb_comp_inlines; /* various compatibility flags (-k switch) */ -ULONG hb_comp_Supported; +ULONG hb_comp_Supported; /* EXTERNAL statement can be placed into any place in a function - this flag is diff --git a/harbour/source/compiler/harbour.sly b/harbour/source/compiler/harbour.sly index 914655a308..e65c2351c6 100644 --- a/harbour/source/compiler/harbour.sly +++ b/harbour/source/compiler/harbour.sly @@ -1903,7 +1903,7 @@ void yyerror( char * s ) } -BOOL hb_compInclude( char * szFileName, PATHNAMES * pSearch ) +BOOL hb_compInclude( char * szFileName, HB_PATHNAMES * pSearch ) { PFILE pFile; diff --git a/harbour/source/compiler/harbour.y b/harbour/source/compiler/harbour.y index 2b6bf3390d..9843ba1a2b 100644 --- a/harbour/source/compiler/harbour.y +++ b/harbour/source/compiler/harbour.y @@ -1716,7 +1716,7 @@ void yyerror( char * s ) } -BOOL hb_compInclude( char * szFileName, PATHNAMES * pSearch ) +BOOL hb_compInclude( char * szFileName, HB_PATHNAMES * pSearch ) { PFILE pFile; diff --git a/harbour/source/pp/ppcore.c b/harbour/source/pp/ppcore.c index eb688cf634..831d016924 100644 --- a/harbour/source/pp/ppcore.c +++ b/harbour/source/pp/ppcore.c @@ -126,7 +126,7 @@ static int strotrim( char *, BOOL ); /* Ron Pinkas 2001-02-14 added 2nd param static int NextWord( char **, char *, BOOL ); static int NextName( char **, char * ); static int NextParm( char **, char * ); -static BOOL OpenInclude( char *, PATHNAMES *, PHB_FNAME, BOOL bStandardOnly, char * ); +static BOOL OpenInclude( char *, HB_PATHNAMES *, PHB_FNAME, BOOL bStandardOnly, char * ); static BOOL IsIdentifier( char *szProspect ); #define ISNAME( c ) ( isalnum( ( int ) c ) || ( c ) == '_' || ( c ) > 0x7E ) @@ -3849,7 +3849,7 @@ static BOOL IsIdentifier( char *szProspect ) return FALSE; } -static BOOL OpenInclude( char * szFileName, PATHNAMES * pSearch, PHB_FNAME pMainFileName, BOOL bStandardOnly, char * szInclude ) +static BOOL OpenInclude( char * szFileName, HB_PATHNAMES * pSearch, PHB_FNAME pMainFileName, BOOL bStandardOnly, char * szInclude ) { FILE * fptr; PHB_FNAME pFileName; diff --git a/harbour/source/pp/pplib.c b/harbour/source/pp/pplib.c index b8e4cc6e52..2353030a17 100644 --- a/harbour/source/pp/pplib.c +++ b/harbour/source/pp/pplib.c @@ -69,28 +69,28 @@ #ifdef HB_EXTENSION -PATHNAMES * hb_comp_pIncludePath = NULL; -PHB_FNAME hb_comp_pFileName = NULL; -FILES hb_comp_files; -int hb_comp_iLine; /* currently parsed file line number */ -int hb_comp_iLinePRG; -int hb_comp_iLineINLINE = 0; +HB_PATHNAMES * hb_comp_pIncludePath = NULL; +PHB_FNAME hb_comp_pFileName = NULL; +FILES hb_comp_files; +int hb_comp_iLine; /* currently parsed file line number */ +int hb_comp_iLinePRG; +int hb_comp_iLineINLINE = 0; /* These are need for the PP #pragma support */ -BOOL hb_comp_bPPO = FALSE; /* flag indicating, is ppo output needed */ -BOOL hb_comp_bStartProc = TRUE; /* holds if we need to create the starting procedure */ -BOOL hb_comp_bLineNumbers = TRUE; /* holds if we need pcodes with line numbers */ +BOOL hb_comp_bPPO = FALSE; /* flag indicating, is ppo output needed */ +BOOL hb_comp_bStartProc = TRUE; /* holds if we need to create the starting procedure */ +BOOL hb_comp_bLineNumbers = TRUE; /* holds if we need pcodes with line numbers */ #if 0 -BOOL hb_comp_bShortCuts = TRUE; /* .and. & .or. expressions shortcuts */ +BOOL hb_comp_bShortCuts = TRUE; /* .and. & .or. expressions shortcuts */ #endif -int hb_comp_iWarnings = 0; /* enable parse warnings */ -BOOL hb_comp_bAutoMemvarAssume = FALSE; /* holds if undeclared variables are automatically assumed MEMVAR (-a)*/ -BOOL hb_comp_bForceMemvars = FALSE; /* holds if memvars are assumed when accesing undeclared variable (-v)*/ -BOOL hb_comp_bDebugInfo = FALSE; /* holds if generate debugger required info */ -int hb_comp_iExitLevel = HB_EXITLEVEL_DEFAULT; /* holds if there was any warning during the compilation process */ -FILE *hb_comp_yyppo = NULL; +int hb_comp_iWarnings = 0; /* enable parse warnings */ +BOOL hb_comp_bAutoMemvarAssume = FALSE; /* holds if undeclared variables are automatically assumed MEMVAR (-a)*/ +BOOL hb_comp_bForceMemvars = FALSE; /* holds if memvars are assumed when accesing undeclared variable (-v)*/ +BOOL hb_comp_bDebugInfo = FALSE; /* holds if generate debugger required info */ +int hb_comp_iExitLevel = HB_EXITLEVEL_DEFAULT; /* holds if there was any warning during the compilation process */ +FILE * hb_comp_yyppo = NULL; static jmp_buf s_env; @@ -101,9 +101,9 @@ static jmp_buf s_env; * should be returned by a reference. */ -static void AddSearchPath( char * szPath, PATHNAMES * * pSearchList ) +static void AddSearchPath( char * szPath, HB_PATHNAMES * * pSearchList ) { - PATHNAMES * pPath = *pSearchList; + HB_PATHNAMES * pPath = *pSearchList; HB_TRACE(HB_TR_DEBUG, ("AddSearchPath(%s, %p)", szPath, pSearchList)); @@ -111,12 +111,12 @@ static void AddSearchPath( char * szPath, PATHNAMES * * pSearchList ) { while( pPath->pNext ) pPath = pPath->pNext; - pPath->pNext = ( PATHNAMES * ) hb_xgrab( sizeof( PATHNAMES ) ); + pPath->pNext = ( HB_PATHNAMES * ) hb_xgrab( sizeof( HB_PATHNAMES ) ); pPath = pPath->pNext; } else { - *pSearchList = pPath = ( PATHNAMES * ) hb_xgrab( sizeof( PATHNAMES ) ); + *pSearchList = pPath = ( HB_PATHNAMES * ) hb_xgrab( sizeof( HB_PATHNAMES ) ); } pPath->pNext = NULL; pPath->szPath = hb_strdup( szPath ); @@ -145,7 +145,7 @@ HB_FUNC( __PP_INIT ) HB_FUNC( __PP_PATH ) { - PATHNAMES * pPath = hb_comp_pIncludePath, * pPathNext; + HB_PATHNAMES * pPath = hb_comp_pIncludePath, * pPathNext; if( ISLOG( 2 ) && hb_parl( 2 ) ) { @@ -174,7 +174,7 @@ HB_FUNC( __PP_PATH ) HB_FUNC( __PP_FREE ) { - PATHNAMES * pPath = hb_comp_pIncludePath, * pPathNext; + HB_PATHNAMES * pPath = hb_comp_pIncludePath, * pPathNext; while( pPath ) { diff --git a/harbour/source/rtl/set.c b/harbour/source/rtl/set.c index e54303e795..2214959f08 100644 --- a/harbour/source/rtl/set.c +++ b/harbour/source/rtl/set.c @@ -73,13 +73,13 @@ static PHB_SET_LISTENER sp_sl_first; static PHB_SET_LISTENER sp_sl_last; static int s_next_listener; -static PATHNAMES * sp_set_path; +static HB_PATHNAMES * sp_set_path; static void hb_setFreeSetPath( void ) { /* Free all set paths */ - PATHNAMES * curPath = sp_set_path; - PATHNAMES * nextPath; + HB_PATHNAMES * curPath = sp_set_path; + HB_PATHNAMES * nextPath; while( curPath ) { nextPath = curPath->pNext; @@ -881,7 +881,7 @@ int hb_setListenerRemove( int listener ) return listener; } -PATHNAMES * hb_setGetFirstSetPath( void ) +HB_PATHNAMES * hb_setGetFirstSetPath( void ) { return sp_set_path; } diff --git a/harbour/source/rtl/spfiles.c b/harbour/source/rtl/spfiles.c index 2fbf49182b..a9c2e67f64 100644 --- a/harbour/source/rtl/spfiles.c +++ b/harbour/source/rtl/spfiles.c @@ -77,7 +77,7 @@ static BOOL FindFile( BYTE * pFilename, BYTE * path ) if( !bIsFile && hb_set.HB_SET_PATH ) { - PATHNAMES * nextPath = hb_setGetFirstSetPath(); + HB_PATHNAMES * nextPath = hb_setGetFirstSetPath(); while( !bIsFile && nextPath ) { pFilepath->szPath = nextPath->szPath; @@ -90,7 +90,7 @@ static BOOL FindFile( BYTE * pFilename, BYTE * path ) hb_xfree( pFilepath ); if( !bIsFile ) - * path = '\0'; + *path = '\0'; return bIsFile; } @@ -106,27 +106,18 @@ BOOL hb_spFile( BYTE * pFilename ) FHANDLE hb_spOpen( BYTE * pFilename, USHORT uiFlags ) { - FHANDLE hFileHandle = -1; BYTE path[ _POSIX_PATH_MAX + 1 ]; HB_TRACE(HB_TR_DEBUG, ("hb_spOpen(%p, %hu)", pFilename, uiFlags)); if( FindFile( pFilename, path ) ) - { - hFileHandle = hb_fsOpen( path, uiFlags ); - } + return hb_fsOpen( path, uiFlags ); else - { - hFileHandle = hb_fsOpen( pFilename, uiFlags ); - } - - return hFileHandle; + return hb_fsOpen( pFilename, uiFlags ); } FHANDLE hb_spCreate( BYTE * pFilename, USHORT uiAttr ) { - FHANDLE hFileHandle = -1; - HB_TRACE(HB_TR_DEBUG, ("hb_spCreate(%p, %hu)", pFilename, uiAttr)); if( ISCHAR( 1 ) ) @@ -140,16 +131,14 @@ FHANDLE hb_spCreate( BYTE * pFilename, USHORT uiAttr ) hb_fsFNameMerge( (char*) path, pFilepath ); hb_xfree( pFilepath ); - hFileHandle = hb_fsCreate( path, uiAttr ); + return hb_fsCreate( path, uiAttr ); } - - return hFileHandle; + else + return FS_ERROR; } FHANDLE hb_spCreateEx( BYTE * pFilename, USHORT uiAttr, USHORT uiFlags ) { - FHANDLE hFileHandle; - HB_TRACE(HB_TR_DEBUG, ("hb_spCreateEx(%p, %hu, %hu)", pFilename, uiAttr, uiFlags)); if( ISCHAR( 1 ) ) @@ -163,8 +152,8 @@ FHANDLE hb_spCreateEx( BYTE * pFilename, USHORT uiAttr, USHORT uiFlags ) hb_fsFNameMerge( (char*) path, pFilepath ); hb_xfree( pFilepath ); - hFileHandle = hb_fsCreateEx( path, uiAttr, uiFlags ); + return hb_fsCreateEx( path, uiAttr, uiFlags ); } - - return hFileHandle; + else + return FS_ERROR; } diff --git a/harbour/source/vm/classes.c b/harbour/source/vm/classes.c index a5364e0f7d..48af1be2e4 100644 --- a/harbour/source/vm/classes.c +++ b/harbour/source/vm/classes.c @@ -2049,7 +2049,6 @@ static HARBOUR hb___msgClsParent( void ) { PHB_ITEM pItemRef; PHB_ITEM pItemParam; - PCLASS pClass; char * szParentName = 0; USHORT uiClass, i; BOOL lClass=FALSE; @@ -2061,8 +2060,6 @@ static HARBOUR hb___msgClsParent( void ) uiClass = pItemRef->item.asArray.value->uiClass; - pClass = s_pClasses + ( uiClass - 1 ); - pItemParam = hb_stackItemFromBase( 1 ); if( HB_IS_OBJECT( pItemParam ) ) diff --git a/harbour/source/vm/hvm.c b/harbour/source/vm/hvm.c index b07d9e4f9d..9e308e6f34 100644 --- a/harbour/source/vm/hvm.c +++ b/harbour/source/vm/hvm.c @@ -2915,11 +2915,8 @@ void hb_vmDo( USHORT uiParams ) if( ! HB_IS_NIL( pSelf ) ) /* are we sending a message ? */ { - - BOOL lPopSuper = FALSE ; + BOOL lPopSuper = FALSE; PHB_BASEARRAY pSelfBase = NULL; - PHB_ITEM pRealSelf=NULL; - USHORT uiClass; if( pSym == &( hb_symEval ) && HB_IS_BLOCK( pSelf ) ) pFunc = pSym->pFunPtr; /* __EVAL method = function */ @@ -2931,7 +2928,10 @@ void hb_vmDo( USHORT uiParams ) pSelfBase = pSelf->item.asArray.value; if( pSelfBase->uiPrevCls ) /* Is is a Super cast ? */ { - USHORT nPos ; + PHB_ITEM pRealSelf; + USHORT nPos; + USHORT uiClass; + /* printf( "\n VmDo Method: %s \n", pSym->szName ); */ @@ -3090,22 +3090,22 @@ void hb_vmSend( USHORT uiParams ) if( ! HB_IS_NIL( pSelf ) ) /* are we sending a message ? */ { - - BOOL lPopSuper = FALSE ; - PHB_BASEARRAY pSelfBase; - PHB_ITEM pRealSelf=NULL; - USHORT uiClass; - if( ! ( pSym == &( hb_symEval ) && HB_IS_BLOCK( pSelf ) ) ) { if( HB_IS_OBJECT( pSelf ) ) /* Object passed */ { + PHB_BASEARRAY pSelfBase; + BOOL lPopSuper = FALSE; pFunc = hb_objGetMethod( pSelf, pSym ); pSelfBase = pSelf->item.asArray.value; + if( pSelfBase->uiPrevCls ) /* Is is a Super cast ? */ { - USHORT nPos ; + PHB_ITEM pRealSelf; + USHORT nPos; + USHORT uiClass; + /* printf( "\n VmSend Method: %s \n", pSym->szName ); */ diff --git a/harbour/utils/hbpp/hbpp.c b/harbour/utils/hbpp/hbpp.c index c31eaba157..e6422d493d 100644 --- a/harbour/utils/hbpp/hbpp.c +++ b/harbour/utils/hbpp/hbpp.c @@ -70,7 +70,7 @@ extern int hb_pp_ParseDefine( char * ); -static void AddSearchPath( char * szPath, PATHNAMES * * pSearchList ); +static void AddSearchPath( char * szPath, HB_PATHNAMES * * pSearchList ); static void OutTable( DEFINES * endDefine, COMMANDS * endCommand ); static BOOL hb_pp_fopen( char * szFileName ); @@ -78,10 +78,10 @@ static char s_szLine[ HB_PP_STR_SIZE ]; static int s_iWarnings = 0; static char * hb_buffer; -PATHNAMES * hb_comp_pIncludePath = NULL; -PHB_FNAME hb_comp_pFileName = NULL; -FILES hb_comp_files; -int hb_comp_iLine = 1; /* currently parsed file line number */ +HB_PATHNAMES * hb_comp_pIncludePath = NULL; +PHB_FNAME hb_comp_pFileName = NULL; +FILES hb_comp_files; +int hb_comp_iLine = 1; /* currently parsed file line number */ /* These are need for the PP #pragma support */ BOOL hb_comp_bPPO = FALSE; /* flag indicating, is ppo output needed */ @@ -426,9 +426,9 @@ static void OutTable( DEFINES * endDefine, COMMANDS * endCommand ) /* * Function that adds specified path to the list of pathnames to search */ -static void AddSearchPath( char * szPath, PATHNAMES * * pSearchList ) +static void AddSearchPath( char * szPath, HB_PATHNAMES * * pSearchList ) { - PATHNAMES * pPath = *pSearchList; + HB_PATHNAMES * pPath = *pSearchList; HB_TRACE(HB_TR_DEBUG, ("AddSearchPath(%s, %p)", szPath, pSearchList)); @@ -436,12 +436,12 @@ static void AddSearchPath( char * szPath, PATHNAMES * * pSearchList ) { while( pPath->pNext ) pPath = pPath->pNext; - pPath->pNext = ( PATHNAMES * ) hb_xgrab( sizeof( PATHNAMES ) ); + pPath->pNext = ( HB_PATHNAMES * ) hb_xgrab( sizeof( HB_PATHNAMES ) ); pPath = pPath->pNext; } else { - *pSearchList = pPath = ( PATHNAMES * ) hb_xgrab( sizeof( PATHNAMES ) ); + *pSearchList = pPath = ( HB_PATHNAMES * ) hb_xgrab( sizeof( HB_PATHNAMES ) ); } pPath->pNext = NULL; pPath->szPath = szPath;