From 01de609658c3cca698dbbdd4e88690b740d0fc6b Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 14 Sep 1999 15:40:29 +0000 Subject: [PATCH] 19990914-17:30 GMT+1 --- harbour/ChangeLog | 11 ++++++ harbour/config/rules.cf | 2 +- harbour/source/compiler/harbour.y | 61 ++++++++++++++++++++++++++----- harbour/source/rtl/do.c | 2 +- 4 files changed, 65 insertions(+), 11 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 1082d22ec1..d7cea9f6f6 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,14 @@ +19990914-17:30 GMT+1 Victor Szel + * config/rules.cf + * Harbour flag /q changed to /q0 to omit the compiler header. + * source/rtl/do.c + ! DO() fixed to use hb_dynsymFind() instead of hb_dynsymGet(), + now it properly displays when the passed string is not a symbol, rather + then throwing an internal error. + * source/compiler/harbour.y + + /CREDITS command line switch to display the development team. Like in + Clipper. + 19990914-13:15 GMT+1 Victor Szel * source/compiler/harbour.y source/compiler/gen*.c diff --git a/harbour/config/rules.cf b/harbour/config/rules.cf index 1786c8c2c2..d6b6efb5e7 100644 --- a/harbour/config/rules.cf +++ b/harbour/config/rules.cf @@ -20,7 +20,7 @@ HB := $(HB_BIN_COMPILE)/ endif HB := $(HB)harbour$(EXE_EXT) -HB_FLAGS = -n -q -I$(TOP) -I$(HB_INC_COMPILE) +HB_FLAGS = -n -q0 -I$(TOP) -I$(HB_INC_COMPILE) # The rule to link an executable. ifeq ($(LD_RULE),) diff --git a/harbour/source/compiler/harbour.y b/harbour/source/compiler/harbour.y index 9d8ff1c2bc..671ee425a8 100644 --- a/harbour/source/compiler/harbour.y +++ b/harbour/source/compiler/harbour.y @@ -264,8 +264,10 @@ extern void GenObj32( PHB_FNAME ); /* generates OBJ 32 bits */ /* argument checking */ void CheckArgs( char *, int ); +static BOOL SwitchCmp( char * szString, char * szSwitch ); void PrintUsage( char * ); +void PrintCredits( void ); #define YYDEBUG 1 /* Parser debug information support */ @@ -427,6 +429,7 @@ int iFunctions = 0; BOOL _bStartProc = TRUE; /* holds if we need to create the starting procedure */ BOOL _bLineNumbers = TRUE; /* holds if we need pcodes with line numbers */ +BOOL _bCredits = FALSE; /* print credits */ BOOL _bLogo = TRUE; /* print logo */ BOOL _bQuiet = FALSE; /* quiet mode */ BOOL _bSyntaxCheckOnly = FALSE; /* syntax check only */ @@ -1348,13 +1351,14 @@ int harbour_main( int argc, char * argv[] ) for( iArg = 1; iArg < argc; iArg++ ) { - if( IS_OPT_SEP( argv[ iArg ][ 0 ] ) && - ( argv[ iArg ][ 1 ] == 'q' || argv[ iArg ][ 1 ] == 'Q' ) && - argv[ iArg ][ 2 ] == '0' ) - { + if( SwitchCmp( argv[ iArg ], "Q0" ) ) _bLogo = FALSE; - break; - } + + else if( SwitchCmp( argv[ iArg ], "CREDITS" ) || + SwitchCmp( argv[ iArg ], "CREDIT" ) || + SwitchCmp( argv[ iArg ], "CREDI" ) || + SwitchCmp( argv[ iArg ], "CRED" ) ) + _bCredits = TRUE; } if( _bLogo ) @@ -1364,6 +1368,12 @@ int harbour_main( int argc, char * argv[] ) printf( "Copyright 1999, http://www.harbour-project.org\n" ); } + if( _bCredits ) + { + PrintCredits(); + return iStatus; + } + if( argc > 1 ) { char szFileName[ _POSIX_PATH_MAX ]; /* filename to parse */ @@ -1803,6 +1813,15 @@ void PrintUsage( char * szSelf ) , szSelf ); } +/* + * Prints credits +*/ +void PrintCredits( void ) +{ + printf( "\nCredits: The Harbour Team at www.harbour-project.com" + ); +} + /* * Function that adds specified path to the list of pathnames to search */ @@ -4190,7 +4209,7 @@ void GenPCode1( BYTE byte ) else if( pOperand2 && pOperand2->cType == ' ' ) GenWarning( _szCWarnings, 'W', WARN_NUMERIC_SUSPECT, NULL, NULL ); - /* compile time 2nd. operand has to be released */ + /* compile time 2nd. operand has to be released */ if( pOperand2 ) { hb_xfree( ( void * ) pOperand2 ); @@ -4235,7 +4254,7 @@ void GenPCode1( BYTE byte ) else cType = pOperand1->cType; - /* compile time 2nd. operand has to be released */ + /* compile time 2nd. operand has to be released */ if( pOperand2 ) { hb_xfree( ( void * ) pOperand2 ); @@ -4279,7 +4298,7 @@ void GenPCode1( BYTE byte ) else if( pOperand1 && pOperand2 && pOperand1->cType != ' ' && pOperand2->cType == ' ' ) GenWarning( _szCWarnings, 'W', WARN_OPERAND_SUSPECT, sType1, NULL ); - /* compile time 2nd. operand has to be released */ + /* compile time 2nd. operand has to be released */ if( pOperand2 ) { hb_xfree( ( void * ) pOperand2 ); @@ -5170,3 +5189,27 @@ static ULONG PackDateTime( void ) return MKLONG( szString[ 3 ], szString[ 2 ], szString[ 1 ], szString[ 0 ] ); } +static BOOL SwitchCmp( char * szString, char * szSwitch ) +{ + if( IS_OPT_SEP( *szString ) ) + { + szString++; + + if( strlen( szString ) == strlen( szSwitch ) ) + { + while( *szString != '\0' ) + { + if( toupper( *szString ) != *szSwitch ) + return FALSE; + + szString++; + szSwitch++; + } + + return TRUE; + } + } + + return FALSE; +} + diff --git a/harbour/source/rtl/do.c b/harbour/source/rtl/do.c index e9f993fd5f..3823e3edd1 100644 --- a/harbour/source/rtl/do.c +++ b/harbour/source/rtl/do.c @@ -94,7 +94,7 @@ HARBOUR HB_DO( void ) if( IS_STRING( pItem ) ) { - PHB_DYNS pDynSym = hb_dynsymGet( hb_itemGetCPtr( pItem ) ); + PHB_DYNS pDynSym = hb_dynsymFind( hb_itemGetCPtr( pItem ) ); if( pDynSym ) {