From e4829a38f4c48a49b0148b0a73cd8c70786c2c56 Mon Sep 17 00:00:00 2001 From: Horacio Dario Roldan Kasimatis Date: Tue, 17 Apr 2001 06:02:16 +0000 Subject: [PATCH] 2001-04-17 02:50 GMT-3 Horacio Roldan *source/rdd/dbfcdx/dbfcdx1.c * fixed some warnings * fixed bug with pathname in hb_cdxOrderCreate --- harbour/ChangeLog | 5 +++++ harbour/source/rdd/dbfcdx/dbfcdx1.c | 29 +++++++++++++++-------------- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 720164f2b9..f02d0cada3 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,8 @@ +2001-04-17 02:50 GMT-3 Horacio Roldan + *source/rdd/dbfcdx/dbfcdx1.c + * fixed some warnings + * fixed bug with pathname in hb_cdxOrderCreate + 2001-04-16 14:40 UTC-0800 Ron Pinkas * source/compiler/harbour.c + Added all GET Methods definitions (still need Exported Vars ) - Thanks to Luiz. diff --git a/harbour/source/rdd/dbfcdx/dbfcdx1.c b/harbour/source/rdd/dbfcdx/dbfcdx1.c index bc6b9b89de..980255122f 100644 --- a/harbour/source/rdd/dbfcdx/dbfcdx1.c +++ b/harbour/source/rdd/dbfcdx/dbfcdx1.c @@ -1232,7 +1232,7 @@ static int hb_cdxKeyCompare( LPKEYINFO pKey1, LPKEYINFO pKey2, USHORT * EndPos, * EndPos += 1; iResult = pKey1->length - pKey2->length; } - if( iResult < 0 && * EndPos > pKey1->length && !Exact ) + if( (iResult < 0) && ((ULONG)* EndPos > pKey1->length) && !Exact ) iResult = 0; if( iResult < 0 ) @@ -2108,7 +2108,7 @@ static void hb_cdxTagTagLoad( LPCDXTAG pTag ) * invalid key value length */ if( pTag->RootBlock == 0 || pTag->RootBlock % CDX_PAGELEN > 0 || - pTag->RootBlock > hb_fsSeek( pTag->pIndex->hFile, 0, FS_END ) || + (ULONG) pTag->RootBlock > hb_fsSeek( pTag->pIndex->hFile, 0, FS_END ) || pHeader.uiKeySize > CDX_MAXKEY ) return; @@ -3003,14 +3003,14 @@ static void hb_cdxIndexResetAvailPage( LPCDXINDEX pIndex ) static void hb_cdxIndexPageRead( LPCDXINDEX pIndex, LONG lPos, void * pBuffer, USHORT uiSize ) { - if( hb_fsSeek( pIndex->hFile, lPos, FS_SET ) == lPos ) + if( hb_fsSeek( pIndex->hFile, lPos, FS_SET ) == (ULONG) lPos ) hb_fsRead( pIndex->hFile, ( BYTE * ) pBuffer, uiSize ); } static void hb_cdxIndexPageWrite( LPCDXINDEX pIndex, LONG lPos, void * pBuffer, USHORT uiSize ) { - if( hb_fsSeek( pIndex->hFile, lPos, FS_SET ) == lPos ) + if( hb_fsSeek( pIndex->hFile, lPos, FS_SET ) == (ULONG) lPos ) hb_fsWrite( pIndex->hFile, ( BYTE * ) pBuffer, uiSize ); } @@ -3674,12 +3674,12 @@ ERRCODE hb_cdxOrderCreate( CDXAREAP pAreaCdx, LPDBORDERCREATEINFO pOrderInfo ) BYTE bType; BOOL bNewFile; AREAP pArea = (AREAP) pAreaCdx; - + /* this is for testing when doing changes or testing a new platform/compiler if ( sizeof(CDXINTERNAL) != 500 ) printf("cdxOrdCreate: Error, size of CDXINTERNAL: %i\n", sizeof(CDXINTERNAL)); if ( sizeof(CDXDATA) != 512 ) printf("cdxOrdCreate: Error, size of CDXDATA: %i\n", sizeof(CDXDATA)); - + */ HB_TRACE(HB_TR_DEBUG, ("cdxOrderCreate(%p, %p)", pArea, pOrderInfo)); if( SELF_GOCOLD( ( AREAP ) pArea ) == FAILURE ) @@ -3842,8 +3842,10 @@ ERRCODE hb_cdxOrderCreate( CDXAREAP pAreaCdx, LPDBORDERCREATEINFO pOrderInfo ) if( strlen( ( char * ) pOrderInfo->abBagName ) == 0 ) { pFileName = hb_fsFNameSplit( pAreaCdx->szDataFileName ); + /* if( pFileName->szDrive ) strcat( szFileName, pFileName->szDrive ); + */ if( pFileName->szPath ) strcat( szFileName, pFileName->szPath ); strcat( szFileName, pFileName->szName ); @@ -4292,7 +4294,7 @@ ERRCODE hb_cdxSeek( CDXAREAP pArea, BOOL bSoftSeek, PHB_ITEM pKey, BOOL bFindLas } } } - return SUCCESS; + //return SUCCESS; } /* @@ -4314,7 +4316,7 @@ ERRCODE hb_cdxGoTo( CDXAREAP pArea, ULONG ulRecNo ) if ( ! pTag ) return SUCCESS; - if( !pTag->CurKeyInfo || pTag->CurKeyInfo->Tag != ulRecNo ) + if( !pTag->CurKeyInfo || (ULONG) pTag->CurKeyInfo->Tag != ulRecNo ) { pKey = hb_cdxKeyNew(); @@ -4340,7 +4342,7 @@ ERRCODE hb_cdxGoTo( CDXAREAP pArea, ULONG ulRecNo ) if ( lRecno > 0 ) { - if ( lRecno == pArea->ulRecNo ) + if ( (ULONG) lRecno == pArea->ulRecNo ) return SUCCESS; else { @@ -4398,7 +4400,7 @@ ERRCODE hb_cdxGoToId( CDXAREAP pArea, PHB_ITEM pItem ) ERRCODE hb_cdxGoHot( CDXAREAP pArea ) { LPCDXTAG pTag; - USHORT uiTag; + //USHORT uiTag; LPKEYINFO pKey; HB_MACRO_PTR pMacro; @@ -4410,7 +4412,7 @@ ERRCODE hb_cdxGoHot( CDXAREAP pArea ) if( pArea->lpIndexes && pArea->lpIndexes->TagList ) { pTag = pArea->lpIndexes->TagList; - uiTag = 1; + //uiTag = 1; while( pTag ) { pKey = hb_cdxKeyNew(); @@ -4432,7 +4434,7 @@ ERRCODE hb_cdxGoHot( CDXAREAP pArea ) pTag->HotKey = pKey; pTag = pTag->pNext; - ++uiTag; + //++uiTag; } } @@ -4523,5 +4525,4 @@ ERRCODE hb_cdxGoCold( CDXAREAP pArea ) if( SUPER_GOCOLD( ( AREAP ) pArea ) == FAILURE ) return FAILURE; return SUCCESS; -} - +} \ No newline at end of file