2007-01-05 16:00 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)

* harbour/include/hbexprb.c
    * make function call optimizations only when hb_compFunCallCheck()
      do not report errors

  * harbour/source/common/reserved.c
    + added VALTYPE to list of reserved words and shortcuts (Clipper
      compatible)

  * harbour/source/compiler/hbfunchk.c
    * checking for number of parameters in FILE() function call is Harbour
      extension - do not enable it when HB_C52_STRICT macro is set

  * harbour/source/rtl/filehb.c
    * formatting
This commit is contained in:
Przemyslaw Czerpak
2007-01-05 15:01:11 +00:00
parent 9d263b1141
commit 386c27f01f
5 changed files with 47 additions and 25 deletions

View File

@@ -8,6 +8,22 @@
2002-12-01 13:30 UTC+0100 Foo Bar <foo.bar@foobar.org>
*/
2007-01-05 16:00 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbexprb.c
* make function call optimizations only when hb_compFunCallCheck()
do not report errors
* harbour/source/common/reserved.c
+ added VALTYPE to list of reserved words and shortcuts (Clipper
compatible)
* harbour/source/compiler/hbfunchk.c
* checking for number of parameters in FILE() function call is Harbour
extension - do not enable it when HB_C52_STRICT macro is set
* harbour/source/rtl/filehb.c
* formatting
2007-01-05 08:00 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbcompdf.h
+ added comment

View File

@@ -1541,32 +1541,33 @@ static HB_EXPR_FUNC( hb_compExprUseFunCall )
USHORT usCount = ( USHORT ) hb_compExprParamListLen( pParms );
#ifndef HB_MACRO_SUPPORT
hb_compFunCallCheck( HB_COMP_PARAM, pName->value.asSymbol, usCount );
if( hb_compFunCallCheck( HB_COMP_PARAM, pName->value.asSymbol, usCount ) )
#endif
if( ( strcmp( "AT", pName->value.asSymbol ) == 0 ) && usCount == 2 )
{
hb_compExprReduceAT( pSelf, HB_COMP_PARAM );
}
else if( ( strcmp( "CHR", pName->value.asSymbol ) == 0 ) && usCount )
{
hb_compExprReduceCHR( pSelf, HB_COMP_PARAM );
}
else if( ( strcmp( "LEN", pName->value.asSymbol ) == 0 ) && usCount )
{
if( HB_SUPPORT_HARBOUR )
hb_compExprReduceLEN( pSelf, HB_COMP_PARAM );
}
else if( ( strcmp( "ASC", pName->value.asSymbol ) == 0 ) && usCount )
{
if( HB_SUPPORT_HARBOUR )
hb_compExprReduceASC( pSelf, HB_COMP_PARAM );
}
else if( ( ( strcmp( "STOD", pName->value.asSymbol ) == 0 ) ||
( strcmp( "HB_STOD", pName->value.asSymbol ) == 0 ) ) && usCount < 2 )
{
if( HB_SUPPORT_HARBOUR )
hb_compExprReduceSTOD( pSelf, usCount, HB_COMP_PARAM );
if( ( strcmp( "AT", pName->value.asSymbol ) == 0 ) && usCount == 2 )
{
hb_compExprReduceAT( pSelf, HB_COMP_PARAM );
}
else if( ( strcmp( "CHR", pName->value.asSymbol ) == 0 ) && usCount )
{
hb_compExprReduceCHR( pSelf, HB_COMP_PARAM );
}
else if( ( strcmp( "LEN", pName->value.asSymbol ) == 0 ) && usCount )
{
if( HB_SUPPORT_HARBOUR )
hb_compExprReduceLEN( pSelf, HB_COMP_PARAM );
}
else if( ( strcmp( "ASC", pName->value.asSymbol ) == 0 ) && usCount )
{
if( HB_SUPPORT_HARBOUR )
hb_compExprReduceASC( pSelf, HB_COMP_PARAM );
}
else if( ( ( strcmp( "STOD", pName->value.asSymbol ) == 0 ) ||
( strcmp( "HB_STOD", pName->value.asSymbol ) == 0 ) ) && usCount < 2 )
{
if( HB_SUPPORT_HARBOUR )
hb_compExprReduceSTOD( pSelf, usCount, HB_COMP_PARAM );
}
}
}
break;

View File

@@ -119,6 +119,7 @@ static const char * s_szReservedFun[] = {
"TYPE" ,
"UPPER" ,
"VAL" ,
"VALTYPE" ,
"WORD" ,
"YEAR"
};

View File

@@ -72,7 +72,9 @@ static HB_FUNCINFO hb_StdFunc[] =
{ "EXP" , 1, 1 },
{ "FCOUNT" , 0, 0 },
{ "FIELDNAME" , 1, 1 },
#if !defined( HB_C52_STRICT )
{ "FILE" , 1, 1 },
#endif
{ "FLOCK" , 0, 0 },
{ "FOUND" , 0, 0 },
{ "INKEY" , 0, 2 },

View File

@@ -61,5 +61,7 @@
HB_FUNC( FILE )
{
hb_retl( ISCHAR( 1 ) ? hb_spFile( ( BYTE * ) hb_parc( 1 ),NULL ) : FALSE );
BYTE * szFile = ( BYTE * ) hb_parc( 1 );
hb_retl( szFile ? hb_spFile( szFile, NULL ) : FALSE );
}