From 3f1adf00127d779abfc0def24d368f3da0da4944 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sat, 6 Sep 2008 09:11:45 +0000 Subject: [PATCH] 2008-09-06 11:07 UTC+0200 Viktor Szakats (harbour.01 syenar hu) * make_vc.bat * contrib/mtpl_vc.bat + Added -nologo to nmake.exe command line. * source/vm/memvars.c * source/rtl/scroll.c * source/rtl/diskspac.c * source/rtl/console.c * source/rtl/philes.c * source/rtl/oldclear.c * source/rtl/oldbox.c * source/rtl/cdpapi.c * source/rtl/setpos.c * source/rtl/errorapi.c * source/rtl/setcolor.c * source/rtl/philes53.c * source/rtl/setkey.c * source/rtl/disksphb.c * source/rtl/shadow.c * source/rtl/hbhex.c * source/rtl/setcurs.c * source/rtl/dates.c * source/rtl/gtwvt/gtwvt.c * source/rtl/hbinet.c * source/rtl/hbffind.c * source/rtl/filesys.c * contrib/hbct/screen2.c * contrib/hbct/screen1.c * contrib/hbnf/fttext.c ! Fixed more MSVS 2008 -W4 warnings (about 100 of them). * contrib/hbnf/fttext.c ! Fixed C++ compile error after recently switching to Harbour API from Clipper one. --- harbour/ChangeLog | 36 ++++++++++++++++++++++++++++++++ harbour/contrib/hbct/screen1.c | 18 ++++++++-------- harbour/contrib/hbct/screen2.c | 2 +- harbour/contrib/hbnf/fttext.c | 2 +- harbour/contrib/mtpl_vc.bat | 6 +++--- harbour/make_vc.bat | 6 +++--- harbour/source/rtl/cdpapi.c | 20 +++++++++--------- harbour/source/rtl/console.c | 10 ++++----- harbour/source/rtl/dates.c | 8 +++---- harbour/source/rtl/diskspac.c | 24 ++++++++++----------- harbour/source/rtl/disksphb.c | 2 +- harbour/source/rtl/errorapi.c | 12 +++++------ harbour/source/rtl/filesys.c | 20 +++++++++--------- harbour/source/rtl/gtwvt/gtwvt.c | 4 ++-- harbour/source/rtl/hbffind.c | 2 +- harbour/source/rtl/hbhex.c | 2 +- harbour/source/rtl/hbinet.c | 8 +++---- harbour/source/rtl/oldbox.c | 25 +++++++++++----------- harbour/source/rtl/oldclear.c | 8 ++++--- harbour/source/rtl/philes.c | 6 +++--- harbour/source/rtl/philes53.c | 3 +-- harbour/source/rtl/scroll.c | 4 ++-- harbour/source/rtl/setcolor.c | 2 +- harbour/source/rtl/setcurs.c | 2 +- harbour/source/rtl/setkey.c | 10 ++++----- harbour/source/rtl/setpos.c | 3 +-- harbour/source/rtl/shadow.c | 20 +++++++++--------- harbour/source/vm/memvars.c | 4 ++-- 28 files changed, 152 insertions(+), 117 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index ff8912eec6..39afac2c14 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,42 @@ 2008-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org) */ +2008-09-06 11:07 UTC+0200 Viktor Szakats (harbour.01 syenar hu) + * make_vc.bat + * contrib/mtpl_vc.bat + + Added -nologo to nmake.exe command line. + + * source/vm/memvars.c + * source/rtl/scroll.c + * source/rtl/diskspac.c + * source/rtl/console.c + * source/rtl/philes.c + * source/rtl/oldclear.c + * source/rtl/oldbox.c + * source/rtl/cdpapi.c + * source/rtl/setpos.c + * source/rtl/errorapi.c + * source/rtl/setcolor.c + * source/rtl/philes53.c + * source/rtl/setkey.c + * source/rtl/disksphb.c + * source/rtl/shadow.c + * source/rtl/hbhex.c + * source/rtl/setcurs.c + * source/rtl/dates.c + * source/rtl/gtwvt/gtwvt.c + * source/rtl/hbinet.c + * source/rtl/hbffind.c + * source/rtl/filesys.c + * contrib/hbct/screen2.c + * contrib/hbct/screen1.c + * contrib/hbnf/fttext.c + ! Fixed more MSVS 2008 -W4 warnings (about 100 of them). + + * contrib/hbnf/fttext.c + ! Fixed C++ compile error after recently + switching to Harbour API from Clipper one. + 2008-09-05 20:45 UTC+0200 Viktor Szakats (harbour.01 syenar hu) * contrib/rddads/adsfunc.c ! Fixed some more MSVS 2008 -W4 warnings. diff --git a/harbour/contrib/hbct/screen1.c b/harbour/contrib/hbct/screen1.c index 5a31a4a2df..86991c94ba 100644 --- a/harbour/contrib/hbct/screen1.c +++ b/harbour/contrib/hbct/screen1.c @@ -102,13 +102,13 @@ HB_FUNC( SCREENATTR ) { SHORT sRow, sCol; - int iRow, iCol; + SHORT iRow, iCol; BYTE bColor, bAttr; USHORT usChar; hb_gtGetPos( &sRow, &sCol ); - iRow = ISNUM( 1 ) ? hb_parni( 1 ) : sRow; - iCol = ISNUM( 2 ) ? hb_parni( 2 ) : sCol; + iRow = ISNUM( 1 ) ? ( SHORT ) hb_parni( 1 ) : sRow; + iCol = ISNUM( 2 ) ? ( SHORT ) hb_parni( 2 ) : sCol; if( hb_gtGetChar( iRow, iCol, &bColor, &bAttr, &usChar ) != SUCCESS ) bColor = 0; @@ -151,7 +151,7 @@ HB_FUNC( SCREENMIX ) char * szText = hb_parc( 1 ), * szAttr; ULONG ulAttr = hb_parclen( 2 ), ul = 0; SHORT sRow, sCol; - int iRow, iCol, i; + SHORT iRow, iCol, i; if( ulAttr == 0 ) { @@ -162,8 +162,8 @@ HB_FUNC( SCREENMIX ) szAttr = hb_parc( 2 ); hb_gtGetPos( &sRow, &sCol ); - iRow = ISNUM( 3 ) ? hb_parni( 3 ) : sRow; - iCol = ISNUM( 4 ) ? hb_parni( 4 ) : sCol; + iRow = ISNUM( 3 ) ? ( SHORT ) hb_parni( 3 ) : sRow; + iCol = ISNUM( 4 ) ? ( SHORT ) hb_parni( 4 ) : sCol; if( iRow >= 0 && iCol >= 0 && iRow <= hb_gtMaxRow() && iCol <= hb_gtMaxCol() ) @@ -231,11 +231,11 @@ HB_FUNC( SAYSCREEN ) { char * szText = hb_parc( 1 ); SHORT sRow, sCol; - int iRow, iCol, i; + SHORT iRow, iCol, i; hb_gtGetPos( &sRow, &sCol ); - iRow = ISNUM( 2 ) ? hb_parni( 2 ) : sRow; - iCol = ISNUM( 3 ) ? hb_parni( 3 ) : sCol; + iRow = ISNUM( 2 ) ? ( SHORT ) hb_parni( 2 ) : sRow; + iCol = ISNUM( 3 ) ? ( SHORT ) hb_parni( 3 ) : sCol; if( iRow >= 0 && iCol >= 0 && iRow <= hb_gtMaxRow() && iCol <= hb_gtMaxCol() ) diff --git a/harbour/contrib/hbct/screen2.c b/harbour/contrib/hbct/screen2.c index a6569f7eec..d46595314c 100644 --- a/harbour/contrib/hbct/screen2.c +++ b/harbour/contrib/hbct/screen2.c @@ -77,7 +77,7 @@ HB_FUNC( SAYDOWN ) if( iRow >= 0 && iCol >= 0 && iRow <= iMaxRow && iCol <= iMaxCol ) { - BYTE bColor = hb_gtGetCurrColor(); + BYTE bColor = ( BYTE ) hb_gtGetCurrColor(); if( ulLen > ( ULONG ) ( iMaxRow - iRow + 1 ) ) ulLen = ( ULONG ) ( iMaxRow - iRow + 1 ); diff --git a/harbour/contrib/hbnf/fttext.c b/harbour/contrib/hbnf/fttext.c index 28e08dd18d..52b0cf4d20 100644 --- a/harbour/contrib/hbnf/fttext.c +++ b/harbour/contrib/hbnf/fttext.c @@ -1253,7 +1253,7 @@ HB_FUNC( FT_FAPPEND ) if( !error[area] ) { /* move DOS eof marker */ - hb_fsWrite( handles[area], (void *) buff, 0 ); + hb_fsWrite( handles[area], (BYTE *) buff, 0 ); error[area] = hb_fsError(); } diff --git a/harbour/contrib/mtpl_vc.bat b/harbour/contrib/mtpl_vc.bat index 1ad463856c..da6581572c 100644 --- a/harbour/contrib/mtpl_vc.bat +++ b/harbour/contrib/mtpl_vc.bat @@ -37,14 +37,14 @@ if "%1" == "INSTALL" goto INSTALL :BUILD - %_HB_MAKE_PROGRAM% %HB_MAKE_FLAGS% -f %_HB_MAKEFILE% %1 %2 %3 > %_HB_MAKELOG% + %_HB_MAKE_PROGRAM% %HB_MAKE_FLAGS% -nologo -f %_HB_MAKEFILE% %1 %2 %3 > %_HB_MAKELOG% if errorlevel 1 set HB_EXIT_LEVEL=1 if errorlevel 1 if not "%HB_SHOW_ERRORS%" == "no" notepad %_HB_MAKELOG% goto EXIT :CLEAN - %_HB_MAKE_PROGRAM% %HB_MAKE_FLAGS% -f %_HB_MAKEFILE% CLEAN > %_HB_MAKELOG% + %_HB_MAKE_PROGRAM% %HB_MAKE_FLAGS% -nologo -f %_HB_MAKEFILE% CLEAN > %_HB_MAKELOG% if errorlevel 1 set HB_EXIT_LEVEL=1 if errorlevel 1 goto EXIT @@ -53,7 +53,7 @@ if "%1" == "INSTALL" goto INSTALL :INSTALL - %_HB_MAKE_PROGRAM% %HB_MAKE_FLAGS% -f %_HB_MAKEFILE% INSTALL > nul + %_HB_MAKE_PROGRAM% %HB_MAKE_FLAGS% -nologo -f %_HB_MAKEFILE% INSTALL > nul if errorlevel 1 set HB_EXIT_LEVEL=1 goto EXIT diff --git a/harbour/make_vc.bat b/harbour/make_vc.bat index f01998dbdd..8977d0c3d3 100644 --- a/harbour/make_vc.bat +++ b/harbour/make_vc.bat @@ -84,14 +84,14 @@ rem --------------------------------------------------------------- :BUILD - %_HB_MAKE_PROGRAM% %HB_MAKE_FLAGS% -f %_HB_MAKEFILE% %1 %2 %3 > make_%_HB_CC_NAME%.log + %_HB_MAKE_PROGRAM% %HB_MAKE_FLAGS% -nologo -f %_HB_MAKEFILE% %1 %2 %3 > make_%_HB_CC_NAME%.log if errorlevel 1 set HB_EXIT_LEVEL=1 if errorlevel 1 if not "%HB_SHOW_ERRORS%" == "no" notepad make_%_HB_CC_NAME%.log goto EXIT :CLEAN - %_HB_MAKE_PROGRAM% %HB_MAKE_FLAGS% -f %_HB_MAKEFILE% CLEAN > make_%_HB_CC_NAME%.log + %_HB_MAKE_PROGRAM% %HB_MAKE_FLAGS% -nologo -f %_HB_MAKEFILE% CLEAN > make_%_HB_CC_NAME%.log if errorlevel 1 set HB_EXIT_LEVEL=1 if errorlevel 1 goto EXIT if exist make_%_HB_CC_NAME%.log del make_%_HB_CC_NAME%.log > nul @@ -100,7 +100,7 @@ rem --------------------------------------------------------------- :INSTALL - %_HB_MAKE_PROGRAM% %HB_MAKE_FLAGS% -f %_HB_MAKEFILE% INSTALL > nul + %_HB_MAKE_PROGRAM% %HB_MAKE_FLAGS% -nologo -f %_HB_MAKEFILE% INSTALL > nul if errorlevel 1 set HB_EXIT_LEVEL=1 goto EXIT diff --git a/harbour/source/rtl/cdpapi.c b/harbour/source/rtl/cdpapi.c index 248d870a04..dd3db88d05 100644 --- a/harbour/source/rtl/cdpapi.c +++ b/harbour/source/rtl/cdpapi.c @@ -334,8 +334,8 @@ HB_EXPORT BOOL hb_cdpRegister( PHB_CODEPAGE cdpage ) for( i = 0; i < 256; i++ ) { - cdpage->s_upper[i] = toupper( ( UCHAR ) i ); - cdpage->s_lower[i] = tolower( ( UCHAR ) i ); + cdpage->s_upper[i] = ( char ) toupper( ( UCHAR ) i ); + cdpage->s_lower[i] = ( char ) tolower( ( UCHAR ) i ); } if( strpbrk( cdpage->CharsUpper, "~." ) != NULL ) { @@ -387,12 +387,12 @@ HB_EXPORT BOOL hb_cdpRegister( PHB_CODEPAGE cdpage ) iumax = iu; ilmax = il; - cdpage->s_chars[iu] = i; - cdpage->s_chars[il] = i + nAddLower; + cdpage->s_chars[iu] = ( char ) i; + cdpage->s_chars[il] = ( char ) ( i + nAddLower ); if( cdpage->lAccInterleave ) { - cdpage->s_accent[iu] = ia; - cdpage->s_accent[il] = ia + nAddLower; + cdpage->s_accent[iu] = ( char ) ia; + cdpage->s_accent[il] = ( char ) ( ia + nAddLower ); } cdpage->s_upper[il] = *ptrUpper; cdpage->s_lower[iu] = *ptrLower; @@ -402,12 +402,12 @@ HB_EXPORT BOOL hb_cdpRegister( PHB_CODEPAGE cdpage ) for( i = 91; i <= 96; i++ ) { if( !cdpage->s_chars[i] ) - cdpage->s_chars[i] = cdpage->nChars + ( i - 90 ); + cdpage->s_chars[i] = ( char ) ( cdpage->nChars + ( i - 90 ) ); } for( i = 123; i < 256; i++ ) { if( !cdpage->s_chars[i] ) - cdpage->s_chars[i] = cdpage->nChars + nAddLower + ( i - 122 ); + cdpage->s_chars[i] = ( char ) ( cdpage->nChars + nAddLower + ( i - 122 ) ); } } /* @@ -799,7 +799,7 @@ HB_EXPORT ULONG hb_cdpStrnToUTF8( PHB_CODEPAGE cdp, BOOL fCtrl, else { uniCodes = cdp->uniTable->uniCodes; - nChars = cdp->uniTable->nChars; + nChars = ( USHORT ) cdp->uniTable->nChars; } } else @@ -843,7 +843,7 @@ HB_EXPORT ULONG hb_cdpStrnToU16( PHB_CODEPAGE cdp, BOOL fCtrl, else { uniCodes = cdp->uniTable->uniCodes; - nChars = cdp->uniTable->nChars; + nChars = ( USHORT ) cdp->uniTable->nChars; } } else diff --git a/harbour/source/rtl/console.c b/harbour/source/rtl/console.c index 87132a867c..e5923492b3 100644 --- a/harbour/source/rtl/console.c +++ b/harbour/source/rtl/console.c @@ -296,7 +296,7 @@ static void hb_conOut( USHORT uiParam, hb_out_func_typedef * pOutFunc ) HB_FUNC( OUTSTD ) /* writes a list of values to the standard output device */ { - USHORT uiPCount = hb_pcount(); + USHORT uiPCount = ( USHORT ) hb_pcount(); USHORT uiParam; for( uiParam = 1; uiParam <= uiPCount; uiParam++ ) @@ -309,7 +309,7 @@ HB_FUNC( OUTSTD ) /* writes a list of values to the standard output device */ HB_FUNC( OUTERR ) /* writes a list of values to the standard error device */ { - USHORT uiPCount = hb_pcount(); + USHORT uiPCount = ( USHORT ) hb_pcount(); USHORT uiParam; for( uiParam = 1; uiParam <= uiPCount; uiParam++ ) @@ -322,7 +322,7 @@ HB_FUNC( OUTERR ) /* writes a list of values to the standard error device */ HB_FUNC( QQOUT ) /* writes a list of values to the current device (screen or printer) and is affected by SET ALTERNATE */ { - USHORT uiPCount = hb_pcount(); + USHORT uiPCount = ( USHORT ) hb_pcount(); USHORT uiParam; for( uiParam = 1; uiParam <= uiPCount; uiParam++ ) @@ -342,7 +342,7 @@ HB_FUNC( QOUT ) BYTE buf[ 80 ]; s_uiPRow++; - s_uiPCol = hb_set.HB_SET_MARGIN; + s_uiPCol = ( USHORT ) hb_set.HB_SET_MARGIN; if( s_uiPCol ) { if( s_uiPCol > sizeof( buf ) ) @@ -395,7 +395,7 @@ static void hb_conDevPos( SHORT iRow, SHORT iCol ) hb_stricmp( hb_set.HB_SET_DEVICE, "PRINTER" ) == 0 ) { USHORT uiPRow = ( USHORT ) iRow; - USHORT uiPCol = ( USHORT ) iCol + hb_set.HB_SET_MARGIN; + USHORT uiPCol = ( USHORT ) iCol + ( USHORT ) hb_set.HB_SET_MARGIN; if( s_uiPRow != uiPRow || s_uiPCol != uiPCol ) { diff --git a/harbour/source/rtl/dates.c b/harbour/source/rtl/dates.c index 8b5fddcdfa..8fe2d3b209 100644 --- a/harbour/source/rtl/dates.c +++ b/harbour/source/rtl/dates.c @@ -126,7 +126,7 @@ HB_EXPORT char * hb_dateFormat( const char * szDate, char * szFormattedDate, con digit_count--; } while( digit_count-- > 0 && format_count < size ) - szFormattedDate[ format_count++ ] = digit; + szFormattedDate[ format_count++ ] = ( char ) digit; } used_d = TRUE; break; @@ -161,7 +161,7 @@ HB_EXPORT char * hb_dateFormat( const char * szDate, char * szFormattedDate, con digit_count--; } while( digit_count-- > 0 && format_count < size ) - szFormattedDate[ format_count++ ] = digit; + szFormattedDate[ format_count++ ] = ( char ) digit; } used_m = TRUE; break; @@ -197,14 +197,14 @@ HB_EXPORT char * hb_dateFormat( const char * szDate, char * szFormattedDate, con digit_count--; } while( digit_count-- > 0 && format_count < size ) - szFormattedDate[ format_count++ ] = digit; + szFormattedDate[ format_count++ ] = ( char ) digit; } used_y = TRUE; break; default: while( digit_count-- > 0 && format_count < size ) - szFormattedDate[ format_count++ ] = digit; + szFormattedDate[ format_count++ ] = ( char ) digit; } } } diff --git a/harbour/source/rtl/diskspac.c b/harbour/source/rtl/diskspac.c index 13e92f26ae..80ab4d20ea 100644 --- a/harbour/source/rtl/diskspac.c +++ b/harbour/source/rtl/diskspac.c @@ -115,17 +115,17 @@ HB_FUNC( DISKSPACE ) typedef BOOL ( WINAPI * P_GDFSE )( LPCSTR, PULARGE_INTEGER, PULARGE_INTEGER, PULARGE_INTEGER ); ULARGE_INTEGER i64FreeBytesToCaller, i64TotalBytes, i64FreeBytes; - USHORT uiParam = hb_parni( 1 ); + USHORT uiParam = ( USHORT ) hb_parni( 1 ); USHORT uiDrive = uiParam == 0 ? hb_fsCurDrv() + 1 : uiParam; UINT uiErrMode = SetErrorMode( SEM_FAILCRITICALERRORS ); #if defined(HB_WINCE) - TCHAR lpPath[4]; + TCHAR lpPath[ 4 ]; - lpPath[0] = uiDrive + 'A' - 1; - lpPath[1] = ':'; - lpPath[2] = '\\'; - lpPath[3] = '\0'; + lpPath[ 0 ] = ( TCHAR ) uiDrive + 'A' - 1; + lpPath[ 1 ] = ':'; + lpPath[ 2 ] = '\\'; + lpPath[ 3 ] = '\0'; bError = !GetDiskFreeSpaceEx( lpPath, ( PULARGE_INTEGER ) &i64FreeBytesToCaller, @@ -134,14 +134,14 @@ HB_FUNC( DISKSPACE ) if( !bError ) dSpace = HB_GET_LARGE_UINT( i64FreeBytesToCaller ); #else - char szPath[4]; + char szPath[ 4 ]; P_GDFSE pGetDiskFreeSpaceEx = ( P_GDFSE ) GetProcAddress( GetModuleHandleA( "kernel32.dll" ), "GetDiskFreeSpaceExA" ); - szPath[0] = uiDrive + 'A' - 1; - szPath[1] = ':'; - szPath[2] = '\\'; - szPath[3] = '\0'; + szPath[ 0 ] = ( char ) uiDrive + 'A' - 1; + szPath[ 1 ] = ':'; + szPath[ 2 ] = '\\'; + szPath[ 3 ] = '\0'; if( pGetDiskFreeSpaceEx ) { @@ -186,7 +186,7 @@ HB_FUNC( DISKSPACE ) } #elif defined(HB_OS_UNIX) { - char *szName = hb_parc( 1 ); + char * szName = hb_parc( 1 ); BOOL fFree = FALSE; if( !szName ) diff --git a/harbour/source/rtl/disksphb.c b/harbour/source/rtl/disksphb.c index b14b53313c..f010531941 100644 --- a/harbour/source/rtl/disksphb.c +++ b/harbour/source/rtl/disksphb.c @@ -70,7 +70,7 @@ HB_FUNC( HB_DISKSPACE ) { char szPathBuf[ 4 ]; char * szPath = hb_parc( 1 ); - USHORT uiType = ISNUM( 2 ) ? hb_parni( 2 ) : HB_DISK_AVAIL; + USHORT uiType = ISNUM( 2 ) ? ( USHORT ) hb_parni( 2 ) : HB_DISK_AVAIL; double dSpace = 0.0; if( uiType > HB_DISK_TOTAL ) diff --git a/harbour/source/rtl/errorapi.c b/harbour/source/rtl/errorapi.c index f2924a1af6..a850bcaa12 100644 --- a/harbour/source/rtl/errorapi.c +++ b/harbour/source/rtl/errorapi.c @@ -758,7 +758,7 @@ USHORT hb_errGetGenCode( PHB_ITEM pError ) { HB_TRACE(HB_TR_DEBUG, ("hb_errGetGenCode(%p)", pError)); - return hb_arrayGetNI( pError, HB_TERROR_GENCODE ); + return ( USHORT ) hb_arrayGetNI( pError, HB_TERROR_GENCODE ); } PHB_ITEM hb_errPutGenCode( PHB_ITEM pError, USHORT uiGenCode ) @@ -797,7 +797,7 @@ USHORT hb_errGetOsCode( PHB_ITEM pError ) { HB_TRACE(HB_TR_DEBUG, ("hb_errGetOsCode(%p)", pError)); - return hb_arrayGetNI( pError, HB_TERROR_OSCODE ); + return ( USHORT ) hb_arrayGetNI( pError, HB_TERROR_OSCODE ); } PHB_ITEM hb_errPutOsCode( PHB_ITEM pError, USHORT uiOsCode ) @@ -813,7 +813,7 @@ USHORT hb_errGetSeverity( PHB_ITEM pError ) { HB_TRACE(HB_TR_DEBUG, ("hb_errGetSeverity(%p)", pError)); - return hb_arrayGetNI( pError, HB_TERROR_SEVERITY ); + return ( USHORT ) hb_arrayGetNI( pError, HB_TERROR_SEVERITY ); } PHB_ITEM hb_errPutSeverity( PHB_ITEM pError, USHORT uiSeverity ) @@ -829,7 +829,7 @@ USHORT hb_errGetSubCode( PHB_ITEM pError ) { HB_TRACE(HB_TR_DEBUG, ("hb_errGetSubCode(%p)", pError)); - return hb_arrayGetNI( pError, HB_TERROR_SUBCODE ); + return ( USHORT ) hb_arrayGetNI( pError, HB_TERROR_SUBCODE ); } PHB_ITEM hb_errPutSubCode( PHB_ITEM pError, USHORT uiSubCode ) @@ -861,7 +861,7 @@ USHORT hb_errGetTries( PHB_ITEM pError ) { HB_TRACE(HB_TR_DEBUG, ("hb_errGetTries(%p)", pError)); - return hb_arrayGetNI( pError, HB_TERROR_TRIES ); + return ( USHORT ) hb_arrayGetNI( pError, HB_TERROR_TRIES ); } PHB_ITEM hb_errPutTries( PHB_ITEM pError, USHORT uiTries ) @@ -877,7 +877,7 @@ USHORT hb_errGetFlags( PHB_ITEM pError ) { HB_TRACE(HB_TR_DEBUG, ("hb_errGetFlags(%p)", pError)); - return hb_arrayGetNI( pError, HB_TERROR_FLAGS ); + return ( USHORT ) hb_arrayGetNI( pError, HB_TERROR_FLAGS ); } PHB_ITEM hb_errPutFlags( PHB_ITEM pError, USHORT uiFlags ) diff --git a/harbour/source/rtl/filesys.c b/harbour/source/rtl/filesys.c index 1accfaf867..6048686d92 100644 --- a/harbour/source/rtl/filesys.c +++ b/harbour/source/rtl/filesys.c @@ -499,10 +499,10 @@ static void convert_open_flags( BOOL fCreate, ULONG ulAttr, USHORT uiFlags, } #endif -static int convert_seek_flags( USHORT uiFlags ) +static USHORT convert_seek_flags( USHORT uiFlags ) { /* by default FS_SET is set */ - int result_flags = SEEK_SET; + USHORT result_flags = SEEK_SET; HB_TRACE(HB_TR_DEBUG, ("convert_seek_flags(%hu)", uiFlags)); @@ -1067,16 +1067,16 @@ HB_EXPORT BOOL hb_fsSetFileTime( BYTE * pszFileName, LONG lJulian, LONG lMillise if( lJulian > 0 ) { - st.wYear = iYear; - st.wMonth = iMonth; - st.wDay = iDay; + st.wYear = ( WORD ) iYear; + st.wMonth = ( WORD ) iMonth; + st.wDay = ( WORD ) iDay; } if( lMillisec >= 0 ) { - st.wHour = iHour; - st.wMinute = iMinute; - st.wSecond = iSecond; - st.wMilliseconds = iMSec; + st.wHour = ( WORD ) iHour; + st.wMinute = ( WORD ) iMinute; + st.wSecond = ( WORD ) iSecond; + st.wMilliseconds = ( WORD ) iMSec; } SystemTimeToFileTime( &st, &local_ft ); LocalFileTimeToFileTime( &local_ft, &ft ); @@ -1949,7 +1949,7 @@ HB_EXPORT ULONG hb_fsSeek( HB_FHANDLE hFileHandle, LONG lOffset, USHORT uiFlags { ret = DosSetFilePtr( hFileHandle, lOffset, Flags, &ulPos ); /* TODO: what we should do with this error code? Is it DOS compatible? */ - hb_fsSetError(( USHORT ) ret ); + hb_fsSetError( ( USHORT ) ret ); } if( ret != 0 ) { diff --git a/harbour/source/rtl/gtwvt/gtwvt.c b/harbour/source/rtl/gtwvt/gtwvt.c index 9fb1f48fe8..5d714cfb42 100644 --- a/harbour/source/rtl/gtwvt/gtwvt.c +++ b/harbour/source/rtl/gtwvt/gtwvt.c @@ -294,10 +294,10 @@ static HFONT hb_gt_wvt_GetFont( char * pszFace, int iHeight, int iWidth, int iWe logfont.lfItalic = 0; logfont.lfUnderline = 0; logfont.lfStrikeOut = 0; - logfont.lfCharSet = iCodePage; /* OEM_CHARSET; */ + logfont.lfCharSet = ( BYTE ) iCodePage; /* OEM_CHARSET; */ logfont.lfOutPrecision = 0; logfont.lfClipPrecision = 0; - logfont.lfQuality = iQuality; /* DEFAULT_QUALITY, DRAFT_QUALITY or PROOF_QUALITY */ + logfont.lfQuality = ( BYTE ) iQuality; /* DEFAULT_QUALITY, DRAFT_QUALITY or PROOF_QUALITY */ logfont.lfPitchAndFamily = FIXED_PITCH+FF_MODERN; /* all mapping depends on fixed width fonts! */ logfont.lfHeight = iHeight; logfont.lfWidth = iWidth < 0 ? -iWidth : iWidth; diff --git a/harbour/source/rtl/hbffind.c b/harbour/source/rtl/hbffind.c index a4557a7132..1081ee81a4 100644 --- a/harbour/source/rtl/hbffind.c +++ b/harbour/source/rtl/hbffind.c @@ -343,7 +343,7 @@ ULONG hb_fsAttrEncode( const char * szAttr ) HB_TRACE(HB_TR_DEBUG, ("hb_fsAttrEncode(%p)", szAttr)); - while( ( ch = toupper( *pos ) ) != '\0' ) + while( ( ch = ( char ) toupper( *pos ) ) != '\0' ) { switch( ch ) { diff --git a/harbour/source/rtl/hbhex.c b/harbour/source/rtl/hbhex.c index 8857b4748a..1785af8685 100644 --- a/harbour/source/rtl/hbhex.c +++ b/harbour/source/rtl/hbhex.c @@ -119,7 +119,7 @@ HB_FUNC( HB_NUMTOHEX ) do { int iDigit = ( int ) ( ulNum & 0x0F ); - ret[ --iLen ] = iDigit + ( iDigit < 10 ? '0' : 'A' - 10 ); + ret[ --iLen ] = ( char ) ( iDigit + ( iDigit < 10 ? '0' : 'A' - 10 ) ); ulNum >>= 4; } while( fDefaultLen ? ulNum != 0 : iLen != 0 ); diff --git a/harbour/source/rtl/hbinet.c b/harbour/source/rtl/hbinet.c index 7f8b109925..9164f9a592 100644 --- a/harbour/source/rtl/hbinet.c +++ b/harbour/source/rtl/hbinet.c @@ -66,7 +66,7 @@ /* Compile in Unix mode under Cygwin */ #ifdef HB_OS_UNIX_COMPATIBLE - #undef HB_OS_WIN_32 + #undef HB_OS_WIN_32 #endif /* HB_INET_H_ */ @@ -180,11 +180,11 @@ #include #endif -#if defined( HB_OS_UNIX ) || defined( HB_OS_UNIX_COMPATIBLE ) || defined( HB_OS_BSD ) || defined(HB_OS_OS2) +#if defined( HB_OS_UNIX ) || defined( HB_OS_UNIX_COMPATIBLE ) || defined( HB_OS_BSD ) || defined( HB_OS_OS2 ) #include #endif -#if defined(HB_OS_OS2) +#if defined( HB_OS_OS2 ) #include #include #include @@ -213,7 +213,7 @@ #define socklen_t int #endif -#if (__POCC__ >= 500) && defined( HB_OS_WIN_64 ) +#if defined( __POCC__ ) && ( __POCC__ >= 500 ) && defined( HB_OS_WIN_64 ) /* TOFIX: Bad workaround for the '__WSAFDIsSet unresolved' problem in Pelles C 5.00.13 AMD64 mode, to make final executables link at all. Some hbinet.c features (or the whole module) diff --git a/harbour/source/rtl/oldbox.c b/harbour/source/rtl/oldbox.c index 42d5a8fad3..7e4d1b1f35 100644 --- a/harbour/source/rtl/oldbox.c +++ b/harbour/source/rtl/oldbox.c @@ -65,10 +65,10 @@ HB_FUNC( __BOX ) char * pszBox = hb_parc( 5 ); if( pTop && pLeft && pBottom && pRight && pszBox ) - hb_gtBox( hb_itemGetNI( pTop ), - hb_itemGetNI( pLeft), - hb_itemGetNI( pBottom ), - hb_itemGetNI( pRight ), + hb_gtBox( ( SHORT ) hb_itemGetNI( pTop ), + ( SHORT ) hb_itemGetNI( pLeft), + ( SHORT ) hb_itemGetNI( pBottom ), + ( SHORT ) hb_itemGetNI( pRight ), ( BYTE * ) ( *pszBox ? pszBox : " " ) ); } @@ -80,10 +80,10 @@ HB_FUNC( __BOXD ) PHB_ITEM pRight = hb_param( 4, HB_IT_NUMERIC ); if( pTop && pLeft && pBottom && pRight ) - hb_gtBoxD( hb_itemGetNI( pTop ), - hb_itemGetNI( pLeft), - hb_itemGetNI( pBottom ), - hb_itemGetNI( pRight ) ); + hb_gtBoxD( ( SHORT ) hb_itemGetNI( pTop ), + ( SHORT ) hb_itemGetNI( pLeft), + ( SHORT ) hb_itemGetNI( pBottom ), + ( SHORT ) hb_itemGetNI( pRight ) ); } HB_FUNC( __BOXS ) @@ -94,11 +94,10 @@ HB_FUNC( __BOXS ) PHB_ITEM pRight = hb_param( 4, HB_IT_NUMERIC ); if( pTop && pLeft && pBottom && pRight ) - hb_gtBoxS( hb_itemGetNI( pTop ), - hb_itemGetNI( pLeft), - hb_itemGetNI( pBottom ), - hb_itemGetNI( pRight ) ); + hb_gtBoxS( ( SHORT ) hb_itemGetNI( pTop ), + ( SHORT ) hb_itemGetNI( pLeft), + ( SHORT ) hb_itemGetNI( pBottom ), + ( SHORT ) hb_itemGetNI( pRight ) ); } #endif - diff --git a/harbour/source/rtl/oldclear.c b/harbour/source/rtl/oldclear.c index 34338ecc8d..6cb44f2653 100644 --- a/harbour/source/rtl/oldclear.c +++ b/harbour/source/rtl/oldclear.c @@ -58,8 +58,11 @@ HB_FUNC( __ATCLEAR ) { if( hb_pcount() == 4 ) { - hb_gtSetPos( hb_parni( 1 ), hb_parni( 2 ) ); - hb_gtScroll( hb_parni( 1 ), hb_parni( 2 ), hb_parni( 3 ), hb_parni( 4 ), 0, 0 ); + hb_gtSetPos( ( SHORT ) hb_parni( 1 ), ( SHORT ) hb_parni( 2 ) ); + hb_gtScroll( ( USHORT ) hb_parni( 1 ), + ( USHORT ) hb_parni( 2 ), + ( USHORT ) hb_parni( 3 ), + ( USHORT ) hb_parni( 4 ), 0, 0 ); } } @@ -70,4 +73,3 @@ HB_FUNC( __CLEAR ) } #endif - diff --git a/harbour/source/rtl/philes.c b/harbour/source/rtl/philes.c index 94f6ddd449..7280abc826 100644 --- a/harbour/source/rtl/philes.c +++ b/harbour/source/rtl/philes.c @@ -59,7 +59,7 @@ HB_FUNC( FOPEN ) if( ISCHAR( 1 ) ) { hb_retnint( ( HB_NHANDLE ) hb_fsOpen( ( BYTE * ) hb_parc( 1 ), - ISNUM( 2 ) ? hb_parni( 2 ) : FO_READ | FO_COMPAT ) ); + ISNUM( 2 ) ? ( USHORT ) hb_parni( 2 ) : FO_READ | FO_COMPAT ) ); hb_fsSetFError( hb_fsError() ); } else @@ -91,7 +91,7 @@ HB_FUNC( HB_FCREATE ) { hb_retnint( ( HB_NHANDLE ) hb_fsCreateEx( ( BYTE * ) hb_parc( 1 ), ISNUM( 2 ) ? hb_parni( 2 ) : FC_NORMAL, - ISNUM( 3 ) ? hb_parni( 3 ) : FO_COMPAT ) ); + ISNUM( 3 ) ? ( USHORT ) hb_parni( 3 ) : FO_COMPAT ) ); hb_fsSetFError( hb_fsError() ); } else @@ -210,7 +210,7 @@ HB_FUNC( FSEEK ) { hb_retnint( hb_fsSeekLarge( hb_numToHandle( hb_parnint( 1 ) ), hb_parnint( 2 ), - ISNUM( 3 ) ? hb_parni( 3 ) : FS_SET ) ); + ISNUM( 3 ) ? ( USHORT ) hb_parni( 3 ) : FS_SET ) ); uiError = hb_fsError(); } else diff --git a/harbour/source/rtl/philes53.c b/harbour/source/rtl/philes53.c index 3ab0d7b7bc..18ae673680 100644 --- a/harbour/source/rtl/philes53.c +++ b/harbour/source/rtl/philes53.c @@ -62,7 +62,7 @@ HB_FUNC( FSETDEVMOD ) /* C53 checks only number of parameters: hb_pcount() == 2 */ if( ISNUM( 1 ) && ISNUM( 2 ) ) { - hb_fsSetDevMode( hb_numToHandle( hb_parnint( 1 ) ), hb_parni( 2 ) ); + hb_fsSetDevMode( hb_numToHandle( hb_parnint( 1 ) ), ( USHORT ) hb_parni( 2 ) ); hb_fsSetFError( hb_fsError() ); } /* NOTE: INCOMPATIBILITY! C53 will return the device flags @@ -72,4 +72,3 @@ HB_FUNC( FSETDEVMOD ) } #endif - diff --git a/harbour/source/rtl/scroll.c b/harbour/source/rtl/scroll.c index 161fb6f743..e9b5dad899 100644 --- a/harbour/source/rtl/scroll.c +++ b/harbour/source/rtl/scroll.c @@ -105,6 +105,6 @@ HB_FUNC( SCROLL ) ( USHORT ) iLeft, ( USHORT ) iBottom, ( USHORT ) iRight, - hb_parni( 5 ), /* Defaults to zero on bad type */ - hb_parni( 6 ) ); /* Defaults to zero on bad type */ + ( SHORT ) hb_parni( 5 ), /* Defaults to zero on bad type */ + ( SHORT ) hb_parni( 6 ) ); /* Defaults to zero on bad type */ } diff --git a/harbour/source/rtl/setcolor.c b/harbour/source/rtl/setcolor.c index 3d1f9f2b04..0e55327c28 100644 --- a/harbour/source/rtl/setcolor.c +++ b/harbour/source/rtl/setcolor.c @@ -74,7 +74,7 @@ HB_FUNC( SETCOLOR ) HB_FUNC( COLORSELECT ) { if( ISNUM( 1 ) ) - hb_gtColorSelect( hb_parni( 1 ) ); + hb_gtColorSelect( ( USHORT ) hb_parni( 1 ) ); } HB_FUNC( SETBLINK ) diff --git a/harbour/source/rtl/setcurs.c b/harbour/source/rtl/setcurs.c index f86d9b50ad..0ac64ec937 100644 --- a/harbour/source/rtl/setcurs.c +++ b/harbour/source/rtl/setcurs.c @@ -76,5 +76,5 @@ HB_FUNC( SETCURSOR ) hb_retni( uiCursor ); if( ISNUM( 1 ) ) - hb_gtSetCursor( hb_parni( 1 ) ); + hb_gtSetCursor( ( USHORT ) hb_parni( 1 ) ); } diff --git a/harbour/source/rtl/setkey.c b/harbour/source/rtl/setkey.c index 0225e1d45e..049e8c2621 100644 --- a/harbour/source/rtl/setkey.c +++ b/harbour/source/rtl/setkey.c @@ -189,7 +189,7 @@ HB_FUNC( SETKEY ) PHB_SETKEY sk_list_tmp, sk_list_end; /* sk_list_end is not used in this context */ - sk_list_tmp = sk_findkey( hb_itemGetNI( pKeyCode ), &sk_list_end ); + sk_list_tmp = sk_findkey( ( SHORT ) hb_itemGetNI( pKeyCode ), &sk_list_end ); if( sk_list_tmp ) { @@ -205,7 +205,7 @@ HB_FUNC( SETKEY ) { /* Set a SETKEY value */ - sk_add( TRUE, hb_itemGetNI( pKeyCode ), + sk_add( TRUE, ( SHORT ) hb_itemGetNI( pKeyCode ), hb_param( 2, HB_IT_BLOCK ), #if defined( HB_EXTENSION ) hb_param( 3, HB_IT_BLOCK ) ); @@ -230,7 +230,7 @@ HB_FUNC( HB_SETKEYARRAY ) ULONG nPos; for( nPos = 1; nPos <= nLen; nPos++ ) - sk_add( FALSE, hb_arrayGetNI( pKeyCodeArray, nPos ), pAction, pIsActive ); + sk_add( FALSE, ( SHORT ) hb_arrayGetNI( pKeyCodeArray, nPos ), pAction, pIsActive ); } } @@ -243,7 +243,7 @@ HB_FUNC( HB_SETKEYGET ) PHB_SETKEY sk_list_tmp, sk_list_end; /* sk_list_end is not used in this context */ - sk_list_tmp = sk_findkey( hb_itemGetNI( pKeyCode ), &sk_list_end ); + sk_list_tmp = sk_findkey( ( SHORT ) hb_itemGetNI( pKeyCode ), &sk_list_end ); if( sk_list_tmp ) { @@ -319,7 +319,7 @@ HB_FUNC( HB_SETKEYCHECK ) PHB_SETKEY sk_list_tmp, sk_list_end; /* sk_list_end is not used in this context */ - sk_list_tmp = sk_findkey( hb_itemGetNI( pKeyCode ), &sk_list_end ); + sk_list_tmp = sk_findkey( ( SHORT ) hb_itemGetNI( pKeyCode ), &sk_list_end ); if( sk_list_tmp ) { diff --git a/harbour/source/rtl/setpos.c b/harbour/source/rtl/setpos.c index 466dfa26c7..8bf6f97b92 100644 --- a/harbour/source/rtl/setpos.c +++ b/harbour/source/rtl/setpos.c @@ -67,7 +67,7 @@ HB_FUNC( SETPOS ) /* Sets the screen position */ { if( ISNUM( 1 ) && ISNUM( 2 ) ) - hb_gtSetPos( hb_parni( 1 ), hb_parni( 2 ) ); + hb_gtSetPos( ( SHORT ) hb_parni( 1 ), ( SHORT ) hb_parni( 2 ) ); } HB_FUNC( ROW ) /* Return the current screen row position (zero origin) */ @@ -89,4 +89,3 @@ HB_FUNC( COL ) /* Return the current screen column position (zero origin) */ hb_retni( iCol ); } - diff --git a/harbour/source/rtl/shadow.c b/harbour/source/rtl/shadow.c index 655ea75ce6..b84b79bf51 100644 --- a/harbour/source/rtl/shadow.c +++ b/harbour/source/rtl/shadow.c @@ -56,19 +56,19 @@ HB_FUNC( HB_SHADOW ) { if( hb_pcount() >= 4 ) - hb_gtDrawShadow( hb_parni( 1 ), - hb_parni( 2 ), - hb_parni( 3 ), - hb_parni( 4 ), - ISNUM( 5 ) ? hb_parni( 5 ) : 7 ); + hb_gtDrawShadow( ( USHORT ) hb_parni( 1 ), + ( USHORT ) hb_parni( 2 ), + ( USHORT ) hb_parni( 3 ), + ( USHORT ) hb_parni( 4 ), + ISNUM( 5 ) ? ( BYTE ) hb_parni( 5 ) : 7 ); } HB_FUNC( HB_CLRAREA ) { if( hb_pcount() > 4 ) - hb_gtSetAttribute( hb_parni( 1 ), - hb_parni( 2 ), - hb_parni( 3 ), - hb_parni( 4 ), - hb_parni( 5 ) ); + hb_gtSetAttribute( ( USHORT ) hb_parni( 1 ), + ( USHORT ) hb_parni( 2 ), + ( USHORT ) hb_parni( 3 ), + ( USHORT ) hb_parni( 4 ), + ( BYTE ) hb_parni( 5 ) ); } diff --git a/harbour/source/vm/memvars.c b/harbour/source/vm/memvars.c index 39a742e66b..92a0b425a1 100644 --- a/harbour/source/vm/memvars.c +++ b/harbour/source/vm/memvars.c @@ -1324,10 +1324,10 @@ static HB_DYNS_FUNC( hb_memvarSave ) buffer[ 11 ] = 'N' + 128; #ifdef HB_C52_STRICT /* NOTE: This is the buggy, but fully CA-Cl*pper compatible method. [vszakats] */ - buffer[ 16 ] = ( BYTE ) iWidth + ( HB_IS_DOUBLE( pItem ) ? iDec + 1 : 0 ); + buffer[ 16 ] = ( BYTE ) iWidth + ( HB_IS_DOUBLE( pItem ) ? ( BYTE ) iDec + 1 : 0 ); #else /* NOTE: This would be the correct method, but Clipper is buggy here. [vszakats] */ - buffer[ 16 ] = ( BYTE ) iWidth + ( iDec == 0 ? 0 : iDec + 1 ); + buffer[ 16 ] = ( BYTE ) iWidth + ( iDec == 0 ? 0 : ( BYTE ) iDec + 1 ); #endif buffer[ 17 ] = ( BYTE ) iDec;