From 7c0914cd438c4a2ec71df4b3228ac90adaec41f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20Czerpak?= Date: Fri, 25 Sep 2015 11:41:09 +0200 Subject: [PATCH] 2015-09-25 11:41 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) * src/rtl/filebuf.c ! removed unnecessary HB_EXPORT attribute * contrib/hbwin/oleuuid.c ! added missing HB_EXPORT attrinute for OpenWatcom builds * contrib/hbcomio/comio.c * contrib/hbpipeio/pipeio.c * contrib/hbtcpio/tcpio.c * src/rtl/hbsockhb.c ! cleaned integer types and casting --- ChangeLog.txt | 13 +++++++++++++ contrib/hbcomio/comio.c | 17 +++++++++-------- contrib/hbpipeio/pipeio.c | 2 +- contrib/hbtcpio/tcpio.c | 8 ++++---- contrib/hbwin/oleuuid.c | 26 ++++++++++++++------------ src/rtl/filebuf.c | 2 +- src/rtl/hbsockhb.c | 6 +++--- 7 files changed, 45 insertions(+), 29 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 329e8baaf4..eb71e648ea 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -10,6 +10,19 @@ * Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment */ +2015-09-25 11:41 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) + * src/rtl/filebuf.c + ! removed unnecessary HB_EXPORT attribute + + * contrib/hbwin/oleuuid.c + ! added missing HB_EXPORT attrinute for OpenWatcom builds + + * contrib/hbcomio/comio.c + * contrib/hbpipeio/pipeio.c + * contrib/hbtcpio/tcpio.c + * src/rtl/hbsockhb.c + ! cleaned integer types and casting + 2015-09-24 22:14 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) * src/rtl/hbcom.c * src/rtl/gtcrs/gtcrs.c diff --git a/contrib/hbcomio/comio.c b/contrib/hbcomio/comio.c index dd7ba2e8c0..e3590a10b0 100644 --- a/contrib/hbcomio/comio.c +++ b/contrib/hbcomio/comio.c @@ -61,13 +61,13 @@ typedef struct _HB_FILE { const HB_FILE_FUNCS * pFuncs; int port; - int timeout; + HB_MAXINT timeout; HB_BOOL fRead; HB_BOOL fWrite; } HB_FILE; -static PHB_FILE s_fileNew( int port, int timeout, HB_BOOL fRead, HB_BOOL fWrite ); +static PHB_FILE s_fileNew( int port, HB_MAXINT timeout, HB_BOOL fRead, HB_BOOL fWrite ); static int s_fileGetValue( const char * pszName, int * piLen ) { @@ -80,14 +80,14 @@ static int s_fileGetValue( const char * pszName, int * piLen ) return iValue; } -static int s_filePortParams( const char * pszName, int * piTimeout, +static int s_filePortParams( const char * pszName, HB_MAXINT * pTimeout, int * piBaud, int * piParity, int * piSize, int * piStop, int * piFlow ) { int iPort = 0, iLen, iValue; - *piTimeout = -1; + *pTimeout = -1; *piBaud = *piParity = *piSize = *piStop = *piFlow = 0; pszName += 3; @@ -256,15 +256,16 @@ static PHB_FILE s_fileOpen( PHB_FILE_FUNCS pFuncs, const char * pszName, { PHB_FILE pFile = NULL; HB_ERRCODE errcode = 0; - int iPort, iTimeout, iBaud, iParity, iSize, iStop, iFlow; + int iPort, iBaud, iParity, iSize, iStop, iFlow; HB_BOOL fRead, fWrite; + HB_MAXINT timeout; HB_SYMBOL_UNUSED( pFuncs ); HB_SYMBOL_UNUSED( pszDefExt ); HB_SYMBOL_UNUSED( pPaths ); fRead = fWrite = HB_TRUE; - iPort = s_filePortParams( pszName, &iTimeout, + iPort = s_filePortParams( pszName, &timeout, &iBaud, &iParity, &iSize, &iStop, &iFlow ); if( iPort > 0 ) { @@ -281,7 +282,7 @@ static PHB_FILE s_fileOpen( PHB_FILE_FUNCS pFuncs, const char * pszName, fRead = HB_FALSE; break; } - pFile = s_fileNew( iPort, iTimeout, fRead, fWrite ); + pFile = s_fileNew( iPort, timeout, fRead, fWrite ); } else errcode = hb_comGetError( iPort ); @@ -464,7 +465,7 @@ static HB_FILE_FUNCS s_fileFuncs = s_fileHandle }; -static PHB_FILE s_fileNew( int port, int timeout, HB_BOOL fRead, HB_BOOL fWrite ) +static PHB_FILE s_fileNew( int port, HB_MAXINT timeout, HB_BOOL fRead, HB_BOOL fWrite ) { PHB_FILE pFile = ( PHB_FILE ) hb_xgrab( sizeof( HB_FILE ) ); diff --git a/contrib/hbpipeio/pipeio.c b/contrib/hbpipeio/pipeio.c index c0edf6ea87..ba417dc7f1 100644 --- a/contrib/hbpipeio/pipeio.c +++ b/contrib/hbpipeio/pipeio.c @@ -354,7 +354,7 @@ HB_FUNC( HB_VFFROMPIPES ) HB_FUNC( HB_VFOPENPROCESS ) { const char * pszCommand = hb_parc( 1 ); - HB_FATTR nMode = hb_parnintdef( 2, FO_READ ); + HB_FATTR nMode = hb_parnldef( 2, FO_READ ); HB_MAXINT timeout = hb_parnintdef( 3, -1 ); HB_BOOL fDetach = hb_parl( 4 ); PHB_FILE pFile; diff --git a/contrib/hbtcpio/tcpio.c b/contrib/hbtcpio/tcpio.c index 4e469c6b35..1bce00e22e 100644 --- a/contrib/hbtcpio/tcpio.c +++ b/contrib/hbtcpio/tcpio.c @@ -65,11 +65,11 @@ typedef struct _HB_FILE const HB_FILE_FUNCS * pFuncs; PHB_SOCKEX sock; HB_BOOL fEof; - int timeout; + HB_MAXINT timeout; } HB_FILE; -static PHB_FILE s_fileNew( PHB_SOCKEX sock, int timeout ); +static PHB_FILE s_fileNew( PHB_SOCKEX sock, HB_MAXINT timeout ); static HB_BOOL s_fileAccept( PHB_FILE_FUNCS pFuncs, const char * pszFileName ) { @@ -87,7 +87,7 @@ static PHB_FILE s_fileOpen( PHB_FILE_FUNCS pFuncs, const char * pszName, HB_ERRCODE errcode = 0; HB_SIZE nLen = 0; int iPort = 0; - int timeout = -1; + HB_MAXINT timeout = -1; HB_SYMBOL_UNUSED( pFuncs ); HB_SYMBOL_UNUSED( pszDefExt ); @@ -358,7 +358,7 @@ static HB_FILE_FUNCS s_fileFuncs = s_fileHandle }; -static PHB_FILE s_fileNew( PHB_SOCKEX sock, int timeout ) +static PHB_FILE s_fileNew( PHB_SOCKEX sock, HB_MAXINT timeout ) { PHB_FILE pFile = ( PHB_FILE ) hb_xgrab( sizeof( HB_FILE ) ); diff --git a/contrib/hbwin/oleuuid.c b/contrib/hbwin/oleuuid.c index dcd1fc6784..f8b7565953 100644 --- a/contrib/hbwin/oleuuid.c +++ b/contrib/hbwin/oleuuid.c @@ -47,19 +47,21 @@ * */ -#include "hbwinole.h" +#include "hbapi.h" +#if defined( HB_OS_WIN ) && defined( __WATCOMC__ ) + #include + #include -#if defined( __WATCOMC__ ) HB_EXTERN_BEGIN - const GUID GUID_NULL = { 0x00000000, 0x0000, 0x0000, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } }; - const IID IID_IUnknown = { 0x00000000, 0x0000, 0x0000, { 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46 } }; - const IID IID_IOleObject = { 0x00000112, 0x0000, 0x0000, { 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46 } }; - const IID IID_IDispatch = { 0x00020400, 0x0000, 0x0000, { 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46 } }; - const IID IID_IEnumVARIANT = { 0x00020404, 0x0000, 0x0000, { 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46 } }; - const IID IID_IPicture = { 0x7bf80980, 0xbf32, 0x101a, { 0x8b, 0xbb, 0x00, 0xaa, 0x00, 0x30, 0x0c, 0xab } }; - const IID IID_IClassFactory2 = { 0xb196b28f, 0xbab4, 0x101a, { 0xb6, 0x9c, 0x00, 0xaa, 0x00, 0x34, 0x1d, 0x07 } }; - const IID IID_IProvideClassInfo = { 0xb196b283, 0xbab4, 0x101a, { 0xb6, 0x9c, 0x00, 0xaa, 0x00, 0x34, 0x1d, 0x07 } }; - const IID IID_IProvideClassInfo2 = { 0xa6bc3ac0, 0xdbaa, 0x11ce, { 0x9d, 0xe3, 0x00, 0xaa, 0x00, 0x4b, 0xb8, 0x51 } }; - const IID IID_IConnectionPointContainer = { 0xb196b284, 0xbab4, 0x101a, { 0xb6, 0x9c, 0x00, 0xaa, 0x00, 0x34, 0x1d, 0x07 } }; + const HB_EXPORT GUID GUID_NULL = { 0x00000000, 0x0000, 0x0000, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } }; + const HB_EXPORT IID IID_IUnknown = { 0x00000000, 0x0000, 0x0000, { 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46 } }; + const HB_EXPORT IID IID_IOleObject = { 0x00000112, 0x0000, 0x0000, { 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46 } }; + const HB_EXPORT IID IID_IDispatch = { 0x00020400, 0x0000, 0x0000, { 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46 } }; + const HB_EXPORT IID IID_IEnumVARIANT = { 0x00020404, 0x0000, 0x0000, { 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46 } }; + const HB_EXPORT IID IID_IPicture = { 0x7bf80980, 0xbf32, 0x101a, { 0x8b, 0xbb, 0x00, 0xaa, 0x00, 0x30, 0x0c, 0xab } }; + const HB_EXPORT IID IID_IClassFactory2 = { 0xb196b28f, 0xbab4, 0x101a, { 0xb6, 0x9c, 0x00, 0xaa, 0x00, 0x34, 0x1d, 0x07 } }; + const HB_EXPORT IID IID_IProvideClassInfo = { 0xb196b283, 0xbab4, 0x101a, { 0xb6, 0x9c, 0x00, 0xaa, 0x00, 0x34, 0x1d, 0x07 } }; + const HB_EXPORT IID IID_IProvideClassInfo2 = { 0xa6bc3ac0, 0xdbaa, 0x11ce, { 0x9d, 0xe3, 0x00, 0xaa, 0x00, 0x4b, 0xb8, 0x51 } }; + const HB_EXPORT IID IID_IConnectionPointContainer = { 0xb196b284, 0xbab4, 0x101a, { 0xb6, 0x9c, 0x00, 0xaa, 0x00, 0x34, 0x1d, 0x07 } }; HB_EXTERN_END #endif diff --git a/src/rtl/filebuf.c b/src/rtl/filebuf.c index f42bbc5cfd..c43bc76402 100644 --- a/src/rtl/filebuf.c +++ b/src/rtl/filebuf.c @@ -1203,7 +1203,7 @@ HB_BOOL hb_fileTimeSet( const char * pszFileName, long lJulian, long lMillisec ) return hb_fsSetFileTime( pszFileName, lJulian, lMillisec ); } -HB_EXPORT HB_FOFFSET hb_fileSizeGet( const char * pszFileName, HB_BOOL bUseDirEntry ) +HB_FOFFSET hb_fileSizeGet( const char * pszFileName, HB_BOOL bUseDirEntry ) { int i = s_fileFindDrv( pszFileName ); diff --git a/src/rtl/hbsockhb.c b/src/rtl/hbsockhb.c index 054640fa68..7250a535d9 100644 --- a/src/rtl/hbsockhb.c +++ b/src/rtl/hbsockhb.c @@ -784,21 +784,21 @@ void hb_socekxParamsGetStd( PHB_ITEM pParams, HB_IS_STRING( pItem ) ) { *pKeydata = hb_itemGetCPtr( pItem ); - *pKeylen = hb_itemGetCLen( pItem ); + *pKeylen = ( int ) hb_itemGetCLen( pItem ); } else if( pKeydata && pKeylen && ( pItem = hb_hashGetCItemPtr( pParams, "pass" ) ) != NULL && HB_IS_STRING( pItem ) ) { *pKeydata = hb_itemGetCPtr( pItem ); - *pKeylen = hb_itemGetCLen( pItem ); + *pKeylen = ( int ) hb_itemGetCLen( pItem ); } if( pIV && pIVlen && ( pItem = hb_hashGetCItemPtr( pParams, "iv" ) ) != NULL && HB_IS_STRING( pItem ) ) { *pIV = hb_itemGetCPtr( pItem ); - *pIVlen = hb_itemGetCLen( pItem ); + *pIVlen = ( int ) hb_itemGetCLen( pItem ); } if( pLevel && ( pItem = hb_hashGetCItemPtr( pParams, "zlib" ) ) != NULL &&