diff --git a/harbour/ChangeLog b/harbour/ChangeLog index e2284cd066..f1f0df242a 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,44 @@ The license applies to all entries newer than 2009-04-28. */ +2010-06-20 17:41 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * src/pp/hbpp.c + * src/vm/cmdarg.c + * src/rtl/defpath.c + * src/rtl/hbstrfmt.c + * src/rtl/dates.c + * src/rtl/hbinet.c + * src/rtl/gtpca/gtpca.c + * src/rtl/file.c + * src/compiler/ppcomp.c + + Added strlen() casts to pacify warnings + + * src/vm/hashfunc.c + + Using hb_vmPushSize() to add HB_SIZE support for Win64 + + * src/vm/debug.c + ! HB_SIZE -> HB_LONG. Signaled by warning + + * include/hbvm.h + * src/vm/hvm.c + + Added hb_vmPushSize() + Please review, I copied hb_vmPushHBLong() + + * src/common/hbfopen.c + + Suppressed MS warning about "unsafe" fopen() + Also readded fopen_s() code, which is made inactive permanently + + * include/hbexprop.h + + Added argument names to function declarations + + * contrib/hbct/ctwin.c + + HB_SIZE -> HB_UINT, plus added necessary casts. Signaled by warning + + * contrib/xhb/xhbarr.c + + HB_SIZE -> int, plus added necessary casts. Signaled by warning + + * contrib/hbsqlit3/hbsqlit3.c + * Suppressed MS warning about "unsafe" fopen() 2010-06-20 12:34 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * contrib/hbct/tab.c diff --git a/harbour/contrib/hbct/ctwin.c b/harbour/contrib/hbct/ctwin.c index df4ce77be4..e5bc5090fa 100644 --- a/harbour/contrib/hbct/ctwin.c +++ b/harbour/contrib/hbct/ctwin.c @@ -1919,11 +1919,11 @@ static int hb_ctw_gt_Alert( PHB_GT pGT, PHB_ITEM pMessage, PHB_ITEM pOptions, if( fScreen ) { PHB_GTCTW pCTW = HB_GTCTW_GET( pGT ); - HB_SIZE ulWidth = 0, ulCurrWidth = 0, ul = 0, ul2, ulMaxWidth, ulLast; + HB_UINT ulWidth = 0, ulCurrWidth = 0, ul = 0, ul2, ulMaxWidth, ulLast; int iKey, iDspCount, iLines = 0, iTop, iLeft, iBottom, iRight, iMnuCol, iPos, iClr, iWnd, iPrevWnd, i; const char * szMessage = hb_itemGetCPtr( pMessage ); - HB_SIZE ulLen = hb_itemGetCLen( pMessage ); + HB_UINT ulLen = ( HB_UINT ) hb_itemGetCLen( pMessage ); ulMaxWidth = iCols - 4; while( ul < ulLen ) @@ -1946,7 +1946,7 @@ static int hb_ctw_gt_Alert( PHB_GT pGT, PHB_ITEM pMessage, PHB_ITEM pOptions, ulCurrWidth = 0; for( i = 1; i <= iOptions; ++i ) { - ulCurrWidth += hb_arrayGetCLen( pOptions, i ) + ( i > 1 ? 3 : 0 ); + ulCurrWidth += ( HB_UINT ) hb_arrayGetCLen( pOptions, i ) + ( i > 1 ? 3 : 0 ); } if( ulCurrWidth > ulWidth ) ulWidth = ulCurrWidth; @@ -2007,7 +2007,7 @@ static int hb_ctw_gt_Alert( PHB_GT pGT, PHB_ITEM pMessage, PHB_ITEM pOptions, for( i = 1; i <= iOptions; ++i ) { iClr = i == iPos ? iClrHigh : iClrNorm; - ulLen = hb_arrayGetCLen( pOptions, i ); + ulLen = ( HB_UINT ) hb_arrayGetCLen( pOptions, i ); HB_GTSELF_PUTTEXT( pGT, iLines + 1, iMnuCol, iClr, hb_arrayGetCPtr( pOptions, i ), ulLen ); iMnuCol += ulLen + 3; @@ -2047,7 +2047,7 @@ static int hb_ctw_gt_Alert( PHB_GT pGT, PHB_ITEM pMessage, PHB_ITEM pOptions, iMnuCol = ( ( ulWidth - ulCurrWidth ) >> 1 ) + 1; for( i = 1; i <= iOptions; ++i ) { - ulLen = hb_arrayGetCLen( pOptions, i ); + ulLen = ( HB_UINT ) hb_arrayGetCLen( pOptions, i ); if( iMCol >= iMnuCol && iMCol < iMnuCol + ( int ) ulLen ) { iRet = i; diff --git a/harbour/contrib/hbsqlit3/hbsqlit3.c b/harbour/contrib/hbsqlit3/hbsqlit3.c index 72b157786d..98f6131057 100644 --- a/harbour/contrib/hbsqlit3/hbsqlit3.c +++ b/harbour/contrib/hbsqlit3/hbsqlit3.c @@ -51,6 +51,12 @@ * */ +/* NOTE: To avoid warnings with MSVC. For our purpose fopen_s() is not a good + alternative because it only opens files in non-shared mode. [vszakats] */ +#ifndef _CRT_SECURE_NO_WARNINGS +#define _CRT_SECURE_NO_WARNINGS +#endif + #include "sqlite3.h" #include "hbvm.h" diff --git a/harbour/contrib/xhb/xhbarr.c b/harbour/contrib/xhb/xhbarr.c index dd675c24d3..3ba8720340 100644 --- a/harbour/contrib/xhb/xhbarr.c +++ b/harbour/contrib/xhb/xhbarr.c @@ -63,7 +63,7 @@ HB_FUNC( ASPLICE ) if( pArray ) { - HB_SIZE ulStart, ulRemove, ulIndex, ulAdd; + HB_SIZE ulStart, ulRemove, ulIndex; HB_SIZE ulLen = hb_arrayLen( pArray ); PHB_ITEM pReturn = hb_stackReturnItem(); @@ -106,13 +106,13 @@ HB_FUNC( ASPLICE ) if( hb_pcount() > 3 ) { - HB_SIZE ulNew = 0; - ulAdd = hb_pcount() - 3; + int ulNew = 0; + int ulAdd = hb_pcount() - 3; - if( ulAdd > ulRemove ) + if( ( HB_SIZE ) ulAdd > ulRemove ) { HB_SIZE ulMore = ulAdd - ulRemove; - HB_SIZE ulShift = ulLen - (ulStart + ulRemove); + HB_SIZE ulShift = ulLen - ( ulStart + ulRemove ); hb_arraySize( pArray, ulLen + ulMore ); @@ -132,7 +132,7 @@ HB_FUNC( ASPLICE ) for( ulIndex = ulStart; ++ulNew <= ulAdd; ulIndex++ ) hb_itemMove( hb_arrayGetItemPtr( pArray, ulIndex + 1 ), hb_param( 3 + ulNew, HB_IT_ANY ) ); - if( ulRemove > ulAdd ) + if( ulRemove > ( HB_SIZE ) ulAdd ) { ulRemove -= ulAdd; diff --git a/harbour/include/hbexprop.h b/harbour/include/hbexprop.h index c3e7b22b2b..75084d3fc4 100644 --- a/harbour/include/hbexprop.h +++ b/harbour/include/hbexprop.h @@ -79,20 +79,20 @@ extern const HB_EXPR_FUNC_PTR hb_comp_ExprTable[ HB_EXPR_COUNT ]; extern HB_EXPR_PTR hb_compExprNewEmpty( HB_COMP_DECL ); extern HB_EXPR_PTR hb_compExprNewNil( HB_COMP_DECL ); extern HB_EXPR_PTR hb_compExprNewDouble( double, HB_BYTE, HB_BYTE, HB_COMP_DECL ); -extern HB_EXPR_PTR hb_compExprNewLong( HB_MAXINT, HB_COMP_DECL ); -extern HB_EXPR_PTR hb_compExprNewDate( long, HB_COMP_DECL ); -extern HB_EXPR_PTR hb_compExprNewTimeStamp( long, long, HB_COMP_DECL ); -extern HB_EXPR_PTR hb_compExprNewString( const char *, HB_ULONG, HB_BOOL, HB_COMP_DECL ); -extern HB_EXPR_PTR hb_compExprNewLogical( int, HB_COMP_DECL ); +extern HB_EXPR_PTR hb_compExprNewLong( HB_MAXINT lValue, HB_COMP_DECL ); +extern HB_EXPR_PTR hb_compExprNewDate( long lDate, HB_COMP_DECL ); +extern HB_EXPR_PTR hb_compExprNewTimeStamp( long lDate, long lTime, HB_COMP_DECL ); +extern HB_EXPR_PTR hb_compExprNewString( const char * szValue, HB_ULONG ulLen, HB_BOOL fDealloc, HB_COMP_DECL ); +extern HB_EXPR_PTR hb_compExprNewLogical( int iValue, HB_COMP_DECL ); extern HB_EXPR_PTR hb_compExprNewSelf( HB_COMP_DECL ); -extern HB_EXPR_PTR hb_compExprNewCodeBlock( char *, HB_ULONG, int, HB_COMP_DECL ); -extern HB_EXPR_PTR hb_compExprNewVar( const char *, HB_COMP_DECL ); +extern HB_EXPR_PTR hb_compExprNewCodeBlock( char * string, HB_ULONG ulLen, int iFlags, HB_COMP_DECL ); +extern HB_EXPR_PTR hb_compExprNewVar( const char * szName, HB_COMP_DECL ); extern HB_EXPR_PTR hb_compExprNewAliasVar( HB_EXPR_PTR, HB_EXPR_PTR, HB_COMP_DECL ); extern HB_EXPR_PTR hb_compExprNewAliasExpr( HB_EXPR_PTR, HB_EXPR_PTR, HB_COMP_DECL ); -extern HB_EXPR_PTR hb_compExprNewMacro( HB_EXPR_PTR, unsigned char, const char *, HB_COMP_DECL ); -extern HB_EXPR_PTR hb_compExprNewFunName( const char *, HB_COMP_DECL ); -extern HB_EXPR_PTR hb_compExprNewRTVar( const char *, HB_EXPR_PTR, HB_COMP_DECL ); -extern HB_EXPR_PTR hb_compExprNewAlias( const char *, HB_COMP_DECL ); +extern HB_EXPR_PTR hb_compExprNewMacro( HB_EXPR_PTR, unsigned char cMacroOp, const char * szName, HB_COMP_DECL ); +extern HB_EXPR_PTR hb_compExprNewFunName( const char * szName, HB_COMP_DECL ); +extern HB_EXPR_PTR hb_compExprNewRTVar( const char * szName, HB_EXPR_PTR, HB_COMP_DECL ); +extern HB_EXPR_PTR hb_compExprNewAlias( const char * szName, HB_COMP_DECL ); extern HB_EXPR_PTR hb_compExprNewEQ( HB_EXPR_PTR, HB_COMP_DECL ); extern HB_EXPR_PTR hb_compExprNewNE( HB_EXPR_PTR, HB_COMP_DECL ); extern HB_EXPR_PTR hb_compExprNewLT( HB_EXPR_PTR, HB_COMP_DECL ); @@ -122,8 +122,8 @@ extern HB_EXPR_PTR hb_compExprNewAnd( HB_EXPR_PTR, HB_COMP_DECL ); extern HB_EXPR_PTR hb_compExprNewOr( HB_EXPR_PTR, HB_COMP_DECL ); extern HB_EXPR_PTR hb_compExprNewNot( HB_EXPR_PTR, HB_COMP_DECL ); extern HB_EXPR_PTR hb_compExprNewNegate( HB_EXPR_PTR, HB_COMP_DECL ); -extern HB_EXPR_PTR hb_compExprNewVarRef( const char *, HB_COMP_DECL ); -extern HB_EXPR_PTR hb_compExprNewFunRef( const char *, HB_COMP_DECL ); +extern HB_EXPR_PTR hb_compExprNewVarRef( const char * szVarName, HB_COMP_DECL ); +extern HB_EXPR_PTR hb_compExprNewFunRef( const char * szFunName, HB_COMP_DECL ); extern HB_EXPR_PTR hb_compExprNewFunCall( HB_EXPR_PTR, HB_EXPR_PTR, HB_COMP_DECL ); extern HB_EXPR_PTR hb_compExprNewRef( HB_EXPR_PTR, HB_COMP_DECL ); extern HB_EXPR_PTR hb_compExprNewCodeblockExpr( HB_EXPR_PTR, HB_EXPR_PTR ); @@ -138,7 +138,7 @@ extern HB_EXPR_PTR hb_compExprNewArray( HB_EXPR_PTR, HB_COMP_DECL ); extern HB_EXPR_PTR hb_compExprNewHash( HB_EXPR_PTR, HB_COMP_DECL ); extern HB_EXPR_PTR hb_compExprNewArrayAt( HB_EXPR_PTR, HB_EXPR_PTR, HB_COMP_DECL ); extern HB_EXPR_PTR hb_compExprAddListExpr( HB_EXPR_PTR, HB_EXPR_PTR ); -extern HB_EXPR_PTR hb_compExprCBVarAdd( HB_EXPR_PTR, const char *, HB_BYTE, HB_COMP_DECL ); +extern HB_EXPR_PTR hb_compExprCBVarAdd( HB_EXPR_PTR, const char * szVarName, HB_BYTE bType, HB_COMP_DECL ); extern void hb_compExprCBVarDel( HB_CBVAR_PTR ); extern HB_EXPR_PTR hb_compExprAddCodeblockExpr( HB_EXPR_PTR, HB_EXPR_PTR ); extern HB_EXPR_PTR hb_compExprSetCodeblockBody( HB_EXPR_PTR pExpr, HB_BYTE * pCode, HB_ULONG ulLen ); @@ -166,7 +166,6 @@ extern const char * hb_compExprAsString( HB_EXPR_PTR ); extern const char * hb_compExprAsSymbol( HB_EXPR_PTR ); extern HB_EXPR_PTR hb_compExprListStrip( HB_EXPR_PTR, HB_COMP_DECL ); -extern HB_BOOL hb_compExprIsValidMacro( const char *, HB_ULONG, HB_BOOL *, HB_COMP_DECL ); extern HB_EXPR_PTR hb_compExprSetOperand( HB_EXPR_PTR, HB_EXPR_PTR, HB_COMP_DECL ); extern HB_EXPR_PTR hb_compExprSetGetBlock( HB_EXPR_PTR pExpr, HB_COMP_DECL ); @@ -204,7 +203,7 @@ extern HB_BOOL hb_compExprReduceCTOD( HB_EXPR_PTR, HB_COMP_DECL ); extern HB_BOOL hb_compExprReduceUPPER( HB_EXPR_PTR, HB_COMP_DECL ); extern HB_BOOL hb_compExprReduceMIN( HB_EXPR_PTR, HB_COMP_DECL ); extern HB_BOOL hb_compExprReduceMAX( HB_EXPR_PTR, HB_COMP_DECL ); -extern HB_BOOL hb_compExprReduceBitFunc( HB_EXPR_PTR, HB_MAXINT, HB_BOOL, HB_COMP_DECL ); +extern HB_BOOL hb_compExprReduceBitFunc( HB_EXPR_PTR, HB_MAXINT lResult, HB_BOOL fBool, HB_COMP_DECL ); HB_EXTERN_END diff --git a/harbour/include/hbvm.h b/harbour/include/hbvm.h index c868f45297..d57570bf59 100644 --- a/harbour/include/hbvm.h +++ b/harbour/include/hbvm.h @@ -156,6 +156,7 @@ extern HB_EXPORT void hb_vmPushNumber( double dNumber, int iDec ); /* pushes extern HB_EXPORT void hb_vmPushInteger( int iNumber ); /* pushes a integer number onto the stack */ extern HB_EXPORT void hb_vmPushLong( long lNumber ); /* pushes a long number onto the stack */ extern HB_EXPORT void hb_vmPushDouble( double lNumber, int iDec ); /* pushes a double number onto the stack */ +extern HB_EXPORT void hb_vmPushSize( HB_ISIZ nNumber ); /* pushes a HB_SIZE number onto the stack */ extern HB_EXPORT void hb_vmPushNumInt( HB_MAXINT lNumber ); /* pushes a number on to the stack and decides if it is integer or HB_MAXINT */ extern HB_EXPORT void hb_vmPushLogical( HB_BOOL bValue ); /* pushes a logical value onto the stack */ extern HB_EXPORT void hb_vmPushString( const char * szText, HB_SIZE length ); /* pushes a string on to the stack */ diff --git a/harbour/src/common/hbfopen.c b/harbour/src/common/hbfopen.c index 226dfac82c..d60c6060a4 100644 --- a/harbour/src/common/hbfopen.c +++ b/harbour/src/common/hbfopen.c @@ -50,15 +50,25 @@ * */ +/* NOTE: To avoid warnings with MSVC. For our purpose fopen_s() is not a good + alternative because it only opens files in non-shared mode. [vszakats] */ +#ifndef _CRT_SECURE_NO_WARNINGS +#define _CRT_SECURE_NO_WARNINGS +#endif + #include "hbapifs.h" -FILE * hb_fopen( const char *path, const char *mode ) +FILE * hb_fopen( const char * path, const char * mode ) { char * pszFree = NULL; FILE * file; path = hb_fsNameConv( path, &pszFree ); +#if defined( _MSC_VER ) && _MSC_VER >= 1400 && ! defined( _CRT_SECURE_NO_WARNINGS ) + fopen_s( &file, path, mode ); +#else file = fopen( path, mode ); +#endif if( pszFree ) hb_xfree( pszFree ); diff --git a/harbour/src/compiler/ppcomp.c b/harbour/src/compiler/ppcomp.c index 86a3cba976..99efd79156 100644 --- a/harbour/src/compiler/ppcomp.c +++ b/harbour/src/compiler/ppcomp.c @@ -124,7 +124,7 @@ static HB_BOOL hb_pp_CompilerSwitch( void * cargo, const char * szSwitch, iValue = *piValue; - i = strlen( szSwitch ); + i = ( int ) strlen( szSwitch ); if( i > 1 && ( ( int ) ( szSwitch[ i - 1 ] - '0' ) ) == iValue ) --i; diff --git a/harbour/src/pp/hbpp.c b/harbour/src/pp/hbpp.c index 2fe4157cf4..4aaac78a10 100644 --- a/harbour/src/pp/hbpp.c +++ b/harbour/src/pp/hbpp.c @@ -79,7 +79,7 @@ static void hb_pp_writeToken( FILE * fout, PHB_PP_TOKEN pToken, { int iOptional = hb_pp_writeTokenCount( pToken->pMTokens ), i; - i = strlen( szName ); + i = ( int ) strlen( szName ); if( pToken->pNext ) fprintf( fout, " { %s +%2d", szName, iToken + iOptional + 1 ); else @@ -89,7 +89,7 @@ static void hb_pp_writeToken( FILE * fout, PHB_PP_TOKEN pToken, else fprintf( fout, ", NULL%*s", i, "" ); - i = 16 - strlen( pToken->value ); + i = 16 - ( int ) strlen( pToken->value ); fprintf( fout, ", \"%s\", %*s %2d,%2d, 0x%04x, %d }%s\n", pToken->value, i < 0 ? 0 : i, "", @@ -561,7 +561,7 @@ static int hb_pp_parseChangelog( PHB_PP_STATE pState, const char * pszFileName, szLine[ 10 ] == ' ' && szLine[ 13 ] == ':' ) { hb_strncpy( szLog, szLine, sizeof( szLog ) - 1 ); - iLen = strlen( szLog ); + iLen = ( int ) strlen( szLog ); while( iLen-- && HB_ISSPACE( szLog[ iLen ] ) ) szLog[ iLen ] = '\0'; } @@ -581,14 +581,14 @@ static int hb_pp_parseChangelog( PHB_PP_STATE pState, const char * pszFileName, { *szLine = '"'; hb_strncpy( szLine + 1, szLog, sizeof( szLine ) - 3 ); - iLen = strlen( szLine ); + iLen = ( int ) strlen( szLine ); szLine[ iLen ] = '"'; szLine[ ++iLen ] = '\0'; hb_pp_addDefine( pState, "HB_VER_LENTRY", szLine ); *pszLastEntry = hb_strdup( szLog ); hb_strncpy( szLine + 1, szId, sizeof( szLine ) - 3 ); - iLen = strlen( szLine ); + iLen = ( int ) strlen( szLine ); szLine[ iLen ] = '"'; szLine[ ++iLen ] = '\0'; hb_pp_addDefine( pState, "HB_VER_CHLID", szLine ); diff --git a/harbour/src/rtl/dates.c b/harbour/src/rtl/dates.c index 221078cd5d..0e9beaea5d 100644 --- a/harbour/src/rtl/dates.c +++ b/harbour/src/rtl/dates.c @@ -80,7 +80,7 @@ char * hb_dateFormat( const char * szDate, char * szFormattedDate, const char * /* * Determine the maximum size of the formatted date string */ - size = strlen( szDateFormat ); + size = ( int ) strlen( szDateFormat ); if( size > 10 ) size = 10; @@ -259,7 +259,7 @@ int hb_dateUnformatRaw( const char * szDate, const char * szDateFormat, long * p if( ! szDateFormat ) szDateFormat = hb_setGetDateFormat(); - size = strlen( szDateFormat ); + size = ( int ) strlen( szDateFormat ); for( count = used = 0; count < size && used < 3; count++ ) { @@ -309,7 +309,7 @@ int hb_dateUnformatRaw( const char * szDate, const char * szDateFormat, long * p /* If there are non-digits at the start of the date field, they are not to be treated as date field separators */ non_digit = 1; - size = strlen( szDate ); + size = ( int ) strlen( szDate ); for( count = used = 0; count < size; count++ ) { digit = szDate[ count ]; @@ -394,7 +394,7 @@ char * hb_timeFormat( char * szBuffer, const char * szTimeFormat, long lMilliSec hb_timeDecode( lMilliSec, &iHour, &iMinutes, &iSeconds, &iMSec ); szTimeBuffer = szBuffer; - size = hb_strnlen( szTimeFormat, 16 ); + size = ( int ) hb_strnlen( szTimeFormat, 16 ); iPM = i12 = 0; for( i = 0; i < size; ++i ) { @@ -538,7 +538,7 @@ long hb_timeUnformat( const char * szTime, const char * szTimeFormat ) if( ! szTimeFormat ) szTimeFormat = hb_setGetTimeFormat(); - size = hb_strnlen( szTime, hb_strnlen( szTimeFormat, 16 ) ); + size = ( int ) hb_strnlen( szTime, hb_strnlen( szTimeFormat, 16 ) ); iHour = iMinutes = iSeconds = iMSec = iPM = -1; prec = 0; for( i = count = 0; i < size && szTime[ count ]; ++i ) diff --git a/harbour/src/rtl/defpath.c b/harbour/src/rtl/defpath.c index 766802921e..3438ac2bb1 100644 --- a/harbour/src/rtl/defpath.c +++ b/harbour/src/rtl/defpath.c @@ -64,10 +64,10 @@ HB_FUNC( __DEFPATH ) { /* Leave enough space to append a path delimiter */ hb_strncpy( buffer, szDefault, sizeof( buffer ) - 1 ); - size = strlen( buffer ); + size = ( int ) strlen( buffer ); } - HB_TRACE(HB_TR_INFO, ("HB_DEFPATH: buffer is |%s|, size is %d, last char is |%c|", buffer, size, buffer[ size - 1])); + HB_TRACE(HB_TR_INFO, ("HB_DEFPATH: buffer is |%s|, size is %d, last char is |%c|", buffer, size, buffer[ size - 1 ])); HB_TRACE(HB_TR_INFO, ("HB_DEFPATH: HB_OS_PATH_DELIM_CHR is |%c| and HB_OS_PATH_LIST_SEP_CHR is |%c|", HB_OS_PATH_DELIM_CHR, HB_OS_PATH_LIST_SEP_CHR)); /* If the path is not empty and it doesn't end with a drive or path diff --git a/harbour/src/rtl/file.c b/harbour/src/rtl/file.c index a736f2a4dd..3d4242e9c2 100644 --- a/harbour/src/rtl/file.c +++ b/harbour/src/rtl/file.c @@ -87,7 +87,7 @@ HB_BOOL hb_fsIsDirectory( const char * pszFilename ) pszFilename = hb_fsNameConv( pszFilename, &pszFree ); - iLen = strlen( pszFilename ); + iLen = ( int ) strlen( pszFilename ); while( iLen && strchr( HB_OS_PATH_DELIM_CHR_LIST, pszFilename[ iLen - 1 ] ) ) --iLen; diff --git a/harbour/src/rtl/gtpca/gtpca.c b/harbour/src/rtl/gtpca/gtpca.c index 3e3f8ed295..099b9b5f8c 100644 --- a/harbour/src/rtl/gtpca/gtpca.c +++ b/harbour/src/rtl/gtpca/gtpca.c @@ -330,7 +330,7 @@ static void hb_gt_pca_AnsiSetCursorPos( int iRow, int iCol ) { char buff[ 16 ]; hb_snprintf( buff, sizeof( buff ), "\x1B[%d;%dH", iRow + 1, iCol + 1 ); - hb_gt_pca_termOut( buff, strlen( buff ) ); + hb_gt_pca_termOut( buff, ( int ) strlen( buff ) ); s_iRow = iRow; s_iCol = iCol; } diff --git a/harbour/src/rtl/hbinet.c b/harbour/src/rtl/hbinet.c index b54e1bbf58..07f843d511 100644 --- a/harbour/src/rtl/hbinet.c +++ b/harbour/src/rtl/hbinet.c @@ -917,7 +917,7 @@ HB_FUNC( HB_INETRECVENDBLOCK ) else { patterns[ 0 ] = s_inetCRLF; - patternsizes[ 0 ] = strlen( s_inetCRLF ); + patternsizes[ 0 ] = ( int ) strlen( s_inetCRLF ); } iPatternsCount = 1; } diff --git a/harbour/src/rtl/hbstrfmt.c b/harbour/src/rtl/hbstrfmt.c index b379a13e7a..22055e4cac 100644 --- a/harbour/src/rtl/hbstrfmt.c +++ b/harbour/src/rtl/hbstrfmt.c @@ -224,7 +224,7 @@ PHB_ITEM hb_strFormat( PHB_ITEM pItemReturn, PHB_ITEM pItemFormat, int iCount, P hb_itemStrBuf( pStr, pItem, iSize, 0 ); while( *pStr2 == ' ' ) pStr2++; - iSize = strlen( pStr2 ); + iSize = ( int ) strlen( pStr2 ); if( *pStr2 == '-' ) { fSign = 1; @@ -350,7 +350,7 @@ PHB_ITEM hb_strFormat( PHB_ITEM pItemReturn, PHB_ITEM pItemFormat, int iCount, P } while( *pStr2 == ' ' ) pStr2++; - iSize = strlen( pStr2 ); + iSize = ( int ) strlen( pStr2 ); } else { diff --git a/harbour/src/vm/cmdarg.c b/harbour/src/vm/cmdarg.c index 9633b9e289..8ca8a3de7d 100644 --- a/harbour/src/vm/cmdarg.c +++ b/harbour/src/vm/cmdarg.c @@ -324,7 +324,7 @@ static char * hb_cmdargGet( const char * pszName, HB_BOOL bRetValue ) chars at all, Harbour is more strict/standard in this respect, it requires the switches to be separated. */ - i = strlen( pszName ); + i = ( int ) strlen( pszName ); while( *pszNext ) { static const char * s_szSeparator = " ;,\t"; diff --git a/harbour/src/vm/debug.c b/harbour/src/vm/debug.c index 811809aeb6..6dc962cbd0 100644 --- a/harbour/src/vm/debug.c +++ b/harbour/src/vm/debug.c @@ -147,15 +147,14 @@ HB_FUNC( __DBGVMSTKGCOUNT ) HB_FUNC( __DBGVMSTKGLIST ) { PHB_ITEM pReturn; - HB_SIZE ulLen = hb_stackTopOffset(); - HB_SIZE ulPos; + HB_LONG ulLen = hb_stackTopOffset(); + HB_LONG ulPos; pReturn = hb_itemArrayNew( ulLen ); /* Create a transfer array */ for( ulPos = 0; ulPos < ulLen; ++ulPos ) - { AddToArray( hb_stackItem( ulPos ), pReturn, ulPos + 1 ); - } + hb_itemReturnRelease( pReturn ); } @@ -207,7 +206,7 @@ HB_FUNC( __DBGVMSTKLCOUNT ) HB_FUNC( __DBGVMSTKLLIST ) { PHB_ITEM pReturn; - HB_SIZE ulLen, ul; + HB_LONG ulLen, ul; HB_LONG lBaseOffset, lPrevOffset; lBaseOffset = hb_stackBaseOffset(); diff --git a/harbour/src/vm/hashfunc.c b/harbour/src/vm/hashfunc.c index 4445ecd02d..fc05faa417 100644 --- a/harbour/src/vm/hashfunc.c +++ b/harbour/src/vm/hashfunc.c @@ -370,7 +370,7 @@ HB_FUNC( HB_HMERGE ) hb_vmPush( pAction ); hb_vmPush( pKey ); hb_vmPush( pValue ); - hb_vmPushLong( ulPos ); + hb_vmPushSize( ulPos ); hb_vmSend( 3 ); { PHB_ITEM pReturn = hb_stackReturnItem(); @@ -415,7 +415,7 @@ HB_FUNC( HB_HEVAL ) hb_vmPush( pBlock ); hb_vmPush( pKey ); hb_vmPush( pValue ); - hb_vmPushLong( ulStart ); + hb_vmPushSize( ulStart ); hb_vmSend( 3 ); } else @@ -456,7 +456,7 @@ HB_FUNC( HB_HSCAN ) hb_vmPush( pValue ); hb_vmPush( pKey ); hb_vmPush( pVal ); - hb_vmPushLong( ulStart ); + hb_vmPushSize( ulStart ); hb_vmSend( 3 ); { PHB_ITEM pReturn = hb_stackReturnItem(); diff --git a/harbour/src/vm/hvm.c b/harbour/src/vm/hvm.c index f5f3314093..503a880245 100644 --- a/harbour/src/vm/hvm.c +++ b/harbour/src/vm/hvm.c @@ -6659,6 +6659,14 @@ void hb_vmPushLong( long lNumber ) HB_ITEM_PUT_LONGRAW( pItem, lNumber ); } +void hb_vmPushSize( HB_ISIZ nNumber ) +{ + if( HB_LIM_INT( nNumber ) ) + hb_vmPushInteger( ( int ) nNumber ); + else + hb_vmPushHBLong( nNumber ); +} + static void hb_vmPushHBLong( HB_MAXINT lNumber ) { HB_STACK_TLS_PRELOAD