diff --git a/harbour/ChangeLog b/harbour/ChangeLog index f0ff9df643..18f30aacdb 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,43 @@ past entries belonging to author(s): Viktor Szakats. */ +2010-01-14 04:04 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) + * src/rtl/binnumx.c + * contrib/xpp/binnumx.c + * contrib/hbmisc/stringsx.c + * contrib/hbtip/utils.c + * contrib/hbcairo/context.c + * contrib/hbcairo/core.c + * ULONG -> HB_SIZE + + * contrib/hbgt/ascposgt.c + * ULONG -> HB_SIZE + ! hb_parni() -> hb_parnl() + + * contrib/hbsqlit3/hbsqlit3.c + ! ULONG -> int (var used in 3rd party interface) + + * contrib/hbmzip/hbmzip.c + * Formatting. + + * contrib/hbclipsm/num.c + % hb_retnl() -> hb_retni() + * ULONG -> HB_SIZE + + * contrib/hbgd/gdwrp.c + % Deleted few unnecessary ULONG casts. + ! Fixed win64 problem where file handle was read from hb_parnl() + instead of hb_parnint(). + ! Fixed 'hb_parnl( 2 ) > -1' code checking for valid file handle + to 'hb_parnint( 2 ) != FS_ERROR'. + * ULONG -> HB_SIZE + % Elmininated few variables. + * Formatting. + + * contrib/hbmisc/strfmt.c + * ULONG -> int, HB_SIZE + * BOOL -> HB_BOOL. + 2010-01-14 03:22 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * contrib/hbwin/win_prn3.c * ULONG -> HB_SIZE diff --git a/harbour/contrib/hbcairo/context.c b/harbour/contrib/hbcairo/context.c index d6543fe51d..0c71a6f06f 100644 --- a/harbour/contrib/hbcairo/context.c +++ b/harbour/contrib/hbcairo/context.c @@ -136,9 +136,9 @@ HB_FUNC( CAIRO_GET_DASH ) cairo_get_dash( pCairo, pDashes, &dOffset ); hb_stornd( dOffset, 3 ); - pItem = hb_itemArrayNew( ( ULONG ) iCount ); + pItem = hb_itemArrayNew( ( HB_SIZE ) iCount ); for( i = 0; i < iCount; i++ ) - hb_arraySetND( pItem, ( ULONG ) i + 1, pDashes[ i ] ); + hb_arraySetND( pItem, ( HB_SIZE ) i + 1, pDashes[ i ] ); hb_xfree( pDashes ); hb_itemParamStoreForward( 2, pItem ); hb_itemRelease( pItem ); @@ -224,7 +224,7 @@ HB_FUNC( CAIRO_SET_DASH ) double * pDashes = ( double * ) hb_xgrab( iCount * sizeof( double ) ); for ( i = 0; i < iCount; i++ ) - pDashes[ i ] = hb_arrayGetND( pItem, ( ULONG ) i + 1 ); + pDashes[ i ] = hb_arrayGetND( pItem, ( HB_SIZE ) i + 1 ); cairo_set_dash( pCairo, pDashes, iCount, hb_parnd( 3 ) ); hb_xfree( pDashes ); } @@ -353,4 +353,3 @@ HB_FUNC( CAIRO_STROKE_PRESERVE ) if( pCairo ) cairo_stroke_preserve( pCairo ); } - diff --git a/harbour/contrib/hbcairo/core.c b/harbour/contrib/hbcairo/core.c index fd0694785e..baf0241e5a 100644 --- a/harbour/contrib/hbcairo/core.c +++ b/harbour/contrib/hbcairo/core.c @@ -394,11 +394,11 @@ HB_FUNC( CAIRO_PATH_ITERATOR_SET_POINTS ) if( pIterator && pIterator->ppPath && ( pPath = * ( pIterator->ppPath ) ) != NULL && pArray ) { cairo_path_data_t * pData; - ULONG ulLen; + HB_SIZE nLen; - ulLen = hb_arrayLen( pArray ); + nLen = hb_arrayLen( pArray ); if( pIterator->iPos < pPath->num_data && pIterator->iPos != -1 && - ( ULONG ) pPath->data[ pIterator->iPos ].header.length == ulLen + 1 ) + ( HB_SIZE ) pPath->data[ pIterator->iPos ].header.length == nLen + 1 ) { PHB_ITEM pItem; int i; diff --git a/harbour/contrib/hbclipsm/num.c b/harbour/contrib/hbclipsm/num.c index ba0c092995..a9e2b3e312 100644 --- a/harbour/contrib/hbclipsm/num.c +++ b/harbour/contrib/hbclipsm/num.c @@ -85,7 +85,7 @@ HB_FUNC( NUMGETDECIMALS ) if( HB_ISNUM( 1 ) ) hb_itemGetNLen( hb_param( 1, HB_IT_NUMERIC ), NULL, &iDec ); - hb_retnl( iDec ); + hb_retni( iDec ); } /* NumGetLen( ) --> nDigits @@ -93,7 +93,7 @@ HB_FUNC( NUMGETDECIMALS ) */ HB_FUNC( NUMGETLEN ) { - ULONG ulLen = 0; + HB_SIZE ulLen = 0; if( HB_ISNUM( 1 ) ) { @@ -157,13 +157,13 @@ HB_FUNC( SIGN ) HB_FUNC( NUMASCURRENCY ) { char * szBuffer = hb_itemStr( hb_param( 1, HB_IT_NUMERIC ), NULL, NULL ); - long ulSymbolLen = hb_itemGetCLen( hb_param( 2, HB_IT_STRING ) ); + HB_SIZE ulSymbolLen = hb_itemGetCLen( hb_param( 2, HB_IT_STRING ) ); char * ptr = szBuffer; char * szCurrency; - ULONG ulLen; + HB_SIZE ulLen; ulLen = strlen( ptr ); - szCurrency = ( char * ) hb_xgrab( ulLen + ulSymbolLen ) ; + szCurrency = ( char * ) hb_xgrab( ulLen + ulSymbolLen ); if( hb_parni( 3 ) < 0 ) { diff --git a/harbour/contrib/hbgd/gdwrp.c b/harbour/contrib/hbgd/gdwrp.c index 9c17c79672..99c26697f5 100644 --- a/harbour/contrib/hbgd/gdwrp.c +++ b/harbour/contrib/hbgd/gdwrp.c @@ -323,7 +323,7 @@ static void SaveImageToFile( const char *szFile, const void * iptr, int sz ) if( ( fhandle = hb_fsCreate( szFile, FC_NORMAL ) ) != FS_ERROR ) { /* Write Image */ - SaveImageToHandle( fhandle, iptr, ( ULONG ) sz ); + SaveImageToHandle( fhandle, iptr, sz ); /* Close file */ hb_fsClose( fhandle ); @@ -370,17 +370,14 @@ static void GDImageCreateFrom( int nType ) ( HB_ISNUM( 2 ) ) ) { - - HB_FHANDLE fhandle; - /* Retrieve file handle */ - fhandle = ( HB_ISNUM( 1 ) ) ? hb_parnl( 1 ) : 0; /* 0 = std input */ + HB_FHANDLE fhandle = HB_ISNUM( 1 ) ? hb_parnint( 1 ) : 0; /* 0 = std input */ + /* Retrieve image size */ sz = hb_parni( 2 ); /* retrieve image from handle */ iptr = LoadImageFromHandle( fhandle, sz ); - } else { @@ -432,7 +429,6 @@ static void GDImageSaveTo( int nType ) gdImagePtr im; int sz = 0; void * iptr = NULL; - HB_FHANDLE fhandle; int level = 0, fg = 0; /* Retrieve image pointer */ @@ -527,16 +523,13 @@ static void GDImageSaveTo( int nType ) /* If i get a file name */ if( HB_ISCHAR( 2 ) ) - { - const char *szFile = hb_parcx( 2 ); - SaveImageToFile( szFile, iptr, sz ); - } + SaveImageToFile( hb_parcx( 2 ), iptr, sz ); /* Write to file handle (1 = std output) */ else if( HB_ISNUM( 2 ) ) { /* Write to std output or to a passed file */ - fhandle = ( hb_parnl( 2 ) > -1 ) ? hb_parnl( 2 ) : 1 ; /* 1 = std output */ + HB_FHANDLE fhandle = ( hb_parnint( 2 ) != FS_ERROR ) ? hb_parnint( 2 ) : 1; /* 1 = std output */ /* Write Image */ SaveImageToHandle( fhandle, iptr, sz ); @@ -546,7 +539,7 @@ static void GDImageSaveTo( int nType ) else { /* Return as string */ - hb_retclen( ( const char * ) iptr, ( ULONG ) sz ); + hb_retclen( ( const char * ) iptr, ( HB_SIZE ) sz ); } /* Free memory */ @@ -3662,7 +3655,7 @@ static void AddImageToFile( const char *szFile, const void * iptr, int sz ) hb_fsSeek( fhandle, 0, FS_END ); /* Write Image */ - SaveImageToHandle( fhandle, iptr, ( ULONG ) sz ); + SaveImageToHandle( fhandle, iptr, sz ); /* Close file */ hb_fsClose( fhandle ); @@ -3700,16 +3693,12 @@ HB_FUNC( GDIMAGEGIFANIMBEGIN ) /* Check if 2nd parameter is a file name or an handle */ if( HB_ISCHAR( 2 ) ) { - const char *szFile = hb_parcx( 2 ); - - SaveImageToFile( szFile, iptr, size ); + SaveImageToFile( hb_parcx( 2 ), iptr, size ); } else if( HB_ISNUM( 2 ) || HB_ISNIL( 2 ) ) { - HB_FHANDLE fhandle; - /* Retrieve file handle */ - fhandle = ( HB_ISNUM( 2 ) ) ? hb_parnl( 2 ) : 1; /* 1 = std output */ + HB_FHANDLE fhandle = HB_ISNUM( 2 ) ? hb_parnint( 2 ) : 1; /* 1 = std output */ SaveImageToHandle( fhandle, iptr, size ); } @@ -3760,19 +3749,14 @@ HB_FUNC( GDIMAGEGIFANIMADD ) /* Check if 2nd parameter is a file name or an handle */ if( HB_ISCHAR( 2 ) ) { - const char * szFile = hb_parcx( 2 ); - - AddImageToFile( szFile, iptr, size ); + AddImageToFile( hb_parcx( 2 ), iptr, size ); } else if( HB_ISNUM( 2 ) || HB_ISNIL( 2 ) ) { - HB_FHANDLE fhandle; - /* Retrieve file handle */ - fhandle = ( HB_ISNUM( 2 ) ) ? hb_parnl( 2 ) : 1; /* 1 = std output */ + HB_FHANDLE fhandle = HB_ISNUM( 2 ) ? hb_parnint( 2 ) : 1; /* 1 = std output */ SaveImageToHandle( fhandle, iptr, size ); - } } @@ -3804,21 +3788,15 @@ HB_FUNC( GDIMAGEGIFANIMEND ) /* Check if 1st parameter is a file name or an handle */ if( HB_ISCHAR( 1 ) ) { - const char * szFile = hb_parcx( 1 ); - - AddImageToFile( szFile, iptr, size ); + AddImageToFile( hb_parcx( 1 ), iptr, size ); } else if( HB_ISNUM( 2 ) || HB_ISNIL( 2 ) ) { - HB_FHANDLE fhandle; - /* Retrieve file handle */ - fhandle = ( HB_ISNUM( 1 ) ) ? hb_parnl( 1 ) : 1; /* 1 = std output */ + HB_FHANDLE fhandle = HB_ISNUM( 1 ) ? hb_parnint( 1 ) : 1; /* 1 = std output */ SaveImageToHandle( fhandle, iptr, size ); - } - } else { diff --git a/harbour/contrib/hbgt/ascposgt.c b/harbour/contrib/hbgt/ascposgt.c index 43462f2d58..0c073d636d 100644 --- a/harbour/contrib/hbgt/ascposgt.c +++ b/harbour/contrib/hbgt/ascposgt.c @@ -22,11 +22,11 @@ HB_FUNC( GT_ASCPOS ) { const char *s; - ULONG p; + HB_SIZE p; if (HB_ISCHAR(1) && HB_ISNUM(2)) { s = hb_parc(1); - p = hb_parni(2); + p = hb_parnl(2); p--; /* decrement p to adjust for c strings */ /* starting at position 0 */ diff --git a/harbour/contrib/hbmisc/strfmt.c b/harbour/contrib/hbmisc/strfmt.c index f5e6cde478..6207a9d21b 100644 --- a/harbour/contrib/hbmisc/strfmt.c +++ b/harbour/contrib/hbmisc/strfmt.c @@ -58,10 +58,10 @@ typedef struct { - char * raw; + char * raw; const char * buffer; - ULONG ulLen; - BOOL bFreeReq; + HB_SIZE ulLen; + HB_BOOL bFreeReq; } STRPAR; /* TODO: Add support for embedded PICTURE string in mask string. */ @@ -69,16 +69,16 @@ typedef struct HB_FUNC( STRFORMAT ) { - ULONG nParNum = hb_pcount(); + int nParNum = hb_pcount(); if( nParNum >= 1 ) { const char * pszMask = hb_parcx( 1 ); - ULONG nMaskLen = hb_parclen( 1 ); - ULONG nMaskPos; - ULONG nPos; + HB_SIZE nMaskLen = hb_parclen( 1 ); + HB_SIZE nMaskPos; + int nPos; - ULONG nRetValLen; + HB_SIZE nRetValLen; char * pszRetVal; char * pszRetValSave; diff --git a/harbour/contrib/hbmisc/stringsx.c b/harbour/contrib/hbmisc/stringsx.c index 0ad641dc81..44c8c3ae81 100644 --- a/harbour/contrib/hbmisc/stringsx.c +++ b/harbour/contrib/hbmisc/stringsx.c @@ -88,7 +88,7 @@ HB_FUNC( ROT13 ) if( HB_ISCHAR(1) ) { const char *szText = hb_parc( 1 ); - ULONG i, lLen = hb_parclen( 1 ); + HB_SIZE i, lLen = hb_parclen( 1 ); char *szResult = (char*)hb_xgrab(lLen + 1); for( i = 0; i < lLen; i++ ) @@ -105,5 +105,5 @@ HB_FUNC( ROT13 ) hb_xfree(szResult); } else - hb_retc(NULL); + hb_retc_null(); } diff --git a/harbour/contrib/hbmzip/hbmzip.c b/harbour/contrib/hbmzip/hbmzip.c index b65c6d67a2..4a0315f1db 100644 --- a/harbour/contrib/hbmzip/hbmzip.c +++ b/harbour/contrib/hbmzip/hbmzip.c @@ -254,8 +254,8 @@ HB_FUNC( HB_ZIPFILEWRITE ) zipFile hZip = hb_zipfileParam( 1 ); ULONG ulLen = hb_parclen( 2 ); - if( HB_ISNUM( 3 ) && (ULONG) hb_parnl( 3 ) < ulLen ) - ulLen = (ULONG) hb_parnl( 3 ); + if( HB_ISNUM( 3 ) && ( ULONG ) hb_parnl( 3 ) < ulLen ) + ulLen = ( ULONG ) hb_parnl( 3 ); if( hZip ) hb_retni( zipWriteInFileInZip( hZip, (void*) pData, ulLen ) ); @@ -397,7 +397,7 @@ HB_FUNC( HB_UNZIPFILEGOTO ) unzFile hUnzip = hb_unzipfileParam( 1 ); if( hUnzip ) - hb_retni( unzSetOffset( hUnzip, (ULONG) hb_parnint( 2 ) ) ); + hb_retni( unzSetOffset( hUnzip, ( ULONG ) hb_parnint( 2 ) ) ); } @@ -504,7 +504,7 @@ HB_FUNC( HB_UNZIPFILEREAD ) if( HB_ISNUM( 3 ) ) { - ULONG ulRead = (ULONG) hb_parnl( 3 ); + ULONG ulRead = ( ULONG ) hb_parnl( 3 ); if( ulRead < ulSize ) ulSize = ulRead; } @@ -1093,7 +1093,7 @@ static int hb_unzipExtractCurrentFile( unzFile hUnzip, const char* szFileName, c while( ( iResult = unzReadCurrentFile( hUnzip, pString, HB_Z_IOBUF_SIZE ) ) > 0 ) { - hb_fsWriteLarge( hFile, pString, (ULONG) iResult ); + hb_fsWriteLarge( hFile, pString, ( ULONG ) iResult ); } hb_xfree( pString ); diff --git a/harbour/contrib/hbsqlit3/hbsqlit3.c b/harbour/contrib/hbsqlit3/hbsqlit3.c index bad44f26bf..c300dbf8ac 100644 --- a/harbour/contrib/hbsqlit3/hbsqlit3.c +++ b/harbour/contrib/hbsqlit3/hbsqlit3.c @@ -753,11 +753,11 @@ HB_FUNC( SQLITE3_PREPARE ) if( SQL ) { const char *pSQL = hb_itemGetCPtr( SQL ); - ULONG ulLen = hb_itemGetCLen( SQL ); + int ulLen = ( int ) hb_itemGetCLen( SQL ); psqlite3_stmt pStmt; const char *pszTail; - if( sqlite3_prepare_v2(pHbSqlite3->db, pSQL, ulLen, &pStmt, &pszTail) == SQLITE_OK ) + if( sqlite3_prepare_v2( pHbSqlite3->db, pSQL, ulLen, &pStmt, &pszTail ) == SQLITE_OK ) { hb_retptr( pStmt ); } diff --git a/harbour/contrib/hbtip/utils.c b/harbour/contrib/hbtip/utils.c index 0b45bae7f0..e98c4314d0 100644 --- a/harbour/contrib/hbtip/utils.c +++ b/harbour/contrib/hbtip/utils.c @@ -567,8 +567,8 @@ HB_FUNC( PSTRCOMPI ) { const char * pcBase = hb_itemGetCPtr( pString ); const char * pcSub = hb_itemGetCPtr( pSubstr ); - ULONG uSublen = hb_itemGetCLen( pSubstr ); - ULONG uStart = hb_itemGetNL( pStart ); + HB_SIZE uSublen = hb_itemGetCLen( pSubstr ); + HB_SIZE uStart = hb_itemGetNL( pStart ); hb_retl( hb_strnicmp( pcBase + uStart - 1, pcSub, uSublen ) == 0 ); } diff --git a/harbour/contrib/xpp/binnumx.c b/harbour/contrib/xpp/binnumx.c index 4989b17f1f..f4b5b5c71f 100644 --- a/harbour/contrib/xpp/binnumx.c +++ b/harbour/contrib/xpp/binnumx.c @@ -61,7 +61,7 @@ HB_FUNC( BIN2U ) if( pItem ) { - ULONG ulLen = hb_itemGetCLen( pItem ); + HB_SIZE ulLen = hb_itemGetCLen( pItem ); if( ulLen ) { const char * pszString = hb_itemGetCPtr( pItem ); diff --git a/harbour/src/rtl/binnumx.c b/harbour/src/rtl/binnumx.c index f504ff8c69..d8a7905abb 100644 --- a/harbour/src/rtl/binnumx.c +++ b/harbour/src/rtl/binnumx.c @@ -65,7 +65,7 @@ HB_FUNC( BIN2U ) if( pItem ) { - ULONG ulLen = hb_itemGetCLen( pItem ); + HB_SIZE ulLen = hb_itemGetCLen( pItem ); if( ulLen ) { const char * pszString = hb_itemGetCPtr( pItem );