2001-03-24 02:20 UTC-0800 Ron Pinkas <ron@profit-master.com>

* source/compiler/hbpcode.c
     ! Fixed some StrongType logic.

   * source/compiler/genc.c
   * source/rdd/dbf1.c
   * source/rtl/gtapi.c
   * source/vm/hvm.c
     ! Corrected Compiler warnings.

   * source/compiler/harbour.c
   * include/hbcomp.h
     * Minor formatting.
This commit is contained in:
Ron Pinkas
2001-04-07 20:27:26 +00:00
parent 03c9010517
commit bb7e6f1111
8 changed files with 100 additions and 42 deletions

View File

@@ -1,3 +1,17 @@
2001-04-07 13:25 UTC-0800 Ron Pinkas <ron@profit-master.com>
* source/compiler/hbpcode.c
! Fixed some StrongType logic.
* source/compiler/genc.c
* source/rdd/dbf1.c
* source/rtl/gtapi.c
* source/vm/hvm.c
! Corrected Compiler warnings.
* source/compiler/harbour.c
* include/hbcomp.h
* Minor formatting.
2001-07-01 21:20 GMT+3 Alexander Kresin <alex@belacy.belgorod.su>
Changes, provided by Marek Paliwoda.
*doc/en/gtslang.txt

View File

@@ -90,23 +90,22 @@ struct _COMCLASS; /* forward declaration */
/* Declared Function/Method support structure */
typedef struct _COMDECLARED
{
char * szName; /* the name of the symbol */
BYTE cType;
BYTE * cParamTypes;
USHORT iParamCount;
struct _COMCLASS * pClass;
struct _COMCLASS * ( * pParamClasses );
struct _COMDECLARED * pNext; /* pointer to the next declared function */
char * szName; /* the name of the symbol */
BYTE cType;
BYTE * cParamTypes;
USHORT iParamCount;
struct _COMCLASS * pClass;
struct _COMCLASS * ( * pParamClasses );
struct _COMDECLARED * pNext; /* pointer to the next declared function */
} COMDECLARED, * PCOMDECLARED;
/* Declared Class support structure */
typedef struct _COMCLASS
{
char * szName;
PCOMDECLARED pMethod;
char * szName;
PCOMDECLARED pMethod;
struct _COMCLASS * pNext;
PCOMDECLARED pLast;
PCOMDECLARED pLast;
} COMCLASS, * PCOMCLASS;
/* locals, static, public variables support */
@@ -156,7 +155,7 @@ typedef struct __FUNC
struct __FUNC * pNext; /* pointer to the next defined function */
} _FUNC, * PFUNCTION;
/* structure to hold a Clipper defined function */
/* structure to hold an INLINE block of source */
typedef struct __INLINE
{
char * szName; /* name of a inline function */

View File

@@ -1607,7 +1607,7 @@ static HB_GENC_FUNC( hb_p_statics )
i = 0;
while( ( chr = pVar->szName[ i++ ] ) )
while( ( chr = pVar->szName[ i++ ] ) == TRUE )
{
if( chr == '\'' || chr == '\\')
fprintf( cargo->yyc, " \'\\%c\',", chr );
@@ -1876,4 +1876,4 @@ static void hb_compGenCCompact( PFUNCTION pFunc, FILE * yyc )
if( nChar != 0)
fprintf( yyc, "\n" );
}
}

View File

@@ -3221,12 +3221,13 @@ void hb_compStaticDefEnd( void )
*/
void hb_compCodeBlockStart()
{
PFUNCTION pFunc = hb_compFunctionNew( NULL, HB_FS_STATIC );
PFUNCTION pBlock;
pFunc->pOwner = hb_comp_functions.pLast;
pFunc->iStaticsBase = hb_comp_functions.pLast->iStaticsBase;
pBlock = hb_compFunctionNew( NULL, HB_FS_STATIC );
pBlock->pOwner = hb_comp_functions.pLast;
pBlock->iStaticsBase = hb_comp_functions.pLast->iStaticsBase;
hb_comp_functions.pLast = pFunc;
hb_comp_functions.pLast = pBlock;
hb_compLinePushIfDebugger();
}
@@ -3304,7 +3305,7 @@ void hb_compCodeBlockEnd( void )
hb_xfree( ( void * ) pFree );
}
hb_compGenPCodeN( pCodeblock->pCode, pCodeblock->lPCodePos, ( BOOL ) 1 );
hb_compGenPCodeN( pCodeblock->pCode, pCodeblock->lPCodePos, ( BOOL ) 0 );
hb_compGenPCode1( HB_P_ENDBLOCK ); /* finish the codeblock */
/* this fake-function is no longer needed */

View File

@@ -243,9 +243,9 @@ void hb_compStrongType( int iSize )
else if( pFunc->iStackSize - pFunc->iStackIndex < 4 )
pFunc->pStack = ( BYTE * ) hb_xrealloc( pFunc->pStack, pFunc->iStackSize += 16 );
/* TODO Split under conitions for the different matching possible iSize. */
/* TODO: Split under conitions for the different matching possible iSize. */
/* TODO Subject to Operator Overloading! */
/* TODO: Subject to Operator Overloading! */
switch ( pFunc->pCode[ ulPos ] )
{
@@ -1194,11 +1194,13 @@ void hb_compStrongType( int iSize )
break;
/* Blcoks */
/*
case HB_P_PUSHBLOCKSHORT :
break;
/* Nothing to do, handled by HB_P_ENDBLOCK.
case HB_P_PUSHBLOCK :
case HB_P_PUSHBLOCKSHORT :
*/
break;
*/
case HB_P_ENDBLOCK :
/* Override the last value of the block left on the stack. */
@@ -1302,7 +1304,7 @@ void hb_compStrongType( int iSize )
case HB_P_PUSHLOCALREF :
case HB_P_PUSHLOCAL :
if( pFunc->pCode[ ulPos ] == HB_P_PUSHLOCALNEAR )
wVar = ( SHORT ) pFunc->pCode[ ulPos + 1 ];
wVar = ( signed char ) pFunc->pCode[ ulPos + 1 ];
else
wVar = * ( ( SHORT * ) &( pFunc->pCode )[ ulPos + 1 ] );
@@ -1314,18 +1316,36 @@ void hb_compStrongType( int iSize )
/* Might be a nested block. */
while ( pTmp->pOwner )
pTmp = pTmp->pOwner;
{
pTmp = pTmp->pOwner;
}
pVar = hb_compVariableFind( pTmp->pLocals, -wVar );
pVar = pFunc->pStatics;
while( ++wVar < 0 && pVar )
{
pVar = pVar->pNext;
}
if ( pVar )
{
wVar = hb_compVariableGetPos( pTmp->pLocals, pVar->szName );
pVar = hb_compVariableFind( pTmp->pLocals, wVar );
}
}
else
{
pVar = hb_compVariableFind( pFunc->pLocals, wVar );
}
if( pVar )
{
if( ! ( pVar->iUsed & VU_INITIALIZED ) )
hb_compGenWarning( hb_comp_szWarnings, 'W', HB_COMP_WARN_NOT_INITIALIZED, pVar->szName, NULL );
/*
printf( "\nUsed: %s\n", pVar->szName );
*/
/* Mark as used */
pVar->iUsed |= VU_USED;
@@ -1346,11 +1366,16 @@ void hb_compStrongType( int iSize )
pFunc->pStack[ pFunc->iStackIndex++ ] = pVar->cType;
}
else
{
/*
printf( "\nCould not find Local %i in: $s\n", wVar, pFunc->szName );
*/
if( pFunc->pCode[ ulPos ] == HB_P_PUSHLOCALREF )
pFunc->pStack[ pFunc->iStackIndex++ ] = '@';
else
pFunc->pStack[ pFunc->iStackIndex++ ] = ' ';
}
break;
case HB_P_PUSHSTATICREF :
@@ -1442,19 +1467,29 @@ void hb_compStrongType( int iSize )
if( pFunc->pCode[ ulPos ] == HB_P_PUSHMEMVAR && pSym->szName )
{
if( pFunc->pMemvars )
{
wVar = hb_compVariableGetPos( pFunc->pMemvars, pSym->szName );
}
if( wVar )
{
pVar = hb_compVariableFind( pFunc->pMemvars, wVar );
}
if( ! pVar )
{
pVar = hb_compPrivateFind( pSym->szName );
}
if( ( ! pVar ) && hb_comp_functions.pFirst->pMemvars )
{
wVar = hb_compVariableGetPos( hb_comp_functions.pFirst->pMemvars, pSym->szName );
if( wVar )
{
pVar = hb_compVariableFind( hb_comp_functions.pFirst->pMemvars, wVar );
/* May have been initialized in any other function - can't check. */
pVar->iUsed |= VU_INITIALIZED;
}
}
}
@@ -1988,17 +2023,31 @@ void hb_compStrongType( int iSize )
/* we are accesing variables within a codeblock */
if( wVar < 0 )
{
/* Finding the Function owning the block. */
pTmp = pFunc->pOwner;
/* Finding the Function owning the block. */
pTmp = pFunc->pOwner;
/* Might be a nested block. */
while ( pTmp->pOwner )
pTmp = pTmp->pOwner;
/* Might be a nested block. */
while ( pTmp->pOwner )
{
pTmp = pTmp->pOwner;
}
pVar = hb_compVariableFind( pTmp->pLocals, -wVar );
pVar = pFunc->pStatics;
while( ++wVar < 0 && pVar )
{
pVar = pVar->pNext;
}
if ( pVar )
{
wVar = hb_compVariableGetPos( pTmp->pLocals, pVar->szName );
pVar = hb_compVariableFind( pTmp->pLocals, wVar );
}
}
else
{
pVar = hb_compVariableFind( pFunc->pLocals, wVar );
}
if( pVar )
{

View File

@@ -2384,7 +2384,6 @@ ERRCODE hb_dbfOpenMemFile( DBFAREAP pArea, LPDBOPENINFO pOpenInfo )
if( pError )
{
hb_errRelease( pError );
pError = NULL;
}
return ( pArea->hMemoFile == FS_ERROR ? FAILURE : SUCCESS );
}
@@ -2517,4 +2516,4 @@ HB_FUNC( DBF_GETFUNCTABLE )
hb_retni( hb_rddInherit( pTable, &dbfTable, &dbfSuper, 0 ) );
else
hb_retni( FAILURE );
}
}

View File

@@ -443,7 +443,7 @@ USHORT hb_gtColorToN( char * szColorString )
HB_TRACE(HB_TR_DEBUG, ("hb_gtColorToN(%s)", szColorString));
while( c = *szColorString++ )
while( ( c = *szColorString++ ) == TRUE )
{
c = toupper( c );

View File

@@ -2894,9 +2894,7 @@ void hb_vmSend( USHORT uiParams )
if( ! HB_IS_NIL( pSelf ) ) /* are we sending a message ? */
{
if( pSym == &( hb_symEval ) && HB_IS_BLOCK( pSelf ) )
pFunc = pSym->pFunPtr; /* __EVAL method = function */
else
if( ! ( pSym == &( hb_symEval ) && HB_IS_BLOCK( pSelf ) ) )
{
if( HB_IS_OBJECT( pSelf ) ) /* Object passed */
{
@@ -2931,8 +2929,6 @@ void hb_vmSend( USHORT uiParams )
{
char *sClass, sDesc[64];
pFunc = NULL;
if( HB_IS_POINTER( pSelf ) )
sClass = "POINTER";
else if( HB_IS_DATE( pSelf ) )