diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 1a5c0c46ee..f68d505eb1 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,69 @@ past entries belonging to author(s): Viktor Szakats. */ +2010-01-15 17:33 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) + * src/vm/cmdarg.c + * contrib/hbct/disk.c + % Using HB_SIZEOFARRAY() instead of repeating declaration size. + + * src/vm/maindllp.c + * src/vm/extend.c + * include/hbtypes.h + * include/hbapi.h + + 'parinfa' retval ULONG -> HB_SIZE + + * src/vm/arrayshb.c + * src/rtl/substr.c + * src/rtl/replic.c + * src/rtl/padr.c + * src/rtl/padc.c + * src/rtl/strtran.c + * src/rtl/padl.c + * src/rtl/lang.c + * src/rtl/right.c + * src/rtl/left.c + * src/rtl/space.c + * src/rtl/hbstrsh.c + * src/rtl/rat.c + * contrib/hbct/charsprd.c + * contrib/xhb/xhbarr.c + * contrib/hbpgsql/postgres.c + * contrib/hbclipsm/stack.c + * contrib/hbmisc/stringsx.c + + 'long' -> HB_ISIZ + + * src/common/hbwince.c + * include/hbwince.h + * contrib/xhb/xhbat.c + * contrib/xhb/cstructc.c + + 'unsigned long' -> HB_SIZE + + * src/rtl/fstemp.c + * src/rtl/net.c + ! L'x' -> TEXT( 'x' ). + 'L' was used also in non-UNICODE mode, which doesn't seem right. + + * src/rtl/diskspac.c + * contrib/hbct/disk.c + * contrib/hbwin/win_com.c + * contrib/hbwin/win_prn3.c + * TCHAR literals enclosed inside TEXT() macro. + + * contrib/hbwin/win_prn1.c + ! WIN_GETPRINTERFONTNAME(): Fixed buffer overrun in UNICODE + mode for font names longer than 64 bytes. + [TOMERGE 2.0] + + * ChangeLog + + Added two missed changed to this entry: + 2010-01-15 12:01 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) + * include/hbdefs.h + + Added HB_ISIZ temporary type to mark string/array/hash + index/length variable already using signed 'long' type. + This will have to converted to HB_SIZE, one HB_SIZE + gets also mapped to 'long'. + * HB_FATTR mapped to HB_U32 (was: unsigned long) + 2010-01-15 15:10 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * include/hbexprb.c ! s&r error bug in recent change. @@ -59,6 +122,13 @@ * FALSE -> HB_FALSE 2010-01-15 12:01 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) + * include/hbdefs.h + + Added HB_ISIZ temporary type to mark string/array/hash + index/length variable already using signed 'long' type. + This will have to converted to HB_SIZE, one HB_SIZE + gets also mapped to 'long'. + * HB_FATTR mapped to HB_U32 (was: unsigned long) + * src/macro/macro.yyc * src/macro/macro.y * src/macro/macrolex.c @@ -73,7 +143,6 @@ * doc/codestyl.txt * include/hbthread.h * include/hbxvm.h - * include/hbdefs.h * include/hbvm.h * include/hbcomp.h * include/hbcompdf.h diff --git a/harbour/contrib/hbclipsm/stack.c b/harbour/contrib/hbclipsm/stack.c index 861c65ff18..c5f742e0d6 100644 --- a/harbour/contrib/hbclipsm/stack.c +++ b/harbour/contrib/hbclipsm/stack.c @@ -74,7 +74,7 @@ HB_FUNC( STACKPUSH ) HB_FUNC( STACKPOP ) { PHB_ITEM pArray = hb_param( 1, HB_IT_ARRAY ); - long ulLen = hb_arrayLen( pArray ); + HB_ISIZ ulLen = hb_arrayLen( pArray ); PHB_ITEM pLast = hb_itemNew( NULL ); if( ulLen ) diff --git a/harbour/contrib/hbct/charsprd.c b/harbour/contrib/hbct/charsprd.c index 59e949a007..ff75156a3f 100644 --- a/harbour/contrib/hbct/charsprd.c +++ b/harbour/contrib/hbct/charsprd.c @@ -62,7 +62,7 @@ HB_FUNC( CHARSPREAD ) hb_retc_null(); else { - long lSize = hb_parnl( 2 ); + HB_ISIZ lSize = hb_parnl( 2 ); if( lSize < 0 || ( HB_SIZE ) lSize <= ulLen ) hb_itemReturn( hb_param( 1, HB_IT_ANY ) ); diff --git a/harbour/contrib/hbct/disk.c b/harbour/contrib/hbct/disk.c index 1e6892f2cd..e00ecb8310 100644 --- a/harbour/contrib/hbct/disk.c +++ b/harbour/contrib/hbct/disk.c @@ -272,12 +272,12 @@ HB_FUNC( GETVOLINFO ) { #if defined( HB_OS_WIN ) && ! defined( HB_OS_WIN_CE ) int iretval; - const char *sDrive = hb_parcx( 1 ); - TCHAR lpVolName[256]; + const char * sDrive = hb_parcx( 1 ); + TCHAR lpVolName[ 256 ]; LPTSTR lpDrive; - lpDrive = sDrive[0] ? HB_TCHAR_CONVTO( sDrive ) : NULL; - iretval = GetVolumeInformation( lpDrive, lpVolName, 256, NULL, NULL, NULL, NULL, 0 ); + lpDrive = sDrive[ 0 ] ? HB_TCHAR_CONVTO( sDrive ) : NULL; + iretval = GetVolumeInformation( lpDrive, lpVolName, HB_SIZEOFARRAY( lpVolName ), NULL, NULL, NULL, NULL, 0 ); if( lpDrive ) HB_TCHAR_FREE( lpDrive ); @@ -340,11 +340,11 @@ HB_FUNC( TRUENAME ) { #if defined( HB_OS_WIN ) && ! defined( HB_OS_WIN_CE ) char *szBuffRet; - TCHAR buffer[MAX_PATH + 1] = { 0 }; + TCHAR buffer[MAX_PATH + 1] = { TEXT( '\0' ) }; LPTSTR lpFile; lpFile = HB_TCHAR_CONVTO( szFile ); - GetFullPathName( lpFile, MAX_PATH, buffer, NULL ); + GetFullPathName( lpFile, HB_SIZEOFARRAY( buffer ) - 1, buffer, NULL ); HB_TCHAR_FREE( lpFile ); szBuffRet = HB_TCHAR_CONVFROM( buffer ); diff --git a/harbour/contrib/hbmisc/stringsx.c b/harbour/contrib/hbmisc/stringsx.c index 44c8c3ae81..c9d7a7330b 100644 --- a/harbour/contrib/hbmisc/stringsx.c +++ b/harbour/contrib/hbmisc/stringsx.c @@ -4,17 +4,15 @@ #include "hbapi.h" -/* TODO: search this file for TODO and find 'em! */ - static const char *hb_strtoken(const char *szText, - long lText, - long lIndex, + HB_ISIZ lText, + HB_ISIZ lIndex, char cDelimiter, - long *lLen) + HB_ISIZ *lLen) { - long wStart; - long wEnd = 0; - long wCounter = 0; + HB_ISIZ wStart; + HB_ISIZ wEnd = 0; + HB_ISIZ wCounter = 0; HB_TRACE(HB_TR_DEBUG, ("hb_strtoken(%s, %ld, %ld, %d, %p)", szText, lText, lIndex, (int) cDelimiter, lLen)); @@ -60,9 +58,9 @@ static const char *hb_strtoken(const char *szText, HB_FUNC( STRTOKEN ) { const char *szText; - long lIndex = hb_parnl(2); + HB_ISIZ lIndex = hb_parnl(2); char cDelimiter = *hb_parc(3); - long lLen; + HB_ISIZ lLen; if( !cDelimiter ) cDelimiter = ' '; @@ -77,7 +75,7 @@ HB_FUNC( STRTOKEN ) HB_FUNC( STRDUMP ) { const char *szText = hb_parc(1); - long i, lLength = hb_parclen(1); + HB_ISIZ i, lLength = hb_parclen(1); for( i = 0; i < lLength; i++ ) printf("%d ", szText[i]); printf("\n"); diff --git a/harbour/contrib/hbpgsql/postgres.c b/harbour/contrib/hbpgsql/postgres.c index 67b7a08017..8082489439 100644 --- a/harbour/contrib/hbpgsql/postgres.c +++ b/harbour/contrib/hbpgsql/postgres.c @@ -273,8 +273,8 @@ HB_FUNC( PQEXECPARAMS ) if( hb_pcount() == 3 ) { PHB_ITEM aParam = hb_param( 3, HB_IT_ARRAY ); - long n = hb_arrayLen( aParam ); - long i; + HB_ISIZ n = hb_arrayLen( aParam ); + HB_ISIZ i; const char ** paramvalues = ( const char ** ) hb_xgrab( sizeof( char * ) * n ); diff --git a/harbour/contrib/hbwin/win_com.c b/harbour/contrib/hbwin/win_com.c index f41941dd1c..8a51eff196 100644 --- a/harbour/contrib/hbwin/win_com.c +++ b/harbour/contrib/hbwin/win_com.c @@ -86,7 +86,17 @@ HB_FUNC( WIN_COMOPEN ) HANDLE hCommPort; DCB NewDCB; - TCHAR szName[ 11 ] = { '\\', '\\', '.', '\\', 'C', 'O', 'M', 0, 0, 0, 0 }; + TCHAR szName[ 11 ] = { TEXT( '\\' ), + TEXT( '\\' ), + TEXT( '.' ), + TEXT( '\\' ), + TEXT( 'C' ), + TEXT( 'O' ), + TEXT( 'M' ), + TEXT( '\0' ), + TEXT( '\0' ), + TEXT( '\0' ), + TEXT( '\0' ) }; i = iPort + 1; iPos = 6; diff --git a/harbour/contrib/hbwin/win_prn1.c b/harbour/contrib/hbwin/win_prn1.c index b61ea780e3..99d73861ab 100644 --- a/harbour/contrib/hbwin/win_prn1.c +++ b/harbour/contrib/hbwin/win_prn1.c @@ -396,7 +396,7 @@ HB_FUNC( WIN_CREATEFONT ) else iWidth = 0; /* Use the default font width */ - hFont = CreateFont( iHeight, + hFont = CreateFont( iHeight, iWidth, 0, 0, @@ -436,7 +436,7 @@ HB_FUNC( WIN_GETPRINTERFONTNAME ) { TCHAR tszFontName[ 128 ]; - GetTextFace( hDC, sizeof( tszFontName ) - 1, tszFontName ); + GetTextFace( hDC, HB_SIZEOFARRAY( tszFontName ) - 1, tszFontName ); HB_RETSTR( tszFontName ); } diff --git a/harbour/contrib/hbwin/win_prn3.c b/harbour/contrib/hbwin/win_prn3.c index a70aeb1c5b..f4320d3c57 100644 --- a/harbour/contrib/hbwin/win_prn3.c +++ b/harbour/contrib/hbwin/win_prn3.c @@ -73,7 +73,7 @@ static TCHAR * hb_tstrncat( TCHAR * pDest, const TCHAR * pSource, HB_SIZE nLen ) HB_TRACE(HB_TR_DEBUG, ("hb_tstrncat(%p, %p, %lu)", pDest, pSource, nLen)); - pDest[ nLen ] = '\0'; + pDest[ nLen ] = TEXT( '\0' ); while( nLen && *pDest ) { @@ -81,7 +81,7 @@ static TCHAR * hb_tstrncat( TCHAR * pDest, const TCHAR * pSource, HB_SIZE nLen ) nLen--; } - while( nLen && ( *pDest++ = *pSource++ ) != '\0' ) + while( nLen && ( *pDest++ = *pSource++ ) != TEXT( '\0' ) ) nLen--; return pBuf; @@ -93,7 +93,7 @@ static HB_SIZE hb_tstrlen( const TCHAR * pText ) HB_TRACE(HB_TR_DEBUG, ("hb_tstrlen(%p)", pText)); - while( pText[ nLen ] ) + while( pText[ nLen ] != TEXT( '\0' ) ) ++nLen; return nLen; @@ -237,7 +237,7 @@ static HB_BOOL hb_SetDefaultPrinter( LPCTSTR lpPrinterName ) String will be in form "printername,drivername,portname". */ pBuffer = ( LPTSTR ) hb_xgrab( ( nStrLen + 1 ) * sizeof( TCHAR ) ); - pBuffer[ 0 ] = '\0'; + pBuffer[ 0 ] = TEXT( '\0' ); /* Build string in form "printername,drivername,portname". */ hb_tstrncat( pBuffer, lpPrinterName, nStrLen ); diff --git a/harbour/contrib/xhb/cstructc.c b/harbour/contrib/xhb/cstructc.c index a288bd5036..6c5441e4b6 100644 --- a/harbour/contrib/xhb/cstructc.c +++ b/harbour/contrib/xhb/cstructc.c @@ -129,8 +129,8 @@ void hb_retclenStatic( const char * szText, HB_SIZE ulLen ) static unsigned int SizeOfCStructure( PHB_ITEM aDef, unsigned int uiAlign ) { PHB_BASEARRAY pBaseDef = aDef->item.asArray.value; - unsigned long ulLen = pBaseDef->ulLen; - unsigned long ulIndex; + HB_SIZE ulLen = pBaseDef->ulLen; + HB_SIZE ulIndex; unsigned int uiSize = 0, uiMemberSize; BYTE cShift; unsigned int uiPad; @@ -294,8 +294,8 @@ static BYTE * ArrayToStructure( PHB_ITEM aVar, PHB_ITEM aDef, unsigned int uiAli { PHB_BASEARRAY pBaseVar = aVar->item.asArray.value; PHB_BASEARRAY pBaseDef = aDef->item.asArray.value; - unsigned long ulLen = pBaseDef->ulLen; - unsigned long ulIndex; + HB_SIZE ulLen = pBaseDef->ulLen; + HB_SIZE ulIndex; BYTE *Buffer; unsigned int uiOffset = 0, uiMemberSize; BYTE cShift; @@ -1050,11 +1050,11 @@ HB_FUNC( HB_ARRAYTOSTRUCTURE ) } } -static PHB_ITEM StructureToArray( BYTE* Buffer, unsigned long ulBufferLen, PHB_ITEM aDef, unsigned int uiAlign, HB_BOOL bAdoptNested, PHB_ITEM pRet ) +static PHB_ITEM StructureToArray( BYTE* Buffer, HB_SIZE ulBufferLen, PHB_ITEM aDef, unsigned int uiAlign, HB_BOOL bAdoptNested, PHB_ITEM pRet ) { PHB_BASEARRAY pBaseDef = aDef->item.asArray.value; - unsigned long ulLen = pBaseDef->ulLen; - unsigned long ulIndex; + HB_SIZE ulLen = pBaseDef->ulLen; + HB_SIZE ulIndex; unsigned int uiOffset, uiMemberSize; BYTE cShift; /* PHB_ITEM pRet = hb_itemNew( NULL ); */ diff --git a/harbour/contrib/xhb/xhbarr.c b/harbour/contrib/xhb/xhbarr.c index 69b4860132..1ad5601bde 100644 --- a/harbour/contrib/xhb/xhbarr.c +++ b/harbour/contrib/xhb/xhbarr.c @@ -238,7 +238,7 @@ HB_FUNC( XHB_ADEL ) if( pArray ) { - long lPos = hb_parnl( 2 ); + HB_ISIZ lPos = hb_parnl( 2 ); if( lPos == 0 ) lPos = 1; @@ -261,8 +261,7 @@ HB_FUNC( XHB_AINS ) if( pArray ) { - long lPos = hb_parnl( 2 ); - + HB_ISIZ lPos = hb_parnl( 2 ); if( hb_parl( 4 ) ) { diff --git a/harbour/contrib/xhb/xhbat.c b/harbour/contrib/xhb/xhbat.c index ff2d4ec8e3..096434acbb 100644 --- a/harbour/contrib/xhb/xhbat.c +++ b/harbour/contrib/xhb/xhbat.c @@ -142,16 +142,14 @@ HB_FUNC( ATSKIPSTRINGS ) /* cFind, cWhere, nStart */ if( pFind && pWhere ) { - unsigned long ulStart = (unsigned long) hb_parnl(3); + HB_SIZE ulStart = ( HB_SIZE ) hb_parnl(3); if( ulStart > 0 ) - { ulStart--; - } if( ulStart < hb_itemGetCLen( pWhere ) ) { - unsigned long ulRet; + HB_SIZE ulRet; ulRet = hb_AtSkipStrings( hb_itemGetCPtr( pFind ), hb_itemGetCLen( pFind ), hb_itemGetCPtr( pWhere ) + ulStart, hb_itemGetCLen( pWhere ) - ulStart ); diff --git a/harbour/include/hbapi.h b/harbour/include/hbapi.h index cec8829fcb..6ff484b971 100644 --- a/harbour/include/hbapi.h +++ b/harbour/include/hbapi.h @@ -621,7 +621,7 @@ extern void hb_gcCollectAll( HB_BOOL fForce ); /* checks if all memory blo /* Extend API */ extern HB_EXPORT ULONG hb_parinfo( int iParam ); /* Determine the param count or data type */ -extern HB_EXPORT ULONG hb_parinfa( int iParamNum, HB_SIZE uiArrayIndex ); /* retrieve length or element type of an array parameter */ +extern HB_EXPORT HB_SIZE hb_parinfa( int iParamNum, HB_SIZE uiArrayIndex ); /* retrieve length or element type of an array parameter */ extern HB_EXPORT PHB_ITEM hb_param( int iParam, long lMask ); /* retrieve a generic parameter */ extern HB_EXPORT PHB_ITEM hb_paramError( int iParam ); /* Returns either the generic parameter or a NIL item if param not provided */ extern HB_EXPORT HB_BOOL hb_extIsArray( int iParam ); diff --git a/harbour/include/hbtypes.h b/harbour/include/hbtypes.h index 1f2118b7c9..4a7b5c9e81 100644 --- a/harbour/include/hbtypes.h +++ b/harbour/include/hbtypes.h @@ -87,7 +87,7 @@ typedef void ( * HB_RETNDLEN )( double dNumber, int iWidth, int iDec ); typedef void ( * HB_RETNILEN )( int iNumber, int iWidth ); typedef void ( * HB_RETNLLEN )( long lNumber, int iWidth ); typedef void ( * HB_RETA )( HB_SIZE ulLen ); -typedef ULONG ( * HB_PARINFA )( int iParamNum, HB_SIZE uiArrayIndex ); +typedef HB_SIZE ( * HB_PARINFA )( int iParamNum, HB_SIZE uiArrayIndex ); typedef ULONG ( * HB_PARINFO )( int iParam ); typedef HB_SIZE ( * HB_PARCLEN )( int iParam ); typedef HB_SIZE ( * HB_PARCSIZ )( int iParam ); diff --git a/harbour/include/hbwince.h b/harbour/include/hbwince.h index b7aa6716f4..5f6eefd182 100644 --- a/harbour/include/hbwince.h +++ b/harbour/include/hbwince.h @@ -181,11 +181,11 @@ extern char * strerror( int errnum ); extern HB_EXPORT wchar_t * hb_mbtowc( const char *srcA ); extern HB_EXPORT char * hb_wctomb( const wchar_t *srcW ); -extern HB_EXPORT wchar_t * hb_mbntowc( const char *srcA, unsigned long ulLen ); -extern HB_EXPORT char * hb_wcntomb( const wchar_t *srcW, unsigned long ulLen ); -extern HB_EXPORT void hb_mbtowccpy( wchar_t *dstW, const char *srcA, unsigned long ulLen ); -extern HB_EXPORT void hb_mbtowcset( wchar_t *dstW, const char *srcA, unsigned long ulLen ); -extern HB_EXPORT void hb_wctombget( char *dstA, const wchar_t *srcW, unsigned long ulLen ); +extern HB_EXPORT wchar_t * hb_mbntowc( const char *srcA, HB_SIZE ulLen ); +extern HB_EXPORT char * hb_wcntomb( const wchar_t *srcW, HB_SIZE ulLen ); +extern HB_EXPORT void hb_mbtowccpy( wchar_t *dstW, const char *srcA, HB_SIZE ulLen ); +extern HB_EXPORT void hb_mbtowcset( wchar_t *dstW, const char *srcA, HB_SIZE ulLen ); +extern HB_EXPORT void hb_wctombget( char *dstA, const wchar_t *srcW, HB_SIZE ulLen ); #if defined( HB_OS_WIN_CE ) #define HBTEXT( x ) TEXT( x ) diff --git a/harbour/src/common/hbwince.c b/harbour/src/common/hbwince.c index 6889e0ba90..35f4cf9470 100644 --- a/harbour/src/common/hbwince.c +++ b/harbour/src/common/hbwince.c @@ -70,7 +70,7 @@ void hb_mbtowccpy( wchar_t *dstW, const char *srcA, HB_SIZE ulLen ) MultiByteToWideChar( CP_ACP, 0, srcA, -1, dstW, ulLen / sizeof( wchar_t ) ); } -void hb_mbtowcset( wchar_t *dstW, const char *srcA, unsigned long ulLen ) +void hb_mbtowcset( wchar_t *dstW, const char *srcA, HB_SIZE ulLen ) { MultiByteToWideChar( CP_ACP, 0, srcA, ulLen, dstW, ulLen ); } @@ -99,7 +99,7 @@ char *hb_wctomb( const wchar_t *srcW ) return dstA; } -wchar_t *hb_mbntowc( const char *srcA, unsigned long ulLen ) +wchar_t *hb_mbntowc( const char *srcA, HB_SIZE ulLen ) { DWORD length; wchar_t *dstW; @@ -111,7 +111,7 @@ wchar_t *hb_mbntowc( const char *srcA, unsigned long ulLen ) return dstW; } -char *hb_wcntomb( const wchar_t *srcW, unsigned long ulLen ) +char *hb_wcntomb( const wchar_t *srcW, HB_SIZE ulLen ) { DWORD length; char *dstA; @@ -123,7 +123,7 @@ char *hb_wcntomb( const wchar_t *srcW, unsigned long ulLen ) return dstA; } -void hb_wctombget( char *dstA, const wchar_t *srcW, unsigned long ulLen ) +void hb_wctombget( char *dstA, const wchar_t *srcW, HB_SIZE ulLen ) { WideCharToMultiByte( CP_ACP, 0, srcW, ulLen, dstA, ulLen, NULL, NULL ); } diff --git a/harbour/src/rtl/diskspac.c b/harbour/src/rtl/diskspac.c index 47ab935e8f..ac27237de1 100644 --- a/harbour/src/rtl/diskspac.c +++ b/harbour/src/rtl/diskspac.c @@ -123,9 +123,9 @@ HB_FUNC( DISKSPACE ) TCHAR lpPath[ 4 ]; lpPath[ 0 ] = ( TCHAR ) ( uiDrive + 'A' - 1 ); - lpPath[ 1 ] = ':'; - lpPath[ 2 ] = '\\'; - lpPath[ 3 ] = '\0'; + lpPath[ 1 ] = TEXT( ':' ); + lpPath[ 2 ] = TEXT( '\\' ); + lpPath[ 3 ] = TEXT( '\0' ); #if defined( HB_OS_WIN_CE ) diff --git a/harbour/src/rtl/fstemp.c b/harbour/src/rtl/fstemp.c index 1fb66a7159..c07f66794a 100644 --- a/harbour/src/rtl/fstemp.c +++ b/harbour/src/rtl/fstemp.c @@ -279,7 +279,7 @@ static HB_BOOL hb_fsTempName( char * pszBuffer, const char * pszDir, const char return HB_FALSE; } } - lpTempDir[ HB_PATH_MAX - 1 ] = L'\0'; + lpTempDir[ HB_PATH_MAX - 1 ] = TEXT( '\0' ); fResult = GetTempFileName( lpTempDir, lpPrefix ? lpPrefix : TEXT( "hb" ), 0, lpBuffer ); diff --git a/harbour/src/rtl/hbstrsh.c b/harbour/src/rtl/hbstrsh.c index 96ce91765a..df59028a77 100644 --- a/harbour/src/rtl/hbstrsh.c +++ b/harbour/src/rtl/hbstrsh.c @@ -59,8 +59,8 @@ HB_FUNC( HB_STRSHRINK ) if( pText ) { - long lLen = hb_itemGetCLen( pText ); - long lShrinkBy = HB_ISNUM( 2 ) ? hb_parnl( 2 ) : 1; + HB_ISIZ lLen = hb_itemGetCLen( pText ); + HB_ISIZ lShrinkBy = HB_ISNUM( 2 ) ? hb_parnl( 2 ) : 1; if( lShrinkBy > 0 ) { diff --git a/harbour/src/rtl/lang.c b/harbour/src/rtl/lang.c index dabe5189d7..38752d7464 100644 --- a/harbour/src/rtl/lang.c +++ b/harbour/src/rtl/lang.c @@ -68,7 +68,7 @@ HB_FUNC( HB_USERLANG ) if( ietf != NULL ) { - long tmp; + HB_ISIZ tmp; for( tmp = 0; ietf[ tmp ] && ietf[ tmp ] != '.' ; tmp++ ) { diff --git a/harbour/src/rtl/left.c b/harbour/src/rtl/left.c index 76a75b2ba7..df1e2584f0 100644 --- a/harbour/src/rtl/left.c +++ b/harbour/src/rtl/left.c @@ -62,7 +62,7 @@ HB_FUNC( LEFT ) if( pText && HB_ISNUM( 2 ) ) { - long lLen = hb_parnl( 2 ); + HB_ISIZ lLen = hb_parnl( 2 ); if( lLen <= 0 ) hb_retc_null(); else diff --git a/harbour/src/rtl/net.c b/harbour/src/rtl/net.c index 97b174932a..e3b2464945 100644 --- a/harbour/src/rtl/net.c +++ b/harbour/src/rtl/net.c @@ -154,7 +154,7 @@ char * hb_netname( void ) TCHAR lpValue[ MAX_COMPUTERNAME_LENGTH + 1 ]; char * pszValue; - lpValue[ 0 ] = L'\0'; + lpValue[ 0 ] = TEXT( '\0' ); GetComputerName( lpValue, &ulLen ); #if defined( UNICODE ) @@ -191,7 +191,7 @@ char * hb_username( void ) TCHAR lpValue[ 256 ]; char * pszValue; - lpValue[ 0 ] = L'\0'; + lpValue[ 0 ] = TEXT( '\0' ); GetUserName( lpValue, &ulLen ); #if defined( UNICODE ) diff --git a/harbour/src/rtl/padc.c b/harbour/src/rtl/padc.c index c115c890f5..659ac91274 100644 --- a/harbour/src/rtl/padc.c +++ b/harbour/src/rtl/padc.c @@ -60,7 +60,7 @@ HB_FUNC( PADC ) HB_SIZE ulSize; HB_BOOL bFreeReq; char * szText; - long lLen = hb_parnl( 2 ); + HB_ISIZ lLen = hb_parnl( 2 ); if( lLen > 0 ) { @@ -79,7 +79,7 @@ HB_FUNC( PADC ) { char * szResult = ( char * ) hb_xgrab( lLen + 1 ); char cPad; - long ulPad = ( ( HB_SIZE ) lLen - ulSize ) >> 1; + HB_ISIZ ulPad = ( ( HB_SIZE ) lLen - ulSize ) >> 1; cPad = ( HB_ISCHAR( 3 ) ? *( hb_parc( 3 ) ) : ' ' ); hb_xmemset( szResult, cPad, ulPad ); diff --git a/harbour/src/rtl/padl.c b/harbour/src/rtl/padl.c index 0771d42bc2..3e6b0cc74f 100644 --- a/harbour/src/rtl/padl.c +++ b/harbour/src/rtl/padl.c @@ -60,7 +60,7 @@ HB_FUNC( PADL ) HB_SIZE ulSize; HB_BOOL bFreeReq; char * szText; - long lLen = hb_parnl( 2 ); + HB_ISIZ lLen = hb_parnl( 2 ); if( lLen > 0 ) { diff --git a/harbour/src/rtl/padr.c b/harbour/src/rtl/padr.c index ba64fe33d4..6000d87a73 100644 --- a/harbour/src/rtl/padr.c +++ b/harbour/src/rtl/padr.c @@ -60,7 +60,7 @@ HB_FUNC( PADR ) HB_SIZE ulSize; HB_BOOL bFreeReq; char * szText; - long lLen = hb_parnl( 2 ); + HB_ISIZ lLen = hb_parnl( 2 ); if( lLen > 0 ) { diff --git a/harbour/src/rtl/rat.c b/harbour/src/rtl/rat.c index a814b345f4..a04461812f 100644 --- a/harbour/src/rtl/rat.c +++ b/harbour/src/rtl/rat.c @@ -58,7 +58,7 @@ HB_FUNC( RAT ) if( ulSubLen ) { - long lPos = hb_parclen( 2 ) - ulSubLen; + HB_ISIZ lPos = hb_parclen( 2 ) - ulSubLen; if( lPos >= 0 ) { @@ -89,14 +89,14 @@ HB_FUNC( HB_RAT ) if( ulSubLen ) { - long lPos = hb_parclen( 2 ) - ulSubLen; + HB_ISIZ lPos = hb_parclen( 2 ) - ulSubLen; if( lPos >= 0 ) { const char * pszSub = hb_parc( 1 ); const char * pszText = hb_parc( 2 ); HB_BOOL bFound = HB_FALSE; - long lStart; + HB_ISIZ lStart; if( HB_ISNUM( 3 ) ) { @@ -111,7 +111,7 @@ HB_FUNC( HB_RAT ) if( HB_ISNUM( 4 ) ) { - long lEnd = hb_parnl( 4 ) - 1; + HB_ISIZ lEnd = hb_parnl( 4 ) - 1; if( lEnd < lPos ) lPos = lEnd; diff --git a/harbour/src/rtl/replic.c b/harbour/src/rtl/replic.c index 9852d41b33..1846de486d 100644 --- a/harbour/src/rtl/replic.c +++ b/harbour/src/rtl/replic.c @@ -60,7 +60,7 @@ HB_FUNC( REPLICATE ) { if( HB_ISCHAR( 1 ) && HB_ISNUM( 2 ) ) { - long lTimes = hb_parnl( 2 ); + HB_ISIZ lTimes = hb_parnl( 2 ); if( lTimes > 0 ) { @@ -71,7 +71,7 @@ HB_FUNC( REPLICATE ) const char * szText = hb_parc( 1 ); char * szResult = ( char * ) hb_xgrab( ( ulLen * lTimes ) + 1 ); char * szPtr = szResult; - long i; + HB_ISIZ i; for( i = 0; i < lTimes; i++ ) { diff --git a/harbour/src/rtl/right.c b/harbour/src/rtl/right.c index 749c628542..c1a934e2bc 100644 --- a/harbour/src/rtl/right.c +++ b/harbour/src/rtl/right.c @@ -62,7 +62,7 @@ HB_FUNC( RIGHT ) if( pText && HB_ISNUM( 2 ) ) { - long lLen = hb_parnl( 2 ); + HB_ISIZ lLen = hb_parnl( 2 ); if( lLen <= 0 ) hb_retc_null(); else diff --git a/harbour/src/rtl/space.c b/harbour/src/rtl/space.c index 76e264f8fd..7ee11db11f 100644 --- a/harbour/src/rtl/space.c +++ b/harbour/src/rtl/space.c @@ -62,7 +62,7 @@ HB_FUNC( SPACE ) if( pItem ) { - long lLen = hb_itemGetNL( pItem ); + HB_ISIZ lLen = hb_itemGetNL( pItem ); if( lLen > 0 ) { diff --git a/harbour/src/rtl/strtran.c b/harbour/src/rtl/strtran.c index bd0815e9f6..0c185e7364 100644 --- a/harbour/src/rtl/strtran.c +++ b/harbour/src/rtl/strtran.c @@ -116,14 +116,14 @@ HB_FUNC( STRTRAN ) if( bAll || ulCount > 0 ) { HB_SIZE ulFound = 0; - long lReplaced = 0; + HB_ISIZ lReplaced = 0; HB_SIZE i = 0; HB_SIZE ulLength = ulText; HB_SIZE ulStop = ulText - ulSeek + 1; while( i < ulStop ) { - if( ( bAll || lReplaced < ( long ) ulCount ) && + if( ( bAll || lReplaced < ( HB_ISIZ ) ulCount ) && ! memcmp( szText + i, szSeek, ulSeek ) ) { ulFound++; diff --git a/harbour/src/rtl/substr.c b/harbour/src/rtl/substr.c index c77e7a3b7c..b4f4a126ec 100644 --- a/harbour/src/rtl/substr.c +++ b/harbour/src/rtl/substr.c @@ -62,8 +62,8 @@ HB_FUNC( SUBSTR ) if( pText && HB_ISNUM( 2 ) ) { - long lPos = hb_parnl( 2 ); - long lSize = ( long ) hb_itemGetCLen( pText ); + HB_ISIZ lPos = hb_parnl( 2 ); + HB_ISIZ lSize = ( HB_ISIZ ) hb_itemGetCLen( pText ); if( lPos < 0 ) { @@ -78,7 +78,7 @@ HB_FUNC( SUBSTR ) if( lPos < lSize ) { - long lLen; + HB_ISIZ lLen; if( hb_pcount() >= 3 ) { diff --git a/harbour/src/vm/arrayshb.c b/harbour/src/vm/arrayshb.c index 86125a04ef..d21b66ed8d 100644 --- a/harbour/src/vm/arrayshb.c +++ b/harbour/src/vm/arrayshb.c @@ -139,7 +139,7 @@ HB_FUNC( ASIZE ) if( pArray && HB_ISNUM( 2 ) ) { - long lSize = hb_parnl( 2 ); + HB_ISIZ lSize = hb_parnl( 2 ); hb_arraySize( pArray, HB_MAX( lSize, 0 ) ); @@ -169,7 +169,7 @@ HB_FUNC( AINS ) if( pArray ) { - long lPos = hb_parnl( 2 ); + HB_ISIZ lPos = hb_parnl( 2 ); if( lPos == 0 ) lPos = 1; @@ -186,7 +186,7 @@ HB_FUNC( ADEL ) if( pArray ) { - long lPos = hb_parnl( 2 ); + HB_ISIZ lPos = hb_parnl( 2 ); if( lPos == 0 ) lPos = 1; @@ -210,7 +210,7 @@ HB_FUNC( AFILL ) if( pValue ) { HB_SIZE ulStart, ulCount; - LONG lStart = hb_parnl( 3 ), lCount = hb_parnl( 4 ); + HB_ISIZ lStart = hb_parnl( 3 ), lCount = hb_parnl( 4 ); /* Explicy lCount of 0 - Nothing to do! */ if( HB_ISNUM( 4 ) && lCount == 0 ) @@ -313,7 +313,7 @@ HB_FUNC( HB_AINS ) if( pArray ) { - long lPos = hb_parnl( 2 ); + HB_ISIZ lPos = hb_parnl( 2 ); if( lPos == 0 ) lPos = 1; @@ -341,7 +341,7 @@ HB_FUNC( HB_ADEL ) if( pArray ) { - long lPos = hb_parnl( 2 ); + HB_ISIZ lPos = hb_parnl( 2 ); if( lPos == 0 ) lPos = 1; diff --git a/harbour/src/vm/cmdarg.c b/harbour/src/vm/cmdarg.c index 6ca7f827fc..af28f50cff 100644 --- a/harbour/src/vm/cmdarg.c +++ b/harbour/src/vm/cmdarg.c @@ -140,9 +140,9 @@ void hb_cmdargUpdate( void ) because in console apps the name may be truncated in some cases, and in GUI apps it's not filled at all. [vszakats] */ - if( GetModuleFileName( NULL, s_lpAppName, MAX_PATH ) != 0 ) + if( GetModuleFileName( NULL, s_lpAppName, HB_SIZEOFARRAY( s_lpAppName ) ) != 0 ) { - HB_TCHAR_GETFROM( s_szAppName, s_lpAppName, MAX_PATH ); + HB_TCHAR_GETFROM( s_szAppName, s_lpAppName, HB_SIZEOFARRAY( s_lpAppName ) ); s_argv[ 0 ] = s_szAppName; } #else diff --git a/harbour/src/vm/extend.c b/harbour/src/vm/extend.c index 914f8a5ab5..1d55ca058b 100644 --- a/harbour/src/vm/extend.c +++ b/harbour/src/vm/extend.c @@ -145,7 +145,7 @@ ULONG hb_parinfo( int iParam ) } } -ULONG hb_parinfa( int iParamNum, HB_SIZE uiArrayIndex ) +HB_SIZE hb_parinfa( int iParamNum, HB_SIZE uiArrayIndex ) { PHB_ITEM pArray; @@ -158,7 +158,7 @@ ULONG hb_parinfa( int iParamNum, HB_SIZE uiArrayIndex ) if( uiArrayIndex == 0 ) return hb_arrayLen( pArray ); else - return ( long ) hb_arrayGetType( pArray, uiArrayIndex ); + return ( HB_ISIZ ) hb_arrayGetType( pArray, uiArrayIndex ); } else return 0; diff --git a/harbour/src/vm/maindllp.c b/harbour/src/vm/maindllp.c index 3097d43bef..fe98878921 100644 --- a/harbour/src/vm/maindllp.c +++ b/harbour/src/vm/maindllp.c @@ -334,7 +334,7 @@ void hb_reta( HB_SIZE ulLen ) /* returns an array with a specific length */ ( ( HB_RETA ) pRet )( ulLen ); } -ULONG hb_parinfa( int iParamNum, HB_SIZE uiArrayIndex ) /* retrieve length or element type of an array parameter */ +HB_SIZE hb_parinfa( int iParamNum, HB_SIZE uiArrayIndex ) /* retrieve length or element type of an array parameter */ { FARPROC pParinfa = hb_getProcAddress( HBTEXT( "_hb_parinfa" ) ); return pParinfa ? ( ( HB_PARINFA ) pParinfa )( iParamNum, uiArrayIndex ) : 0;