2007-11-04 19:20 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)

* harbour/include/hbcomp.h
  * harbour/include/hbmacro.h
  * harbour/source/compiler/hbmain.c
  * harbour/source/compiler/harbour.y
  * harbour/source/vm/macro.c
  * harbour/source/vm/garbage.c
  * harbour/source/vm/hvm.c
  * harbour/source/vm/classes.c
  * harbour/source/rdd/dbf1.c
  * harbour/source/rdd/dbffpt/dbffpt1.c
  * harbour/source/rtl/binnum.c
  * harbour/source/rtl/gtwvt/gtwvt.c
    * added explicit casting or changed some declarations to avoid
      warning about possible data lost in conversions
  * harbour/source/rtl/direct.c
    % optimized directory array creation and fixed one TOFIX note

   I left few warnings intentionally to mark places which should be
   updated in the future (f.e. HB_SYMBOLSCOPE translations).
   Victor, if you can please make build test with MSVC builds and
   send the list of warnings which still exist to harbour-devel.
This commit is contained in:
Przemyslaw Czerpak
2007-11-04 18:21:17 +00:00
parent 79a2901315
commit 7aa8292529
14 changed files with 108 additions and 97 deletions

View File

@@ -8,6 +8,29 @@
2002-12-01 13:30 UTC+0100 Foo Bar <foo.bar@foobar.org>
*/
2007-11-04 19:20 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbcomp.h
* harbour/include/hbmacro.h
* harbour/source/compiler/hbmain.c
* harbour/source/compiler/harbour.y
* harbour/source/vm/macro.c
* harbour/source/vm/garbage.c
* harbour/source/vm/hvm.c
* harbour/source/vm/classes.c
* harbour/source/rdd/dbf1.c
* harbour/source/rdd/dbffpt/dbffpt1.c
* harbour/source/rtl/binnum.c
* harbour/source/rtl/gtwvt/gtwvt.c
* added explicit casting or changed some declarations to avoid
warning about possible data lost in conversions
* harbour/source/rtl/direct.c
% optimized directory array creation and fixed one TOFIX note
I left few warnings intentionally to mark places which should be
updated in the future (f.e. HB_SYMBOLSCOPE translations).
Victor, if you can please make build test with MSVC builds and
send the list of warnings which still exist to harbour-devel.
2007-11-04 17:47 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbpp.h
! fixed typo in quoting condition for 1-st line token

View File

@@ -210,8 +210,8 @@ extern void hb_compGenPushDate( HB_LONG lNumber, HB_COMP_DECL ); /* Pushes
extern void hb_compGenPushNil( HB_COMP_DECL ); /* Pushes nil on the virtual machine stack */
extern void hb_compGenPushString( char * szText, ULONG ulLen, HB_COMP_DECL ); /* Pushes a string on the virtual machine stack */
extern void hb_compGenPushSymbol( char * szSymbolName, BOOL bFunction, HB_COMP_DECL ); /* Pushes a symbol on to the Virtual machine stack */
extern void hb_compGenPushAliasedVar( char *, BOOL, char *, long, HB_COMP_DECL );
extern void hb_compGenPopAliasedVar( char *, BOOL, char *, long, HB_COMP_DECL );
extern void hb_compGenPushAliasedVar( char *, BOOL, char *, HB_LONG, HB_COMP_DECL );
extern void hb_compGenPopAliasedVar( char *, BOOL, char *, HB_LONG, HB_COMP_DECL );
extern void hb_compGenPushFunRef( char *, HB_COMP_DECL );
extern void hb_compGenPCode1( BYTE, HB_COMP_DECL ); /* generates 1 byte of pcode */
extern void hb_compGenPCode2( BYTE, BYTE, HB_COMP_DECL ); /* generates 2 bytes of pcode + flag for optional StrongType(). */
@@ -389,7 +389,7 @@ extern const BYTE hb_comp_pcode_len[];
#if defined( HB_MACRO_SUPPORT )
# define HB_MACRO_GENFLAGS HB_COMPFLAG_RT_MACRO
#elif ! defined( HB_COMMON_SUPPORT )
# define HB_MACRO_GENFLAGS ( HB_COMP_PARAM->supported & \
# define HB_MACRO_GENFLAGS ( ( ( BYTE ) HB_COMP_PARAM->supported ) & \
( HB_COMPFLAG_HARBOUR | \
HB_COMPFLAG_XBASE | \
HB_COMPFLAG_SHORTCUTS | \

View File

@@ -136,16 +136,16 @@ extern void hb_macroGenMessage( char * szMsgName, BOOL bIsObject, HB_COMP_DECL )
extern void hb_macroGenMessageData( char * szMsg, BOOL bIsObject, HB_COMP_DECL );
extern void hb_macroGenPopVar( char * szVarName, HB_COMP_DECL );
extern void hb_macroGenPopAliasedVar( char * szVarName,
BOOL bPushAliasValue,
char * szAlias,
long lWorkarea, HB_COMP_DECL );
BOOL bPushAliasValue,
char * szAlias,
HB_LONG lWorkarea, HB_COMP_DECL );
extern void hb_macroGenPushVar( char * szVarName, BOOL bMacroVar, HB_COMP_DECL );
extern void hb_macroGenPushVarRef( char * szVarName, HB_COMP_DECL );
extern void hb_macroGenPushMemvarRef( char * szVarName, HB_COMP_DECL );
extern void hb_macroGenPushAliasedVar( char * szVarName,
BOOL bPushAliasValue,
char * szAlias,
long lWorkarea, HB_COMP_DECL );
BOOL bPushAliasValue,
char * szAlias,
HB_LONG lWorkarea, HB_COMP_DECL );
extern void hb_macroGenPushLogical( int iTrueFalse, HB_COMP_DECL );
extern void hb_macroGenPushDouble( double dNumber, BYTE bWidth, BYTE bDec, HB_COMP_DECL );
extern void hb_macroGenPushFunCall( char * szFunName, HB_COMP_DECL );

View File

@@ -288,12 +288,12 @@ Source : Crlf
Line : LINE NUM_LONG LITERAL Crlf
{ HB_COMP_PARAM->currModule = hb_compIdentifierNew( HB_COMP_PARAM, $3.string, $3.dealloc ? HB_IDENT_FREE : HB_IDENT_STATIC );
HB_COMP_PARAM->currLine = $2.lNumber;
HB_COMP_PARAM->currLine = ( int ) $2.lNumber;
HB_COMP_PARAM->pLex->fEol = FALSE;
if( $3.dealloc ) { hb_xfree( $3.string ); $3.dealloc = FALSE; } }
| LINE NUM_LONG LITERAL '@' LITERAL Crlf /* Xbase++ style */
{ HB_COMP_PARAM->currModule = hb_compIdentifierNew( HB_COMP_PARAM, $5.string, $5.dealloc ? HB_IDENT_FREE : HB_IDENT_STATIC );
HB_COMP_PARAM->currLine = $2.lNumber;
HB_COMP_PARAM->currLine = ( int ) $2.lNumber;
HB_COMP_PARAM->pLex->fEol = FALSE;
if( $3.dealloc ) { hb_xfree( $3.string ); $3.dealloc = FALSE; }
if( $5.dealloc ) { hb_xfree( $5.string ); $5.dealloc = FALSE; } }
@@ -1065,8 +1065,8 @@ CodeBlock : BlockHead BlockExpList '}'
hb_compCodeBlockEnd( HB_COMP_PARAM );
$$ = hb_compExprSetCodeblockBody( $1,
HB_COMP_PARAM->functions.pLast->pCode + ( ULONG ) $<lNumber>3,
HB_COMP_PARAM->functions.pLast->lPCodePos - $<lNumber>3 );
HB_COMP_PARAM->functions.pLast->lPCodePos = $<lNumber>3;
HB_COMP_PARAM->functions.pLast->lPCodePos - ( ULONG ) $<lNumber>3 );
HB_COMP_PARAM->functions.pLast->lPCodePos = ( ULONG ) $<lNumber>3;
HB_COMP_PARAM->lastLinePos = 0;
}
;
@@ -1505,11 +1505,11 @@ DoWhile : WhileBegin Expression Crlf
EmptyStats
{
hb_compLoopHere( HB_COMP_PARAM );
hb_compGenJump( $1 - HB_COMP_PARAM->functions.pLast->lPCodePos, HB_COMP_PARAM );
hb_compGenJump( ( ULONG ) $1 - HB_COMP_PARAM->functions.pLast->lPCodePos, HB_COMP_PARAM );
}
EndWhile
{
hb_compGenJumpHere( $<lNumber>4, HB_COMP_PARAM );
hb_compGenJumpHere( ( ULONG ) $<lNumber>4, HB_COMP_PARAM );
if( HB_COMP_PARAM->wWhileCounter )
--HB_COMP_PARAM->wWhileCounter;
hb_compLoopEnd( HB_COMP_PARAM );
@@ -1562,7 +1562,7 @@ ForNext : FOR LValue ForAssign Expression /* 1 2 3 4 */
hb_compLoopHere( HB_COMP_PARAM );
iLine = HB_COMP_PARAM->currLine;
HB_COMP_PARAM->currLine = $<lNumber>1;
HB_COMP_PARAM->currLine = ( int ) $<lNumber>1;
hb_compLinePush( HB_COMP_PARAM );
HB_COMP_PARAM->currLine = iLine;
@@ -1571,7 +1571,7 @@ ForNext : FOR LValue ForAssign Expression /* 1 2 3 4 */
HB_COMP_EXPR_CLEAR( hb_compExprGenPush( hb_compExprSetOperand( hb_compExprNewPlusEq( $2, HB_COMP_PARAM ), $<asExpr>8, HB_COMP_PARAM ), HB_COMP_PARAM ) );
else
HB_COMP_EXPR_CLEAR( hb_compExprGenPush( hb_compExprNewPreInc( $2, HB_COMP_PARAM ), HB_COMP_PARAM ) );
hb_compGenJumpHere( $<lNumber>9, HB_COMP_PARAM );
hb_compGenJumpHere( ( ULONG ) $<lNumber>9, HB_COMP_PARAM );
hb_compExprGenPush( $7, HB_COMP_PARAM ); /* end */
if( iSign )
hb_compGenPCode1( iSign > 0 ? HB_P_GREATER : HB_P_LESS, HB_COMP_PARAM );
@@ -1581,7 +1581,7 @@ ForNext : FOR LValue ForAssign Expression /* 1 2 3 4 */
hb_compGenPCode1( HB_P_FORTEST, HB_COMP_PARAM );
}
hb_compGenJumpFalse( $<lNumber>11 - HB_COMP_PARAM->functions.pLast->lPCodePos, HB_COMP_PARAM );
hb_compGenJumpFalse( ( ULONG ) $<lNumber>11 - HB_COMP_PARAM->functions.pLast->lPCodePos, HB_COMP_PARAM );
hb_compLoopEnd( HB_COMP_PARAM );
if( hb_compExprAsSymbol( $<asExpr>2 ) )
hb_compForEnd( HB_COMP_PARAM, hb_compExprAsSymbol( $<asExpr>2 ) );
@@ -1657,9 +1657,9 @@ ForEach : FOREACH ForList IN ForArgs /* 1 2 3 4 */
{
hb_compLoopHere( HB_COMP_PARAM );
hb_compEnumNext( HB_COMP_PARAM, $2, $6 );
hb_compGenJump( $<lNumber>7 - HB_COMP_PARAM->functions.pLast->lPCodePos, HB_COMP_PARAM );
hb_compGenJump( ( ULONG ) $<lNumber>7 - HB_COMP_PARAM->functions.pLast->lPCodePos, HB_COMP_PARAM );
hb_compGenJumpHere( $<lNumber>9, HB_COMP_PARAM );
hb_compGenJumpHere( ( ULONG ) $<lNumber>9, HB_COMP_PARAM );
hb_compLoopEnd( HB_COMP_PARAM );
HB_COMP_PARAM->functions.pLast->bFlags &= ~ ( FUN_WITH_RETURN | FUN_BREAK_CODE );
hb_compEnumEnd( HB_COMP_PARAM, $2 );
@@ -1754,7 +1754,7 @@ BeginSeq : BEGINSEQ /* 1 */
*/
if( $<lNumber>3 )
hb_compGenPCode1( HB_P_POP, HB_COMP_PARAM );
hb_compGenJumpHere( $<lNumber>2, HB_COMP_PARAM );
hb_compGenJumpHere( ( ULONG ) $<lNumber>2, HB_COMP_PARAM );
$<lNumber>$ = hb_compSequenceEnd( HB_COMP_PARAM );
$<lNumber>4 = hb_compLoopCount( HB_COMP_PARAM );
}
@@ -1764,7 +1764,7 @@ BeginSeq : BEGINSEQ /* 1 */
* HB_P_SEQBEGIN opcode if there is RECOVER clause
*/
if( $<lNumber>7 )
hb_compGenJumpThere( $<lNumber>2, $<lNumber>7, HB_COMP_PARAM );
hb_compGenJumpThere( ( ULONG ) $<lNumber>2, ( ULONG ) $<lNumber>7, HB_COMP_PARAM );
else if( HB_COMP_PARAM->wSeqCounter )
--HB_COMP_PARAM->wSeqCounter;
}
@@ -1782,19 +1782,19 @@ BeginSeq : BEGINSEQ /* 1 */
--HB_COMP_PARAM->wAlwaysCounter;
/* replace END address with ALWAYS address in
HB_P_SEQEND opcode */
hb_compGenJumpThere( $<lNumber>6, $<lNumber>9, HB_COMP_PARAM );
hb_compGenJumpThere( ( ULONG ) $<lNumber>6, ( ULONG ) $<lNumber>9, HB_COMP_PARAM );
/* Fix ALWAYS address in HB_P_SEQALWAYS opcode */
hb_compGenJumpThere( $<lNumber>2 - 4, $<lNumber>9, HB_COMP_PARAM );
hb_compGenJumpThere( ( ULONG ) $<lNumber>2 - 4, ( ULONG ) $<lNumber>9, HB_COMP_PARAM );
/* Fix ALWAYSEND address in HB_P_ALWAYSBEGIN opcode */
hb_compGenJumpHere( $<lNumber>9 + 1, HB_COMP_PARAM );
hb_compGenJumpHere( ( ULONG ) $<lNumber>9 + 1, HB_COMP_PARAM );
hb_compGenPCode1( HB_P_ALWAYSEND, HB_COMP_PARAM );
}
else
{
/* Fix END address in HB_P_SEQEND opcode */
hb_compGenJumpHere( $<lNumber>6, HB_COMP_PARAM );
hb_compGenJumpHere( ( ULONG ) $<lNumber>6, HB_COMP_PARAM );
}
hb_compSequenceFinish( HB_COMP_PARAM, $<lNumber>2, $<lNumber>6, $<lNumber>9,
hb_compSequenceFinish( HB_COMP_PARAM, ( ULONG ) $<lNumber>2, ( ULONG ) $<lNumber>6, ( ULONG ) $<lNumber>9,
$<lNumber>5 != 0, $<lNumber>7 != 0, $<lNumber>4 == lLoopCount );
}
EndSeqID /* 10 */
@@ -1917,7 +1917,7 @@ WithObject : WITHOBJECT Expression Crlf
else
{
hb_compNOOPfill( HB_COMP_PARAM->functions.pLast,
$<lNumber>4, 1, FALSE, TRUE );
( ULONG ) $<lNumber>4, 1, FALSE, TRUE );
hb_compGenPCode1( HB_P_POP, HB_COMP_PARAM );
}
}

View File

@@ -3193,7 +3193,7 @@ void hb_compGenPushMemvarRef( char * szVarName, HB_COMP_DECL ) /* generates the
void hb_compGenPopAliasedVar( char * szVarName,
BOOL bPushAliasValue,
char * szAlias,
long lWorkarea,
HB_LONG lWorkarea,
HB_COMP_DECL )
{
if( bPushAliasValue )
@@ -3238,7 +3238,7 @@ void hb_compGenPopAliasedVar( char * szVarName,
void hb_compGenPushAliasedVar( char * szVarName,
BOOL bPushAliasValue,
char * szAlias,
long lWorkarea,
HB_LONG lWorkarea,
HB_COMP_DECL )
{
if( bPushAliasValue )

View File

@@ -370,7 +370,7 @@ static void hb_dbfSetBlankRecord( DBFAREAP pArea, int iType )
{
HB_LONG nValue = hb_dbfGetNextValue( pArea, uiCount );
if( pField->uiDec )
nValue = ( HB_LONG ) hb_numDecConv( nValue, - ( int ) pField->uiDec );
nValue = ( HB_LONG ) hb_numDecConv( ( double ) nValue, - ( int ) pField->uiDec );
if( pField->uiType == HB_FT_INTEGER ||
pField->uiType == HB_FT_AUTOINC )
{

View File

@@ -2412,13 +2412,13 @@ static ERRCODE hb_fptCopyToFile( FHANDLE hSrc, FHANDLE hDst, HB_FOFFSET size )
ULONG ulBufSize, ulRead;
BYTE * pBuffer;
ulBufSize = HB_MIN( 0x10000, size );
ulBufSize = ( ULONG ) HB_MIN( 0x10000, size );
pBuffer = ( BYTE * ) hb_xgrab( ulBufSize );
do
{
ulRead = hb_fsReadLarge( hSrc, pBuffer,
HB_MIN( ulBufSize, size - written ) );
( ULONG ) HB_MIN( ulBufSize, size - written ) );
if( ulRead <= 0 )
errCode = EDBF_READ;
else if( hb_fsWriteLarge( hDst, pBuffer, ulRead ) != ulRead )
@@ -3926,12 +3926,12 @@ static ERRCODE hb_fptCreateMemFile( FPTAREAP pArea, LPDBOPENINFO pCreateInfo )
if( pArea->bMemoType == DB_MEMO_SMT || pArea->bMemoType == DB_MEMO_DBT )
{
HB_PUT_LE_UINT32( fptHeader.nextBlock, ulNextBlock );
HB_PUT_LE_UINT32( fptHeader.blockSize, pArea->uiMemoBlockSize );
HB_PUT_LE_UINT32( fptHeader.blockSize, ( UINT32 ) pArea->uiMemoBlockSize );
}
else
{
HB_PUT_BE_UINT32( fptHeader.nextBlock, ulNextBlock );
HB_PUT_BE_UINT32( fptHeader.blockSize, pArea->uiMemoBlockSize );
HB_PUT_BE_UINT32( fptHeader.blockSize, ( UINT32 ) pArea->uiMemoBlockSize );
}
if( hb_fsWrite( pArea->hMemoFile, ( BYTE * ) &fptHeader, ( USHORT) ulSize ) != ( USHORT ) ulSize )
return FAILURE;
@@ -4269,8 +4269,8 @@ static ERRCODE hb_fptPutValueFile( FPTAREAP pArea, USHORT uiIndex, BYTE * szFile
static ERRCODE hb_fptDoPackRec( FPTAREAP pArea )
{
ERRCODE errCode = SUCCESS;
ULONG ulBlock, ulSize, ulType;
USHORT uiSkip, uiField;
ULONG ulBlock, ulSize, ulSkip, ulType;
USHORT uiField;
HB_FOFFSET pos;
HB_TRACE(HB_TR_DEBUG, ("hb_fptDoPackRec(%p)", pArea));
@@ -4316,12 +4316,13 @@ static ERRCODE hb_fptDoPackRec( FPTAREAP pArea )
hb_fsSeekLarge( pArea->hMemoFile, ( HB_FOFFSET ) ulBlock *
( HB_FOFFSET ) pArea->uiMemoBlockSize, FS_SET );
pos = hb_fsSeekLarge( pArea->hMemoTmpFile, 0, FS_RELATIVE );
ulBlock = ( pos + pArea->uiNewBlockSize - 1 ) /
pArea->uiNewBlockSize;
uiSkip = ( ( HB_FOFFSET ) ulBlock *
( HB_FOFFSET ) pArea->uiNewBlockSize ) - pos;
if( uiSkip )
hb_fsSeek( pArea->hMemoTmpFile, uiSkip, FS_RELATIVE );
ulBlock = ( ULONG ) ( ( pos + pArea->uiNewBlockSize - 1 ) /
pArea->uiNewBlockSize );
ulSkip = ( ULONG ) ( ( ( HB_FOFFSET ) ulBlock *
( HB_FOFFSET ) pArea->uiNewBlockSize ) -
pos );
if( ulSkip )
hb_fsSeek( pArea->hMemoTmpFile, ulSkip, FS_RELATIVE );
errCode = hb_fptCopyToFile( pArea->hMemoFile,
pArea->hMemoTmpFile, ulSize );
}
@@ -4378,12 +4379,13 @@ static ERRCODE hb_fptDoPackRec( FPTAREAP pArea )
hb_fsSeekLarge( pArea->hMemoFile, ( HB_FOFFSET ) ulBlock *
( HB_FOFFSET ) pArea->uiMemoBlockSize, FS_SET );
pos = hb_fsSeekLarge( pArea->hMemoTmpFile, 0, FS_RELATIVE );
ulBlock = ( pos + pArea->uiNewBlockSize - 1 ) /
pArea->uiNewBlockSize;
uiSkip = ( ( HB_FOFFSET ) ulBlock *
( HB_FOFFSET ) pArea->uiNewBlockSize ) - pos;
if( uiSkip )
hb_fsSeek( pArea->hMemoTmpFile, uiSkip, FS_RELATIVE );
ulBlock = ( ULONG ) ( ( pos + pArea->uiNewBlockSize - 1 ) /
pArea->uiNewBlockSize );
ulSkip = ( ULONG ) ( ( ( HB_FOFFSET ) ulBlock *
( HB_FOFFSET ) pArea->uiNewBlockSize ) -
pos );
if( ulSkip )
hb_fsSeek( pArea->hMemoTmpFile, ulSkip, FS_RELATIVE );
errCode = hb_fptCopyToFile( pArea->hMemoFile,
pArea->hMemoTmpFile, ulSize );
if( errCode == SUCCESS )
@@ -4485,8 +4487,8 @@ static ERRCODE hb_fptDoPack( FPTAREAP pArea, USHORT uiBlockSize,
ULONG ulNextBlock;
BYTE buffer[4];
ulNextBlock = ( size + pArea->uiNewBlockSize - 1 ) /
pArea->uiNewBlockSize;
ulNextBlock = ( ULONG ) ( ( size + pArea->uiNewBlockSize - 1 ) /
pArea->uiNewBlockSize );
if( pArea->bMemoType == DB_MEMO_SMT ||
pArea->bMemoType == DB_MEMO_DBT )
HB_PUT_LE_UINT32( buffer, ulNextBlock );
@@ -4590,8 +4592,8 @@ static ERRCODE hb_fptPack( FPTAREAP pArea )
ULONG ulNextBlock;
BYTE buffer[4];
ulNextBlock = ( size + pArea->uiNewBlockSize - 1 ) /
pArea->uiNewBlockSize;
ulNextBlock = ( ULONG ) ( ( size + pArea->uiNewBlockSize - 1 ) /
pArea->uiNewBlockSize );
if( pArea->bMemoType == DB_MEMO_SMT ||
pArea->bMemoType == DB_MEMO_DBT )
HB_PUT_LE_UINT32( buffer, ulNextBlock );

View File

@@ -92,10 +92,9 @@ HB_FUNC( I2BIN )
if( ISNUM( 1 ) )
{
SHORT iValue = hb_parni( 1 );
SHORT iValue = ( SHORT ) hb_parni( 1 );
szString[ 0 ] = ( iValue & 0x00FF );
szString[ 1 ] = ( iValue & 0xFF00 ) >> 8;
HB_PUT_LE_UINT16( szString, iValue );
}
else
{
@@ -114,10 +113,7 @@ HB_FUNC( L2BIN )
{
long lValue = hb_parnl( 1 );
szString[ 0 ] = ( char ) ( lValue & 0x000000FF );
szString[ 1 ] = ( char ) ( ( lValue & 0x0000FF00 ) >> 8 );
szString[ 2 ] = ( char ) ( ( lValue & 0x00FF0000 ) >> 16 );
szString[ 3 ] = ( char ) ( ( lValue & 0xFF000000 ) >> 24 );
HB_PUT_LE_UINT32( szString, lValue );
}
else
{

View File

@@ -145,35 +145,25 @@ HB_FUNC( DIRECTORY )
if( ( ffind = hb_fsFindFirst( pDirSpec ? hb_itemGetCPtr( pDirSpec ) : HB_DIR_ALL_FILES_MASK, uiMask ) ) != NULL )
{
PHB_ITEM pFilename = hb_itemNew( NULL );
PHB_ITEM pSize = hb_itemNew( NULL );
PHB_ITEM pDate = hb_itemNew( NULL );
PHB_ITEM pTime = hb_itemNew( NULL );
PHB_ITEM pAttr = hb_itemNew( NULL );
PHB_ITEM pSubarray = hb_itemNew( NULL );
do
{
PHB_ITEM pSubarray = hb_itemArrayNew( F_LEN );
char buffer[ 32 ];
hb_arraySet( pSubarray, F_NAME, hb_itemPutC( pFilename, ffind->szName ) );
hb_arraySet( pSubarray, F_SIZE, hb_itemPutNL( pSize, ( LONG ) ffind->size ) ); /* TOFIX: Loss of digits. */
hb_arraySet( pSubarray, F_DATE, hb_itemPutDL( pDate, ffind->lDate ) );
hb_arraySet( pSubarray, F_TIME, hb_itemPutC( pTime, ffind->szTime ) );
hb_arraySet( pSubarray, F_ATTR, hb_itemPutC( pAttr, hb_fsAttrDecode( ffind->attr, buffer ) ) );
hb_arrayNew( pSubarray, F_LEN );
hb_arraySetC ( pSubarray, F_NAME, ffind->szName );
hb_arraySetNInt( pSubarray, F_SIZE, ffind->size );
hb_arraySetDL ( pSubarray, F_DATE, ffind->lDate );
hb_arraySetC ( pSubarray, F_TIME, ffind->szTime );
hb_arraySetC ( pSubarray, F_ATTR, hb_fsAttrDecode( ffind->attr, buffer ) );
/* Don't exit when array limit is reached */
hb_arrayAdd( pDir, pSubarray );
hb_itemRelease( pSubarray );
}
while( hb_fsFindNext( ffind ) );
hb_itemRelease( pFilename );
hb_itemRelease( pSize );
hb_itemRelease( pDate );
hb_itemRelease( pTime );
hb_itemRelease( pAttr );
hb_itemRelease( pSubarray );
hb_fsFindClose( ffind );
}

View File

@@ -211,12 +211,12 @@ static HFONT hb_gt_wvt_GetFont( char * pszFace, int iHeight, int iWidth, int iWe
static USHORT hb_gt_wvt_CalcPixelHeight( void )
{
return _s.PTEXTSIZE.y * _s.ROWS;
return ( USHORT ) ( _s.PTEXTSIZE.y * _s.ROWS );
}
static USHORT hb_gt_wvt_CalcPixelWidth( void )
{
return _s.PTEXTSIZE.x * _s.COLS;
return ( USHORT ) ( _s.PTEXTSIZE.x * _s.COLS );
}
static void hb_gt_wvt_ResetWindowSize( HWND hWnd )
@@ -1184,8 +1184,8 @@ static BOOL hb_gt_wvt_ValidWindowSize( int rows, int cols, HFONT hFont, int iWid
SystemParametersInfo( SPI_GETWORKAREA,0, &rcWorkArea, 0 );
maxWidth = (SHORT) ( rcWorkArea.right - rcWorkArea.left );
maxHeight = (SHORT) ( rcWorkArea.bottom - rcWorkArea.top );
maxWidth = (USHORT) ( rcWorkArea.right - rcWorkArea.left );
maxHeight = (USHORT) ( rcWorkArea.bottom - rcWorkArea.top );
hdc = GetDC( _s.hWnd );
hOldFont = ( HFONT ) SelectObject( hdc, hFont );
@@ -1193,10 +1193,10 @@ static BOOL hb_gt_wvt_ValidWindowSize( int rows, int cols, HFONT hFont, int iWid
SelectObject( hdc, hOldFont ); /* Put old font back */
ReleaseDC( _s.hWnd, hdc );
width = iWidth < 0 ? -iWidth : tm.tmAveCharWidth * cols ; /* Total pixel width this setting would take */
height = tm.tmHeight * rows; /* Total pixel height this setting would take */
width = (USHORT) ( iWidth < 0 ? -iWidth : tm.tmAveCharWidth * cols ); /* Total pixel width this setting would take */
height = (USHORT) ( tm.tmHeight * rows ); /* Total pixel height this setting would take */
return ( width <= maxWidth ) && ( height <= maxHeight );
return ( width <= maxWidth ) && ( height <= maxHeight );
}
static HWND hb_gt_wvt_CreateWindow( HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow )

View File

@@ -842,7 +842,7 @@ static BOOL hb_clsUpdateHiddenMessages( PMETHOD pSrcMethod, PMETHOD pDstMethod,
if( uiData == 0 )
{
uiData = hb_arrayLen( pDstClass->pClassDatas ) + 1;
uiData = ( USHORT ) hb_arrayLen( pDstClass->pClassDatas ) + 1;
hb_arraySize( pDstClass->pClassDatas, uiData );
}
if( pDstMethod->uiOffset )

View File

@@ -128,7 +128,7 @@ static BOOL s_bCollecting = FALSE;
/* flag for used/unused blocks - the meaning of the HB_GC_USED_FLAG bit
* is reversed on every collecting attempt
*/
static USHORT s_uUsedFlag = HB_GC_USED_FLAG;
static BYTE s_uUsedFlag = HB_GC_USED_FLAG;
static void hb_gcUnregisterSweep( void * Cargo );

View File

@@ -4429,7 +4429,7 @@ static void hb_vmArrayNew( HB_ITEM_PTR pArray, USHORT uiDimension )
if( HB_IS_INTEGER( pDim ) )
ulElements = ( ULONG ) pDim->item.asInteger.value;
else if( HB_IS_LONG( pDim ) )
ulElements = pDim->item.asLong.value;
ulElements = ( ULONG ) pDim->item.asLong.value;
else if( HB_IS_DOUBLE( pDim ) )
ulElements = ( ULONG ) pDim->item.asDouble.value;
else
@@ -4587,7 +4587,7 @@ static void hb_vmMacroDo( USHORT uiArgSets )
lArgs = hb_vmArgsJoin( -1, uiArgSets );
hb_stackDecrease( uiArgSets );
hb_vmDo( lArgs );
hb_vmDo( ( USHORT ) lArgs );
}
static void hb_vmMacroFunc( USHORT uiArgSets )
@@ -4598,7 +4598,7 @@ static void hb_vmMacroFunc( USHORT uiArgSets )
lArgs = hb_vmArgsJoin( -1, uiArgSets );
hb_stackDecrease( uiArgSets );
hb_vmDo( lArgs );
hb_vmDo( ( USHORT ) lArgs );
hb_stackPushReturn();
}
@@ -4610,7 +4610,7 @@ static void hb_vmMacroSend( USHORT uiArgSets )
lArgs = hb_vmArgsJoin( -1, uiArgSets );
hb_stackDecrease( uiArgSets );
hb_vmSend( lArgs );
hb_vmSend( ( USHORT ) lArgs );
hb_stackPushReturn();
}

View File

@@ -1255,9 +1255,9 @@ void hb_macroGenPopVar( char * szVarName, HB_COMP_DECL )
* an aliased variable
*/
void hb_macroGenPopAliasedVar( char * szVarName,
BOOL bPushAliasValue,
char * szAlias,
long lWorkarea, HB_COMP_DECL )
BOOL bPushAliasValue,
char * szAlias,
HB_LONG lWorkarea, HB_COMP_DECL )
{
HB_TRACE(HB_TR_DEBUG, ("hb_macroGenPopAliasedVar(%s->%s)",szAlias,szVarName));
@@ -1345,9 +1345,9 @@ void hb_macroGenPushMemvarRef( char * szVarName, HB_COMP_DECL )
* machine stack
*/
void hb_macroGenPushAliasedVar( char * szVarName,
BOOL bPushAliasValue,
char * szAlias,
long lWorkarea, HB_COMP_DECL )
BOOL bPushAliasValue,
char * szAlias,
HB_LONG lWorkarea, HB_COMP_DECL )
{
HB_TRACE(HB_TR_DEBUG, ("hb_macroGenPushAliasedVar(%s->%s)",szAlias,szVarName));