From 73a06f6c8fdc67bc51a0de6992549b6a7a32df69 Mon Sep 17 00:00:00 2001 From: Przemyslaw Czerpak Date: Tue, 15 Jun 2010 10:00:45 +0000 Subject: [PATCH] 2010-06-15 12:00 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/include/hbdefs.h * harbour/include/hbvmpub.h * harbour/src/common/expropt1.c * harbour/src/common/expropt2.c * harbour/src/common/hbstr.c * harbour/src/compiler/gencc.c * harbour/src/vm/hvm.c * harbour/src/vm/itemapi.c * harbour/src/vm/task.c * harbour/src/rtl/abs.c * harbour/src/rtl/hbdyn.c * harbour/src/rdd/dbsql.c * harbour/contrib/hbwin/olecore.c * harbour/contrib/sddoci/sddoci.c * harbour/contrib/sddsqlt3/sddsqlt3.c * renamed HB_LONG_{MIN,MAX} to HB_VMLONG_{MIN,MAX} and HB_INT_{MIN,MAX} to HB_VMINT_{MIN,MAX} to not confuse users after renaming HB_LONG to HB_MAXINT and LONG to HB_LONG. They could expect that HB_LONG_{MIN,MAX} are for HB_LONG type. --- harbour/ChangeLog | 21 +++++++++++++ harbour/contrib/hbwin/olecore.c | 14 ++++----- harbour/contrib/sddoci/sddoci.c | 2 +- harbour/contrib/sddsqlt3/sddsqlt3.c | 2 +- harbour/include/hbdefs.h | 46 ++++++++++++++--------------- harbour/include/hbvmpub.h | 2 +- harbour/src/common/expropt1.c | 4 +-- harbour/src/common/expropt2.c | 4 +-- harbour/src/common/hbstr.c | 4 +-- harbour/src/compiler/gencc.c | 2 +- harbour/src/rdd/dbsql.c | 2 +- harbour/src/rtl/abs.c | 10 +++---- harbour/src/rtl/hbdyn.c | 12 ++++---- harbour/src/vm/hvm.c | 32 ++++++++++---------- harbour/src/vm/itemapi.c | 6 ++-- harbour/src/vm/task.c | 2 +- 16 files changed, 93 insertions(+), 72 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 4eae22b11d..ce6cb12a8f 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,27 @@ The license applies to all entries newer than 2009-04-28. */ +2010-06-15 12:00 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/include/hbdefs.h + * harbour/include/hbvmpub.h + * harbour/src/common/expropt1.c + * harbour/src/common/expropt2.c + * harbour/src/common/hbstr.c + * harbour/src/compiler/gencc.c + * harbour/src/vm/hvm.c + * harbour/src/vm/itemapi.c + * harbour/src/vm/task.c + * harbour/src/rtl/abs.c + * harbour/src/rtl/hbdyn.c + * harbour/src/rdd/dbsql.c + * harbour/contrib/hbwin/olecore.c + * harbour/contrib/sddoci/sddoci.c + * harbour/contrib/sddsqlt3/sddsqlt3.c + * renamed HB_LONG_{MIN,MAX} to HB_VMLONG_{MIN,MAX} and + HB_INT_{MIN,MAX} to HB_VMINT_{MIN,MAX} to not confuse users + after renaming HB_LONG to HB_MAXINT and LONG to HB_LONG. + They could expect that HB_LONG_{MIN,MAX} are for HB_LONG type. + 2010-06-15 10:58 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * contrib/hbcurl/hbcurl.c ! Fixed typo in prev change. diff --git a/harbour/contrib/hbwin/olecore.c b/harbour/contrib/hbwin/olecore.c index 7648bdb4d0..17902fd8fa 100644 --- a/harbour/contrib/hbwin/olecore.c +++ b/harbour/contrib/hbwin/olecore.c @@ -387,7 +387,7 @@ static void hb_oleItemToVariantRef( VARIANT* pVariant, PHB_ITEM pItem, break; case HB_IT_LONG: -#if HB_LONG_MAX == INT32_MAX || defined( HB_LONG_LONG_OFF ) +#if HB_VMLONG_MAX == INT32_MAX || defined( HB_LONG_LONG_OFF ) pVariant->n1.n2.vt = VT_I4; pVariant->n1.n2.n3.lVal = hb_itemGetNL( pItem ); if( pVarRef ) @@ -708,7 +708,7 @@ void hb_oleVariantToItem( PHB_ITEM pItem, VARIANT* pVariant ) break; case VT_I8: -#if HB_LONG_MAX == INT32_MAX || defined( HB_LONG_LONG_OFF ) +#if HB_VMLONG_MAX == INT32_MAX || defined( HB_LONG_LONG_OFF ) hb_itemPutNInt( pItem, ( HB_MAXINT ) pVariant->n1.n2.n3.lVal ); #elif defined( HB_OLE_NO_LL ) /* workaround for wrong OLE variant structure definition */ @@ -719,7 +719,7 @@ void hb_oleVariantToItem( PHB_ITEM pItem, VARIANT* pVariant ) break; case VT_I8 | VT_BYREF: -#if HB_LONG_MAX == INT32_MAX || defined( HB_LONG_LONG_OFF ) +#if HB_VMLONG_MAX == INT32_MAX || defined( HB_LONG_LONG_OFF ) hb_itemPutNInt( pItem, ( HB_MAXINT ) *pVariant->n1.n2.n3.plVal ); #elif defined( HB_OLE_NO_LLREF ) /* workaround for wrong OLE variant structure definition */ @@ -755,7 +755,7 @@ void hb_oleVariantToItem( PHB_ITEM pItem, VARIANT* pVariant ) case VT_UI8: /* TODO: sign is lost. Convertion to double will lose significant digits. */ -#if HB_LONG_MAX == INT32_MAX || defined( HB_LONG_LONG_OFF ) +#if HB_VMLONG_MAX == INT32_MAX || defined( HB_LONG_LONG_OFF ) hb_itemPutNInt( pItem, ( HB_MAXINT ) pVariant->n1.n2.n3.ulVal ); #elif defined( HB_OLE_NO_LL ) /* workaround for wrong OLE variant structure definition */ @@ -767,7 +767,7 @@ void hb_oleVariantToItem( PHB_ITEM pItem, VARIANT* pVariant ) case VT_UI8 | VT_BYREF: /* TODO: sign is lost. Convertion to double will lose significant digits. */ -#if HB_LONG_MAX == INT32_MAX || defined( HB_LONG_LONG_OFF ) +#if HB_VMLONG_MAX == INT32_MAX || defined( HB_LONG_LONG_OFF ) hb_itemPutNInt( pItem, ( HB_MAXINT ) *pVariant->n1.n2.n3.pulVal ); #elif defined( HB_OLE_NO_LLREF ) /* workaround for wrong OLE variant structure definition */ @@ -994,7 +994,7 @@ void hb_oleVariantUpdate( VARIANT* pVariant, PHB_ITEM pItem, break; case VT_I8 | VT_BYREF: -#if HB_LONG_MAX == INT32_MAX || defined( HB_LONG_LONG_OFF ) +#if HB_VMLONG_MAX == INT32_MAX || defined( HB_LONG_LONG_OFF ) *pVariant->n1.n2.n3.plVal = ( long ) hb_itemGetNInt( pItem ); #elif defined( HB_OLE_NO_LLREF ) /* workaround for wrong OLE variant structure definition */ @@ -1017,7 +1017,7 @@ void hb_oleVariantUpdate( VARIANT* pVariant, PHB_ITEM pItem, break; case VT_UI8 | VT_BYREF: -#if HB_LONG_MAX == INT32_MAX || defined( HB_LONG_LONG_OFF ) +#if HB_VMLONG_MAX == INT32_MAX || defined( HB_LONG_LONG_OFF ) *pVariant->n1.n2.n3.pulVal = ( unsigned long ) hb_itemGetNInt( pItem ); #elif defined( HB_OLE_NO_LLREF ) /* workaround for wrong OLE variant structure definition */ diff --git a/harbour/contrib/sddoci/sddoci.c b/harbour/contrib/sddoci/sddoci.c index a0c5990553..a6fad37f56 100644 --- a/harbour/contrib/sddoci/sddoci.c +++ b/harbour/contrib/sddoci/sddoci.c @@ -567,7 +567,7 @@ static HB_ERRCODE ocilibGoTo( SQLBASEAREAP pArea, HB_ULONG ulRecNo ) case HB_FT_LONG: case HB_FT_INTEGER: if( pField->uiDec == 0 ) -#if HB_LONG_MAX == INT32_MAX || defined( HB_LONG_LONG_OFF ) +#if HB_VMLONG_MAX == INT32_MAX || defined( HB_LONG_LONG_OFF ) pItem = hb_itemPutNIntLen( NULL, OCI_GetInt( rs, ui ), pField->uiLen ); #else pItem = hb_itemPutNIntLen( NULL, OCI_GetBigInt( rs, ui ), pField->uiLen ); diff --git a/harbour/contrib/sddsqlt3/sddsqlt3.c b/harbour/contrib/sddsqlt3/sddsqlt3.c index e81746f767..2a89eb7524 100644 --- a/harbour/contrib/sddsqlt3/sddsqlt3.c +++ b/harbour/contrib/sddsqlt3/sddsqlt3.c @@ -451,7 +451,7 @@ static HB_ERRCODE sqlite3GoTo( SQLBASEAREAP pArea, HB_ULONG ulRecNo ) case HB_FT_LONG: case HB_FT_INTEGER: if( pField->uiDec == 0 ) -#if HB_LONG_MAX == INT32_MAX || defined( HB_LONG_LONG_OFF ) +#if HB_VMLONG_MAX == INT32_MAX || defined( HB_LONG_LONG_OFF ) pItem = hb_itemPutNIntLen( NULL, sqlite3_column_int( st, ui ), pField->uiLen ); #else pItem = hb_itemPutNIntLen( NULL, sqlite3_column_int64( st, ui ), pField->uiLen ); diff --git a/harbour/include/hbdefs.h b/harbour/include/hbdefs.h index f949cfd041..c8f32098d1 100644 --- a/harbour/include/hbdefs.h +++ b/harbour/include/hbdefs.h @@ -477,28 +477,28 @@ typedef HB_UCHAR HB_BYTE; #endif #if defined( HB_CLIPPER_INT_ITEMS ) -# define HB_INT_MAX SHRT_MAX -# define HB_INT_MIN SHRT_MIN -# define HB_LONG_MAX LONG_MAX -# define HB_LONG_MIN LONG_MIN -# define HB_ULONG_MAX ULONG_MAX +# define HB_VMINT_MAX SHRT_MAX +# define HB_VMINT_MIN SHRT_MIN +# define HB_VMLONG_MAX LONG_MAX +# define HB_VMLONG_MIN LONG_MIN +# define HB_VMULONG_MAX ULONG_MAX typedef long HB_MAXINT; typedef unsigned long HB_MAXUINT; # define PFHL "l" #elif !defined( HB_LONG_LONG_OFF ) && ULONG_MAX == UINT_MAX -# define HB_INT_MAX INT_MAX -# define HB_INT_MIN INT_MIN -# define HB_LONG_MAX LONGLONG_MAX -# define HB_LONG_MIN LONGLONG_MIN -# define HB_ULONG_MAX ULONGLONG_MAX +# define HB_VMINT_MAX INT_MAX +# define HB_VMINT_MIN INT_MIN +# define HB_VMLONG_MAX LONGLONG_MAX +# define HB_VMLONG_MIN LONGLONG_MIN +# define HB_VMULONG_MAX ULONGLONG_MAX typedef HB_LONGLONG HB_MAXINT; typedef HB_ULONGLONG HB_MAXUINT; #else -# define HB_INT_MAX INT_MAX -# define HB_INT_MIN INT_MIN -# define HB_LONG_MAX LONG_MAX -# define HB_LONG_MIN LONG_MIN -# define HB_ULONG_MAX ULONG_MAX +# define HB_VMINT_MAX INT_MAX +# define HB_VMINT_MIN INT_MIN +# define HB_VMLONG_MAX LONG_MAX +# define HB_VMLONG_MIN LONG_MIN +# define HB_VMULONG_MAX ULONG_MAX typedef long HB_MAXINT; typedef unsigned long HB_MAXUINT; # define PFHL "l" @@ -507,10 +507,10 @@ typedef HB_UCHAR HB_BYTE; typedef HB_MAXINT HB_VMMAXINT; typedef HB_MAXUINT HB_VMMAXUINT; -#define HB_DBL_LIM_INT(d) ( HB_INT_MIN <= (d) && (d) <= HB_INT_MAX ) -#define HB_DBL_LIM_LONG(d) ( (HB_MAXDBL) HB_LONG_MIN <= (HB_MAXDBL) (d) && (HB_MAXDBL) (d) <= (HB_MAXDBL) HB_LONG_MAX ) -#define HB_LIM_INT(l) ( HB_INT_MIN <= (l) && (l) <= HB_INT_MAX ) -#define HB_LIM_LONG(l) ( HB_LONG_MIN <= (l) && (l) <= HB_LONG_MAX ) +#define HB_DBL_LIM_INT(d) ( HB_VMINT_MIN <= (d) && (d) <= HB_VMINT_MAX ) +#define HB_DBL_LIM_LONG(d) ( (HB_MAXDBL) HB_VMLONG_MIN <= (HB_MAXDBL) (d) && (HB_MAXDBL) (d) <= (HB_MAXDBL) HB_VMLONG_MAX ) +#define HB_LIM_INT(l) ( HB_VMINT_MIN <= (l) && (l) <= HB_VMINT_MAX ) +#define HB_LIM_LONG(l) ( HB_VMLONG_MIN <= (l) && (l) <= HB_VMLONG_MAX ) #define HB_DBL_LIM_INT8(d) ( -128 <= (d) && (d) <= 127 ) #define HB_DBL_LIM_INT16(d) ( INT16_MIN <= (d) && (d) <= INT16_MAX ) @@ -559,21 +559,21 @@ typedef HB_MAXUINT HB_VMMAXUINT; * intentionally replicated. I think we should keep it * only in strict compatibility mode. [druzus] */ -#if HB_INT_MIN < -999999999 +#if HB_VMINT_MIN < -999999999 # define HB_INT_LENGTH( i ) ( ( (i) < -999999999 || (i) > 999999999 ) ? 20 : 10 ) #else # define HB_INT_LENGTH( i ) 10 # define HB_INT_EXPLENGTH( i ) 10 -# if HB_LONG_MIN < -999999999 +# if HB_VMLONG_MIN < -999999999 # define HB_LONG_LENGTH( i ) ( ( (i) < -999999999 || (i) > 999999999 ) ? 20 : 10 ) # endif #endif #if !defined( HB_LONG_LONG_OFF ) -# if HB_LONG_MAX > HB_LL( 9999999999 ) +# if HB_VMLONG_MAX > HB_LL( 9999999999 ) # define HB_LONG_LENGTH( l ) ( ( (l) < -999999999 || (l) > HB_LL( 9999999999 ) ) ? 20 : 10 ) # endif -# if HB_INT_MAX > HB_LL( 9999999999 ) +# if HB_VMINT_MAX > HB_LL( 9999999999 ) # define HB_INT_EXPLENGTH( i ) HB_LONG_LENGTH( i ) # endif #endif diff --git a/harbour/include/hbvmpub.h b/harbour/include/hbvmpub.h index f16942b42c..a7d40c562a 100644 --- a/harbour/include/hbvmpub.h +++ b/harbour/include/hbvmpub.h @@ -91,7 +91,7 @@ struct _HB_SYMB; } \ } while( 0 ) -# if HB_INT_MAX >= LONG_MAX +# if HB_VMINT_MAX >= LONG_MAX # define HB_ITEM_PUT_LONGRAW( p, v ) \ do { \ (p)->type = HB_IT_INTEGER; \ diff --git a/harbour/src/common/expropt1.c b/harbour/src/common/expropt1.c index c67b2f3b34..cb781b2d15 100644 --- a/harbour/src/common/expropt1.c +++ b/harbour/src/common/expropt1.c @@ -1121,8 +1121,8 @@ HB_EXPR_PTR hb_compExprNewNegate( HB_EXPR_PTR pNegExpr, HB_COMP_DECL ) } else { -#if -HB_LONG_MAX > HB_LONG_MIN - if( pNegExpr->value.asNum.val.l < -HB_LONG_MAX ) +#if -HB_VMLONG_MAX > HB_VMLONG_MIN + if( pNegExpr->value.asNum.val.l < -HB_VMLONG_MAX ) { pNegExpr->value.asNum.NumType = HB_ET_DOUBLE; pNegExpr->value.asNum.val.d = - ( double ) pNegExpr->value.asNum.val.l; diff --git a/harbour/src/common/expropt2.c b/harbour/src/common/expropt2.c index 7ff87082b9..b30b400984 100644 --- a/harbour/src/common/expropt2.c +++ b/harbour/src/common/expropt2.c @@ -951,8 +951,8 @@ HB_EXPR_PTR hb_compExprReduceNegate( HB_EXPR_PTR pSelf, HB_COMP_DECL ) } else { -#if -HB_LONG_MAX > HB_LONG_MIN - if( pExpr->value.asNum.val.l < -HB_LONG_MAX ) +#if -HB_VMLONG_MAX > HB_VMLONG_MIN + if( pExpr->value.asNum.val.l < -HB_VMLONG_MAX ) { pExpr->value.asNum.NumType = HB_ET_DOUBLE; pExpr->value.asNum.val.d = - ( double ) pExpr->value.asNum.val.l; diff --git a/harbour/src/common/hbstr.c b/harbour/src/common/hbstr.c index 44f075be31..fef9d4cbc2 100644 --- a/harbour/src/common/hbstr.c +++ b/harbour/src/common/hbstr.c @@ -590,8 +590,8 @@ static HB_BOOL hb_str2number( HB_BOOL fPCode, const char* szNum, HB_SIZE ulLen, HB_MAXINT lLimV; int iLimC; - lLimV = HB_LONG_MAX / 10; - iLimC = ( int ) ( HB_LONG_MAX % 10 ); + lLimV = HB_VMLONG_MAX / 10; + iLimC = ( int ) ( HB_VMLONG_MAX % 10 ); iWidth = ulPos; diff --git a/harbour/src/compiler/gencc.c b/harbour/src/compiler/gencc.c index 193593d618..57e8f65989 100644 --- a/harbour/src/compiler/gencc.c +++ b/harbour/src/compiler/gencc.c @@ -1246,7 +1246,7 @@ static HB_GENC_FUNC( hb_p_pushlong ) if( iSkip == 0 ) { -#if HB_INT_MAX >= INT32_MAX +#if INT_MAX >= INT32_MAX fprintf( cargo->yyc, "\thb_xvmPushInteger( %d );\n", ( int ) lVal ); #else fprintf( cargo->yyc, "\thb_xvmPushLong( %ldL );\n", ( long ) lVal ); diff --git a/harbour/src/rdd/dbsql.c b/harbour/src/rdd/dbsql.c index 79fb44006b..1a5addbd28 100644 --- a/harbour/src/rdd/dbsql.c +++ b/harbour/src/rdd/dbsql.c @@ -363,7 +363,7 @@ HB_FUNC( __DBSQL ) const char * szSep = hb_parcx( 13 ); const char * szDelim = hb_parcx( 14 ); const char * szEsc = hb_parcx( 15 ); - HB_MAXINT llNext = HB_LONG_MAX; + HB_MAXINT llNext = HB_VMLONG_MAX; HB_FHANDLE hFile; HB_ERRCODE errCode; diff --git a/harbour/src/rtl/abs.c b/harbour/src/rtl/abs.c index 853cc0edd3..b4f9bef320 100644 --- a/harbour/src/rtl/abs.c +++ b/harbour/src/rtl/abs.c @@ -71,9 +71,9 @@ HB_FUNC( ABS ) if( iNumber >= 0 ) hb_retnilen( iNumber, iWidth ); -#if -HB_INT_MAX > HB_INT_MIN - else if( iNumber < -HB_INT_MAX ) -#if HB_LONG_MAX > HB_INT_MAX +#if -HB_VMINT_MAX > HB_VMINT_MIN + else if( iNumber < -INT_MAX ) +#if HB_VMLONG_MAX > HB_VMINT_MAX hb_retnint( - ( HB_MAXINT ) iNumber ); #else hb_retndlen( - ( double ) iNumber, 0, iDec ); @@ -88,8 +88,8 @@ HB_FUNC( ABS ) if( lNumber >= 0 ) hb_retnintlen( lNumber, iWidth ); -#if -HB_LONG_MAX > HB_LONG_MIN - else if( lNumber < -HB_LONG_MAX ) +#if -HB_VMLONG_MAX > HB_VMLONG_MIN + else if( lNumber < -HB_VMLONG_MAX ) hb_retndlen( - ( double ) lNumber, 0, iDec ); #endif else diff --git a/harbour/src/rtl/hbdyn.c b/harbour/src/rtl/hbdyn.c index 6ffe5314a3..4cd502b90b 100644 --- a/harbour/src/rtl/hbdyn.c +++ b/harbour/src/rtl/hbdyn.c @@ -185,7 +185,7 @@ static HB_U64 hb_u64par( PHB_ITEM pParam, PHB_DYNARG pArg ) case HB_DYN_CTYPE_LLONG_UNSIGNED: /* TOFIX: Digits are lost. */ -#if HB_LONG_MAX == INT32_MAX || defined( HB_LONG_LONG_OFF ) +#if HB_VMLONG_MAX == INT32_MAX || defined( HB_LONG_LONG_OFF ) pArg->value.t.n64 = ( HB_MAXUINT ) hb_itemGetNInt( pParam ); #else pArg->value.t.n64 = ( HB_ULONGLONG ) hb_itemGetNInt( pParam ); @@ -322,7 +322,7 @@ static PHB_ITEM hb_u64ret( PHB_ITEM pItem, int iRetType, int iEncoding, HB_DYNVA break; case HB_DYN_CTYPE_LLONG: -#if HB_LONG_MAX == INT32_MAX || defined( HB_LONG_LONG_OFF ) +#if HB_VMLONG_MAX == INT32_MAX || defined( HB_LONG_LONG_OFF ) hb_itemPutNInt( pItem, ( HB_MAXINT ) value.t.n64 ); #else hb_itemPutNInt( pItem, ( HB_LONGLONG ) value.t.n64 ); @@ -330,7 +330,7 @@ static PHB_ITEM hb_u64ret( PHB_ITEM pItem, int iRetType, int iEncoding, HB_DYNVA break; case HB_DYN_CTYPE_LLONG_UNSIGNED: -#if HB_LONG_MAX == INT32_MAX || defined( HB_LONG_LONG_OFF ) +#if HB_VMLONG_MAX == INT32_MAX || defined( HB_LONG_LONG_OFF ) hb_itemPutNInt( pItem, ( HB_MAXUINT ) value.t.n64 ); #else hb_itemPutNInt( pItem, ( HB_ULONGLONG ) value.t.n64 ); @@ -536,7 +536,7 @@ static void hb_u32par( PHB_ITEM pParam, PHB_DYNARG pArg, HB_U32 * r1, HB_U32 * r case HB_DYN_CTYPE_LLONG_UNSIGNED: /* TOFIX: Digits are lost. */ -#if HB_LONG_MAX == INT32_MAX || defined( HB_LONG_LONG_OFF ) +#if HB_VMLONG_MAX == INT32_MAX || defined( HB_LONG_LONG_OFF ) pArg->value.t.n64 = ( HB_MAXUINT ) hb_itemGetNInt( pParam ); #else pArg->value.t.n64 = ( HB_ULONGLONG ) hb_itemGetNInt( pParam ); @@ -687,7 +687,7 @@ static PHB_ITEM hb_u32ret( PHB_ITEM pItem, int iRetType, int iEncoding, HB_DYNVA break; case HB_DYN_CTYPE_LLONG: -#if HB_LONG_MAX == INT32_MAX || defined( HB_LONG_LONG_OFF ) +#if HB_VMLONG_MAX == INT32_MAX || defined( HB_LONG_LONG_OFF ) hb_itemPutNInt( pItem, ( HB_MAXINT ) value.t.n64 ); #else hb_itemPutNInt( pItem, ( HB_LONGLONG ) value.t.n64 ); @@ -695,7 +695,7 @@ static PHB_ITEM hb_u32ret( PHB_ITEM pItem, int iRetType, int iEncoding, HB_DYNVA break; case HB_DYN_CTYPE_LLONG_UNSIGNED: -#if HB_LONG_MAX == INT32_MAX || defined( HB_LONG_LONG_OFF ) +#if HB_VMLONG_MAX == INT32_MAX || defined( HB_LONG_LONG_OFF ) hb_itemPutNInt( pItem, ( HB_MAXUINT ) value.t.n64 ); #else hb_itemPutNInt( pItem, ( HB_ULONGLONG ) value.t.n64 ); diff --git a/harbour/src/vm/hvm.c b/harbour/src/vm/hvm.c index 09d9a5125f..f790b56427 100644 --- a/harbour/src/vm/hvm.c +++ b/harbour/src/vm/hvm.c @@ -180,7 +180,7 @@ static void hb_vmPushHBLong( HB_MAXINT lNumber ); /* pushes a HB_MAXINT numbe #if !defined( HB_LONG_LONG_OFF ) static void hb_vmPushLongLongConst( HB_LONGLONG lNumber ); /* Pushes a long long constant (pcode) */ #endif -#if HB_INT_MAX >= INT32_MAX +#if HB_VMINT_MAX >= INT32_MAX static void hb_vmPushIntegerConst( int iNumber ); /* Pushes a int constant (pcode) */ #else static void hb_vmPushLongConst( long lNumber ); /* Pushes a long constant (pcode) */ @@ -2100,7 +2100,7 @@ void hb_vmExecute( const HB_BYTE * pCode, PHB_SYMB pSymbols ) case HB_P_PUSHLONG: HB_TRACE( HB_TR_DEBUG, ("(HB_P_PUSHLONG)") ); -#if HB_INT_MAX >= INT32_MAX +#if HB_VMINT_MAX >= INT32_MAX hb_vmPushIntegerConst( ( int ) HB_PCODE_MKLONG( &pCode[ 1 ] ) ); #else hb_vmPushLongConst( ( long ) HB_PCODE_MKLONG( &pCode[ 1 ] ) ); @@ -3002,10 +3002,10 @@ static void hb_vmNegate( void ) if( HB_IS_INTEGER( pItem ) ) { -#if -HB_INT_MAX > HB_INT_MIN - if( pItem->item.asInteger.value < -HB_INT_MAX ) +#if -HB_VMINT_MAX > HB_VMINT_MIN + if( pItem->item.asInteger.value < -HB_VMINT_MAX ) { -#if HB_LONG_MAX > HB_INT_MAX +#if HB_VMLONG_MAX > HB_VMINT_MAX HB_MAXINT lValue = ( HB_MAXINT ) pItem->item.asInteger.value; pItem->type = HB_IT_LONG; pItem->item.asLong.value = -lValue; @@ -3028,8 +3028,8 @@ static void hb_vmNegate( void ) } else if( HB_IS_LONG( pItem ) ) { -#if -HB_LONG_MAX > HB_LONG_MIN - if( pItem->item.asLong.value < -HB_LONG_MAX ) +#if -HB_VMLONG_MAX > HB_VMLONG_MIN + if( pItem->item.asLong.value < -HB_VMLONG_MAX ) { double dValue = ( double ) pItem->item.asLong.value; pItem->type = HB_IT_DOUBLE; @@ -3351,8 +3351,8 @@ static void hb_vmMult( HB_ITEM_PTR pResult, HB_ITEM_PTR pItem1, HB_ITEM_PTR pIte { HB_TRACE(HB_TR_DEBUG, ("hb_vmMult(%p,%p,%p)", pResult, pItem1, pItem2)); -#if HB_LONG_MAX / HB_INT_MAX >= HB_INT_MAX && \ - HB_LONG_MIN / HB_INT_MIN >= HB_INT_MIN && 1 +#if HB_VMLONG_MAX / HB_VMINT_MAX >= HB_VMINT_MAX && \ + HB_VMLONG_MIN / HB_VMINT_MIN >= -HB_VMINT_MIN && 1 if( HB_IS_INTEGER( pItem1 ) && HB_IS_INTEGER( pItem2 ) ) { HB_MAXINT lResult = ( HB_MAXINT ) pItem1->item.asInteger.value * @@ -3535,7 +3535,7 @@ static void hb_vmInc( PHB_ITEM pItem ) { if( HB_IS_INTEGER( pItem ) ) { - if( pItem->item.asInteger.value < HB_INT_MAX ) + if( pItem->item.asInteger.value < HB_VMINT_MAX ) { pItem->type = HB_IT_INTEGER; pItem->item.asInteger.value++; @@ -3543,7 +3543,7 @@ static void hb_vmInc( PHB_ITEM pItem ) } else { -#if HB_INT_MAX < HB_LONG_MAX +#if HB_VMINT_MAX < HB_VMLONG_MAX pItem->type = HB_IT_LONG; pItem->item.asLong.value = ( HB_MAXINT ) pItem->item.asInteger.value + 1; pItem->item.asLong.length = HB_LONG_EXPLENGTH( pItem->item.asLong.value ); @@ -3555,7 +3555,7 @@ static void hb_vmInc( PHB_ITEM pItem ) #endif } } - else if( pItem->item.asLong.value < HB_LONG_MAX ) + else if( pItem->item.asLong.value < HB_VMLONG_MAX ) { pItem->type = HB_IT_LONG; pItem->item.asLong.value++; @@ -3600,7 +3600,7 @@ static void hb_vmDec( PHB_ITEM pItem ) { if( HB_IS_INTEGER( pItem ) ) { - if( pItem->item.asInteger.value > HB_INT_MIN ) + if( pItem->item.asInteger.value > HB_VMINT_MIN ) { pItem->type = HB_IT_INTEGER; pItem->item.asInteger.value--; @@ -3608,7 +3608,7 @@ static void hb_vmDec( PHB_ITEM pItem ) } else { -#if HB_INT_MIN > HB_LONG_MIN +#if HB_VMINT_MIN > HB_VMLONG_MIN pItem->type = HB_IT_LONG; pItem->item.asLong.value = ( HB_MAXINT ) pItem->item.asInteger.value - 1; pItem->item.asLong.length = HB_LONG_EXPLENGTH( pItem->item.asLong.value ); @@ -3620,7 +3620,7 @@ static void hb_vmDec( PHB_ITEM pItem ) #endif } } - else if( pItem->item.asLong.value > HB_LONG_MIN ) + else if( pItem->item.asLong.value > HB_VMLONG_MIN ) { pItem->type = HB_IT_LONG; pItem->item.asLong.value--; @@ -6598,7 +6598,7 @@ void hb_vmPushInteger( int iNumber ) pItem->item.asInteger.length = HB_INT_LENGTH( iNumber ); } -#if HB_INT_MAX >= INT32_MAX +#if HB_VMINT_MAX >= INT32_MAX static void hb_vmPushIntegerConst( int iNumber ) { HB_STACK_TLS_PRELOAD diff --git a/harbour/src/vm/itemapi.c b/harbour/src/vm/itemapi.c index 6a097547a0..680dad8085 100644 --- a/harbour/src/vm/itemapi.c +++ b/harbour/src/vm/itemapi.c @@ -976,7 +976,7 @@ PHB_ITEM hb_itemPutNLL( PHB_ITEM pItem, HB_LONGLONG llNumber ) else pItem = hb_itemNew( NULL ); -#if HB_LONG_MAX >= LONGLONG_MAX +#if HB_VMLONG_MAX >= LONGLONG_MAX pItem->type = HB_IT_LONG; pItem->item.asLong.value = ( HB_MAXINT ) llNumber; pItem->item.asLong.length = HB_LONG_LENGTH( llNumber ); @@ -1181,7 +1181,7 @@ PHB_ITEM hb_itemPutNLLen( PHB_ITEM pItem, long lNumber, int iWidth ) else pItem = hb_itemNew( NULL ); -#if HB_INT_MAX == LONG_MAX +#if HB_VMINT_MAX == LONG_MAX if( iWidth <= 0 || iWidth > 99 ) iWidth = HB_INT_LENGTH( lNumber ); @@ -1213,7 +1213,7 @@ PHB_ITEM hb_itemPutNLLLen( PHB_ITEM pItem, HB_LONGLONG llNumber, int iWidth ) else pItem = hb_itemNew( NULL ); -#if HB_LONG_MAX >= LONGLONG_MAX +#if HB_VMLONG_MAX >= LONGLONG_MAX if( iWidth <= 0 || iWidth > 99 ) iWidth = HB_LONG_LENGTH( llNumber ); diff --git a/harbour/src/vm/task.c b/harbour/src/vm/task.c index fc82cfdbbe..acb0099b47 100644 --- a/harbour/src/vm/task.c +++ b/harbour/src/vm/task.c @@ -89,7 +89,7 @@ #define HB_TASK_STACK_MIN 16384 #define HB_TASK_STACK_ALIGN 16 #define HB_TASK_NO_DELAY 0 -#define HB_TASK_INFINITE_DELAY HB_LONG_MAX +#define HB_TASK_INFINITE_DELAY HB_VMLONG_MAX #undef HB_TASK_STACK_INIT