2009-11-28 10:37 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)
* src/rtl/filesys.c
* src/rtl/fssize.c
* src/rdd/dbfcdx/dbfcdx1.c
* contrib/hbtip/utils.c
* contrib/hbwin/win_prn1.c
* contrib/hbbmcdx/bmdbfcdx.c
* contrib/hbbtree/hb_btree.c
! Fixed to use Harbour FS_* constants in hb_fsSeek*() calls
(instead of SEEK_* ones).
This commit is contained in:
@@ -17,6 +17,17 @@
|
||||
past entries belonging to author(s): Viktor Szakats.
|
||||
*/
|
||||
|
||||
2009-11-28 10:37 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)
|
||||
* src/rtl/filesys.c
|
||||
* src/rtl/fssize.c
|
||||
* src/rdd/dbfcdx/dbfcdx1.c
|
||||
* contrib/hbtip/utils.c
|
||||
* contrib/hbwin/win_prn1.c
|
||||
* contrib/hbbmcdx/bmdbfcdx.c
|
||||
* contrib/hbbtree/hb_btree.c
|
||||
! Fixed to use Harbour FS_* constants in hb_fsSeek*() calls
|
||||
(instead of SEEK_* ones).
|
||||
|
||||
2009-11-28 04:02 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
|
||||
* harbour/src/vm/fm.c
|
||||
* minor formatting
|
||||
|
||||
@@ -9701,7 +9701,7 @@ static void hb_cdxSortGetPageKey( LPCDXSORTINFO pSort, ULONG ulPage,
|
||||
ULONG ulKeys = HB_MIN( pSort->ulPgKeys, pSort->pSwapPage[ ulPage ].ulKeys );
|
||||
ULONG ulSize = ulKeys * ( iLen + 4 );
|
||||
|
||||
if( hb_fsSeekLarge( pSort->hTempFile, pSort->pSwapPage[ ulPage ].nOffset, SEEK_SET ) != pSort->pSwapPage[ ulPage ].nOffset ||
|
||||
if( hb_fsSeekLarge( pSort->hTempFile, pSort->pSwapPage[ ulPage ].nOffset, FS_SET ) != pSort->pSwapPage[ ulPage ].nOffset ||
|
||||
hb_fsReadLarge( pSort->hTempFile, pSort->pSwapPage[ ulPage ].pKeyPool, ulSize ) != ulSize )
|
||||
{
|
||||
hb_errInternal( 9303, "hb_cdxSortGetPageKey: Read error from temporary file.", NULL, NULL );
|
||||
|
||||
@@ -441,7 +441,7 @@ static void ioBufferAlloc( struct hb_BTree * pBTree, ULONG ulBuffers )
|
||||
|
||||
static void ioBufferWrite( struct hb_BTree * pBTree, ioBuffer_T *thisptr )
|
||||
{
|
||||
hb_fsSeek( pBTree->hFile, thisptr->ulPage, SEEK_SET );
|
||||
hb_fsSeek( pBTree->hFile, thisptr->ulPage, FS_SET );
|
||||
if ( hb_fsWrite( pBTree->hFile, thisptr->Buffer, pBTree->usPageSize ) != pBTree->usPageSize )
|
||||
{
|
||||
hb_RaiseError( HB_BTree_WriteError_EC, "write error", "ioBufferWrite*", 0 );
|
||||
@@ -459,7 +459,7 @@ static void ioBufferRead( struct hb_BTree * pBTree, ULONG ulNode )
|
||||
thisptr->IsDirty = FALSE;
|
||||
}
|
||||
thisptr->ulPage = ulNode;
|
||||
hb_fsSeek( pBTree->hFile, thisptr->ulPage, SEEK_SET );
|
||||
hb_fsSeek( pBTree->hFile, thisptr->ulPage, FS_SET );
|
||||
hb_fsRead( pBTree->hFile, thisptr->Buffer, pBTree->usPageSize );
|
||||
}
|
||||
|
||||
@@ -705,7 +705,7 @@ static void HeaderWrite( struct hb_BTree * pBTree )
|
||||
|
||||
/* TODO: store this to a temp buffer and write the buffer */
|
||||
/* TODO: write this info in a non-endian method */
|
||||
hb_fsSeek( pBTree->hFile, 0, SEEK_SET );
|
||||
hb_fsSeek( pBTree->hFile, 0, FS_SET );
|
||||
|
||||
if ( hb_fsWrite( pBTree->hFile, HEADER_ID, sizeof( HEADER_ID ) ) +
|
||||
hb_fsWrite( pBTree->hFile, ( const BYTE * )&pBTree->ulFreePage, sizeof( pBTree->ulFreePage ) ) + /* 4 bytes */
|
||||
@@ -750,7 +750,7 @@ static ULONG Grow( struct hb_BTree * pBTree )
|
||||
{
|
||||
BYTE *buffer = pBTree->ioBuffer->Buffer;
|
||||
|
||||
pBTree->ioBuffer->ulPage = hb_fsSeek( pBTree->hFile, 0, SEEK_END );
|
||||
pBTree->ioBuffer->ulPage = hb_fsSeek( pBTree->hFile, 0, FS_END );
|
||||
hb_xmemset( buffer, '\0', pBTree->usPageSize );
|
||||
if ( pBTree->usPageSize != hb_fsWrite( pBTree->hFile, buffer, pBTree->usPageSize ) )
|
||||
{
|
||||
@@ -759,7 +759,7 @@ static ULONG Grow( struct hb_BTree * pBTree )
|
||||
}
|
||||
else
|
||||
{
|
||||
pBTree->ioBuffer->ulPage = hb_fsSeek( pBTree->hFile, pBTree->ulFreePage, SEEK_SET );
|
||||
pBTree->ioBuffer->ulPage = hb_fsSeek( pBTree->hFile, pBTree->ulFreePage, FS_SET );
|
||||
hb_fsRead( pBTree->hFile, ( BYTE * )&pBTree->ulFreePage, sizeof( pBTree->ulFreePage ) );
|
||||
}
|
||||
pBTree->ioBuffer->IsDirty = TRUE;
|
||||
@@ -790,7 +790,7 @@ static void Prune( struct hb_BTree * pBTree, ULONG ulNode )
|
||||
}
|
||||
else
|
||||
{
|
||||
hb_fsSeek( pBTree->hFile, ulNode, SEEK_SET );
|
||||
hb_fsSeek( pBTree->hFile, ulNode, FS_SET );
|
||||
if ( hb_fsWrite( pBTree->hFile, ( const BYTE * )&pBTree->ulFreePage, sizeof( pBTree->ulFreePage ) ) != sizeof( pBTree->ulFreePage ) )
|
||||
{
|
||||
hb_RaiseError( HB_BTree_WriteError_EC, "write error", "Prune*", 0 );
|
||||
|
||||
@@ -478,13 +478,13 @@ static const char * s_findFileMimeType( HB_FHANDLE fileIn )
|
||||
int iLen;
|
||||
ULONG ulPos;
|
||||
|
||||
ulPos = hb_fsSeek( fileIn, 0, SEEK_CUR );
|
||||
hb_fsSeek( fileIn, 0, SEEK_SET );
|
||||
ulPos = hb_fsSeek( fileIn, 0, FS_RELATIVE );
|
||||
hb_fsSeek( fileIn, 0, FS_SET );
|
||||
iLen = hb_fsRead( fileIn, buf, sizeof( buf ) );
|
||||
|
||||
if( iLen > 0 )
|
||||
{
|
||||
hb_fsSeek( fileIn, ulPos, SEEK_SET );
|
||||
hb_fsSeek( fileIn, ulPos, FS_SET );
|
||||
return s_findStringMimeType( buf, iLen );
|
||||
}
|
||||
|
||||
|
||||
@@ -539,13 +539,13 @@ HB_FUNC( WIN_LOADBITMAPFILE )
|
||||
|
||||
if( fhnd != FS_ERROR )
|
||||
{
|
||||
ULONG ulSize = hb_fsSeek( fhnd, 0, SEEK_END );
|
||||
ULONG ulSize = hb_fsSeek( fhnd, 0, FS_END );
|
||||
|
||||
if( ulSize > 2 && ulSize <= ( 32 * 1024 * 1024 ) )
|
||||
{
|
||||
BITMAPFILEHEADER * pbmfh = ( BITMAPFILEHEADER * ) hb_xgrab( ulSize );
|
||||
|
||||
hb_fsSeek( fhnd, 0, SEEK_SET );
|
||||
hb_fsSeek( fhnd, 0, FS_SET );
|
||||
|
||||
if( hb_fsReadLarge( fhnd, pbmfh, ulSize ) == ulSize && pbmfh->bfType == *( WORD * ) "BM" )
|
||||
hb_retclen( ( char * ) pbmfh, ( HB_SIZE ) ulSize );
|
||||
|
||||
@@ -8919,7 +8919,7 @@ static void hb_cdxSortGetPageKey( LPCDXSORTINFO pSort, ULONG ulPage,
|
||||
ULONG ulKeys = HB_MIN( pSort->ulPgKeys, pSort->pSwapPage[ ulPage ].ulKeys );
|
||||
ULONG ulSize = ulKeys * ( iLen + 4 );
|
||||
|
||||
if( hb_fsSeekLarge( pSort->hTempFile, pSort->pSwapPage[ ulPage ].nOffset, SEEK_SET ) != pSort->pSwapPage[ ulPage ].nOffset ||
|
||||
if( hb_fsSeekLarge( pSort->hTempFile, pSort->pSwapPage[ ulPage ].nOffset, FS_SET ) != pSort->pSwapPage[ ulPage ].nOffset ||
|
||||
hb_fsReadLarge( pSort->hTempFile, pSort->pSwapPage[ ulPage ].pKeyPool, ulSize ) != ulSize )
|
||||
{
|
||||
hb_errInternal( 9303, "hb_cdxSortGetPageKey: Read error from temporary file.", NULL, NULL );
|
||||
|
||||
@@ -3195,11 +3195,11 @@ BOOL hb_fsEof( HB_FHANDLE hFileHandle )
|
||||
HB_FOFFSET endPos;
|
||||
HB_FOFFSET newPos;
|
||||
|
||||
curPos = hb_fsSeekLarge( hFileHandle, 0L, SEEK_CUR );
|
||||
curPos = hb_fsSeekLarge( hFileHandle, 0L, FS_RELATIVE );
|
||||
if( curPos != -1 )
|
||||
{
|
||||
endPos = hb_fsSeekLarge( hFileHandle, 0L, SEEK_END );
|
||||
newPos = hb_fsSeekLarge( hFileHandle, curPos, SEEK_SET );
|
||||
endPos = hb_fsSeekLarge( hFileHandle, 0L, FS_END );
|
||||
newPos = hb_fsSeekLarge( hFileHandle, curPos, FS_SET );
|
||||
fResult = ( endPos != -1 && newPos == curPos );
|
||||
}
|
||||
else
|
||||
|
||||
@@ -134,7 +134,7 @@ HB_FOFFSET hb_fsFSize( const char * pszFileName, BOOL bUseDirEntry )
|
||||
{
|
||||
HB_FOFFSET ulPos;
|
||||
|
||||
ulPos = hb_fsSeekLarge( hFileHandle, 0, SEEK_END );
|
||||
ulPos = hb_fsSeekLarge( hFileHandle, 0, FS_END );
|
||||
hb_fsClose( hFileHandle );
|
||||
return ulPos;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user