See changelog

This commit is contained in:
Eddie Runia
1999-05-22 13:19:37 +00:00
parent 6b601b5fc9
commit d972547fbe
7 changed files with 79 additions and 25 deletions

View File

@@ -1,3 +1,22 @@
19990522-14:10 CET Eddie Runia
Change from 11:43 committed
* tests/broken/instr.prg
removed
* include/hbsetup.h
#define HARBOUR_START_PROGRAM temporarily commented out, because of errors
19990522-11:43 CET Eddie Runia
* source/vm/hvm.c
pItem bug in add changed
Instring operator added
'unreleased memory block' only get shown if memory block remain open
* tests/working/instr.prg
test program for instring added
* tests/working/runner.c
'Loading' messages removed
* source/compiler/harbour.y
'Debug' messages removed.
19990521-21:45 CET Eddie Runia
* tests/broken/instr.prg added. Contribution from Les Griffiths.
formerly known as strcomp

View File

@@ -16,7 +16,7 @@
*
* By default we are using automatic lookup (symbol not defined)
*/
#define HARBOUR_START_PROCEDURE "MAIN"
/* #define HARBOUR_START_PROCEDURE "MAIN" */
/* This symbol defines if we want an ability to create and link OBJ files
* generated by Harbour compiler

View File

@@ -3459,9 +3459,6 @@ void GenPortObj( char *szFileName, char *szName )
while( pFunc )
{
/* if( pFunc->cScope != FS_PUBLIC )
fprintf( yyc, "static " ); */
fputs( pFunc->szName, yyc );
fputc( 0, yyc );
fputc( (BYTE) ( ( pFunc->lPCodePos ) & 255 ), yyc ); /* Write size */
@@ -3469,7 +3466,7 @@ void GenPortObj( char *szFileName, char *szName )
fputc( (BYTE) ( ( pFunc->lPCodePos >> 16 ) & 255 ), yyc );
fputc( (BYTE) ( ( pFunc->lPCodePos >> 24 ) & 255 ), yyc );
printf( "Creating output for %s\n", pFunc->szName );
/* printf( "Creating output for %s\n", pFunc->szName ); */
lPCodePos = 0;
lPad = 0; /* Number of bytes optimized */

View File

@@ -50,6 +50,7 @@ void GenArray( WORD wElements ); /* generates a wElements Array and fills it fro
void Greater( void ); /* checks if the latest - 1 value is greater than the latest, removes both and leaves result */
void GreaterEqual( void ); /* checks if the latest - 1 value is greater than or equal the latest, removes both and leaves result */
void Inc( void ); /* increment the latest numeric value on the stack */
void Instring( void ); /* check whether string 1 is contained in string 2 */
void ItemCopy( PITEM pDest, PITEM pSource ); /* copies an item to one place to another respecting its containts */
void Less( void ); /* checks if the latest - 1 value is less than the latest, removes both and leaves result */
void LessEqual( void ); /* checks if the latest - 1 value is less than or equal the latest, removes both and leaves result */
@@ -125,6 +126,7 @@ void InitSymbolTable( void ); /* initialization of runtime support symbols */
static void ForceLink( void );
ULONG hb_isMessage( PITEM, char * );
ULONG hb_strAt( char *, long, char *, long );
#define STACK_INITITEMS 100
#define STACK_EXPANDITEMS 20
@@ -231,10 +233,13 @@ BYTE bErrorLevel = 0; /* application exit errorlevel */
/* LogSymbols(); */
HBDEBUG( "Done!\n" );
printf( "\n\ntotal memory blocks allocated: %lu\n", ulMemoryMaxBlocks );
printf( "memory maximum size consumed: %ld\n", ulMemoryMaxConsumed );
printf( "memory blocks not released: %ld\n", ulMemoryBlocks );
printf( "memory size not released: %ld\n", ulMemoryConsumed );
if( ulMemoryBlocks )
{
printf( "\n\ntotal memory blocks allocated: %lu\n", ulMemoryMaxBlocks );
printf( "memory maximum size consumed: %ld\n", ulMemoryMaxConsumed );
printf( "memory blocks not released: %ld\n", ulMemoryBlocks );
printf( "memory size not released: %ld\n", ulMemoryConsumed );
}
return bErrorLevel;
}
@@ -345,6 +350,11 @@ void VirtualMachine( PBYTE pCode, PSYMBOL pSymbols )
w++;
break;
case _INSTRING:
Instring();
w++;
break;
case _JUMP:
wParams = pCode[ w + 1 ] + ( pCode[ w + 2 ] * 256 );
if( wParams )
@@ -1043,6 +1053,31 @@ void ItemRelease( PITEM pItem )
pItem->wType = IT_NIL;
}
void Instring( void )
{
PITEM pItem1 = stack.pPos - 2;
PITEM pItem2 = stack.pPos - 1;
int iResult;
ULONG ul;
if( IS_STRING( pItem1 ) && IS_STRING( pItem2 ) )
{
for( iResult = 0, ul = 0; !iResult && ul < (ULONG) pItem1->wLength; ul++ )
iResult = hb_strAt( pItem1->value.szText + ul, 1,
pItem2->value.szText, pItem2->wLength );
StackPop();
StackPop();
PushLogical( iResult == 0 ? 0 : 1 );
}
else
{
PITEM pError = _errNew();
_errPutDescription( pError, "Error BASE/1109 Argument error: $" );
_errLaunch( pError );
}
}
void ItemCopy( PITEM pDest, PITEM pSource )
{
ItemRelease( pDest );
@@ -1382,7 +1417,7 @@ void Plus( void )
PushDate( lDate1 + dNumber2 );
}
else if( IS_OBJECT( pItem1 ) && hb_isMessage( pItem, "+" ) )
else if( IS_OBJECT( pItem1 ) && hb_isMessage( pItem2, "+" ) )
OperatorCall( pItem1, pItem2, "+" );
/* TODO: Generate an error if types don't match */

View File

@@ -1,14 +0,0 @@
/* test of instring $ operator */
function main
qout( "test of instring $ operator ")
qout('"d" $ "bcde"', "d" $ "bcde",.t.)
qout('"D" $ "BCDE"', "D" $ "BCDE",.t.)
qout('"a" $ "bcde"', "a" $ "bcde",.f.)
qout('"d" $ "BCDE"', "d" $ "BCDE",.f.)
qout('"D" $ "bcde"', "D" $ "bcde",.f.)
return nil

View File

@@ -0,0 +1,18 @@
/* test of instring $ operator */
function main
qout( "test of instring $ operator ")
qout('"d" $ "bcde" ', "d" $ "bcde",.t.)
qout('"D" $ "BCDE" ', "D" $ "BCDE",.t.)
qout('"a" $ "bcde" ', "a" $ "bcde",.f.)
qout('"d" $ "BCDE" ', "d" $ "BCDE",.f.)
qout('"D" $ "bcde" ', "D" $ "bcde",.f.)
qout('"de" $ "bcde"', "de" $ "bcde",.t.)
qout('"bd" $ "bcde"', "bd" $ "bcde",.t.)
qout('"BD" $ "bcde"', "BD" $ "bcde",.f.)
return nil

View File

@@ -172,7 +172,6 @@ HARBOUR HB_RUN( void ) /* HB_Run( <cFile> ) */
else
bCont = FALSE;
} while( bCont );
printf("\nLoading <%s>", szTemp );
pDynFunc[ ul ].szName = (char *) _xgrab( szIdx - szTemp + 1);
strcpy( pDynFunc[ ul ].szName, szTemp );