From 36a9aff8ffd8999d7168c7dfd26af3d9e8ea7252 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 3 Jul 2009 16:52:16 +0000 Subject: [PATCH] 2009-07-03 18:51 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * source/rtl/fscopy.c * source/rtl/copyfile.c * source/rtl/memofile.c * source/rtl/filesys.c * contrib/hbmzip/hbmzip.c * contrib/hbsqlit3/hbsqlit3.c * contrib/hbpgsql/postgres.c * contrib/hbgd/gdwrp.c % Cleaned BYTE usage (converted to void). --- harbour/ChangeLog | 11 +++++++ harbour/contrib/hbgd/gdwrp.c | 47 ++++++++++++++--------------- harbour/contrib/hbmzip/hbmzip.c | 2 +- harbour/contrib/hbpgsql/postgres.c | 4 +-- harbour/contrib/hbsqlit3/hbsqlit3.c | 4 +-- harbour/source/rtl/copyfile.c | 4 +-- harbour/source/rtl/filesys.c | 4 +-- harbour/source/rtl/fscopy.c | 2 +- harbour/source/rtl/memofile.c | 4 +-- 9 files changed, 45 insertions(+), 37 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 58b54c1b01..1ee0a89001 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,17 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-07-03 18:51 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * source/rtl/fscopy.c + * source/rtl/copyfile.c + * source/rtl/memofile.c + * source/rtl/filesys.c + * contrib/hbmzip/hbmzip.c + * contrib/hbsqlit3/hbsqlit3.c + * contrib/hbpgsql/postgres.c + * contrib/hbgd/gdwrp.c + % Cleaned BYTE usage (converted to void). + 2009-07-03 18:13 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * make_gnu.bat + Requires Windows NT to start win/wce target builds. diff --git a/harbour/contrib/hbgd/gdwrp.c b/harbour/contrib/hbgd/gdwrp.c index 218b884f15..855409a9e0 100644 --- a/harbour/contrib/hbgd/gdwrp.c +++ b/harbour/contrib/hbgd/gdwrp.c @@ -249,8 +249,8 @@ static void * LoadImageFromHandle( HB_FHANDLE fhandle, int sz ) fhandle = 0; /* 0 = std input */ /* Read file */ - iptr = ( BYTE * ) hb_xgrab( sz ); - hb_fsReadLarge( fhandle, iptr, (ULONG) sz ); + iptr = hb_xgrab( sz ); + hb_fsReadLarge( fhandle, iptr, ( ULONG ) sz ); /* TraceLog( NULL, "Error dim %i, read %i", sz, iRead ); */ return iptr; @@ -272,8 +272,8 @@ static void * LoadImageFromFile( const char *szFile, int *sz ) hb_fsSeek( fhandle, 0, FS_SET ); /* Read file */ - iptr = ( BYTE * ) hb_xgrab( *sz ); - hb_fsReadLarge( fhandle, iptr, (ULONG) *sz ); + iptr = hb_xgrab( *sz ); + hb_fsReadLarge( fhandle, iptr, ( ULONG ) *sz ); /* TraceLog( NULL, "Error dim %i, read %i", sz, iRead ); */ /* Close file */ @@ -298,7 +298,7 @@ static void SaveImageToHandle( HB_FHANDLE fhandle, const void * iptr, int sz ) fhandle = 1; /* 1 = std output */ /* Write Image */ - hb_fsWriteLarge( fhandle, iptr, (ULONG) sz ); + hb_fsWriteLarge( fhandle, iptr, ( ULONG ) sz ); } /* ---------------------------------------------------------------------------*/ @@ -310,7 +310,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, ( ULONG ) sz ); /* Close file */ hb_fsClose( fhandle ); @@ -385,19 +385,19 @@ static void GDImageCreateFrom( int nType ) switch ( nType ) { case IMAGE_JPEG : - im = gdImageCreateFromJpegPtr( sz, ( BYTE *) iptr ); + im = gdImageCreateFromJpegPtr( sz, iptr ); break; case IMAGE_GIF : - im = gdImageCreateFromGifPtr( sz, ( BYTE *) iptr ); + im = gdImageCreateFromGifPtr( sz, iptr ); break; case IMAGE_PNG : - im = gdImageCreateFromPngPtr( sz, ( BYTE *) iptr ); + im = gdImageCreateFromPngPtr( sz, iptr ); break; case IMAGE_WBMP : - im = gdImageCreateFromWBMPPtr( sz, ( BYTE *) iptr ); + im = gdImageCreateFromWBMPPtr( sz, iptr ); break; case IMAGE_GD : - im = gdImageCreateFromGdPtr( sz, ( BYTE *) iptr ); + im = gdImageCreateFromGdPtr( sz, iptr ); break; } @@ -535,7 +535,7 @@ static void GDImageSaveTo( int nType ) else { /* Return as string */ - hb_retclen( (const char *) iptr, (ULONG) sz ); + hb_retclen( ( const char * ) iptr, ( ULONG ) sz ); } /* Free memory */ @@ -3382,7 +3382,7 @@ HB_FUNC( GDTRUECOLORALPHA ) /* int gdTrueColorAlpha(int red, int green, int blue a = hb_parni( 4 ); /* Allocate color */ - color = gdTrueColorAlpha(r, g, b, a); + color = gdTrueColorAlpha( r, g, b, a ); /* return color */ hb_retni( color ); @@ -3443,7 +3443,7 @@ HB_FUNC( GDIMAGECOPY ) /* void gdImageCopy(gdImagePtr dst, gdImagePtr src, int d h = hb_parni( 8 ); /* Perform copy */ - gdImageCopy(dst, src, dstX, dstY, srcX, srcY, w, h); + gdImageCopy( dst, src, dstX, dstY, srcX, srcY, w, h ); } else { @@ -3506,7 +3506,7 @@ HB_FUNC( GDIMAGECOPYRESIZED ) /* void gdImageCopyResized(gdImagePtr dst, gdImage srcH = hb_parni( 10 ); /* Perform copy */ - gdImageCopyResized(dst, src, dstX, dstY, srcX, srcY, dstW, dstH, srcW, srcH); + gdImageCopyResized( dst, src, dstX, dstY, srcX, srcY, dstW, dstH, srcW, srcH ); } else { @@ -3570,7 +3570,7 @@ HB_FUNC( GDIMAGECOPYRESAMPLED ) /* void gdImageCopyResampled(gdImagePtr dst, gdI srcH = hb_parni( 10 ); /* Perform copy */ - gdImageCopyResampled(dst, src, dstX, dstY, srcX, srcY, dstW, dstH, srcW, srcH); + gdImageCopyResampled( dst, src, dstX, dstY, srcX, srcY, dstW, dstH, srcW, srcH ); } else { @@ -3630,7 +3630,7 @@ HB_FUNC( GDIMAGECOPYROTATED ) /* void gdImageCopyRotated(gdImagePtr dst, gdImage angle = hb_parni( 9 ); /* Perform rotation */ - gdImageCopyRotated(dst, src, dstX, dstY, srcX, srcY, srcW, srcH, angle); + gdImageCopyRotated( dst, src, dstX, dstY, srcX, srcY, srcW, srcH, angle ); } else { @@ -3689,7 +3689,7 @@ HB_FUNC( GDIMAGECOPYMERGE ) /* void gdImageCopyMerge(gdImagePtr dst, gdImagePtr pct = hb_parni( 9 ); /* Perform copy */ - gdImageCopyMerge(dst, src, dstX, dstY, srcX, srcY, w, h, pct); + gdImageCopyMerge( dst, src, dstX, dstY, srcX, srcY, w, h, pct ); } else { @@ -3748,7 +3748,7 @@ HB_FUNC( GDIMAGECOPYMERGEGRAY ) /* void gdImageCopyMergeGray(gdImagePtr dst, gdI pct = hb_parni( 9 ); /* Perform copy */ - gdImageCopyMergeGray(dst, src, dstX, dstY, srcX, srcY, w, h, pct); + gdImageCopyMergeGray( dst, src, dstX, dstY, srcX, srcY, w, h, pct ); } else { @@ -3815,7 +3815,7 @@ HB_FUNC( GDIMAGESQUARETOCIRCLE ) /* void gdImageSquareToCircle(gdImagePtr im, in radius = hb_parni( 2 ); /* TODO */ - gdImageSquareToCircle(im, radius); + gdImageSquareToCircle( im, radius ); } else @@ -3850,7 +3850,6 @@ HB_FUNC( GDIMAGESHARPEN ) /* void gdImageSharpen(gdImagePtr im, int pct) */ /* Sharpens the specified image */ gdImageSharpen(im, pct); - } else { @@ -3945,10 +3944,10 @@ static void AddImageToFile( const char *szFile, const void * iptr, int sz ) if( ( fhandle = hb_fsOpen( szFile, FO_READWRITE ) ) != FS_ERROR ) { /* move to end of file */ - hb_fsSeek(fhandle, 0, FS_END); + hb_fsSeek( fhandle, 0, FS_END ); /* Write Image */ - SaveImageToHandle( fhandle, iptr, (ULONG) sz ); + SaveImageToHandle( fhandle, iptr, ( ULONG ) sz ); /* Close file */ hb_fsClose( fhandle ); @@ -3998,9 +3997,7 @@ HB_FUNC( GDIMAGEGIFANIMBEGIN ) fhandle = ( hb_parinfo( 2 ) & HB_IT_NUMERIC ) ? hb_parnl( 2 ) : 1; /* 1 = std output */ SaveImageToHandle( fhandle, iptr, size ); - } - } else { diff --git a/harbour/contrib/hbmzip/hbmzip.c b/harbour/contrib/hbmzip/hbmzip.c index 9425f83fd6..ffcf964fb9 100644 --- a/harbour/contrib/hbmzip/hbmzip.c +++ b/harbour/contrib/hbmzip/hbmzip.c @@ -1409,7 +1409,7 @@ static int hb_zipDeleteFile( const char* szZipFile, const char* szFileMask ) if( ufi.compressed_size ) { - BYTE * buffer = ( BYTE * ) hb_xgrab( HB_Z_IOBUF_SIZE ); + void * buffer = hb_xgrab( HB_Z_IOBUF_SIZE ); uLong ulLeft = ufi.compressed_size; while( ulLeft > 0 ) diff --git a/harbour/contrib/hbpgsql/postgres.c b/harbour/contrib/hbpgsql/postgres.c index 2440e43b27..01c2b121e3 100644 --- a/harbour/contrib/hbpgsql/postgres.c +++ b/harbour/contrib/hbpgsql/postgres.c @@ -855,11 +855,11 @@ HB_FUNC( PQFREECANCEL ) HB_FUNC( PQESCAPEBYTEACONN ) { - unsigned const char * from = ( BYTE * ) hb_parc( 2 ); + const char * from = hb_parc( 2 ); size_t from_length = hb_parclen( 2 ); size_t to_length = from_length * 5 + 1; - unsigned char * to = PQescapeByteaConn( PGconn_par( 1 ), from, from_length, &to_length ); + unsigned char * to = PQescapeByteaConn( PGconn_par( 1 ), ( unsigned const char * ) from, from_length, &to_length ); hb_retc( ( char * ) to ); PQfreemem( to ); } diff --git a/harbour/contrib/hbsqlit3/hbsqlit3.c b/harbour/contrib/hbsqlit3/hbsqlit3.c index f4b20a0f14..f6f6b7d5e1 100644 --- a/harbour/contrib/hbsqlit3/hbsqlit3.c +++ b/harbour/contrib/hbsqlit3/hbsqlit3.c @@ -1641,14 +1641,14 @@ HB_FUNC( SQLITE3_BLOB_READ ) if( pBlob ) { int iLen = hb_parni( 2 ); - BYTE *buffer; + void *buffer; if( iLen == 0 ) { iLen = sqlite3_blob_bytes( pBlob ); } - buffer = ( BYTE * ) hb_xgrab( iLen + 1 ); + buffer = hb_xgrab( iLen + 1 ); /*hb_xmemset( buffer, 0, iLen );*/ diff --git a/harbour/source/rtl/copyfile.c b/harbour/source/rtl/copyfile.c index d0bd80beac..04916a3826 100644 --- a/harbour/source/rtl/copyfile.c +++ b/harbour/source/rtl/copyfile.c @@ -109,10 +109,10 @@ static BOOL hb_copyfile( const char * szSource, const char * szDest ) struct stat struFileInfo; int iSuccess = fstat( fhndSource, &struFileInfo ); #endif - BYTE * buffer; + void * buffer; USHORT usRead; - buffer = ( BYTE * ) hb_xgrab( BUFFER_SIZE ); + buffer = hb_xgrab( BUFFER_SIZE ); bRetVal = TRUE; diff --git a/harbour/source/rtl/filesys.c b/harbour/source/rtl/filesys.c index 2479100020..0e277590f5 100644 --- a/harbour/source/rtl/filesys.c +++ b/harbour/source/rtl/filesys.c @@ -1501,7 +1501,7 @@ ULONG hb_fsReadLarge( HB_FHANDLE hFileHandle, void * pBuff, ULONG ulCount ) ULONG ulLeftToRead = ulCount; USHORT uiToRead; USHORT uiRead; - BYTE * pPtr = ( BYTE * ) pBuff; + void * pPtr = pBuff; ulRead = 0; @@ -1590,7 +1590,7 @@ ULONG hb_fsWriteLarge( HB_FHANDLE hFileHandle, const void * pBuff, ULONG ulCount ULONG ulLeftToWrite = ulCount; USHORT uiToWrite; USHORT uiWritten; - const BYTE * pPtr = ( const BYTE * ) pBuff; + const void * pPtr = pBuff; ulWritten = 0; diff --git a/harbour/source/rtl/fscopy.c b/harbour/source/rtl/fscopy.c index e0a234841b..3f587a9937 100644 --- a/harbour/source/rtl/fscopy.c +++ b/harbour/source/rtl/fscopy.c @@ -66,7 +66,7 @@ BOOL hb_fsCopy( const char * pszSource, const char * pszDest ) if( ( fhndDest = hb_fsCreate( pszDest, FC_NORMAL ) ) != FS_ERROR ) { USHORT nBytesRead; - BYTE * pbyBuffer = ( BYTE * ) hb_xgrab( HB_FSCOPY_BUFFERSIZE ); + void * pbyBuffer = hb_xgrab( HB_FSCOPY_BUFFERSIZE ); while( ( nBytesRead = hb_fsRead( fhndSource, pbyBuffer, HB_FSCOPY_BUFFERSIZE ) ) > 0 ) { diff --git a/harbour/source/rtl/memofile.c b/harbour/source/rtl/memofile.c index ebbfe0de31..a50471c105 100644 --- a/harbour/source/rtl/memofile.c +++ b/harbour/source/rtl/memofile.c @@ -72,7 +72,7 @@ static void hb_memoread( BOOL bHandleEOF ) if( ulSize != 0 ) { - BYTE * pbyBuffer; + void * pbyBuffer; /* Don't read the file terminating EOF character */ @@ -91,7 +91,7 @@ static void hb_memoread( BOOL bHandleEOF ) HB_SYMBOL_UNUSED( bHandleEOF ); #endif - pbyBuffer = ( BYTE * ) hb_xgrab( ulSize + sizeof( char ) ); + pbyBuffer = hb_xgrab( ulSize + sizeof( char ) ); hb_fsSeek( fhnd, 0, FS_SET ); hb_fsReadLarge( fhnd, pbyBuffer, ulSize );