2015-09-01 15:07 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)

* ChangeLog.txt
    ! fixed typo in ChangeLog entry. I used hb_socketNew() instead of
      hb_socketSetFilter()

  * include/hbapifs.h
  * src/rtl/filebuf.c
    + added helper C function:
         HB_SIZE hb_fileResult( HB_SIZE nSize );
      It converts ( HB_SIZE ) FS_ERROR to 0 so it can be used to wrap
      hb_fileRead()/hb_fileWrite() to force previous results.

  * src/rdd/dbffpt/dbffpt1.c
    * reduced variable scope

  * src/rtl/copyfile.c
    ! fixed typo in last commit - thanks to Viktor.
This commit is contained in:
Przemysław Czerpak
2015-09-01 15:07:03 +02:00
parent 310e2134bd
commit 9a9128ea27
5 changed files with 31 additions and 8 deletions

View File

@@ -1001,11 +1001,11 @@ static HB_ULONG hb_fptGetMemoLen( FPTAREAP pArea, HB_USHORT uiIndex )
if( pArea->bMemoType == DB_MEMO_DBT )
{
HB_BYTE pBlock[ DBT_DEFBLOCKSIZE ];
HB_SIZE nLen, n;
HB_SIZE n;
do
{
nLen = hb_fileReadAt( pArea->pMemoFile, pBlock, DBT_DEFBLOCKSIZE, fOffset );
HB_SIZE nLen = hb_fileReadAt( pArea->pMemoFile, pBlock, DBT_DEFBLOCKSIZE, fOffset );
if( nLen == 0 || nLen == ( HB_SIZE ) FS_ERROR )
break;
fOffset += nLen;
@@ -2412,7 +2412,6 @@ static HB_ERRCODE hb_fptReadFlexItem( FPTAREAP pArea, HB_BYTE ** pbMemoBuf, HB_B
char * pszStr = ( char * ) ( *pbMemoBuf );
*pbMemoBuf += ulLen;
if( iTrans == FPT_TRANS_UNICODE )
{
hb_itemPutStrLenU16( pItem, HB_CDP_ENDIAN_LITTLE,

View File

@@ -132,7 +132,7 @@ static HB_BOOL hb_copyfile( const char * pszSource, const char * pszDest )
while( nWritten < nRead )
{
HB_SIZE nDone = hb_fileWrite( pDest, buffer + nWritten, nRead - nWritten, -1 );
if( nDone > 0 )
if( nDone != ( HB_SIZE ) FS_ERROR )
nWritten += nDone;
if( nWritten < nRead )
{

View File

@@ -1482,3 +1482,8 @@ PHB_FILE hb_filePOpen( const char * pszFileName, const char * pszMode )
return pFile;
}
HB_SIZE hb_fileResult( HB_SIZE nSize )
{
return nSize == ( HB_SIZE ) FS_ERROR ? 0 : nSize;
}