diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 733c0169e7..2a9c4740cb 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,14 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-11-22 21:45 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) + * contrib/hbwin/win_prn1.c + * contrib/hbwin/win_prn2.c + * Using HB_BOOL for Harbour variables. + * Few minor cleanups. + ; TOFIX: CreateFile() is used in one place instead of Harbour + File I/O. Anyone? + 2009-11-22 21:29 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * contrib/hbwin/win_prn1.c * Renamed some variables to reflect their real type. @@ -100,7 +108,7 @@ of Windows one to read from a disk file. * More variable name / macro usage cleanup. - ! TOFIX: PRINTFILERAW() has suspicious code aiming to delete + ; TOFIX: PRINTFILERAW() has suspicious code aiming to delete Chr( 26 ) from input files. In current implementation it can strip Chr( 26 ) even from inside the file if the file is larger than read buffer, which means it will corrupt input diff --git a/harbour/contrib/hbwin/win_prn1.c b/harbour/contrib/hbwin/win_prn1.c index 03695924e3..eeed358a31 100644 --- a/harbour/contrib/hbwin/win_prn1.c +++ b/harbour/contrib/hbwin/win_prn1.c @@ -104,7 +104,6 @@ static const HB_GC_FUNCS s_gc_HDC_funcs = hb_gcDummyMark }; - static HDC win_HDC_par( int iParam ) { void ** ph = ( void ** ) hb_parptrGC( &s_gc_HDC_funcs, iParam ); @@ -172,7 +171,7 @@ HB_FUNC( WIN_STARTDOC ) { HDC hDC = win_HDC_par( 1 ); DOCINFO sDoc; - BOOL bResult = FALSE; + HB_BOOL bResult = FALSE; if( hDC ) { @@ -183,7 +182,7 @@ HB_FUNC( WIN_STARTDOC ) sDoc.lpszOutput = NULL; sDoc.lpszDatatype = NULL; sDoc.fwType = 0; - bResult = ( BOOL ) ( StartDoc( hDC, &sDoc ) > 0 ); + bResult = ( StartDoc( hDC, &sDoc ) > 0 ); if( lpDocName ) HB_TCHAR_FREE( lpDocName ); @@ -194,7 +193,7 @@ HB_FUNC( WIN_STARTDOC ) HB_FUNC( WIN_ENDDOC ) { - BOOL bResult = FALSE; + HB_BOOL bResult = FALSE; HDC hDC = win_HDC_par( 1 ); if( hDC ) @@ -434,7 +433,7 @@ HB_FUNC( WIN_BITMAPSOK ) HB_FUNC( WIN_SETDOCUMENTPROPERTIES ) { - BOOL bResult = FALSE; + HB_BOOL bResult = FALSE; HDC hDC = win_HDC_par( 1 ); if( hDC ) @@ -492,7 +491,7 @@ HB_FUNC( WIN_SETDOCUMENTPROPERTIES ) HB_FUNC( WIN_GETDOCUMENTPROPERTIES ) { - BOOL bResult = FALSE; + HB_BOOL bResult = FALSE; HANDLE hPrinter; const char * pszPrinterName = hb_parc( 1 ); LPTSTR lpPrinterName = pszPrinterName ? HB_TCHAR_CONVTO( pszPrinterName ) : NULL; @@ -536,11 +535,12 @@ HB_FUNC( WIN_GETDOCUMENTPROPERTIES ) HB_FUNC( WIN_LOADBITMAPFILE ) { LPTSTR lpFileName = HB_TCHAR_CONVTO( hb_parcx( 1 ) ); - BOOL bSuccess = FALSE; + HB_BOOL bSuccess = FALSE; DWORD dwFileSize = 0, dwHighSize, dwBytesRead; HANDLE hFile; BITMAPFILEHEADER * pbmfh = NULL; + /* TOFIX: To use Harbour File I/O API here. */ hFile = CreateFile( ( LPCTSTR ) lpFileName, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_FLAG_SEQUENTIAL_SCAN, NULL ); @@ -565,7 +565,7 @@ HB_FUNC( WIN_LOADBITMAPFILE ) } if( bSuccess ) - hb_retclen( ( char * ) pbmfh, dwFileSize ); + hb_retclen( ( char * ) pbmfh, ( HB_SIZE ) dwFileSize ); else hb_retc_null(); diff --git a/harbour/contrib/hbwin/win_prn2.c b/harbour/contrib/hbwin/win_prn2.c index c8ce1589b1..dda0f3f9a7 100644 --- a/harbour/contrib/hbwin/win_prn2.c +++ b/harbour/contrib/hbwin/win_prn2.c @@ -71,7 +71,7 @@ #define MAXBUFFERSIZE 255 -static BOOL hb_IsLegacyDevice( const char * pszPrinterName ) +static HB_BOOL hb_IsLegacyDevice( const char * pszPrinterName ) { static const char * s_pszPrnDev[] = { "lpt1", "lpt2", "lpt3", "lpt4", "lpt5", "lpt6", "com1", "com2", "com3", "com4", NULL }; int i; @@ -87,7 +87,7 @@ static BOOL hb_IsLegacyDevice( const char * pszPrinterName ) HB_FUNC( PRINTEREXISTS ) { - BOOL bResult = FALSE; + HB_BOOL bResult = FALSE; if( HB_ISCHAR( 1 ) ) { @@ -123,9 +123,9 @@ HB_FUNC( PRINTEREXISTS ) hb_retl( bResult ); } -static BOOL hb_GetDefaultPrinter( char * pszPrinterName, HB_SIZE * pulBufferSize ) +static HB_BOOL hb_GetDefaultPrinter( char * pszPrinterName, HB_SIZE * pulBufferSize ) { - BOOL bResult = FALSE; + HB_BOOL bResult = FALSE; if( pszPrinterName && pulBufferSize ) { @@ -231,9 +231,9 @@ HB_FUNC( GETDEFAULTPRINTER ) hb_retc_null(); } -static BOOL hb_GetJobs( HANDLE hPrinter, JOB_INFO_2 ** ppJobInfo, long * plJobs ) +static HB_BOOL hb_GetJobs( HANDLE hPrinter, JOB_INFO_2 ** ppJobInfo, long * plJobs ) { - BOOL bResult = FALSE; + HB_BOOL bResult = FALSE; DWORD dwByteNeeded = 0; GetPrinter( hPrinter, 2, NULL, 0, &dwByteNeeded ); @@ -341,7 +341,7 @@ HB_FUNC( PRINTERPORTTONAME ) if( hb_parclen( 1 ) > 0 ) { const char * pszPortNameFind = hb_parc( 1 ); - BOOL bSubStr = hb_parl( 2 ); + HB_BOOL bSubStr = hb_parl( 2 ); DWORD dwNeeded = 0, dwReturned = 0; @@ -353,7 +353,7 @@ HB_FUNC( PRINTERPORTTONAME ) if( EnumPrinters( _ENUMPRN_FLAGS_, NULL, 5, ( LPBYTE ) pPrinterEnum, dwNeeded, &dwNeeded, &dwReturned ) ) { - BOOL bFound = FALSE; + HB_BOOL bFound = FALSE; DWORD i; for( i = 0; i < dwReturned && ! bFound; ++i, ++pPrinterEnum ) @@ -461,8 +461,8 @@ HB_FUNC( PRINTFILERAW ) HB_FUNC( GETPRINTERS ) { - BOOL bPrinterNamesOnly = HB_ISLOG( 1 ) ? ! hb_parl( 1 ) : TRUE; - BOOL bLocalPrintersOnly = hb_parl( 2 ); + HB_BOOL bPrinterNamesOnly = HB_ISLOG( 1 ) ? ! hb_parl( 1 ) : TRUE; + HB_BOOL bLocalPrintersOnly = hb_parl( 2 ); DWORD dwNeeded = 0, dwReturned = 0, i; PHB_ITEM pTempItem = hb_itemNew( NULL ); PHB_ITEM pPrinterArray = hb_itemNew( NULL );