From f9336a957b0cf29ca6724e3a46e5bb80582ac85f Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sun, 7 Feb 2010 15:37:24 +0000 Subject: [PATCH] 2010-02-07 16:34 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * src/rtl/cdpapi.c ! Fixed type when manually correcting 'unsigned char' to UCHAR to sync with declaration. * contrib/gtwvg/gtwvg.c ! Fixed wrong casts (HB_LONG instead of long) * src/pp/ppcore.c * src/vm/macro.c * src/vm/hashes.c * src/vm/itemapi.c * src/vm/hvm.c * src/vm/arrays.c * src/vm/task.c * src/vm/thread.c * src/vm/extend.c * src/common/hbwince.c * src/common/expropt1.c * src/common/hbstr.c * src/common/expropt2.c * src/common/hbdate.c * src/macro/macro.yyc * src/macro/macro.y * src/macro/macro.yyh * src/macro/macrolex.c * src/rtl/gttrm/gttrm.c * src/rtl/hbstrfmt.c * src/rtl/hbcrc.c * src/rtl/minmax.c * src/rtl/hbrandom.c * src/rtl/hbsocket.c * src/rtl/hbbit.c * src/rtl/hbgtcore.c * src/rtl/cputime.c * src/rtl/idle.c * src/rtl/itemseri.c * src/rtl/gtsln/gtsln.c * src/rtl/gtpca/gtpca.c * src/rtl/hbznet.c * src/rtl/hbhex.c * src/rtl/seconds.c * src/rtl/abs.c * src/rtl/gtwvt/gtwvt.c * src/rtl/hbbyte.c * src/rtl/val.c * src/rdd/dbfntx/dbfntx1.c * src/rdd/dbsql.c * src/rdd/sdf1.c * src/rdd/delim1.c * src/rdd/dbf1.c * src/rdd/dbffpt/dbffpt1.c * src/compiler/hbmain.c * src/compiler/complex.c * src/compiler/harbour.yyc * src/compiler/harbour.y * src/compiler/harbour.yyh * include/hbvmpub.h * include/hbgtcore.h * include/hbthread.h * include/hbdefs.h * include/hbmacro.h * include/hbapi.h * include/hbapiitm.h * include/hbznet.h * include/hbvm.h * include/hbcomp.h * include/hbcompdf.h * include/hbexprop.h * include/hbsocket.h * include/hbchksum.h * include/hbexprb.c * include/hbdate.h * contrib/hbct/bitnum.c * contrib/hbct/dbftools.c * contrib/hbct/files.c * contrib/hbct/disk.c * contrib/xhb/xhbfunc.c * contrib/hbcurl/hbcurl.c * contrib/hbnetio/netiocli.c * contrib/hbnetio/netiosrv.c * contrib/gtwvg/gtwvg.c * contrib/gtwvg/wvggui.c * contrib/gtwvg/wvgcore.c * contrib/rddads/ads1.c * contrib/hbwin/olecore.c * HB_LONG -> HB_MAXINT * HB_ULONG -> HB_MAXUINT --- harbour/ChangeLog | 89 ++++++++++++++++++++++++++++++ harbour/contrib/gtwvg/gtwvg.c | 22 ++++---- harbour/contrib/gtwvg/wvgcore.c | 8 +-- harbour/contrib/gtwvg/wvggui.c | 8 +-- harbour/contrib/hbct/bitnum.c | 34 ++++++------ harbour/contrib/hbct/dbftools.c | 4 +- harbour/contrib/hbct/disk.c | 2 +- harbour/contrib/hbct/files.c | 4 +- harbour/contrib/hbcurl/hbcurl.c | 2 +- harbour/contrib/hbnetio/netiocli.c | 2 +- harbour/contrib/hbnetio/netiosrv.c | 2 +- harbour/contrib/hbwin/olecore.c | 12 ++-- harbour/contrib/rddads/ads1.c | 8 +-- harbour/contrib/xhb/xhbfunc.c | 2 +- harbour/include/hbapi.h | 30 +++++----- harbour/include/hbapiitm.h | 6 +- harbour/include/hbchksum.h | 4 +- harbour/include/hbcomp.h | 6 +- harbour/include/hbcompdf.h | 4 +- harbour/include/hbdate.h | 2 +- harbour/include/hbdefs.h | 1 - harbour/include/hbexprb.c | 16 +++--- harbour/include/hbexprop.h | 6 +- harbour/include/hbgtcore.h | 6 +- harbour/include/hbmacro.h | 6 +- harbour/include/hbsocket.h | 20 +++---- harbour/include/hbthread.h | 8 +-- harbour/include/hbvm.h | 2 +- harbour/include/hbvmpub.h | 4 +- harbour/include/hbznet.h | 12 ++-- harbour/src/common/expropt1.c | 6 +- harbour/src/common/expropt2.c | 4 +- harbour/src/common/hbdate.c | 12 ++-- harbour/src/common/hbstr.c | 20 +++---- harbour/src/common/hbwince.c | 2 +- harbour/src/compiler/complex.c | 8 +-- harbour/src/compiler/harbour.y | 6 +- harbour/src/compiler/harbour.yyc | 6 +- harbour/src/compiler/harbour.yyh | 6 +- harbour/src/compiler/hbmain.c | 6 +- harbour/src/macro/macro.y | 12 ++-- harbour/src/macro/macro.yyc | 12 ++-- harbour/src/macro/macro.yyh | 10 ++-- harbour/src/macro/macrolex.c | 2 +- harbour/src/pp/ppcore.c | 16 +++--- harbour/src/rdd/dbf1.c | 36 ++++++------ harbour/src/rdd/dbffpt/dbffpt1.c | 18 +++--- harbour/src/rdd/dbfntx/dbfntx1.c | 2 +- harbour/src/rdd/dbsql.c | 4 +- harbour/src/rdd/delim1.c | 4 +- harbour/src/rdd/sdf1.c | 2 +- harbour/src/rtl/abs.c | 4 +- harbour/src/rtl/cdpapi.c | 2 +- harbour/src/rtl/cputime.c | 8 +-- harbour/src/rtl/gtpca/gtpca.c | 2 +- harbour/src/rtl/gtsln/gtsln.c | 2 +- harbour/src/rtl/gttrm/gttrm.c | 2 +- harbour/src/rtl/gtwvt/gtwvt.c | 2 +- harbour/src/rtl/hbbit.c | 30 +++++----- harbour/src/rtl/hbbyte.c | 16 +++--- harbour/src/rtl/hbcrc.c | 22 ++++---- harbour/src/rtl/hbgtcore.c | 16 +++--- harbour/src/rtl/hbhex.c | 10 ++-- harbour/src/rtl/hbrandom.c | 10 ++-- harbour/src/rtl/hbsocket.c | 58 +++++++++---------- harbour/src/rtl/hbstrfmt.c | 2 +- harbour/src/rtl/hbznet.c | 8 +-- harbour/src/rtl/idle.c | 2 +- harbour/src/rtl/itemseri.c | 4 +- harbour/src/rtl/minmax.c | 8 +-- harbour/src/rtl/seconds.c | 2 +- harbour/src/rtl/val.c | 2 +- harbour/src/vm/arrays.c | 4 +- harbour/src/vm/extend.c | 28 +++++----- harbour/src/vm/hashes.c | 4 +- harbour/src/vm/hvm.c | 68 +++++++++++------------ harbour/src/vm/itemapi.c | 24 ++++---- harbour/src/vm/macro.c | 6 +- harbour/src/vm/task.c | 14 ++--- harbour/src/vm/thread.c | 4 +- 80 files changed, 489 insertions(+), 401 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 3a48154765..4966d70713 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,95 @@ past entries belonging to author(s): Viktor Szakats. */ +2010-02-07 16:34 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) + * src/rtl/cdpapi.c + ! Fixed type when manually correcting 'unsigned char' to UCHAR + to sync with declaration. + + * contrib/gtwvg/gtwvg.c + ! Fixed wrong casts (HB_LONG instead of long) + + * src/pp/ppcore.c + * src/vm/macro.c + * src/vm/hashes.c + * src/vm/itemapi.c + * src/vm/hvm.c + * src/vm/arrays.c + * src/vm/task.c + * src/vm/thread.c + * src/vm/extend.c + * src/common/hbwince.c + * src/common/expropt1.c + * src/common/hbstr.c + * src/common/expropt2.c + * src/common/hbdate.c + * src/macro/macro.yyc + * src/macro/macro.y + * src/macro/macro.yyh + * src/macro/macrolex.c + * src/rtl/gttrm/gttrm.c + * src/rtl/hbstrfmt.c + * src/rtl/hbcrc.c + * src/rtl/minmax.c + * src/rtl/hbrandom.c + * src/rtl/hbsocket.c + * src/rtl/hbbit.c + * src/rtl/hbgtcore.c + * src/rtl/cputime.c + * src/rtl/idle.c + * src/rtl/itemseri.c + * src/rtl/gtsln/gtsln.c + * src/rtl/gtpca/gtpca.c + * src/rtl/hbznet.c + * src/rtl/hbhex.c + * src/rtl/seconds.c + * src/rtl/abs.c + * src/rtl/gtwvt/gtwvt.c + * src/rtl/hbbyte.c + * src/rtl/val.c + * src/rdd/dbfntx/dbfntx1.c + * src/rdd/dbsql.c + * src/rdd/sdf1.c + * src/rdd/delim1.c + * src/rdd/dbf1.c + * src/rdd/dbffpt/dbffpt1.c + * src/compiler/hbmain.c + * src/compiler/complex.c + * src/compiler/harbour.yyc + * src/compiler/harbour.y + * src/compiler/harbour.yyh + * include/hbvmpub.h + * include/hbgtcore.h + * include/hbthread.h + * include/hbdefs.h + * include/hbmacro.h + * include/hbapi.h + * include/hbapiitm.h + * include/hbznet.h + * include/hbvm.h + * include/hbcomp.h + * include/hbcompdf.h + * include/hbexprop.h + * include/hbsocket.h + * include/hbchksum.h + * include/hbexprb.c + * include/hbdate.h + * contrib/hbct/bitnum.c + * contrib/hbct/dbftools.c + * contrib/hbct/files.c + * contrib/hbct/disk.c + * contrib/xhb/xhbfunc.c + * contrib/hbcurl/hbcurl.c + * contrib/hbnetio/netiocli.c + * contrib/hbnetio/netiosrv.c + * contrib/gtwvg/gtwvg.c + * contrib/gtwvg/wvggui.c + * contrib/gtwvg/wvgcore.c + * contrib/rddads/ads1.c + * contrib/hbwin/olecore.c + * HB_LONG -> HB_MAXINT + * HB_ULONG -> HB_MAXUINT + 2010-02-07 16:03 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * include/hbdefs.h ! New Harbour types moved upper in the file to avoid diff --git a/harbour/contrib/gtwvg/gtwvg.c b/harbour/contrib/gtwvg/gtwvg.c index e9d8ffa894..1d3f1e9141 100644 --- a/harbour/contrib/gtwvg/gtwvg.c +++ b/harbour/contrib/gtwvg/gtwvg.c @@ -1911,9 +1911,9 @@ static LRESULT CALLBACK hb_gt_wvt_WndProc( HWND hWnd, UINT message, WPARAM wPara hb_arrayNew( pEvParams, 3 ); - hb_arraySetNL( pEvParams, 1, ( HB_LONG ) LOWORD( wParam ) ); - hb_arraySetNL( pEvParams, 2, ( HB_LONG ) HIWORD( wParam ) ); - hb_arraySetNInt( pEvParams, 3, ( HB_LONG ) ( HB_PTRDIFF ) lParam ); + hb_arraySetNL( pEvParams, 1, ( long ) LOWORD( wParam ) ); + hb_arraySetNL( pEvParams, 2, ( long ) HIWORD( wParam ) ); + hb_arraySetNInt( pEvParams, 3, ( HB_MAXINT ) ( HB_PTRDIFF ) lParam ); hb_gt_wvt_FireEvent( pWVT, HB_GTE_HSCROLL, pEvParams ); return 0; @@ -1924,9 +1924,9 @@ static LRESULT CALLBACK hb_gt_wvt_WndProc( HWND hWnd, UINT message, WPARAM wPara hb_arrayNew( pEvParams, 3 ); - hb_arraySetNL( pEvParams, 1, ( HB_LONG ) LOWORD( wParam ) ); - hb_arraySetNL( pEvParams, 2, ( HB_LONG ) HIWORD( wParam ) ); - hb_arraySetNInt( pEvParams, 3, ( HB_LONG ) ( HB_PTRDIFF ) lParam ); + hb_arraySetNL( pEvParams, 1, ( long ) LOWORD( wParam ) ); + hb_arraySetNL( pEvParams, 2, ( long ) HIWORD( wParam ) ); + hb_arraySetNInt( pEvParams, 3, ( HB_MAXINT ) ( HB_PTRDIFF ) lParam ); hb_gt_wvt_FireEvent( pWVT, HB_GTE_VSCROLL, pEvParams ); return 0; @@ -1964,7 +1964,7 @@ static LRESULT CALLBACK hb_gt_wvt_WndProc( HWND hWnd, UINT message, WPARAM wPara } { /* To evoke if that portion is covered by GUI control */ PHB_ITEM pEvParams = hb_itemNew( NULL ); - hb_itemPutNInt( pEvParams, ( HB_LONG ) ( HB_PTRDIFF ) hWnd ); + hb_itemPutNInt( pEvParams, ( HB_MAXINT ) ( HB_PTRDIFF ) hWnd ); hb_gt_wvt_FireEvent( pWVT, HB_GTE_PAINT, pEvParams ); } return 0; @@ -1988,7 +1988,7 @@ static LRESULT CALLBACK hb_gt_wvt_WndProc( HWND hWnd, UINT message, WPARAM wPara { hb_vmPushDynSym( pWVT->pSymWVT_SETFOCUS ); hb_vmPushNil(); - hb_vmPushNumInt( ( HB_LONG ) ( HB_PTRDIFF ) hWnd ); + hb_vmPushNumInt( ( HB_MAXINT ) ( HB_PTRDIFF ) hWnd ); hb_vmDo( 1 ); hb_vmRequestRestore(); } @@ -2020,7 +2020,7 @@ static LRESULT CALLBACK hb_gt_wvt_WndProc( HWND hWnd, UINT message, WPARAM wPara { hb_vmPushDynSym( pWVT->pSymWVT_KILLFOCUS ); hb_vmPushNil(); - hb_vmPushNumInt( ( HB_LONG ) ( HB_PTRDIFF ) hWnd ); + hb_vmPushNumInt( ( HB_MAXINT ) ( HB_PTRDIFF ) hWnd ); hb_vmDo( 1 ); hb_vmRequestRestore(); } @@ -3166,7 +3166,7 @@ static HB_BOOL hb_gt_wvt_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo ) if( hb_itemGetNInt( pInfo->pNewVal ) != 0 ) { HICON hIcon = LoadIcon( pWVT->hInstance, - MAKEINTRESOURCE( ( HB_LONG ) + MAKEINTRESOURCE( ( HB_MAXINT ) hb_itemGetNInt( pInfo->pNewVal ) ) ); if( hIcon ) { @@ -3567,7 +3567,7 @@ static HB_BOOL hb_gt_wvt_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo ) else if( iIconType == 2 ) { hIcon = LoadIcon( pWVT->hInstance, - MAKEINTRESOURCE( ( HB_LONG ) + MAKEINTRESOURCE( ( HB_MAXINT ) hb_arrayGetNInt( pInfo->pNewVal2, 3 ) ) ); } tnid.cbSize = sizeof( NOTIFYICONDATA ) ; diff --git a/harbour/contrib/gtwvg/wvgcore.c b/harbour/contrib/gtwvg/wvgcore.c index d89502c63a..2dcda2bcf2 100644 --- a/harbour/contrib/gtwvg/wvgcore.c +++ b/harbour/contrib/gtwvg/wvgcore.c @@ -390,7 +390,7 @@ BOOL CALLBACK hb_wvt_gtDlgProcMLess( HWND hDlg, UINT message, WPARAM wParam, LPA { hb_vmPushDynSym( ( PHB_DYNS ) pFunc ); hb_vmPushNil(); - hb_vmPushNumInt( ( HB_LONG ) ( HB_PTRDIFF ) hDlg ); + hb_vmPushNumInt( ( HB_MAXINT ) ( HB_PTRDIFF ) hDlg ); hb_vmPushNumInt( message ); hb_vmPushNumInt( wParam ); hb_vmPushNumInt( lParam ); @@ -408,7 +408,7 @@ BOOL CALLBACK hb_wvt_gtDlgProcMLess( HWND hDlg, UINT message, WPARAM wParam, LPA { hb_vmPushEvalSym(); hb_vmPush( _s->pFunc[ iIndex ] ); - hb_vmPushNumInt( ( HB_LONG ) ( HB_PTRDIFF ) hDlg ); + hb_vmPushNumInt( ( HB_MAXINT ) ( HB_PTRDIFF ) hDlg ); hb_vmPushNumInt( message ); hb_vmPushNumInt( wParam ); hb_vmPushNumInt( lParam ); @@ -507,7 +507,7 @@ BOOL CALLBACK hb_wvt_gtDlgProcModal( HWND hDlg, UINT message, WPARAM wParam, LPA { hb_vmPushDynSym( ( PHB_DYNS ) pFunc ); hb_vmPushNil(); - hb_vmPushNumInt( ( HB_LONG ) ( HB_PTRDIFF ) hDlg ); + hb_vmPushNumInt( ( HB_MAXINT ) ( HB_PTRDIFF ) hDlg ); hb_vmPushNumInt( message ); hb_vmPushNumInt( wParam ); hb_vmPushNumInt( lParam ); @@ -525,7 +525,7 @@ BOOL CALLBACK hb_wvt_gtDlgProcModal( HWND hDlg, UINT message, WPARAM wParam, LPA { hb_vmPushEvalSym(); hb_vmPush( pFunc ); - hb_vmPushNumInt( ( HB_LONG ) ( HB_PTRDIFF ) hDlg ); + hb_vmPushNumInt( ( HB_MAXINT ) ( HB_PTRDIFF ) hDlg ); hb_vmPushNumInt( message ); hb_vmPushNumInt( wParam ); hb_vmPushNumInt( lParam ); diff --git a/harbour/contrib/gtwvg/wvggui.c b/harbour/contrib/gtwvg/wvggui.c index 9d7613bc65..c371296287 100644 --- a/harbour/contrib/gtwvg/wvggui.c +++ b/harbour/contrib/gtwvg/wvggui.c @@ -1166,7 +1166,7 @@ static LRESULT CALLBACK hb_gt_wvt_WndProc( HWND hWnd, UINT message, WPARAM wPara hb_arraySetNL( pEvParams, 1, ( long ) LOWORD( wParam ) ); hb_arraySetNL( pEvParams, 2, ( long ) HIWORD( wParam ) ); - hb_arraySetNInt( pEvParams, 3, ( HB_LONG ) ( HB_PTRDIFF ) lParam ); + hb_arraySetNInt( pEvParams, 3, ( HB_MAXINT ) ( HB_PTRDIFF ) lParam ); hb_gt_wvt_FireEvent( pWVT, HB_GTE_HSCROLL, pEvParams ); return 0; @@ -1179,7 +1179,7 @@ static LRESULT CALLBACK hb_gt_wvt_WndProc( HWND hWnd, UINT message, WPARAM wPara hb_arraySetNL( pEvParams, 1, ( long ) LOWORD( wParam ) ); hb_arraySetNL( pEvParams, 2, ( long ) HIWORD( wParam ) ); - hb_arraySetNInt( pEvParams, 3, ( HB_LONG ) ( HB_PTRDIFF ) lParam ); + hb_arraySetNInt( pEvParams, 3, ( HB_MAXINT ) ( HB_PTRDIFF ) lParam ); hb_gt_wvt_FireEvent( pWVT, HB_GTE_VSCROLL, pEvParams ); return 0; @@ -1642,7 +1642,7 @@ static HB_BOOL hb_gt_wvt_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo ) pWVT->bIconToFree = HB_FALSE; pWVT->hIcon = LoadIcon( pWVT->hInstance, - MAKEINTRESOURCE( ( HB_LONG ) + MAKEINTRESOURCE( ( HB_MAXINT ) hb_itemGetNInt( pInfo->pNewVal ) ) ); if( pWVT->hWnd ) @@ -1961,7 +1961,7 @@ static HB_BOOL hb_gt_wvt_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo ) else if( iIconType == 2 ) { hIcon = LoadIcon( pWVT->hInstance, - MAKEINTRESOURCE( ( HB_LONG ) + MAKEINTRESOURCE( ( HB_MAXINT ) hb_arrayGetNInt( pInfo->pNewVal2, 3 ) ) ); } tnid.cbSize = sizeof( NOTIFYICONDATA ) ; diff --git a/harbour/contrib/hbct/bitnum.c b/harbour/contrib/hbct/bitnum.c index 8ab9d1fb82..7cc7774e74 100644 --- a/harbour/contrib/hbct/bitnum.c +++ b/harbour/contrib/hbct/bitnum.c @@ -56,7 +56,7 @@ #include "hbapi.h" -static HB_BOOL __numParam( int iParam, HB_LONG * plNum ) +static HB_BOOL __numParam( int iParam, HB_MAXINT * plNum ) { const char *szHex = hb_parc( iParam ); @@ -96,7 +96,7 @@ static HB_BOOL __numParam( int iParam, HB_LONG * plNum ) HB_FUNC( NUMAND ) { int iPCount = hb_pcount(), i = 1; - HB_LONG lValue = -1, lNext = 0; + HB_MAXINT lValue = -1, lNext = 0; if( iPCount && __numParam( 1, &lValue ) ) { @@ -112,7 +112,7 @@ HB_FUNC( NUMAND ) HB_FUNC( NUMOR ) { int iPCount = hb_pcount(), i = 1; - HB_LONG lValue = -1, lNext = 0; + HB_MAXINT lValue = -1, lNext = 0; if( iPCount && __numParam( 1, &lValue ) ) { @@ -128,7 +128,7 @@ HB_FUNC( NUMOR ) HB_FUNC( NUMXOR ) { int iPCount = hb_pcount(), i = 1; - HB_LONG lValue = -1, lNext = 0; + HB_MAXINT lValue = -1, lNext = 0; if( iPCount && __numParam( 1, &lValue ) ) { @@ -143,7 +143,7 @@ HB_FUNC( NUMXOR ) HB_FUNC( NUMNOT ) { - HB_LONG lValue; + HB_MAXINT lValue; if( __numParam( 1, &lValue ) ) lValue = ( ~lValue ) & 0xffff; @@ -153,7 +153,7 @@ HB_FUNC( NUMNOT ) HB_FUNC( NUMLOW ) { - HB_LONG lValue; + HB_MAXINT lValue; if( __numParam( 1, &lValue ) ) lValue &= 0xff; @@ -163,7 +163,7 @@ HB_FUNC( NUMLOW ) HB_FUNC( NUMHIGH ) { - HB_LONG lValue; + HB_MAXINT lValue; if( __numParam( 1, &lValue ) /* && lValue == lValue & 0xffff */ ) lValue = ( lValue >> 8 ) & 0xff; @@ -173,7 +173,7 @@ HB_FUNC( NUMHIGH ) HB_FUNC( NUMROL ) { - HB_LONG lValue, lShift; + HB_MAXINT lValue, lShift; if( __numParam( 1, &lValue ) && lValue == ( lValue & 0xffff ) && __numParam( 2, &lShift ) && lShift == ( lShift & 0xffff ) ) @@ -199,7 +199,7 @@ HB_FUNC( NUMROL ) HB_FUNC( NUMMIRR ) { - HB_LONG lValue; + HB_MAXINT lValue; if( __numParam( 1, &lValue ) && lValue == ( lValue & 0xffff ) ) { @@ -226,7 +226,7 @@ HB_FUNC( NUMMIRR ) HB_FUNC( CLEARBIT ) { int iPCount = hb_pcount(), iBit, i = 1; - HB_LONG lValue; + HB_MAXINT lValue; if( __numParam( 1, &lValue ) ) { @@ -235,7 +235,7 @@ HB_FUNC( CLEARBIT ) iBit = hb_parni( ++i ); if( iBit < 1 || iBit > 64 ) break; - lValue &= ~( ( ( HB_LONG ) 1 ) << ( iBit - 1 ) ); + lValue &= ~( ( ( HB_MAXINT ) 1 ) << ( iBit - 1 ) ); } if( iPCount ) @@ -248,7 +248,7 @@ HB_FUNC( CLEARBIT ) HB_FUNC( SETBIT ) { int iPCount = hb_pcount(), iBit, i = 1; - HB_LONG lValue; + HB_MAXINT lValue; if( __numParam( 1, &lValue ) ) { @@ -257,7 +257,7 @@ HB_FUNC( SETBIT ) iBit = hb_parni( ++i ); if( iBit < 1 || iBit > 64 ) break; - lValue |= ( ( HB_LONG ) 1 ) << ( iBit - 1 ); + lValue |= ( ( HB_MAXINT ) 1 ) << ( iBit - 1 ); } if( iPCount ) @@ -269,7 +269,7 @@ HB_FUNC( SETBIT ) HB_FUNC( ISBIT ) { - HB_LONG lValue; + HB_MAXINT lValue; if( __numParam( 1, &lValue ) ) { @@ -277,7 +277,7 @@ HB_FUNC( ISBIT ) if( iBit ) --iBit; - lValue &= ( ( HB_LONG ) 1 ) << iBit; + lValue &= ( ( HB_MAXINT ) 1 ) << iBit; } else lValue = 0; @@ -287,7 +287,7 @@ HB_FUNC( ISBIT ) HB_FUNC( INTNEG ) { - HB_LONG lValue; + HB_MAXINT lValue; if( __numParam( 1, &lValue ) ) { @@ -304,7 +304,7 @@ HB_FUNC( INTNEG ) HB_FUNC( INTPOS ) { - HB_LONG lValue; + HB_MAXINT lValue; if( __numParam( 1, &lValue ) ) { diff --git a/harbour/contrib/hbct/dbftools.c b/harbour/contrib/hbct/dbftools.c index 6f5a0b3a1c..d4069cf5fd 100644 --- a/harbour/contrib/hbct/dbftools.c +++ b/harbour/contrib/hbct/dbftools.c @@ -77,7 +77,7 @@ HB_FUNC( FIELDNUM ) HB_FUNC( DBFSIZE ) { - HB_LONG llSize = 0; + HB_MAXINT llSize = 0; AREAP pArea; if( ( pArea = ( AREAP ) hb_rddGetCurrentWorkAreaPointer() ) != NULL ) @@ -93,7 +93,7 @@ HB_FUNC( DBFSIZE ) ulRecSize = hb_itemGetNL( pSize ); if( SELF_RECCOUNT( pArea, &ulRecCount ) == HB_SUCCESS ) { - llSize += ( HB_LONG ) ulRecCount *ulRecSize; + llSize += ( HB_MAXINT ) ulRecCount * ulRecSize; } } } diff --git a/harbour/contrib/hbct/disk.c b/harbour/contrib/hbct/disk.c index 51bcca08cb..998d75cfa6 100644 --- a/harbour/contrib/hbct/disk.c +++ b/harbour/contrib/hbct/disk.c @@ -83,7 +83,7 @@ HB_FUNC( DIRMAKE ) if( hb_fsMkDir( hb_parcx( 1 ) ) ) hb_retni( 0 ); else - hb_retnint( - ( HB_LONG ) hb_fsOsError() ); + hb_retnint( - ( HB_MAXINT ) hb_fsOsError() ); } HB_FUNC( DIRNAME ) diff --git a/harbour/contrib/hbct/files.c b/harbour/contrib/hbct/files.c index 7deaec07ce..eb11d6e16f 100644 --- a/harbour/contrib/hbct/files.c +++ b/harbour/contrib/hbct/files.c @@ -293,7 +293,7 @@ HB_FUNC( FILEDELETE ) HB_FUNC( FILEMOVE ) { hb_retnint( hb_fsRename( hb_parcx( 1 ), - hb_parcx( 2 ) ) ? 0 : - ( HB_LONG ) hb_fsOsError() ); + hb_parcx( 2 ) ) ? 0 : - ( HB_MAXINT ) hb_fsOsError() ); } @@ -305,7 +305,7 @@ HB_FUNC( RENAMEFILE ) HB_FUNC( DELETEFILE ) { - hb_retnint( hb_fsDelete( hb_parcx( 1 ) ) ? 0 : - ( HB_LONG ) hb_fsOsError() ); + hb_retnint( hb_fsDelete( hb_parcx( 1 ) ) ? 0 : - ( HB_MAXINT ) hb_fsOsError() ); } diff --git a/harbour/contrib/hbcurl/hbcurl.c b/harbour/contrib/hbcurl/hbcurl.c index e509829ad4..5410f7f449 100644 --- a/harbour/contrib/hbcurl/hbcurl.c +++ b/harbour/contrib/hbcurl/hbcurl.c @@ -1865,7 +1865,7 @@ HB_FUNC( CURL_EASY_STRERROR ) HB_FUNC( CURL_GETDATE ) { if( HB_ISCHAR( 1 ) ) - hb_retnint( ( HB_LONG ) curl_getdate( hb_parc( 1 ), NULL ) ); + hb_retnint( ( HB_MAXINT ) curl_getdate( hb_parc( 1 ), NULL ) ); else hb_errRT_BASE( EG_ARG, 2010, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } diff --git a/harbour/contrib/hbnetio/netiocli.c b/harbour/contrib/hbnetio/netiocli.c index bd8967ef71..740f36832f 100644 --- a/harbour/contrib/hbnetio/netiocli.c +++ b/harbour/contrib/hbnetio/netiocli.c @@ -473,7 +473,7 @@ static const char * s_fileDecode( const char * pszFilename, if( iLen > 0 ) { int iOverflow; - HB_LONG llPort; + HB_MAXINT llPort; port_buf[ iLen ] = '\0'; llPort = hb_strValInt( port_buf, &iOverflow ); diff --git a/harbour/contrib/hbnetio/netiosrv.c b/harbour/contrib/hbnetio/netiosrv.c index fefa87b05f..a663695f1e 100644 --- a/harbour/contrib/hbnetio/netiosrv.c +++ b/harbour/contrib/hbnetio/netiosrv.c @@ -565,7 +565,7 @@ HB_FUNC( NETIO_ACCEPT ) if( lsd && lsd->sd != HB_NO_SOCKET && !lsd->stop ) { - HB_LONG timeout = HB_ISNUM( 2 ) ? hb_parnint( 2 ) : -1; + HB_MAXINT timeout = HB_ISNUM( 2 ) ? hb_parnint( 2 ) : -1; HB_SOCKET connsd; int iLevel, iStrategy, keylen = ( int ) hb_parclen( 3 ); diff --git a/harbour/contrib/hbwin/olecore.c b/harbour/contrib/hbwin/olecore.c index 758d982b67..85712fcda9 100644 --- a/harbour/contrib/hbwin/olecore.c +++ b/harbour/contrib/hbwin/olecore.c @@ -692,7 +692,7 @@ void hb_oleVariantToItem( PHB_ITEM pItem, VARIANT* pVariant ) case VT_I8: #if HB_LONG_MAX == INT32_MAX || defined( HB_LONG_LONG_OFF ) - hb_itemPutNInt( pItem, ( HB_LONG ) pVariant->n1.n2.n3.lVal ); + hb_itemPutNInt( pItem, ( HB_MAXINT ) pVariant->n1.n2.n3.lVal ); #elif defined( HB_OLE_NO_LL ) /* workaround for wrong OLE variant structure definition */ hb_itemPutNInt( pItem, * ( ( HB_LONGLONG * ) &pVariant->n1.n2.n3.lVal ) ); @@ -703,7 +703,7 @@ void hb_oleVariantToItem( PHB_ITEM pItem, VARIANT* pVariant ) case VT_I8 | VT_BYREF: #if HB_LONG_MAX == INT32_MAX || defined( HB_LONG_LONG_OFF ) - hb_itemPutNInt( pItem, ( HB_LONG ) *pVariant->n1.n2.n3.plVal ); + hb_itemPutNInt( pItem, ( HB_MAXINT ) *pVariant->n1.n2.n3.plVal ); #elif defined( HB_OLE_NO_LLREF ) /* workaround for wrong OLE variant structure definition */ hb_itemPutNInt( pItem, * ( HB_LONGLONG * ) pVariant->n1.n2.n3.pdblVal ); @@ -739,24 +739,24 @@ 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 ) - hb_itemPutNInt( pItem, ( HB_LONG ) pVariant->n1.n2.n3.ulVal ); + hb_itemPutNInt( pItem, ( HB_MAXINT ) pVariant->n1.n2.n3.ulVal ); #elif defined( HB_OLE_NO_LL ) /* workaround for wrong OLE variant structure definition */ hb_itemPutNInt( pItem, * ( ( HB_LONGLONG * ) &pVariant->n1.n2.n3.ulVal ) ); #else - hb_itemPutNInt( pItem, ( HB_LONG ) pVariant->n1.n2.n3.ullVal ); + hb_itemPutNInt( pItem, ( HB_MAXINT ) pVariant->n1.n2.n3.ullVal ); #endif break; 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 ) - hb_itemPutNInt( pItem, ( HB_LONG ) *pVariant->n1.n2.n3.pulVal ); + hb_itemPutNInt( pItem, ( HB_MAXINT ) *pVariant->n1.n2.n3.pulVal ); #elif defined( HB_OLE_NO_LLREF ) /* workaround for wrong OLE variant structure definition */ hb_itemPutNInt( pItem, * ( HB_LONGLONG * ) pVariant->n1.n2.n3.pdblVal ); #else - hb_itemPutNInt( pItem, ( HB_LONG ) *pVariant->n1.n2.n3.pullVal ); + hb_itemPutNInt( pItem, ( HB_MAXINT ) *pVariant->n1.n2.n3.pullVal ); #endif break; diff --git a/harbour/contrib/rddads/ads1.c b/harbour/contrib/rddads/ads1.c index 67f7341eb5..2dc7aed278 100644 --- a/harbour/contrib/rddads/ads1.c +++ b/harbour/contrib/rddads/ads1.c @@ -443,7 +443,7 @@ static void adsGetKeyItem( ADSAREAP pArea, PHB_ITEM pItem, int iKeyType, if( pArea->iFileType == ADS_NTX ) { int iLen = iKeyLen, iDec; - HB_LONG lValue; + HB_MAXINT lValue; if( *pKeyBuf == '0' - 4 ) /* negative number */ { @@ -2164,7 +2164,7 @@ static HB_ERRCODE adsGetValue( ADSAREAP pArea, USHORT uiIndex, PHB_ITEM pItem ) qVal = 0; pArea->area.fEof = HB_TRUE; } - hb_itemPutNIntLen( pItem, ( HB_LONG ) qVal, 20 ); + hb_itemPutNIntLen( pItem, ( HB_MAXINT ) qVal, 20 ); #else DOUBLE dVal = 0; u32RetVal = AdsGetDouble( pArea->hTable, ADSFIELD( uiIndex ), &dVal ); @@ -2203,7 +2203,7 @@ static HB_ERRCODE adsGetValue( ADSAREAP pArea, USHORT uiIndex, PHB_ITEM pItem ) qVal = 0; pArea->area.fEof = HB_TRUE; } - hb_itemPutNIntLen( pItem, ( HB_LONG ) qVal, 10 ); + hb_itemPutNIntLen( pItem, ( HB_MAXINT ) qVal, 10 ); break; } case HB_FT_ROWVER: @@ -2215,7 +2215,7 @@ static HB_ERRCODE adsGetValue( ADSAREAP pArea, USHORT uiIndex, PHB_ITEM pItem ) qVal = 0; pArea->area.fEof = HB_TRUE; } - hb_itemPutNIntLen( pItem, ( HB_LONG ) qVal, 20 ); + hb_itemPutNIntLen( pItem, ( HB_MAXINT ) qVal, 20 ); break; } #else diff --git a/harbour/contrib/xhb/xhbfunc.c b/harbour/contrib/xhb/xhbfunc.c index 0e0c2c2015..6e73d996d3 100644 --- a/harbour/contrib/xhb/xhbfunc.c +++ b/harbour/contrib/xhb/xhbfunc.c @@ -158,7 +158,7 @@ HB_FUNC( XHB__KEYBOARD ) HB_FUNC( HB_CREATELEN8 ) { char buffer[ 8 ]; - HB_LONG llValue; + HB_MAXINT llValue; if( HB_ISNUM( 1 ) ) { diff --git a/harbour/include/hbapi.h b/harbour/include/hbapi.h index 1063410de0..c310b72456 100644 --- a/harbour/include/hbapi.h +++ b/harbour/include/hbapi.h @@ -328,7 +328,7 @@ struct hb_struInteger struct hb_struLong { - HB_LONG value; + HB_MAXINT value; USHORT length; }; @@ -643,7 +643,7 @@ extern HB_EXPORT int hb_parni( int iParam ); /* retrieve a numeric para extern HB_EXPORT int hb_parnidef( int iParam, int iDefValue ); /* retrieve a numeric parameter as a integer, return default value if parameter isn't numeric */ extern HB_EXPORT long hb_parnl( int iParam ); /* retrieve a numeric parameter as a long */ extern HB_EXPORT long hb_parnldef( int iParam, long lDefValue ); /* retrieve a numeric parameter as a long, return default value if parameter isn't numeric */ -extern HB_EXPORT HB_LONG hb_parnint( int iParam ); /* retrieve a numeric parameter as a HB_LONG */ +extern HB_EXPORT HB_MAXINT hb_parnint( int iParam ); /* retrieve a numeric parameter as a HB_MAXINT */ extern HB_EXPORT void * hb_parptr( int iParam ); /* retrieve a parameter as a pointer */ extern HB_EXPORT void * hb_parptrGC( const HB_GC_FUNCS * pFuncs, int iParam ); /* retrieve a parameter as a pointer if it's a pointer to GC allocated block */ #ifndef HB_LONG_LONG_OFF @@ -663,7 +663,7 @@ extern HB_EXPORT int hb_parvl( int iParam, ... ); /* retrieve a logical extern HB_EXPORT double hb_parvnd( int iParam, ... ); /* retrieve a numeric parameter as a double */ extern HB_EXPORT int hb_parvni( int iParam, ... ); /* retrieve a numeric parameter as a integer */ extern HB_EXPORT long hb_parvnl( int iParam, ... ); /* retrieve a numeric parameter as a long */ -extern HB_EXPORT HB_LONG hb_parvnint( int iParam, ... ); /* retrieve a numeric parameter as a HB_LONG */ +extern HB_EXPORT HB_MAXINT hb_parvnint( int iParam, ... ); /* retrieve a numeric parameter as a HB_MAXINT */ extern HB_EXPORT void * hb_parvptr( int iParam, ... ); /* retrieve a parameter as a pointer */ extern HB_EXPORT void * hb_parvptrGC( const HB_GC_FUNCS * pFuncs, int iParam, ... ); /* retrieve a parameter as a pointer if it's a pointer to GC allocated block */ #ifndef HB_LONG_LONG_OFF @@ -687,12 +687,12 @@ extern HB_EXPORT void hb_retl( int iTrueFalse ); /* returns a logical integer extern HB_EXPORT void hb_retnd( double dNumber ); /* returns a double */ extern HB_EXPORT void hb_retni( int iNumber ); /* returns a integer number */ extern HB_EXPORT void hb_retnl( long lNumber );/* returns a long number */ -extern HB_EXPORT void hb_retnint( HB_LONG lNumber );/* returns a long number */ +extern HB_EXPORT void hb_retnint( HB_MAXINT lNumber );/* returns a long number */ extern HB_EXPORT void hb_retnlen( double dNumber, int iWidth, int iDec ); /* returns a double, with specific width and decimals */ extern HB_EXPORT void hb_retndlen( double dNumber, int iWidth, int iDec ); /* returns a double, with specific width and decimals */ extern HB_EXPORT void hb_retnilen( int iNumber, int iWidth ); /* returns a integer number, with specific width */ extern HB_EXPORT void hb_retnllen( long lNumber, int iWidth ); /* returns a long number, with specific width */ -extern HB_EXPORT void hb_retnintlen( HB_LONG lNumber, int iWidth ); /* returns a long long number, with specific width */ +extern HB_EXPORT void hb_retnintlen( HB_MAXINT lNumber, int iWidth ); /* returns a long long number, with specific width */ extern HB_EXPORT void hb_reta( HB_SIZE ulLen ); /* returns an array with a specific length */ extern HB_EXPORT void hb_retptr( void * ptr ); /* returns a pointer */ extern HB_EXPORT void hb_retptrGC( void * ptr ); /* returns a pointer to an allocated memory, collected by GC */ @@ -761,7 +761,7 @@ extern HB_EXPORT int hb_storl( int iLogical, int iParam ); /* stores a logica extern HB_EXPORT int hb_storni( int iValue, int iParam ); /* stores an integer on a variable by reference */ extern HB_EXPORT int hb_stornl( long lValue, int iParam ); /* stores a long on a variable by reference */ extern HB_EXPORT int hb_stornd( double dValue, int iParam ); /* stores a double on a variable by reference */ -extern HB_EXPORT int hb_stornint( HB_LONG lValue, int iParam ); /* stores a HB_LONG on a variable by reference */ +extern HB_EXPORT int hb_stornint( HB_MAXINT lValue, int iParam ); /* stores a HB_MAXINT on a variable by reference */ extern HB_EXPORT int hb_storptr( void * pointer, int iParam ); /* stores a pointer on a variable by reference */ extern HB_EXPORT int hb_storptrGC( void * pointer, int iParam ); /* stores a pointer to GC block on a variable by reference */ #ifndef HB_LONG_LONG_OFF @@ -779,7 +779,7 @@ extern HB_EXPORT int hb_storvl( int iLogical, int iParam, ... ); /* stores a extern HB_EXPORT int hb_storvni( int iValue, int iParam, ... ); /* stores an integer on a variable by reference */ extern HB_EXPORT int hb_storvnl( long lValue, int iParam, ... ); /* stores a long on a variable by reference */ extern HB_EXPORT int hb_storvnd( double dValue, int iParam, ... ); /* stores a double on a variable by reference */ -extern HB_EXPORT int hb_storvnint( HB_LONG lValue, int iParam, ... ); /* stores a HB_LONG on a variable by reference */ +extern HB_EXPORT int hb_storvnint( HB_MAXINT lValue, int iParam, ... ); /* stores a HB_MAXINT on a variable by reference */ extern HB_EXPORT int hb_storvptr( void * pointer, int iParam, ... ); /* stores a pointer on a variable by reference */ extern HB_EXPORT int hb_storvptrGC( void * pointer, int iParam, ... ); /* stores a pointer to GC block on a variable by reference */ #ifndef HB_LONG_LONG_OFF @@ -811,7 +811,7 @@ extern HB_EXPORT PHB_SYMB hb_arrayGetSymbol( PHB_ITEM pArray, HB_SIZE ulInde extern HB_EXPORT HB_BOOL hb_arrayGetL( PHB_ITEM pArray, HB_SIZE ulIndex ); /* retrieves the logical value contained on an array element */ extern HB_EXPORT int hb_arrayGetNI( PHB_ITEM pArray, HB_SIZE ulIndex ); /* retrieves the int value contained on an array element */ extern HB_EXPORT long hb_arrayGetNL( PHB_ITEM pArray, HB_SIZE ulIndex ); /* retrieves the long numeric value contained on an array element */ -extern HB_EXPORT HB_LONG hb_arrayGetNInt( PHB_ITEM pArray, HB_SIZE ulIndex ); /* retrieves the HB_LONG value contained on an array element */ +extern HB_EXPORT HB_MAXINT hb_arrayGetNInt( PHB_ITEM pArray, HB_SIZE ulIndex ); /* retrieves the HB_MAXINT value contained on an array element */ extern HB_EXPORT double hb_arrayGetND( PHB_ITEM pArray, HB_SIZE ulIndex ); /* retrieves the double value contained on an array element */ extern HB_EXPORT char * hb_arrayGetDS( PHB_ITEM pArray, HB_SIZE ulIndex, char * szDate ); /* retrieves the date value contained in an array element */ extern HB_EXPORT long hb_arrayGetDL( PHB_ITEM pArray, HB_SIZE ulIndex ); /* retrieves the date value contained in an array element, as a long integer */ @@ -830,7 +830,7 @@ extern HB_EXPORT HB_BOOL hb_arraySetNL( PHB_ITEM pArray, HB_SIZE ulIndex, l #ifndef HB_LONG_LONG_OFF extern HB_EXPORT HB_BOOL hb_arraySetNLL( PHB_ITEM pArray, HB_SIZE ulIndex, HB_LONGLONG llNumber ); #endif -extern HB_EXPORT HB_BOOL hb_arraySetNInt( PHB_ITEM pArray, HB_SIZE ulIndex, HB_LONG lNumber ); +extern HB_EXPORT HB_BOOL hb_arraySetNInt( PHB_ITEM pArray, HB_SIZE ulIndex, HB_MAXINT lNumber ); extern HB_EXPORT HB_BOOL hb_arraySetND( PHB_ITEM pArray, HB_SIZE ulIndex, double dNumber ); extern HB_EXPORT HB_BOOL hb_arraySetC( PHB_ITEM pArray, HB_SIZE ulIndex, const char * szText ); extern HB_EXPORT HB_BOOL hb_arraySetCL( PHB_ITEM pArray, HB_SIZE ulIndex, const char * szText, HB_SIZE ulLen ); @@ -930,10 +930,10 @@ extern HB_EXPORT HB_SIZE hb_strlentrim( const char * pszText ); /* like strlen extern HB_EXPORT HB_SIZE hb_strnlen( const char * pszText, HB_SIZE ulLen ); /* like strlen() but result is limited to ulLen */ extern HB_EXPORT char * hb_xstrcat( char * dest, const char * src, ... ); /* Concatenates multiple strings into a single result */ extern HB_EXPORT char * hb_xstrcpy( char * szDest, const char * szSrc, ... ); /* Concatenates multiple strings into a single result */ -extern HB_EXPORT HB_BOOL hb_compStrToNum( const char * szNum, HB_SIZE ulLen, HB_LONG * plVal, double * pdVal, int * piDec, int * piWidth ); /* converts string to number, sets iDec, iWidth and returns HB_TRUE if results is double, used by compiler */ -extern HB_EXPORT HB_BOOL hb_valStrnToNum( const char * szNum, HB_SIZE ulLen, HB_LONG * plVal, double * pdVal, int * piDec, int * piWidth ); /* converts string to number, sets iDec, iWidth and returns HB_TRUE if results is double, used by VAL() */ -extern HB_EXPORT HB_BOOL hb_strToNum( const char * szNum, HB_LONG * plVal, double * pdVal ); /* converts string to number, returns HB_TRUE if results is double */ -extern HB_EXPORT HB_BOOL hb_strnToNum( const char * szNum, HB_SIZE ulLen, HB_LONG * plVal, double * pdVal ); /* converts string to number, returns HB_TRUE if results is double */ +extern HB_EXPORT HB_BOOL hb_compStrToNum( const char * szNum, HB_SIZE ulLen, HB_MAXINT * plVal, double * pdVal, int * piDec, int * piWidth ); /* converts string to number, sets iDec, iWidth and returns HB_TRUE if results is double, used by compiler */ +extern HB_EXPORT HB_BOOL hb_valStrnToNum( const char * szNum, HB_SIZE ulLen, HB_MAXINT * plVal, double * pdVal, int * piDec, int * piWidth ); /* converts string to number, sets iDec, iWidth and returns HB_TRUE if results is double, used by VAL() */ +extern HB_EXPORT HB_BOOL hb_strToNum( const char * szNum, HB_MAXINT * plVal, double * pdVal ); /* converts string to number, returns HB_TRUE if results is double */ +extern HB_EXPORT HB_BOOL hb_strnToNum( const char * szNum, HB_SIZE ulLen, HB_MAXINT * plVal, double * pdVal ); /* converts string to number, returns HB_TRUE if results is double */ extern HB_EXPORT int hb_snprintf( char * buffer, size_t bufsize, const char * format, ... ) HB_PRINTF_FORMAT( 3, 4 ); /* snprintf() equivalent */ extern HB_EXPORT int hb_vsnprintf( char * buffer, size_t bufsize, const char * format, va_list ap ); /* vsnprintf() equivalent */ extern HB_EXPORT int hb_printf_params( const char * format ); @@ -964,9 +964,9 @@ extern HB_EXPORT double hb_strVal( const char * szText, HB_SIZE ulLen ); /* r extern HB_EXPORT const char * hb_strLTrim( const char * szText, HB_SIZE * ulLen ); /* return a pointer to the first non-white space character */ extern HB_EXPORT HB_SIZE hb_strRTrimLen( const char * szText, HB_SIZE ulLen, HB_BOOL bAnySpace ); /* return length of a string, ignoring trailing white space (or true spaces) */ extern HB_EXPORT double hb_strVal( const char * szText, HB_SIZE ulLen ); -extern HB_EXPORT HB_LONG hb_strValInt( const char * szText, int * iOverflow ); +extern HB_EXPORT HB_MAXINT hb_strValInt( const char * szText, int * iOverflow ); extern HB_EXPORT char * hb_strRemEscSeq( char * szText, HB_SIZE * ulLen ); /* remove C ESC sequences and converts them to Clipper chars */ -extern HB_EXPORT char * hb_numToStr( char * szBuf, HB_SIZE ulSize, HB_LONG lNumber ); +extern HB_EXPORT char * hb_numToStr( char * szBuf, HB_SIZE ulSize, HB_MAXINT lNumber ); extern HB_EXPORT double hb_numRound( double dResult, int iDec ); /* round a number to a specific number of digits */ extern HB_EXPORT double hb_numInt( double dNum ); /* take the integer part of the number */ extern HB_EXPORT double hb_random_num( void ); diff --git a/harbour/include/hbapiitm.h b/harbour/include/hbapiitm.h index c759108f7b..7c7089ec82 100644 --- a/harbour/include/hbapiitm.h +++ b/harbour/include/hbapiitm.h @@ -97,7 +97,7 @@ extern HB_EXPORT double hb_itemGetND ( PHB_ITEM pItem ); extern HB_EXPORT double hb_itemGetNDDec ( PHB_ITEM pItem, int * piDec ); extern HB_EXPORT int hb_itemGetNI ( PHB_ITEM pItem ); extern HB_EXPORT long hb_itemGetNL ( PHB_ITEM pItem ); -extern HB_EXPORT HB_LONG hb_itemGetNInt ( PHB_ITEM pItem ); +extern HB_EXPORT HB_MAXINT hb_itemGetNInt ( PHB_ITEM pItem ); extern HB_EXPORT void hb_itemGetNLen ( PHB_ITEM pItem, int * piWidth, int * piDec ); extern HB_EXPORT void * hb_itemGetPtr ( PHB_ITEM pItem ); extern HB_EXPORT void * hb_itemGetPtrGC ( PHB_ITEM pItem, const HB_GC_FUNCS * pFuncs ); @@ -123,8 +123,8 @@ extern HB_EXPORT PHB_ITEM hb_itemPutL ( PHB_ITEM pItem, HB_BOOL bValue extern HB_EXPORT PHB_ITEM hb_itemPutND ( PHB_ITEM pItem, double dNumber ); extern HB_EXPORT PHB_ITEM hb_itemPutNI ( PHB_ITEM pItem, int iNumber ); extern HB_EXPORT PHB_ITEM hb_itemPutNL ( PHB_ITEM pItem, long lNumber ); -extern HB_EXPORT PHB_ITEM hb_itemPutNInt ( PHB_ITEM pItem, HB_LONG lNumber ); -extern HB_EXPORT PHB_ITEM hb_itemPutNIntLen( PHB_ITEM pItem, HB_LONG lNumber, int iWidth ); +extern HB_EXPORT PHB_ITEM hb_itemPutNInt ( PHB_ITEM pItem, HB_MAXINT lNumber ); +extern HB_EXPORT PHB_ITEM hb_itemPutNIntLen( PHB_ITEM pItem, HB_MAXINT lNumber, int iWidth ); extern HB_EXPORT PHB_ITEM hb_itemPutNLen ( PHB_ITEM pItem, double dNumber, int iWidth, int iDec ); extern HB_EXPORT PHB_ITEM hb_itemPutNDLen ( PHB_ITEM pItem, double dNumber, int iWidth, int iDec ); extern HB_EXPORT PHB_ITEM hb_itemPutNDDec ( PHB_ITEM pItem, double dNumber, int iDec ); diff --git a/harbour/include/hbchksum.h b/harbour/include/hbchksum.h index e1bfc41d79..a0c2138cd2 100644 --- a/harbour/include/hbchksum.h +++ b/harbour/include/hbchksum.h @@ -57,8 +57,8 @@ HB_EXTERN_BEGIN extern HB_EXPORT HB_U32 hb_adler32( HB_U32 adler, const void * buf, HB_SIZE len ); extern HB_EXPORT HB_U16 hb_crc16( HB_U16 crc, const void * buf, HB_SIZE len ); extern HB_EXPORT HB_U32 hb_crc32( HB_U32 crc, const void * buf, HB_SIZE len ); -extern HB_EXPORT HB_ULONG hb_crc( HB_ULONG crc, const void * buf, HB_SIZE len, HB_ULONG poly ); -extern HB_EXPORT HB_ULONG hb_crcct( HB_ULONG crc, const void * buf, HB_SIZE len, HB_ULONG poly ); +extern HB_EXPORT HB_MAXUINT hb_crc( HB_MAXUINT crc, const void * buf, HB_SIZE len, HB_MAXUINT poly ); +extern HB_EXPORT HB_MAXUINT hb_crcct( HB_MAXUINT crc, const void * buf, HB_SIZE len, HB_MAXUINT poly ); extern HB_EXPORT void hb_md5( const void * data, HB_SIZE datalen, char * digest ); extern HB_EXPORT void hb_md5file( HB_FHANDLE hFile, char * digest ); diff --git a/harbour/include/hbcomp.h b/harbour/include/hbcomp.h index 0934d29fe3..1d94138b3f 100644 --- a/harbour/include/hbcomp.h +++ b/harbour/include/hbcomp.h @@ -203,14 +203,14 @@ extern void hb_compGenPushVarRef( const char * szVarName, HB_COMP_DECL ); extern void hb_compGenPushMemvarRef( const char * szVarName, HB_COMP_DECL ); /* generates the pcode to push memvar variable by reference to the virtual machine stack */ extern void hb_compGenPushInteger( int iNumber, HB_COMP_DECL ); /* Pushes a integer number on the virtual machine stack */ extern void hb_compGenPushLogical( int iTrueFalse, HB_COMP_DECL ); /* pushes a logical value on the virtual machine stack */ -extern void hb_compGenPushLong( HB_LONG lNumber, HB_COMP_DECL ); /* Pushes a long number on the virtual machine stack */ +extern void hb_compGenPushLong( HB_MAXINT lNumber, HB_COMP_DECL ); /* Pushes a long number on the virtual machine stack */ extern void hb_compGenPushDate( long lDate, HB_COMP_DECL ); /* Pushes a date constant on the virtual machine stack */ extern void hb_compGenPushTimeStamp( long lDate, long lTime, HB_COMP_DECL ); /* Pushes a timestamp constant on the virtual machine stack */ extern void hb_compGenPushNil( HB_COMP_DECL ); /* Pushes nil on the virtual machine stack */ extern void hb_compGenPushString( const char * szText, ULONG ulLen, HB_COMP_DECL ); /* Pushes a string on the virtual machine stack */ extern void hb_compGenPushSymbol( const char * szSymbolName, HB_BOOL bFunction, HB_COMP_DECL ); /* Pushes a symbol on to the Virtual machine stack */ -extern void hb_compGenPushAliasedVar( const char *, HB_BOOL, const char *, HB_LONG, HB_COMP_DECL ); -extern void hb_compGenPopAliasedVar( const char *, HB_BOOL, const char *, HB_LONG, HB_COMP_DECL ); +extern void hb_compGenPushAliasedVar( const char *, HB_BOOL, const char *, HB_MAXINT, HB_COMP_DECL ); +extern void hb_compGenPopAliasedVar( const char *, HB_BOOL, const char *, HB_MAXINT, HB_COMP_DECL ); extern void hb_compGenPCode1( BYTE, HB_COMP_DECL ); /* generates 1 byte of pcode */ extern void hb_compGenPCode2( BYTE, BYTE, HB_COMP_DECL ); /* generates 2 bytes of pcode + flag for optional StrongType(). */ extern void hb_compGenPCode3( BYTE, BYTE, BYTE, HB_COMP_DECL ); /* generates 3 bytes of pcode + flag for optional StrongType() */ diff --git a/harbour/include/hbcompdf.h b/harbour/include/hbcompdf.h index 73b18b5b9b..51e4cf96fa 100644 --- a/harbour/include/hbcompdf.h +++ b/harbour/include/hbcompdf.h @@ -268,8 +268,8 @@ typedef struct HB_EXPR_ struct { union { - HB_LONG l; /* long value */ - double d; /* double value */ + HB_MAXINT l; /* long value */ + double d; /* double value */ } val; unsigned char bWidth; /* unsigned char used intentionally */ unsigned char bDec; /* unsigned char used intentionally */ diff --git a/harbour/include/hbdate.h b/harbour/include/hbdate.h index 503f6450bd..92ce1793ad 100644 --- a/harbour/include/hbdate.h +++ b/harbour/include/hbdate.h @@ -61,7 +61,7 @@ extern HB_EXPORT double hb_secondsCPU( int n ); extern HB_EXPORT double hb_dateSeconds( void ); /* return UTC julian timestamp in milliseconds */ -extern HB_EXPORT HB_ULONG hb_dateMilliSeconds( void ); +extern HB_EXPORT HB_MAXUINT hb_dateMilliSeconds( void ); /* functions to operate on julian date values */ diff --git a/harbour/include/hbdefs.h b/harbour/include/hbdefs.h index 68c26821db..273ae08b59 100644 --- a/harbour/include/hbdefs.h +++ b/harbour/include/hbdefs.h @@ -601,7 +601,6 @@ typedef unsigned long HB_COUNTER; */ /* TODO: Remove dependence on old types */ -/* TODO: Solve HB_LONG/HB_ULONG. It currently means something else that it would later. */ /* Harbour overloaded types: */ diff --git a/harbour/include/hbexprb.c b/harbour/include/hbexprb.c index 5af860cd41..246913bc57 100644 --- a/harbour/include/hbexprb.c +++ b/harbour/include/hbexprb.c @@ -1793,7 +1793,7 @@ static HB_EXPR_FUNC( hb_compExprUseFunCall ) usCount && pParms->value.asList.pExprList->ExprType == HB_ET_NUMERIC ) { HB_EXPR_PTR pArg = pParms->value.asList.pExprList; - HB_LONG lResult = 0; + HB_MAXINT lResult = 0; HB_BOOL fOptimize = HB_FALSE, fBool = HB_FALSE; if( usCount >= 2 ) @@ -1847,28 +1847,28 @@ static HB_EXPR_FUNC( hb_compExprUseFunCall ) } else if( strcmp( "TEST", pName->value.asSymbol + 6 ) == 0 ) { - HB_LONG lBit = hb_compExprAsLongNum( pArg->pNext ); + HB_MAXINT lBit = hb_compExprAsLongNum( pArg->pNext ); lResult = ( hb_compExprAsLongNum( pArg ) & - ( ( HB_LONG ) 1 << lBit ) ) != 0; + ( ( HB_MAXINT ) 1 << lBit ) ) != 0; fOptimize = fBool = HB_TRUE; } else if( strcmp( "SET", pName->value.asSymbol + 6 ) == 0 ) { - HB_LONG lBit = hb_compExprAsLongNum( pArg->pNext ); + HB_MAXINT lBit = hb_compExprAsLongNum( pArg->pNext ); lResult = hb_compExprAsLongNum( pArg ) | - ( ( HB_LONG ) 1 << lBit ); + ( ( HB_MAXINT ) 1 << lBit ); fOptimize = HB_TRUE; } else if( strcmp( "RESET", pName->value.asSymbol + 6 ) == 0 ) { - HB_LONG lBit = hb_compExprAsLongNum( pArg->pNext ); + HB_MAXINT lBit = hb_compExprAsLongNum( pArg->pNext ); lResult = hb_compExprAsLongNum( pArg ) & - ( ~ ( ( HB_LONG ) 1 << lBit ) ); + ( ~ ( ( HB_MAXINT ) 1 << lBit ) ); fOptimize = HB_TRUE; } else if( strcmp( "SHIFT", pName->value.asSymbol + 6 ) == 0 ) { - HB_LONG lBits = hb_compExprAsLongNum( pArg->pNext ); + HB_MAXINT lBits = hb_compExprAsLongNum( pArg->pNext ); lResult = hb_compExprAsLongNum( pArg ); if( lBits < 0 ) lResult >>= -lBits; diff --git a/harbour/include/hbexprop.h b/harbour/include/hbexprop.h index cc62f6d0f5..82a5348707 100644 --- a/harbour/include/hbexprop.h +++ b/harbour/include/hbexprop.h @@ -79,7 +79,7 @@ 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, BYTE, BYTE, HB_COMP_DECL ); -extern HB_EXPR_PTR hb_compExprNewLong( HB_LONG, 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 *, ULONG, HB_BOOL, HB_COMP_DECL ); @@ -162,7 +162,7 @@ extern int hb_compExprAsInteger( HB_EXPR_PTR ); extern int hb_compExprAsNumSign( HB_EXPR_PTR ); extern int hb_compExprIsString( HB_EXPR_PTR ); extern int hb_compExprAsStringLen( HB_EXPR_PTR ); -extern HB_LONG hb_compExprAsLongNum( HB_EXPR_PTR ); +extern HB_MAXINT hb_compExprAsLongNum( HB_EXPR_PTR ); extern const char * hb_compExprAsString( HB_EXPR_PTR ); extern const char * hb_compExprAsSymbol( HB_EXPR_PTR ); @@ -205,7 +205,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_LONG, HB_BOOL, HB_COMP_DECL ); +extern HB_BOOL hb_compExprReduceBitFunc( HB_EXPR_PTR, HB_MAXINT, HB_BOOL, HB_COMP_DECL ); HB_EXTERN_END diff --git a/harbour/include/hbgtcore.h b/harbour/include/hbgtcore.h index 8156caac78..70207ca892 100644 --- a/harbour/include/hbgtcore.h +++ b/harbour/include/hbgtcore.h @@ -316,9 +316,9 @@ typedef struct _HB_GT_BASE HB_BOOL fMouseVisible; int iMouseLastRow; int iMouseLastCol; - HB_LONG iMouseLeftTimer; - HB_LONG iMouseRightTimer; - HB_LONG iMouseMiddleTimer; + HB_MAXINT iMouseLeftTimer; + HB_MAXINT iMouseRightTimer; + HB_MAXINT iMouseMiddleTimer; int defaultKeyBuffer[ HB_DEFAULT_INKEY_BUFSIZE + 1 ]; diff --git a/harbour/include/hbmacro.h b/harbour/include/hbmacro.h index 208d66ab60..68850509e2 100644 --- a/harbour/include/hbmacro.h +++ b/harbour/include/hbmacro.h @@ -130,7 +130,7 @@ extern void hb_macroGenJumpHere( ULONG ulOffset, HB_COMP_DECL ); extern ULONG hb_macroGenJumpTrue( LONG lOffset, HB_COMP_DECL ); extern void hb_macroGenPushSymbol( const char * szSymbolName, HB_BOOL bFunction, HB_COMP_DECL ); -extern void hb_macroGenPushLong( HB_LONG lNumber, HB_COMP_DECL ); +extern void hb_macroGenPushLong( HB_MAXINT lNumber, HB_COMP_DECL ); extern void hb_macroGenPushDate( long lDate, HB_COMP_DECL ); extern void hb_macroGenPushTimeStamp( long lDate, long lTime, HB_COMP_DECL ); extern void hb_macroGenMessage( const char * szMsgName, HB_BOOL bIsObject, HB_COMP_DECL ); @@ -140,14 +140,14 @@ extern void hb_macroGenPopMemvar( const char * szVarName, HB_COMP_DECL ); extern void hb_macroGenPopAliasedVar( const char * szVarName, HB_BOOL bPushAliasValue, const char * szAlias, - HB_LONG lWorkarea, HB_COMP_DECL ); + HB_MAXINT lWorkarea, HB_COMP_DECL ); extern void hb_macroGenPushVar( const char * szVarName, HB_BOOL bMacroVar, HB_COMP_DECL ); extern void hb_macroGenPushVarRef( const char * szVarName, HB_COMP_DECL ); extern void hb_macroGenPushMemvarRef( const char * szVarName, HB_COMP_DECL ); extern void hb_macroGenPushAliasedVar( const char * szVarName, HB_BOOL bPushAliasValue, const char * szAlias, - HB_LONG lWorkarea, HB_COMP_DECL ); + HB_MAXINT lWorkarea, HB_COMP_DECL ); extern void hb_macroGenPushLogical( int iTrueFalse, HB_COMP_DECL ); extern void hb_macroGenPushDouble( double dNumber, BYTE bWidth, BYTE bDec, HB_COMP_DECL ); extern void hb_macroGenPushFunCall( const char * szFunName, HB_COMP_DECL ); diff --git a/harbour/include/hbsocket.h b/harbour/include/hbsocket.h index 053dfe151a..c9fe1a57a9 100644 --- a/harbour/include/hbsocket.h +++ b/harbour/include/hbsocket.h @@ -92,12 +92,12 @@ HB_EXPORT extern int hb_socketClose( HB_SOCKET sd ); HB_EXPORT extern int hb_socketShutdown( HB_SOCKET sd, int iMode ); HB_EXPORT extern int hb_socketBind( HB_SOCKET sd, const void * pSockAddr, unsigned uiLen ); HB_EXPORT extern int hb_socketListen( HB_SOCKET sd, int iBacklog ); -HB_EXPORT extern HB_SOCKET hb_socketAccept( HB_SOCKET sd, void ** pSockAddr, unsigned * puiLen, HB_LONG timeout ); -HB_EXPORT extern int hb_socketConnect( HB_SOCKET sd, const void * pSockAddr, unsigned uiLen, HB_LONG timeout ); -HB_EXPORT extern long hb_socketSend( HB_SOCKET sd, const void * data, long len, int flags, HB_LONG timeout ); -HB_EXPORT extern long hb_socketSendTo( HB_SOCKET sd, const void * data, long len, int flags, const void * pSockAddr, unsigned uiSockLen, HB_LONG timeout ); -HB_EXPORT extern long hb_socketRecv( HB_SOCKET sd, void * data, long len, int flags, HB_LONG timeout ); -HB_EXPORT extern long hb_socketRecvFrom( HB_SOCKET sd, void * data, long len, int flags, void ** pSockAddr, unsigned * puiSockLen, HB_LONG timeout ); +HB_EXPORT extern HB_SOCKET hb_socketAccept( HB_SOCKET sd, void ** pSockAddr, unsigned * puiLen, HB_MAXINT timeout ); +HB_EXPORT extern int hb_socketConnect( HB_SOCKET sd, const void * pSockAddr, unsigned uiLen, HB_MAXINT timeout ); +HB_EXPORT extern long hb_socketSend( HB_SOCKET sd, const void * data, long len, int flags, HB_MAXINT timeout ); +HB_EXPORT extern long hb_socketSendTo( HB_SOCKET sd, const void * data, long len, int flags, const void * pSockAddr, unsigned uiSockLen, HB_MAXINT timeout ); +HB_EXPORT extern long hb_socketRecv( HB_SOCKET sd, void * data, long len, int flags, HB_MAXINT timeout ); +HB_EXPORT extern long hb_socketRecvFrom( HB_SOCKET sd, void * data, long len, int flags, void ** pSockAddr, unsigned * puiSockLen, HB_MAXINT timeout ); HB_EXPORT extern int hb_socketSetBlockingIO( HB_SOCKET sd, HB_BOOL fBlocking ); HB_EXPORT extern int hb_socketSetNoDelay( HB_SOCKET sd, HB_BOOL fNoDelay ); HB_EXPORT extern int hb_socketSetReuseAddr( HB_SOCKET sd, HB_BOOL fReuse ); @@ -108,13 +108,13 @@ HB_EXPORT extern int hb_socketSetRcvBufSize( HB_SOCKET sd, int iSize ); HB_EXPORT extern int hb_socketGetRcvBufSize( HB_SOCKET sd, int * piSize ); HB_EXPORT extern int hb_socketGetSndBufSize( HB_SOCKET sd, int * piSize ); HB_EXPORT extern int hb_socketSetMulticast( HB_SOCKET sd, int af, const char * szAddr ); -HB_EXPORT extern int hb_socketSelectRead( HB_SOCKET sd, HB_LONG timeout ); -HB_EXPORT extern int hb_socketSelectWrite( HB_SOCKET sd, HB_LONG timeout ); -HB_EXPORT extern int hb_socketSelectWriteEx( HB_SOCKET sd, HB_LONG timeout ); +HB_EXPORT extern int hb_socketSelectRead( HB_SOCKET sd, HB_MAXINT timeout ); +HB_EXPORT extern int hb_socketSelectWrite( HB_SOCKET sd, HB_MAXINT timeout ); +HB_EXPORT extern int hb_socketSelectWriteEx( HB_SOCKET sd, HB_MAXINT timeout ); HB_EXPORT extern int hb_socketSelect( PHB_ITEM pArrayRD, HB_BOOL fSetRD, PHB_ITEM pArrayWR, HB_BOOL fSetWR, PHB_ITEM pArrayEX, HB_BOOL fSetEX, - HB_LONG timeout, HB_SOCKET_FUNC pFunc ); + HB_MAXINT timeout, HB_SOCKET_FUNC pFunc ); HB_EXTERN_END diff --git a/harbour/include/hbthread.h b/harbour/include/hbthread.h index 530879f2ee..4583e15019 100644 --- a/harbour/include/hbthread.h +++ b/harbour/include/hbthread.h @@ -83,7 +83,7 @@ HB_EXTERN_BEGIN # include "hbtask.h" - typedef HB_LONG HB_THREAD_NO; + typedef HB_MAXINT HB_THREAD_NO; typedef void * HB_THREAD_ID; typedef void * HB_CRITICAL_T; typedef void * HB_COND_T; @@ -122,7 +122,7 @@ HB_EXTERN_BEGIN #elif defined( HB_PTHREAD_API ) - typedef HB_LONG HB_THREAD_NO; + typedef HB_MAXINT HB_THREAD_NO; typedef pthread_t HB_THREAD_ID; typedef pthread_t HB_THREAD_HANDLE; typedef pthread_mutex_t HB_RAWCRITICAL_T; @@ -173,7 +173,7 @@ HB_EXTERN_BEGIN #elif defined( HB_OS_WIN ) - typedef HB_LONG HB_THREAD_NO; + typedef HB_MAXINT HB_THREAD_NO; typedef HANDLE HB_THREAD_HANDLE; typedef CRITICAL_SECTION HB_RAWCRITICAL_T; typedef HANDLE HB_OSCOND_T; @@ -216,7 +216,7 @@ HB_EXTERN_BEGIN * it may cause troubles when code will be ported to other platforms. */ /* typedef TID HB_THREAD_NO; */ - typedef HB_LONG HB_THREAD_NO; + typedef HB_MAXINT HB_THREAD_NO; typedef TID HB_THREAD_ID; typedef TID HB_THREAD_HANDLE; typedef HMTX HB_RAWCRITICAL_T; diff --git a/harbour/include/hbvm.h b/harbour/include/hbvm.h index df0870191b..fc1ce45ffe 100644 --- a/harbour/include/hbvm.h +++ b/harbour/include/hbvm.h @@ -153,7 +153,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_vmPushNumInt( HB_LONG lNumber ); /* pushes a number on to the stack and decides if it is integer or HB_LONG */ +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 */ extern HB_EXPORT void hb_vmPushStringPcode( const char * szText, HB_SIZE length ); /* pushes a string from pcode on to the stack */ diff --git a/harbour/include/hbvmpub.h b/harbour/include/hbvmpub.h index 726e5f172a..8955d7090b 100644 --- a/harbour/include/hbvmpub.h +++ b/harbour/include/hbvmpub.h @@ -78,8 +78,8 @@ struct _HB_SYMB; # endif # define HB_ITEM_GET_NUMINTRAW( p ) ( HB_IS_INTEGER( p ) ? \ - ( HB_LONG ) (p)->item.asInteger.value : \ - ( HB_LONG ) (p)->item.asLong.value ) + ( HB_MAXINT ) (p)->item.asInteger.value : \ + ( HB_MAXINT ) (p)->item.asLong.value ) # define HB_ITEM_PUT_NUMINTRAW( p, v ) \ do { \ diff --git a/harbour/include/hbznet.h b/harbour/include/hbznet.h index cd4afbe3a5..20baaeb96e 100644 --- a/harbour/include/hbznet.h +++ b/harbour/include/hbznet.h @@ -64,9 +64,9 @@ HB_EXTERN_BEGIN typedef void * PHB_ZNETSTREAM; #endif -typedef long ( * HB_INET_SFUNC ) ( PHB_ZNETSTREAM, HB_SOCKET, const void *, long, HB_LONG, long * ); -typedef long ( * HB_INET_RFUNC ) ( PHB_ZNETSTREAM, HB_SOCKET, void *, long, HB_LONG ); -typedef long ( * HB_INET_FFUNC ) ( PHB_ZNETSTREAM, HB_SOCKET, HB_LONG ); +typedef long ( * HB_INET_SFUNC ) ( PHB_ZNETSTREAM, HB_SOCKET, const void *, long, HB_MAXINT, long * ); +typedef long ( * HB_INET_RFUNC ) ( PHB_ZNETSTREAM, HB_SOCKET, void *, long, HB_MAXINT ); +typedef long ( * HB_INET_FFUNC ) ( PHB_ZNETSTREAM, HB_SOCKET, HB_MAXINT ); typedef void ( * HB_INET_CFUNC ) ( PHB_ZNETSTREAM ); extern HB_EXPORT int hb_znetError( PHB_ZNETSTREAM pStream ); @@ -75,9 +75,9 @@ extern HB_EXPORT PHB_ZNETSTREAM hb_znetOpen( int level, int strategy ); extern HB_EXPORT void hb_znetEncryptKey( PHB_ZNETSTREAM pStream, const void * keydata, int keylen ); extern HB_EXPORT void hb_znetClose( PHB_ZNETSTREAM pStream ); extern HB_EXPORT int hb_znetError( PHB_ZNETSTREAM pStream ); -extern HB_EXPORT long hb_znetRead( PHB_ZNETSTREAM pStream, HB_SOCKET sd, void * buffer, long len, HB_LONG timeout ); -extern HB_EXPORT long hb_znetFlush( PHB_ZNETSTREAM pStream, HB_SOCKET sd, HB_LONG timeout ); -extern HB_EXPORT long hb_znetWrite( PHB_ZNETSTREAM pStream, HB_SOCKET sd, const void * buffer, long len, HB_LONG timeout, long * plast ); +extern HB_EXPORT long hb_znetRead( PHB_ZNETSTREAM pStream, HB_SOCKET sd, void * buffer, long len, HB_MAXINT timeout ); +extern HB_EXPORT long hb_znetFlush( PHB_ZNETSTREAM pStream, HB_SOCKET sd, HB_MAXINT timeout ); +extern HB_EXPORT long hb_znetWrite( PHB_ZNETSTREAM pStream, HB_SOCKET sd, const void * buffer, long len, HB_MAXINT timeout, long * plast ); extern HB_EXPORT HB_BOOL hb_znetInetInitialize( PHB_ITEM, PHB_ZNETSTREAM, HB_INET_RFUNC, diff --git a/harbour/src/common/expropt1.c b/harbour/src/common/expropt1.c index 9e6b87ee47..c854003243 100644 --- a/harbour/src/common/expropt1.c +++ b/harbour/src/common/expropt1.c @@ -267,14 +267,14 @@ int hb_compExprAsInteger( HB_EXPR_PTR pExpr ) return 0; } -HB_LONG hb_compExprAsLongNum( HB_EXPR_PTR pExpr ) +HB_MAXINT hb_compExprAsLongNum( HB_EXPR_PTR pExpr ) { if( pExpr->ExprType == HB_ET_NUMERIC ) { if( pExpr->value.asNum.NumType == HB_ET_LONG ) return pExpr->value.asNum.val.l; else - return ( HB_LONG ) pExpr->value.asNum.val.d; + return ( HB_MAXINT ) pExpr->value.asNum.val.d; } else return 0; @@ -320,7 +320,7 @@ HB_EXPR_PTR hb_compExprNewDouble( double dValue, BYTE ucWidth, BYTE ucDec, return pExpr; } -HB_EXPR_PTR hb_compExprNewLong( HB_LONG lValue, HB_COMP_DECL ) +HB_EXPR_PTR hb_compExprNewLong( HB_MAXINT lValue, HB_COMP_DECL ) { HB_EXPR_PTR pExpr; diff --git a/harbour/src/common/expropt2.c b/harbour/src/common/expropt2.c index d72d53f767..6bd76fd7f2 100644 --- a/harbour/src/common/expropt2.c +++ b/harbour/src/common/expropt2.c @@ -2137,7 +2137,7 @@ HB_BOOL hb_compExprReduceINT( HB_EXPR_PTR pSelf, HB_COMP_DECL ) { HB_MAXDBL dVal = ( HB_MAXDBL ) pArg->value.asNum.val.d; if( HB_DBL_LIM_LONG( dVal ) ) - pExpr = hb_compExprNewLong( ( HB_LONG ) pArg->value.asNum.val.d, HB_COMP_PARAM ); + pExpr = hb_compExprNewLong( ( HB_MAXINT ) pArg->value.asNum.val.d, HB_COMP_PARAM ); else pExpr = hb_compExprNewDouble( pArg->value.asNum.val.d, pArg->value.asNum.bWidth, 0, @@ -2513,7 +2513,7 @@ HB_BOOL hb_compExprReduceMAX( HB_EXPR_PTR pSelf, HB_COMP_DECL ) return HB_FALSE; } -HB_BOOL hb_compExprReduceBitFunc( HB_EXPR_PTR pSelf, HB_LONG lResult, HB_BOOL fBool, HB_COMP_DECL ) +HB_BOOL hb_compExprReduceBitFunc( HB_EXPR_PTR pSelf, HB_MAXINT lResult, HB_BOOL fBool, HB_COMP_DECL ) { HB_EXPR_PTR pParms = pSelf->value.asFunCall.pParms; HB_EXPR_PTR pExpr = fBool ? hb_compExprNewLogical( lResult != 0, HB_COMP_PARAM ) : diff --git a/harbour/src/common/hbdate.c b/harbour/src/common/hbdate.c index dbf6b7e36b..e0f6d3be43 100644 --- a/harbour/src/common/hbdate.c +++ b/harbour/src/common/hbdate.c @@ -158,7 +158,7 @@ void hb_timeStampGetLocal( int * piYear, int * piMonth, int * piDay, } /* return UTC julian timestamp in milliseconds */ -HB_ULONG hb_dateMilliSeconds( void ) +HB_MAXUINT hb_dateMilliSeconds( void ) { HB_TRACE(HB_TR_DEBUG, ("hb_dateMilliSeconds()")); @@ -166,7 +166,7 @@ HB_ULONG hb_dateMilliSeconds( void ) { SYSTEMTIME st; GetSystemTime( &st ); - return ( HB_ULONG ) hb_dateEncode( st.wYear, st.wMonth, st.wDay ) * + return ( HB_MAXUINT ) hb_dateEncode( st.wYear, st.wMonth, st.wDay ) * HB_MILLISECS_PER_DAY + hb_timeEncode( st.wHour, st.wMinute, st.wSecond, st.wMilliseconds ); } @@ -174,16 +174,16 @@ HB_ULONG hb_dateMilliSeconds( void ) { struct timeval tv; gettimeofday( &tv, NULL ); - return ( ( HB_ULONG ) tv.tv_sec + - ( HB_ULONG ) HB_SYS_DATE_BASE * HB_SECONDS_PER_DAY ) * 1000 + + return ( ( HB_MAXUINT ) tv.tv_sec + + ( HB_MAXUINT ) HB_SYS_DATE_BASE * HB_SECONDS_PER_DAY ) * 1000 + tv.tv_usec / 1000; } #else { struct timeb tb; ftime( &tb ); - return ( ( HB_ULONG ) tb.time + - ( HB_ULONG ) HB_SYS_DATE_BASE * HB_SECONDS_PER_DAY ) * 1000 + + return ( ( HB_MAXUINT ) tb.time + + ( HB_MAXUINT ) HB_SYS_DATE_BASE * HB_SECONDS_PER_DAY ) * 1000 + tb.time; } #endif diff --git a/harbour/src/common/hbstr.c b/harbour/src/common/hbstr.c index a7dc21d02e..b71754577f 100644 --- a/harbour/src/common/hbstr.c +++ b/harbour/src/common/hbstr.c @@ -535,7 +535,7 @@ double hb_numDecConv( double dNum, int iDec ) return hb_numRound( dNum, 0 ); } -static HB_BOOL hb_str2number( HB_BOOL fPCode, const char* szNum, HB_SIZE ulLen, HB_LONG * lVal, double * dVal, int * piDec, int * piWidth ) +static HB_BOOL hb_str2number( HB_BOOL fPCode, const char* szNum, HB_SIZE ulLen, HB_MAXINT * lVal, double * dVal, int * piDec, int * piWidth ) { HB_BOOL fDbl = HB_FALSE, fDec = HB_FALSE, fNeg, fHex = HB_FALSE; HB_SIZE ulPos = 0; @@ -587,7 +587,7 @@ static HB_BOOL hb_str2number( HB_BOOL fPCode, const char* szNum, HB_SIZE ulLen, } else { - HB_LONG lLimV; + HB_MAXINT lLimV; int iLimC; lLimV = HB_LONG_MAX / 10; @@ -700,25 +700,25 @@ static HB_BOOL hb_str2number( HB_BOOL fPCode, const char* szNum, HB_SIZE ulLen, return fDbl; } -HB_BOOL hb_compStrToNum( const char* szNum, HB_SIZE ulLen, HB_LONG * plVal, double * pdVal, int * piDec, int * piWidth ) +HB_BOOL hb_compStrToNum( const char* szNum, HB_SIZE ulLen, HB_MAXINT * plVal, double * pdVal, int * piDec, int * piWidth ) { HB_TRACE(HB_TR_DEBUG, ("hb_compStrToNum( %s, %lu, %p, %p, %p, %p)", szNum, ulLen, plVal, pdVal, piDec, piWidth )); return hb_str2number( HB_TRUE, szNum, ulLen, plVal, pdVal, piDec, piWidth ); } -HB_BOOL hb_valStrnToNum( const char* szNum, HB_SIZE ulLen, HB_LONG * plVal, double * pdVal, int * piDec, int * piWidth ) +HB_BOOL hb_valStrnToNum( const char* szNum, HB_SIZE ulLen, HB_MAXINT * plVal, double * pdVal, int * piDec, int * piWidth ) { HB_TRACE(HB_TR_DEBUG, ("hb_valStrnToNum( %s, %lu, %p, %p, %p, %p)", szNum, ulLen, plVal, pdVal, piDec, piWidth )); return hb_str2number( HB_FALSE, szNum, ulLen, plVal, pdVal, piDec, piWidth ); } -HB_BOOL hb_strToNum( const char* szNum, HB_LONG * plVal, double * pdVal ) +HB_BOOL hb_strToNum( const char* szNum, HB_MAXINT * plVal, double * pdVal ) { HB_TRACE(HB_TR_DEBUG, ("hb_strToNum(%s, %p, %p)", szNum, plVal, pdVal )); return hb_str2number( HB_FALSE, szNum, strlen( szNum ), plVal, pdVal, NULL, NULL ); } -HB_BOOL hb_strnToNum( const char* szNum, HB_SIZE ulLen, HB_LONG * plVal, double * pdVal ) +HB_BOOL hb_strnToNum( const char* szNum, HB_SIZE ulLen, HB_MAXINT * plVal, double * pdVal ) { HB_TRACE(HB_TR_DEBUG, ("hb_strnToNum(%.*s, %lu, %p, %p)", ( int ) ulLen, szNum, ulLen, plVal, pdVal )); return hb_str2number( HB_FALSE, szNum, ulLen, plVal, pdVal, NULL, NULL ); @@ -727,7 +727,7 @@ HB_BOOL hb_strnToNum( const char* szNum, HB_SIZE ulLen, HB_LONG * plVal, double /* returns the numeric value of a character string representation of a number */ double hb_strVal( const char * szText, HB_SIZE ulLen ) { - HB_LONG lVal; + HB_MAXINT lVal; double dVal; HB_TRACE(HB_TR_DEBUG, ("hb_strVal(%.*s, %lu)", ( int ) ulLen, szText, ulLen)); @@ -737,9 +737,9 @@ double hb_strVal( const char * szText, HB_SIZE ulLen ) return dVal; } -HB_LONG hb_strValInt( const char * szText, int * iOverflow ) +HB_MAXINT hb_strValInt( const char * szText, int * iOverflow ) { - HB_LONG lVal; + HB_MAXINT lVal; double dVal; HB_TRACE(HB_TR_DEBUG, ("hb_strValInt(%s)", szText)); @@ -753,7 +753,7 @@ HB_LONG hb_strValInt( const char * szText, int * iOverflow ) return lVal; } -char * hb_numToStr( char * szBuf, HB_SIZE ulSize, HB_LONG lNumber ) +char * hb_numToStr( char * szBuf, HB_SIZE ulSize, HB_MAXINT lNumber ) { int iPos = ( int ) ulSize; HB_BOOL fNeg = HB_FALSE; diff --git a/harbour/src/common/hbwince.c b/harbour/src/common/hbwince.c index 16cf55328b..79600c5e28 100644 --- a/harbour/src/common/hbwince.c +++ b/harbour/src/common/hbwince.c @@ -330,7 +330,7 @@ int WINAPI MulDiv( int nNumber, int nNumerator, int nDenominator ) { if( nDenominator ) { - HB_LONG llResult = ( HB_LONG ) nNumber * nNumerator / nDenominator; + HB_MAXINT llResult = ( HB_MAXINT ) nNumber * nNumerator / nDenominator; if( HB_LIM_INT32( llResult ) ) return ( int ) llResult; } diff --git a/harbour/src/compiler/complex.c b/harbour/src/compiler/complex.c index 151d8622eb..e09f423f60 100644 --- a/harbour/src/compiler/complex.c +++ b/harbour/src/compiler/complex.c @@ -291,7 +291,7 @@ static const char * hb_comp_tokenString( YYSTYPE *yylval_ptr, HB_COMP_DECL, PHB_ #if defined( HB_COMPAT_FOXPRO ) || 1 static HB_BOOL hb_comp_timeDecode( PHB_PP_TOKEN pTime, long * plTime ) { - HB_LONG lHour, lMinute, lMilliSec; + HB_MAXINT lHour, lMinute, lMilliSec; double dNumber; int iDec, iWidth; @@ -325,7 +325,7 @@ static HB_BOOL hb_comp_timeDecode( PHB_PP_TOKEN pTime, long * plTime ) { if( dNumber < 0.0 || dNumber >= 60.0 ) return HB_FALSE; - lMilliSec = ( HB_LONG ) ( dNumber * 1000 + 0.05 / HB_MILLISECS_PER_DAY ); + lMilliSec = ( HB_MAXINT ) ( dNumber * 1000 + 0.05 / HB_MILLISECS_PER_DAY ); if( lMilliSec == 60000 ) --lMilliSec; } @@ -385,7 +385,7 @@ static int hb_comp_dayTimeDecode( PHB_COMP_LEX pLex, PHB_PP_TOKEN pToken, /* Now support for dates constatns: {^YYYY/MM/DD} or {^YYYY-MM-DD} */ PHB_PP_TOKEN pYear, pMonth, pDay; - HB_LONG lYear, lMonth, lDay; + HB_MAXINT lYear, lMonth, lDay; long lDate = 0, lTime = 0; double dNumber; int iDec, iWidth, iType = 0; @@ -473,7 +473,7 @@ int hb_complex( YYSTYPE *yylval_ptr, HB_COMP_DECL ) { case HB_PP_TOKEN_NUMBER: { - HB_LONG lNumber; + HB_MAXINT lNumber; double dNumber; int iDec, iWidth; diff --git a/harbour/src/compiler/harbour.y b/harbour/src/compiler/harbour.y index 8e903411a0..9dfd629abc 100644 --- a/harbour/src/compiler/harbour.y +++ b/harbour/src/compiler/harbour.y @@ -114,14 +114,14 @@ static void hb_compDebugStart( void ) { } { char * string; /* to hold a string returned by lex */ int iNumber; /* to hold a temporary integer number */ - HB_LONG lNumber; /* to hold a temporary long number */ + HB_MAXINT lNumber; /* to hold a temporary long number */ HB_BOOL bTrue; HB_EXPR_PTR asExpr; void * pVoid; /* to hold any memory structure we may need */ struct { - HB_LONG lNumber; /* to hold a long number returned by lex */ - HB_UCHAR bWidth; /* to hold the width of the value */ + HB_MAXINT lNumber; /* to hold a long number returned by lex */ + HB_UCHAR bWidth; /* to hold the width of the value */ } valLong; struct { diff --git a/harbour/src/compiler/harbour.yyc b/harbour/src/compiler/harbour.yyc index 6beec2c713..88f484d472 100644 --- a/harbour/src/compiler/harbour.yyc +++ b/harbour/src/compiler/harbour.yyc @@ -433,14 +433,14 @@ typedef union YYSTYPE { char * string; /* to hold a string returned by lex */ int iNumber; /* to hold a temporary integer number */ - HB_LONG lNumber; /* to hold a temporary long number */ + HB_MAXINT lNumber; /* to hold a temporary long number */ HB_BOOL bTrue; HB_EXPR_PTR asExpr; void * pVoid; /* to hold any memory structure we may need */ struct { - HB_LONG lNumber; /* to hold a long number returned by lex */ - HB_UCHAR bWidth; /* to hold the width of the value */ + HB_MAXINT lNumber; /* to hold a long number returned by lex */ + HB_UCHAR bWidth; /* to hold the width of the value */ } valLong; struct { diff --git a/harbour/src/compiler/harbour.yyh b/harbour/src/compiler/harbour.yyh index 3a6dbe809b..81562ffb00 100644 --- a/harbour/src/compiler/harbour.yyh +++ b/harbour/src/compiler/harbour.yyh @@ -270,14 +270,14 @@ typedef union YYSTYPE { char * string; /* to hold a string returned by lex */ int iNumber; /* to hold a temporary integer number */ - HB_LONG lNumber; /* to hold a temporary long number */ + HB_MAXINT lNumber; /* to hold a temporary long number */ HB_BOOL bTrue; HB_EXPR_PTR asExpr; void * pVoid; /* to hold any memory structure we may need */ struct { - HB_LONG lNumber; /* to hold a long number returned by lex */ - HB_UCHAR bWidth; /* to hold the width of the value */ + HB_MAXINT lNumber; /* to hold a long number returned by lex */ + HB_UCHAR bWidth; /* to hold the width of the value */ } valLong; struct { diff --git a/harbour/src/compiler/hbmain.c b/harbour/src/compiler/hbmain.c index aaa1215a25..8743bb2849 100644 --- a/harbour/src/compiler/hbmain.c +++ b/harbour/src/compiler/hbmain.c @@ -2776,7 +2776,7 @@ void hb_compGenPushMemvarRef( const char * szVarName, HB_COMP_DECL ) /* generate void hb_compGenPopAliasedVar( const char * szVarName, HB_BOOL bPushAliasValue, const char * szAlias, - HB_LONG lWorkarea, + HB_MAXINT lWorkarea, HB_COMP_DECL ) { if( bPushAliasValue ) @@ -2821,7 +2821,7 @@ void hb_compGenPopAliasedVar( const char * szVarName, void hb_compGenPushAliasedVar( const char * szVarName, HB_BOOL bPushAliasValue, const char * szAlias, - HB_LONG lWorkarea, + HB_MAXINT lWorkarea, HB_COMP_DECL ) { if( bPushAliasValue ) @@ -2940,7 +2940,7 @@ void hb_compGenPushSymbol( const char * szSymbolName, HB_BOOL bFunction, HB_COMP } /* generates the pcode to push a long number on the virtual machine stack */ -void hb_compGenPushLong( HB_LONG lNumber, HB_COMP_DECL ) +void hb_compGenPushLong( HB_MAXINT lNumber, HB_COMP_DECL ) { if( HB_COMP_PARAM->fLongOptimize ) { diff --git a/harbour/src/macro/macro.y b/harbour/src/macro/macro.y index 5e942fcd1d..cd21d4bb6f 100644 --- a/harbour/src/macro/macro.y +++ b/harbour/src/macro/macro.y @@ -134,9 +134,9 @@ %union /* special structure used by lex and yacc to share info */ { const char * string; /* to hold a string returned by lex */ - int iNumber; /* to hold a temporary integer number */ - HB_LONG lNumber; /* to hold a temporary long number */ - void * pVoid; /* to hold any memory structure we may need */ + int iNumber; /* to hold a temporary integer number */ + HB_MAXINT lNumber; /* to hold a temporary long number */ + void * pVoid; /* to hold any memory structure we may need */ HB_EXPR_PTR asExpr; struct { @@ -149,8 +149,8 @@ } valInteger; struct { - HB_LONG lNumber; /* to hold a long number returned by lex */ - HB_UCHAR bWidth; /* to hold the width of the value */ + HB_MAXINT lNumber; /* to hold a long number returned by lex */ + HB_UCHAR bWidth; /* to hold the width of the value */ } valLong; struct { @@ -968,7 +968,7 @@ int hb_macrolex( YYSTYPE *yylval_ptr, HB_MACRO_PTR pMacro ) case HB_PP_TOKEN_NUMBER: { - HB_LONG lNumber; + HB_MAXINT lNumber; double dNumber; int iDec, iWidth; diff --git a/harbour/src/macro/macro.yyc b/harbour/src/macro/macro.yyc index 66652a0dee..e4ef3f8979 100644 --- a/harbour/src/macro/macro.yyc +++ b/harbour/src/macro/macro.yyc @@ -310,9 +310,9 @@ typedef union YYSTYPE #line 135 "macro.y" { const char * string; /* to hold a string returned by lex */ - int iNumber; /* to hold a temporary integer number */ - HB_LONG lNumber; /* to hold a temporary long number */ - void * pVoid; /* to hold any memory structure we may need */ + int iNumber; /* to hold a temporary integer number */ + HB_MAXINT lNumber; /* to hold a temporary long number */ + void * pVoid; /* to hold any memory structure we may need */ HB_EXPR_PTR asExpr; struct { @@ -325,8 +325,8 @@ typedef union YYSTYPE } valInteger; struct { - HB_LONG lNumber; /* to hold a long number returned by lex */ - HB_UCHAR bWidth; /* to hold the width of the value */ + HB_MAXINT lNumber; /* to hold a long number returned by lex */ + HB_UCHAR bWidth; /* to hold the width of the value */ } valLong; struct { @@ -3307,7 +3307,7 @@ int hb_macrolex( YYSTYPE *yylval_ptr, HB_MACRO_PTR pMacro ) case HB_PP_TOKEN_NUMBER: { - HB_LONG lNumber; + HB_MAXINT lNumber; double dNumber; int iDec, iWidth; diff --git a/harbour/src/macro/macro.yyh b/harbour/src/macro/macro.yyh index 990157b522..45798f24c5 100644 --- a/harbour/src/macro/macro.yyh +++ b/harbour/src/macro/macro.yyh @@ -127,9 +127,9 @@ typedef union YYSTYPE #line 135 "macro.y" { const char * string; /* to hold a string returned by lex */ - int iNumber; /* to hold a temporary integer number */ - HB_LONG lNumber; /* to hold a temporary long number */ - void * pVoid; /* to hold any memory structure we may need */ + int iNumber; /* to hold a temporary integer number */ + HB_MAXINT lNumber; /* to hold a temporary long number */ + void * pVoid; /* to hold any memory structure we may need */ HB_EXPR_PTR asExpr; struct { @@ -142,8 +142,8 @@ typedef union YYSTYPE } valInteger; struct { - HB_LONG lNumber; /* to hold a long number returned by lex */ - HB_UCHAR bWidth; /* to hold the width of the value */ + HB_MAXINT lNumber; /* to hold a long number returned by lex */ + HB_UCHAR bWidth; /* to hold the width of the value */ } valLong; struct { diff --git a/harbour/src/macro/macrolex.c b/harbour/src/macro/macrolex.c index 397f1c6c58..ccc62faaaa 100644 --- a/harbour/src/macro/macrolex.c +++ b/harbour/src/macro/macrolex.c @@ -243,7 +243,7 @@ static int hb_lexStringExtCopy( YYSTYPE *yylval_ptr, HB_MACRO_PTR pMacro, static int hb_lexNumConv( YYSTYPE *yylval_ptr, PHB_MACRO_LEX pLex, ULONG ulLen ) { - HB_LONG lNumber; + HB_MAXINT lNumber; double dNumber; int iDec, iWidth; diff --git a/harbour/src/pp/ppcore.c b/harbour/src/pp/ppcore.c index 7683fc26f0..ff9ce811c7 100644 --- a/harbour/src/pp/ppcore.c +++ b/harbour/src/pp/ppcore.c @@ -4612,7 +4612,7 @@ static PHB_PP_TOKEN hb_pp_calcPrecedence( PHB_PP_TOKEN pToken, return pNext; } -static HB_BOOL hb_pp_calcReduce( HB_LONG * plValue, int iOperation ) +static HB_BOOL hb_pp_calcReduce( HB_MAXINT * plValue, int iOperation ) { switch( iOperation ) { @@ -4632,8 +4632,8 @@ static HB_BOOL hb_pp_calcReduce( HB_LONG * plValue, int iOperation ) return HB_FALSE; } -static HB_LONG hb_pp_calcOperation( HB_LONG lValueLeft, HB_LONG lValueRight, - int iOperation, HB_BOOL * pfError ) +static HB_MAXINT hb_pp_calcOperation( HB_MAXINT lValueLeft, HB_MAXINT lValueRight, + int iOperation, HB_BOOL * pfError ) { switch( iOperation ) { @@ -4708,7 +4708,7 @@ static HB_LONG hb_pp_calcOperation( HB_LONG lValueLeft, HB_LONG lValueRight, } static PHB_PP_TOKEN hb_pp_calcValue( PHB_PP_TOKEN pToken, int iPrecedense, - HB_LONG * plValue, HB_BOOL * pfError, + HB_MAXINT * plValue, HB_BOOL * pfError, HB_BOOL * pfUndef ) { if( HB_PP_TOKEN_ISEOC( pToken ) ) @@ -4780,7 +4780,7 @@ static PHB_PP_TOKEN hb_pp_calcValue( PHB_PP_TOKEN pToken, int iPrecedense, else if( iNextPrec > iPrecedense ) { HB_BOOL fDefined = ( ! * pfUndef ) && hb_pp_calcReduce( plValue, iNextOper ); - HB_LONG lValue = 0; + HB_MAXINT lValue = 0; * pfError = HB_TRUE; pToken = hb_pp_calcValue( pNext, iNextPrec, &lValue, pfError, pfUndef ); if( ! * pfError ) @@ -4795,11 +4795,11 @@ static PHB_PP_TOKEN hb_pp_calcValue( PHB_PP_TOKEN pToken, int iPrecedense, return pToken; } -static HB_LONG hb_pp_calculateValue( PHB_PP_STATE pState, PHB_PP_TOKEN pToken, - HB_BOOL fNoError ) +static HB_MAXINT hb_pp_calculateValue( PHB_PP_STATE pState, PHB_PP_TOKEN pToken, + HB_BOOL fNoError ) { HB_BOOL fError = HB_TRUE, fUndef = HB_FALSE; - HB_LONG lValue = 0; + HB_MAXINT lValue = 0; pToken = hb_pp_calcValue( pToken, HB_PP_PREC_NUL, &lValue, &fError, &fUndef ); if( !HB_PP_TOKEN_ISEOC( pToken ) || fUndef ) diff --git a/harbour/src/rdd/dbf1.c b/harbour/src/rdd/dbf1.c index f10da47fd7..c6717b7c0f 100644 --- a/harbour/src/rdd/dbf1.c +++ b/harbour/src/rdd/dbf1.c @@ -121,7 +121,7 @@ static HB_ERRCODE hb_dbfErrorRT( DBFAREAP pArea, return errCode; } -static HB_LONG hb_dbfGetRowVer( DBFAREAP pArea, USHORT uiField, HB_LONG * pValue ) +static HB_MAXINT hb_dbfGetRowVer( DBFAREAP pArea, USHORT uiField, HB_MAXINT * pValue ) { DBFFIELD dbField; HB_BOOL fLck = HB_FALSE; @@ -153,9 +153,9 @@ static HB_LONG hb_dbfGetRowVer( DBFAREAP pArea, USHORT uiField, HB_LONG * pValue return HB_SUCCESS; } -static HB_LONG hb_dbfGetNextValue( DBFAREAP pArea, USHORT uiField ) +static HB_MAXINT hb_dbfGetNextValue( DBFAREAP pArea, USHORT uiField ) { - HB_LONG nValue = 0; + HB_MAXINT nValue = 0; DBFFIELD dbField; if( hb_fileReadAt( pArea->pDataFile, &dbField, sizeof( dbField ), @@ -174,7 +174,7 @@ static HB_LONG hb_dbfGetNextValue( DBFAREAP pArea, USHORT uiField ) static void hb_dbfUpdateStampFields( DBFAREAP pArea ) { long lJulian = 0, lMilliSec = 0; - HB_LONG nRowVer = 0; + HB_MAXINT nRowVer = 0; LPFIELD pField; USHORT uiCount; @@ -298,9 +298,9 @@ static void hb_dbfSetBlankRecord( DBFAREAP pArea, int iType ) } else if( bNext == HB_BLANK_AUTOINC ) { - HB_LONG nValue = hb_dbfGetNextValue( pArea, uiCount ); + HB_MAXINT nValue = hb_dbfGetNextValue( pArea, uiCount ); if( pField->uiDec ) - nValue = ( HB_LONG ) hb_numDecConv( ( double ) nValue, - ( int ) pField->uiDec ); + nValue = ( HB_MAXINT ) hb_numDecConv( ( double ) nValue, - ( int ) pField->uiDec ); if( pField->uiType == HB_FT_INTEGER || pField->uiType == HB_FT_AUTOINC ) { @@ -1926,14 +1926,14 @@ static HB_ERRCODE hb_dbfGetValue( DBFAREAP pArea, USHORT uiIndex, PHB_ITEM pItem hb_itemPutNILen( pItem, ( int ) HB_GET_LE_INT16( pArea->pRecord + pArea->pFieldOffset[ uiIndex ] ), 6 ); break; case 3: - hb_itemPutNIntLen( pItem, ( HB_LONG ) HB_GET_LE_INT24( pArea->pRecord + pArea->pFieldOffset[ uiIndex ] ), 10 ); + hb_itemPutNIntLen( pItem, ( HB_MAXINT ) HB_GET_LE_INT24( pArea->pRecord + pArea->pFieldOffset[ uiIndex ] ), 10 ); break; case 4: - hb_itemPutNIntLen( pItem, ( HB_LONG ) HB_GET_LE_INT32( pArea->pRecord + pArea->pFieldOffset[ uiIndex ] ), 10 ); + hb_itemPutNIntLen( pItem, ( HB_MAXINT ) HB_GET_LE_INT32( pArea->pRecord + pArea->pFieldOffset[ uiIndex ] ), 10 ); break; case 8: #ifndef HB_LONG_LONG_OFF - hb_itemPutNIntLen( pItem, ( HB_LONG ) HB_GET_LE_INT64( pArea->pRecord + pArea->pFieldOffset[ uiIndex ] ), 20 ); + hb_itemPutNIntLen( pItem, ( HB_MAXINT ) HB_GET_LE_INT64( pArea->pRecord + pArea->pFieldOffset[ uiIndex ] ), 20 ); #else hb_itemPutNLen( pItem, ( double ) HB_GET_LE_INT64( pArea->pRecord + pArea->pFieldOffset[ uiIndex ] ), 20, 0 ); #endif @@ -1964,7 +1964,7 @@ static HB_ERRCODE hb_dbfGetValue( DBFAREAP pArea, USHORT uiIndex, PHB_ITEM pItem else */ { - HB_LONG lVal; + HB_MAXINT lVal; double dVal; HB_BOOL fDbl; @@ -1995,7 +1995,7 @@ static HB_ERRCODE hb_dbfGetValue( DBFAREAP pArea, USHORT uiIndex, PHB_ITEM pItem } else if( pField->uiLen == 4 ) { - hb_itemPutNIntLen( pItem, ( HB_LONG ) HB_GET_LE_INT32( pArea->pRecord + pArea->pFieldOffset[ uiIndex ] ), 10 ); + hb_itemPutNIntLen( pItem, ( HB_MAXINT ) HB_GET_LE_INT32( pArea->pRecord + pArea->pFieldOffset[ uiIndex ] ), 10 ); } else { @@ -2351,14 +2351,14 @@ static HB_ERRCODE hb_dbfPutValue( DBFAREAP pArea, USHORT uiIndex, PHB_ITEM pItem } else if( pField->uiType == HB_FT_INTEGER ) { - HB_LONG lVal; + HB_MAXINT lVal; double dVal; int iSize; if( pField->uiDec ) { dVal = hb_numDecConv( hb_itemGetND( pItem ), - ( int ) pField->uiDec ); - lVal = ( HB_LONG ) dVal; + lVal = ( HB_MAXINT ) dVal; if( ! HB_DBL_LIM_INT64( dVal ) ) iSize = 99; else @@ -2377,7 +2377,7 @@ static HB_ERRCODE hb_dbfPutValue( DBFAREAP pArea, USHORT uiIndex, PHB_ITEM pItem else if( HB_IS_DOUBLE( pItem ) ) { dVal = hb_itemGetND( pItem ); - lVal = ( HB_LONG ) dVal; + lVal = ( HB_MAXINT ) dVal; if( ! HB_DBL_LIM_INT64( dVal ) ) iSize = 99; else @@ -2395,7 +2395,7 @@ static HB_ERRCODE hb_dbfPutValue( DBFAREAP pArea, USHORT uiIndex, PHB_ITEM pItem } else { - lVal = ( HB_LONG ) hb_itemGetNInt( pItem ); + lVal = ( HB_MAXINT ) hb_itemGetNInt( pItem ); #ifdef HB_LONG_LONG_OFF dVal = ( double ) lVal; #endif @@ -2444,7 +2444,7 @@ static HB_ERRCODE hb_dbfPutValue( DBFAREAP pArea, USHORT uiIndex, PHB_ITEM pItem } else if( pField->uiType == HB_FT_ANY && pField->uiLen == 4 ) { - HB_LONG lVal = hb_itemGetNInt( pItem ); + HB_MAXINT lVal = hb_itemGetNInt( pItem ); if( HB_IS_DOUBLE( pItem ) ? HB_DBL_LIM_INT32( hb_itemGetND( pItem ) ) : HB_LIM_INT32( lVal ) ) @@ -3242,12 +3242,12 @@ static HB_ERRCODE hb_dbfInfo( DBFAREAP pArea, USHORT uiIndex, PHB_ITEM pItem ) case DBI_FILEHANDLE: hb_itemPutNInt( pItem, !pArea->pDataFile ? FS_ERROR : - ( HB_LONG ) ( HB_NHANDLE ) hb_fileHandle( pArea->pDataFile ) ); + ( HB_MAXINT ) ( HB_NHANDLE ) hb_fileHandle( pArea->pDataFile ) ); break; case DBI_MEMOHANDLE: hb_itemPutNInt( pItem, ! pArea->pMemoFile ? FS_ERROR : - ( HB_LONG ) ( HB_NHANDLE ) hb_fileHandle( pArea->pMemoFile ) ); + ( HB_MAXINT ) ( HB_NHANDLE ) hb_fileHandle( pArea->pMemoFile ) ); break; case DBI_SHARED: diff --git a/harbour/src/rdd/dbffpt/dbffpt1.c b/harbour/src/rdd/dbffpt/dbffpt1.c index 4c97176018..6fdf783e3c 100644 --- a/harbour/src/rdd/dbffpt/dbffpt1.c +++ b/harbour/src/rdd/dbffpt/dbffpt1.c @@ -1157,7 +1157,7 @@ static ULONG hb_fptCountSMTItemLength( FPTAREAP pArea, PHB_ITEM pItem, case HB_IT_INTEGER: case HB_IT_LONG: { - HB_LONG iVal; + HB_MAXINT iVal; iVal = hb_itemGetNInt( pItem ); if( HB_LIM_INT32( iVal ) ) { @@ -1238,7 +1238,7 @@ static HB_ERRCODE hb_fptCountSMTDataLength( FPTAREAP pArea, HB_FOFFSET * pfOffse static ULONG hb_fptStoreSMTItem( FPTAREAP pArea, PHB_ITEM pItem, BYTE ** bBufPtr, HB_BOOL fTrans ) { ULONG ulLen, u, ulSize = 0; - HB_LONG iVal; + HB_MAXINT iVal; LONG lVal; double dVal; int iWidth, iDec; @@ -1607,7 +1607,7 @@ static ULONG hb_fptCountSixItemLength( FPTAREAP pArea, PHB_ITEM pItem, static ULONG hb_fptStoreSixItem( FPTAREAP pArea, PHB_ITEM pItem, BYTE ** bBufPtr, HB_BOOL fTrans ) { ULONG ulLen, u, ulSize; - HB_LONG iVal; + HB_MAXINT iVal; LONG lVal; double dVal; int iWidth, iDec; @@ -1819,7 +1819,7 @@ static ULONG hb_fptCountFlexItemLength( FPTAREAP pArea, PHB_ITEM pItem, ULONG * pulArrayCount, HB_BOOL fTrans ) { ULONG ulLen, u, ulSize = 1; - HB_LONG iVal; + HB_MAXINT iVal; switch ( hb_itemType( pItem ) ) { @@ -1872,7 +1872,7 @@ static ULONG hb_fptCountFlexItemLength( FPTAREAP pArea, PHB_ITEM pItem, static void hb_fptStoreFlexItem( FPTAREAP pArea, PHB_ITEM pItem, BYTE ** bBufPtr, HB_BOOL fTrans ) { ULONG ulLen, u; - HB_LONG iVal; + HB_MAXINT iVal; LONG lVal; double dVal; int iWidth, iDec; @@ -2925,7 +2925,7 @@ static HB_ERRCODE hb_fptPutMemo( FPTAREAP pArea, USHORT uiIndex, PHB_ITEM pItem, BYTE itmBuffer[FLEX_ITEM_BUFSIZE]; BYTE *bBufPtr = NULL, *bBufAlloc = NULL; HB_ERRCODE errCode; - HB_LONG iVal; + HB_MAXINT iVal; LONG lVal; HB_TRACE(HB_TR_DEBUG, ("hb_fptPutMemo(%p, %hu, %p, %p)", pArea, uiIndex, pItem, pulBlock)); @@ -3239,7 +3239,7 @@ static HB_ERRCODE hb_fptGetVarField( FPTAREAP pArea, USHORT uiIndex, PHB_ITEM pI if( pField->uiLen == 3 || uiType == HB_VF_DATE ) hb_itemPutDL( pItem, hb_sxPtoD( ( char * ) pFieldBuf ) ); else if( pField->uiLen == 4 || uiType == HB_VF_INT ) - hb_itemPutNIntLen( pItem, ( HB_LONG ) HB_GET_LE_INT32( pFieldBuf ), 10 ); + hb_itemPutNIntLen( pItem, ( HB_MAXINT ) HB_GET_LE_INT32( pFieldBuf ), 10 ); else if( pField->uiLen == 2 ) hb_itemPutNIntLen( pItem, ( int ) HB_GET_LE_INT16( pFieldBuf ), 10 ); else if( pField->uiLen == 1 ) @@ -3538,7 +3538,7 @@ static HB_ERRCODE hb_fptPutVarField( FPTAREAP pArea, USHORT uiIndex, PHB_ITEM pI } else if( pField->uiLen == 4 ) { - HB_LONG lVal; + HB_MAXINT lVal; if( ! HB_IS_NUMBER( pItem ) ) return EDBF_DATATYPE; @@ -3600,7 +3600,7 @@ static HB_ERRCODE hb_fptPutVarField( FPTAREAP pArea, USHORT uiIndex, PHB_ITEM pI } else if( HB_IS_NUMBER( pItem ) ) { - HB_LONG lVal; + HB_MAXINT lVal; lVal = hb_itemGetNInt( pItem ); if( !HB_IS_DOUBLE( pItem ) && HB_LIM_INT32( lVal ) ) diff --git a/harbour/src/rdd/dbfntx/dbfntx1.c b/harbour/src/rdd/dbfntx/dbfntx1.c index e023a17767..6d8872fc4a 100644 --- a/harbour/src/rdd/dbfntx/dbfntx1.c +++ b/harbour/src/rdd/dbfntx/dbfntx1.c @@ -319,7 +319,7 @@ static PHB_ITEM hb_ntxStrToNum( PHB_ITEM pItem, char* szKeyVal, USHORT length, U char szBuffer[ NTX_MAX_KEY + 1 ]; char *ptr = szKeyVal, *ptr2, c; int iLen, iDec; - HB_LONG lValue; + HB_MAXINT lValue; double dValue; HB_SYMBOL_UNUSED( dec ); diff --git a/harbour/src/rdd/dbsql.c b/harbour/src/rdd/dbsql.c index 664895e8ea..b0c392f900 100644 --- a/harbour/src/rdd/dbsql.c +++ b/harbour/src/rdd/dbsql.c @@ -235,7 +235,7 @@ static HB_BOOL hb_exportBufSqlVar( PHB_FILEBUF pFileBuf, PHB_ITEM pValue, } /* Export DBF content to a SQL script file */ -static ULONG hb_db2Sql( AREAP pArea, PHB_ITEM pFields, HB_LONG llNext, +static ULONG hb_db2Sql( AREAP pArea, PHB_ITEM pFields, HB_MAXINT llNext, PHB_ITEM pWhile, PHB_ITEM pFor, const char * szDelim, const char * szSep, const char * szEsc, const char * szTable, @@ -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_LONG llNext = HB_LONG_MAX; + HB_MAXINT llNext = HB_LONG_MAX; HB_FHANDLE hFile; HB_ERRCODE errCode; diff --git a/harbour/src/rdd/delim1.c b/harbour/src/rdd/delim1.c index a7ab9ccc41..1beb479a3e 100644 --- a/harbour/src/rdd/delim1.c +++ b/harbour/src/rdd/delim1.c @@ -321,7 +321,7 @@ static HB_ERRCODE hb_delimReadRecord( DELIMAREAP pArea ) } else { - HB_LONG lVal; + HB_MAXINT lVal; double dVal; HB_BOOL fDbl; @@ -590,7 +590,7 @@ static HB_ERRCODE hb_delimGetValue( DELIMAREAP pArea, USHORT uiIndex, PHB_ITEM p case HB_FT_LONG: { - HB_LONG lVal; + HB_MAXINT lVal; double dVal; HB_BOOL fDbl; diff --git a/harbour/src/rdd/sdf1.c b/harbour/src/rdd/sdf1.c index 018fde8881..7c1ac81684 100644 --- a/harbour/src/rdd/sdf1.c +++ b/harbour/src/rdd/sdf1.c @@ -413,7 +413,7 @@ static HB_ERRCODE hb_sdfGetValue( SDFAREAP pArea, USHORT uiIndex, PHB_ITEM pItem case HB_FT_LONG: { - HB_LONG lVal; + HB_MAXINT lVal; double dVal; HB_BOOL fDbl; diff --git a/harbour/src/rtl/abs.c b/harbour/src/rtl/abs.c index 9d4812ca32..5c07e39721 100644 --- a/harbour/src/rtl/abs.c +++ b/harbour/src/rtl/abs.c @@ -74,7 +74,7 @@ HB_FUNC( ABS ) #if -HB_INT_MAX > HB_INT_MIN else if( iNumber < -HB_INT_MAX ) #if HB_LONG_MAX > HB_INT_MAX - hb_retnint( - ( HB_LONG ) iNumber ); + hb_retnint( - ( HB_MAXINT ) iNumber ); #else hb_retndlen( - ( double ) iNumber, 0, iDec ); #endif @@ -84,7 +84,7 @@ HB_FUNC( ABS ) } else if( HB_IS_LONG( pNumber ) ) { - HB_LONG lNumber = hb_itemGetNInt( pNumber ); + HB_MAXINT lNumber = hb_itemGetNInt( pNumber ); if( lNumber >= 0 ) hb_retnintlen( lNumber, iWidth ); diff --git a/harbour/src/rtl/cdpapi.c b/harbour/src/rtl/cdpapi.c index 119afd24d3..b490081a6f 100644 --- a/harbour/src/rtl/cdpapi.c +++ b/harbour/src/rtl/cdpapi.c @@ -1044,7 +1044,7 @@ HB_WCHAR hb_cdpGetU16( PHB_CODEPAGE cdp, HB_BOOL fCtrl, unsigned char ch ) return ch; } -HB_UCHAR char hb_cdpGetChar( PHB_CODEPAGE cdp, HB_BOOL fCtrl, HB_WCHAR wc ) +HB_UCHAR hb_cdpGetChar( PHB_CODEPAGE cdp, HB_BOOL fCtrl, HB_WCHAR wc ) { if( cdp && ( fCtrl || wc >= 32 ) ) { diff --git a/harbour/src/rtl/cputime.c b/harbour/src/rtl/cputime.c index eec7b56587..0188706934 100644 --- a/harbour/src/rtl/cputime.c +++ b/harbour/src/rtl/cputime.c @@ -130,13 +130,13 @@ double hb_secondsCPU( int n ) { if( n & 1 ) { - d += ( double ) ( ( ( HB_LONG ) User.dwHighDateTime << 32 ) + - ( HB_LONG ) User.dwLowDateTime ); + d += ( double ) ( ( ( HB_MAXINT ) User.dwHighDateTime << 32 ) + + ( HB_MAXINT ) User.dwLowDateTime ); } if( n & 2 ) { - d += ( double ) ( ( ( HB_LONG ) Kernel.dwHighDateTime << 32 ) + - ( HB_LONG ) Kernel.dwLowDateTime ); + d += ( double ) ( ( ( HB_MAXINT ) Kernel.dwHighDateTime << 32 ) + + ( HB_MAXINT ) Kernel.dwLowDateTime ); } d /= 10000000.0; } diff --git a/harbour/src/rtl/gtpca/gtpca.c b/harbour/src/rtl/gtpca/gtpca.c index 5f3f90c995..8d8989fa6b 100644 --- a/harbour/src/rtl/gtpca/gtpca.c +++ b/harbour/src/rtl/gtpca/gtpca.c @@ -233,7 +233,7 @@ static void hb_gt_pca_AnsiGetCurPos( int * iRow, int * iCol ) { char rdbuf[ 64 ]; int i, j, n, d, y, x; - HB_ULONG end_timer, time; + HB_MAXUINT end_timer, time; hb_gt_pca_termOut( "\x1B[6n", 4 ); hb_gt_pca_termFlush(); diff --git a/harbour/src/rtl/gtsln/gtsln.c b/harbour/src/rtl/gtsln/gtsln.c index 9b67de913c..17e8a1bf3c 100644 --- a/harbour/src/rtl/gtsln/gtsln.c +++ b/harbour/src/rtl/gtsln/gtsln.c @@ -504,7 +504,7 @@ static int hb_sln_isUTF8( int iStdOut, int iStdIn ) { char rdbuf[ 64 ]; int i, j, n, d, y, x; - HB_ULONG end_timer, time; + HB_MAXUINT end_timer, time; n = j = x = y = 0; /* wait up to 2 seconds for answer */ diff --git a/harbour/src/rtl/gttrm/gttrm.c b/harbour/src/rtl/gttrm/gttrm.c index 995546c141..24a097916c 100644 --- a/harbour/src/rtl/gttrm/gttrm.c +++ b/harbour/src/rtl/gttrm/gttrm.c @@ -1838,7 +1838,7 @@ static HB_BOOL hb_gt_trm_AnsiGetCursorPos( PHB_GTTRM pTerm, int * iRow, int * iC { char rdbuf[ 64 ]; int i, j, n, d, y, x; - HB_ULONG end_timer, time; + HB_MAXUINT end_timer, time; hb_gt_trm_termOut( pTerm, "\x1B[6n", 4 ); if( szPost ) diff --git a/harbour/src/rtl/gtwvt/gtwvt.c b/harbour/src/rtl/gtwvt/gtwvt.c index 1ed41e01e0..5e3dd4410a 100644 --- a/harbour/src/rtl/gtwvt/gtwvt.c +++ b/harbour/src/rtl/gtwvt/gtwvt.c @@ -2462,7 +2462,7 @@ static HB_BOOL hb_gt_wvt_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo ) pWVT->bIconToFree = HB_FALSE; pWVT->hIcon = LoadIcon( pWVT->hInstance, - MAKEINTRESOURCE( ( HB_LONG ) + MAKEINTRESOURCE( ( HB_MAXINT ) hb_itemGetNInt( pInfo->pNewVal ) ) ); if( pWVT->hWnd ) diff --git a/harbour/src/rtl/hbbit.c b/harbour/src/rtl/hbbit.c index 2c8cc40e89..44490bda6e 100644 --- a/harbour/src/rtl/hbbit.c +++ b/harbour/src/rtl/hbbit.c @@ -60,7 +60,7 @@ to update the references in the compiler as well. [vszakats] */ -static HB_BOOL hb_numParam( int iParam, HB_LONG * plNum ) +static HB_BOOL hb_numParam( int iParam, HB_MAXINT * plNum ) { if( HB_ISNUM( iParam ) ) { @@ -74,13 +74,13 @@ static HB_BOOL hb_numParam( int iParam, HB_LONG * plNum ) HB_FUNC( HB_BITAND ) { - HB_LONG lValue; + HB_MAXINT lValue; if( hb_numParam( 1, &lValue ) ) { int iPCount = hb_pcount() - 1, i = 1; do { - HB_LONG lNext; + HB_MAXINT lNext; if( !hb_numParam( ++i, &lNext ) ) return; lValue &= lNext; @@ -92,13 +92,13 @@ HB_FUNC( HB_BITAND ) HB_FUNC( HB_BITOR ) { - HB_LONG lValue; + HB_MAXINT lValue; if( hb_numParam( 1, &lValue ) ) { int iPCount = hb_pcount() - 1, i = 1; do { - HB_LONG lNext; + HB_MAXINT lNext; if( !hb_numParam( ++i, &lNext ) ) return; lValue |= lNext; @@ -110,13 +110,13 @@ HB_FUNC( HB_BITOR ) HB_FUNC( HB_BITXOR ) { - HB_LONG lValue; + HB_MAXINT lValue; if( hb_numParam( 1, &lValue ) ) { int iPCount = hb_pcount() - 1, i = 1; do { - HB_LONG lNext; + HB_MAXINT lNext; if( !hb_numParam( ++i, &lNext ) ) return; lValue ^= lNext; @@ -128,35 +128,35 @@ HB_FUNC( HB_BITXOR ) HB_FUNC( HB_BITNOT ) { - HB_LONG lValue; + HB_MAXINT lValue; if( hb_numParam( 1, &lValue ) ) hb_retnint( ~lValue ); } HB_FUNC( HB_BITTEST ) { - HB_LONG lValue, lBit; + HB_MAXINT lValue, lBit; if( hb_numParam( 1, &lValue ) && hb_numParam( 2, &lBit ) ) - hb_retl( ( lValue & ( ( HB_LONG ) 1 << lBit ) ) != 0 ); + hb_retl( ( lValue & ( ( HB_MAXINT ) 1 << lBit ) ) != 0 ); } HB_FUNC( HB_BITSET ) { - HB_LONG lValue, lBit; + HB_MAXINT lValue, lBit; if( hb_numParam( 1, &lValue ) && hb_numParam( 2, &lBit ) ) - hb_retnint( lValue | ( ( HB_LONG ) 1 << lBit ) ); + hb_retnint( lValue | ( ( HB_MAXINT ) 1 << lBit ) ); } HB_FUNC( HB_BITRESET ) { - HB_LONG lValue, lBit; + HB_MAXINT lValue, lBit; if( hb_numParam( 1, &lValue ) && hb_numParam( 2, &lBit ) ) - hb_retnint( lValue & ( ~ ( ( HB_LONG ) 1 << lBit ) ) ); + hb_retnint( lValue & ( ~ ( ( HB_MAXINT ) 1 << lBit ) ) ); } HB_FUNC( HB_BITSHIFT ) { - HB_LONG lValue, lBits; + HB_MAXINT lValue, lBits; if( hb_numParam( 1, &lValue ) && hb_numParam( 2, &lBits ) ) { if( lBits < 0 ) diff --git a/harbour/src/rtl/hbbyte.c b/harbour/src/rtl/hbbyte.c index 446212240a..5a3467b2db 100644 --- a/harbour/src/rtl/hbbyte.c +++ b/harbour/src/rtl/hbbyte.c @@ -53,7 +53,7 @@ #include "hbapi.h" #include "hbapierr.h" -static HB_BOOL hb_numParam( int iParam, HB_LONG * plNum ) +static HB_BOOL hb_numParam( int iParam, HB_MAXINT * plNum ) { if( HB_ISNUM( iParam ) ) { @@ -67,7 +67,7 @@ static HB_BOOL hb_numParam( int iParam, HB_LONG * plNum ) HB_FUNC( HB_BYTESWAPI ) { - HB_LONG lValue; + HB_MAXINT lValue; if( hb_numParam( 1, &lValue ) ) { @@ -78,7 +78,7 @@ HB_FUNC( HB_BYTESWAPI ) HB_FUNC( HB_BYTESWAPW ) { - HB_LONG lValue; + HB_MAXINT lValue; if( hb_numParam( 1, &lValue ) ) { @@ -89,7 +89,7 @@ HB_FUNC( HB_BYTESWAPW ) HB_FUNC( HB_BYTESWAPL ) { - HB_LONG lValue; + HB_MAXINT lValue; if( hb_numParam( 1, &lValue ) ) { @@ -100,7 +100,7 @@ HB_FUNC( HB_BYTESWAPL ) HB_FUNC( HB_BYTESWAPU ) { - HB_LONG lValue; + HB_MAXINT lValue; if( hb_numParam( 1, &lValue ) ) { @@ -111,14 +111,14 @@ HB_FUNC( HB_BYTESWAPU ) HB_FUNC( HB_BYTESWAPLL ) { - HB_LONG lValue; + HB_MAXINT lValue; if( hb_numParam( 1, &lValue ) ) { #if defined( HB_LONG_LONG_OFF ) - HB_LONG iVal = ( HB_LONG ) HB_SWAP_UINT32( lValue ); + HB_MAXINT iVal = ( HB_MAXINT ) HB_SWAP_UINT32( lValue ); #else - HB_LONG iVal = ( HB_LONG ) HB_SWAP_UINT64( lValue ); + HB_MAXINT iVal = ( HB_MAXINT ) HB_SWAP_UINT64( lValue ); #endif hb_retnint( iVal ); } diff --git a/harbour/src/rtl/hbcrc.c b/harbour/src/rtl/hbcrc.c index fb10549070..ca2523866a 100644 --- a/harbour/src/rtl/hbcrc.c +++ b/harbour/src/rtl/hbcrc.c @@ -175,12 +175,12 @@ HB_U16 hb_crc16( HB_U16 crc, const void * buf, HB_SIZE len ) return crc ^ 0xffff; } -HB_ULONG hb_crc( HB_ULONG crc, const void * buf, HB_SIZE len, HB_ULONG poly ) +HB_MAXUINT hb_crc( HB_MAXUINT crc, const void * buf, HB_SIZE len, HB_MAXUINT poly ) { if( buf && len ) { const unsigned char * ucbuf = ( const unsigned char * ) buf; - HB_ULONG mask = 1, revp = 0; + HB_MAXUINT mask = 1, revp = 0; while( poly > 1 ) { @@ -205,17 +205,17 @@ HB_ULONG hb_crc( HB_ULONG crc, const void * buf, HB_SIZE len, HB_ULONG poly ) return crc; } -HB_ULONG hb_crcct( HB_ULONG crc, const void * buf, HB_SIZE len, HB_ULONG poly ) +HB_MAXUINT hb_crcct( HB_MAXUINT crc, const void * buf, HB_SIZE len, HB_MAXUINT poly ) { if( buf && len ) { const unsigned char * ucbuf = ( const unsigned char * ) buf; - HB_ULONG mask, revp = poly; + HB_MAXUINT mask, revp = poly; int bits = 0; while( revp >>= 1 ) ++bits; - mask = ( HB_LONG ) 1 << ( bits - 1 ); + mask = ( HB_MAXINT ) 1 << ( bits - 1 ); bits -= 8; if( bits < 0 ) { @@ -225,7 +225,7 @@ HB_ULONG hb_crcct( HB_ULONG crc, const void * buf, HB_SIZE len, HB_ULONG poly ) do { int i = 8; - crc ^= ( HB_ULONG ) ( *ucbuf++ ); + crc ^= ( HB_MAXUINT ) ( *ucbuf++ ); do crc = crc & mask ? poly ^ ( crc << 1 ) : crc << 1; while( --i ); @@ -239,7 +239,7 @@ HB_ULONG hb_crcct( HB_ULONG crc, const void * buf, HB_SIZE len, HB_ULONG poly ) do { int i = 8; - crc ^= ( HB_ULONG ) ( *ucbuf++ ) << bits; + crc ^= ( HB_MAXUINT ) ( *ucbuf++ ) << bits; do crc = crc & mask ? poly ^ ( crc << 1 ) : crc << 1; while( --i ); @@ -277,10 +277,10 @@ HB_FUNC( HB_CRC ) if( szString ) { - HB_ULONG ulPolynomial = ( HB_ULONG ) hb_parnint( 3 ); + HB_MAXUINT ulPolynomial = ( HB_MAXUINT ) hb_parnint( 3 ); if( ulPolynomial == 0 ) ulPolynomial = 0x11021; - hb_retnint( hb_crc( ( HB_ULONG ) hb_parnint( 2 ), szString, hb_parclen( 1 ), ulPolynomial ) ); + hb_retnint( hb_crc( ( HB_MAXUINT ) hb_parnint( 2 ), szString, hb_parclen( 1 ), ulPolynomial ) ); } else hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); @@ -292,10 +292,10 @@ HB_FUNC( HB_CRCCT ) if( szString ) { - HB_ULONG ulPolynomial = ( HB_ULONG ) hb_parnint( 3 ); + HB_MAXUINT ulPolynomial = ( HB_MAXUINT ) hb_parnint( 3 ); if( ulPolynomial == 0 ) ulPolynomial = 0x11021; - hb_retnint( hb_crcct( ( HB_ULONG ) hb_parnint( 2 ), szString, hb_parclen( 1 ), ulPolynomial ) ); + hb_retnint( hb_crcct( ( HB_MAXUINT ) hb_parnint( 2 ), szString, hb_parclen( 1 ), ulPolynomial ) ); } else hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); diff --git a/harbour/src/rtl/hbgtcore.c b/harbour/src/rtl/hbgtcore.c index ea9ede5f31..7083f068d0 100644 --- a/harbour/src/rtl/hbgtcore.c +++ b/harbour/src/rtl/hbgtcore.c @@ -2445,14 +2445,14 @@ static int hb_gt_def_InkeyNext( PHB_GT pGT, int iEventMask ) /* Wait for keyboard input */ static int hb_gt_def_InkeyGet( PHB_GT pGT, HB_BOOL fWait, double dSeconds, int iEventMask ) { - HB_ULONG end_timer; + HB_MAXUINT end_timer; HB_BOOL fPop; HB_TRACE(HB_TR_DEBUG, ("hb_gt_def_InkeyGet(%p,%d,%f,%d)", pGT, (int) fWait, dSeconds, iEventMask)); /* Wait forever ?, Use fixed value 100 for strict Clipper compatibility */ if( fWait && dSeconds * 100 >= 1 ) - end_timer = hb_dateMilliSeconds() + ( HB_ULONG ) ( dSeconds * 1000 ); + end_timer = hb_dateMilliSeconds() + ( HB_MAXUINT ) ( dSeconds * 1000 ); else end_timer = 0; @@ -2794,8 +2794,8 @@ static int hb_gt_def_MouseReadKey( PHB_GT pGT, int iEventMask ) { if( iEventMask & INKEY_LDOWN && HB_GTSELF_MOUSEBUTTONPRESSED( pGT, 0, &iRow, &iCol ) ) { - HB_ULONG timer = hb_dateMilliSeconds(); - if( timer - pGT->iMouseLeftTimer <= ( HB_ULONG ) HB_GTSELF_MOUSEGETDOUBLECLICKSPEED( pGT ) ) + HB_MAXUINT timer = hb_dateMilliSeconds(); + if( timer - pGT->iMouseLeftTimer <= ( HB_MAXUINT ) HB_GTSELF_MOUSEGETDOUBLECLICKSPEED( pGT ) ) iKey = K_LDBLCLK; else iKey = K_LBUTTONDOWN; @@ -2807,8 +2807,8 @@ static int hb_gt_def_MouseReadKey( PHB_GT pGT, int iEventMask ) } else if( iEventMask & INKEY_RDOWN && HB_GTSELF_MOUSEBUTTONPRESSED( pGT, 1, &iRow, &iCol ) ) { - HB_ULONG timer = hb_dateMilliSeconds(); - if( timer - pGT->iMouseRightTimer <= ( HB_ULONG ) HB_GTSELF_MOUSEGETDOUBLECLICKSPEED( pGT ) ) + HB_MAXUINT timer = hb_dateMilliSeconds(); + if( timer - pGT->iMouseRightTimer <= ( HB_MAXUINT ) HB_GTSELF_MOUSEGETDOUBLECLICKSPEED( pGT ) ) iKey = K_RDBLCLK; else iKey = K_RBUTTONDOWN; @@ -2820,8 +2820,8 @@ static int hb_gt_def_MouseReadKey( PHB_GT pGT, int iEventMask ) } else if( iEventMask & INKEY_MMIDDLE && HB_GTSELF_MOUSEBUTTONPRESSED( pGT, 2, &iRow, &iCol ) ) { - HB_ULONG timer = hb_dateMilliSeconds(); - if( timer - pGT->iMouseMiddleTimer <= ( HB_ULONG ) HB_GTSELF_MOUSEGETDOUBLECLICKSPEED( pGT ) ) + HB_MAXUINT timer = hb_dateMilliSeconds(); + if( timer - pGT->iMouseMiddleTimer <= ( HB_MAXUINT ) HB_GTSELF_MOUSEGETDOUBLECLICKSPEED( pGT ) ) iKey = K_MDBLCLK; else iKey = K_MBUTTONDOWN; diff --git a/harbour/src/rtl/hbhex.c b/harbour/src/rtl/hbhex.c index a190ec6665..8118b30193 100644 --- a/harbour/src/rtl/hbhex.c +++ b/harbour/src/rtl/hbhex.c @@ -60,7 +60,7 @@ HB_FUNC( HB_HEXTONUM ) if( szHex ) { - HB_ULONG ulNum = 0; + HB_MAXUINT ulNum = 0; while( *szHex == ' ' ) szHex++; while( *szHex ) @@ -88,10 +88,10 @@ HB_FUNC( HB_HEXTONUM ) HB_FUNC( HB_NUMTOHEX ) { - HB_ULONG ulNum; - int iLen; - HB_BOOL fDefaultLen; - char ret[ 33 ]; + HB_MAXUINT ulNum; + int iLen; + HB_BOOL fDefaultLen; + char ret[ 33 ]; if( HB_ISNUM( 2 ) ) { diff --git a/harbour/src/rtl/hbrandom.c b/harbour/src/rtl/hbrandom.c index 1847510ca5..38f0c46782 100644 --- a/harbour/src/rtl/hbrandom.c +++ b/harbour/src/rtl/hbrandom.c @@ -105,18 +105,18 @@ HB_FUNC( HB_RANDOMINT ) if( ! HB_ISNUM( 1 ) ) hb_retni( dRnd >= 0.5 ? 0 : 1 ); else if( ! HB_ISNUM( 2 ) ) - hb_retnint( ( HB_LONG ) ( 1 + ( dRnd * hb_parnint( 1 ) ) ) ); + hb_retnint( ( HB_MAXINT ) ( 1 + ( dRnd * hb_parnint( 1 ) ) ) ); else { - HB_LONG lX = hb_parnint( 1 ); - HB_LONG lY = hb_parnint( 2 ); + HB_MAXINT lX = hb_parnint( 1 ); + HB_MAXINT lY = hb_parnint( 2 ); if( lX > lY ) { - HB_LONG lZ = lY; + HB_MAXINT lZ = lY; lY = lX; lX = lZ; } - hb_retnint( ( HB_LONG ) ( lX + ( dRnd * ( lY - lX + 1 ) ) ) ); + hb_retnint( ( HB_MAXINT ) ( lX + ( dRnd * ( lY - lX + 1 ) ) ) ); } } diff --git a/harbour/src/rtl/hbsocket.c b/harbour/src/rtl/hbsocket.c index a0e5578ff3..b65cb95c5e 100644 --- a/harbour/src/rtl/hbsocket.c +++ b/harbour/src/rtl/hbsocket.c @@ -476,7 +476,7 @@ int hb_socketListen( HB_SOCKET sd, int iBacklog ) return -1; } -HB_SOCKET hb_socketAccept( HB_SOCKET sd, void ** pSockAddr, unsigned * puiLen, HB_LONG timeout ) +HB_SOCKET hb_socketAccept( HB_SOCKET sd, void ** pSockAddr, unsigned * puiLen, HB_MAXINT timeout ) { HB_SYMBOL_UNUSED( sd ); HB_SYMBOL_UNUSED( pSockAddr ); @@ -486,7 +486,7 @@ HB_SOCKET hb_socketAccept( HB_SOCKET sd, void ** pSockAddr, unsigned * puiLen, H return HB_NO_SOCKET; } -int hb_socketConnect( HB_SOCKET sd, const void * pSockAddr, unsigned uiLen, HB_LONG timeout ) +int hb_socketConnect( HB_SOCKET sd, const void * pSockAddr, unsigned uiLen, HB_MAXINT timeout ) { HB_SYMBOL_UNUSED( sd ); HB_SYMBOL_UNUSED( pSockAddr ); @@ -496,7 +496,7 @@ int hb_socketConnect( HB_SOCKET sd, const void * pSockAddr, unsigned uiLen, HB_L return -1; } -long hb_socketSend( HB_SOCKET sd, const void * data, long len, int flags, HB_LONG timeout ) +long hb_socketSend( HB_SOCKET sd, const void * data, long len, int flags, HB_MAXINT timeout ) { HB_SYMBOL_UNUSED( sd ); HB_SYMBOL_UNUSED( data ); @@ -507,7 +507,7 @@ long hb_socketSend( HB_SOCKET sd, const void * data, long len, int flags, HB_LON return -1; } -long hb_socketSendTo( HB_SOCKET sd, const void * data, long len, int flags, const void * pSockAddr, unsigned uiSockLen, HB_LONG timeout ) +long hb_socketSendTo( HB_SOCKET sd, const void * data, long len, int flags, const void * pSockAddr, unsigned uiSockLen, HB_MAXINT timeout ) { HB_SYMBOL_UNUSED( sd ); HB_SYMBOL_UNUSED( data ); @@ -520,7 +520,7 @@ long hb_socketSendTo( HB_SOCKET sd, const void * data, long len, int flags, cons return -1; } -long hb_socketRecv( HB_SOCKET sd, void * data, long len, int flags, HB_LONG timeout ) +long hb_socketRecv( HB_SOCKET sd, void * data, long len, int flags, HB_MAXINT timeout ) { HB_SYMBOL_UNUSED( sd ); HB_SYMBOL_UNUSED( data ); @@ -531,7 +531,7 @@ long hb_socketRecv( HB_SOCKET sd, void * data, long len, int flags, HB_LONG time return -1; } -long hb_socketRecvFrom( HB_SOCKET sd, void * data, long len, int flags, void ** pSockAddr, unsigned * puiSockLen, HB_LONG timeout ) +long hb_socketRecvFrom( HB_SOCKET sd, void * data, long len, int flags, void ** pSockAddr, unsigned * puiSockLen, HB_MAXINT timeout ) { HB_SYMBOL_UNUSED( sd ); HB_SYMBOL_UNUSED( data ); @@ -625,7 +625,7 @@ int hb_socketSetMulticast( HB_SOCKET sd, int af, const char * szAddr ) return -1; } -int hb_socketSelectRead( HB_SOCKET sd, HB_LONG timeout ) +int hb_socketSelectRead( HB_SOCKET sd, HB_MAXINT timeout ) { HB_SYMBOL_UNUSED( sd ); HB_SYMBOL_UNUSED( timeout ); @@ -633,7 +633,7 @@ int hb_socketSelectRead( HB_SOCKET sd, HB_LONG timeout ) return -1; } -int hb_socketSelectWrite( HB_SOCKET sd, HB_LONG timeout ) +int hb_socketSelectWrite( HB_SOCKET sd, HB_MAXINT timeout ) { HB_SYMBOL_UNUSED( sd ); HB_SYMBOL_UNUSED( timeout ); @@ -642,7 +642,7 @@ int hb_socketSelectWrite( HB_SOCKET sd, HB_LONG timeout ) } -int hb_socketSelectWriteEx( HB_SOCKET sd, HB_LONG timeout ) +int hb_socketSelectWriteEx( HB_SOCKET sd, HB_MAXINT timeout ) { HB_SYMBOL_UNUSED( sd ); HB_SYMBOL_UNUSED( timeout ); @@ -653,7 +653,7 @@ int hb_socketSelectWriteEx( HB_SOCKET sd, HB_LONG timeout ) int hb_socketSelect( PHB_ITEM pArrayRD, HB_BOOL fSetRD, PHB_ITEM pArrayWR, HB_BOOL fSetWR, PHB_ITEM pArrayEX, HB_BOOL fSetEX, - HB_LONG timeout, HB_SOCKET_FUNC pFunc ) + HB_MAXINT timeout, HB_SOCKET_FUNC pFunc ) { HB_SYMBOL_UNUSED( pArrayRD ); HB_SYMBOL_UNUSED( fSetRD ); @@ -1361,13 +1361,13 @@ static int hb_socketTransType( int type, int *err ) } #endif -static int hb_socketSelectRD( HB_SOCKET sd, HB_LONG timeout ) +static int hb_socketSelectRD( HB_SOCKET sd, HB_MAXINT timeout ) { struct timeval tv, * ptv; fd_set rfds; int iResult; #if !defined( HB_HAS_SELECT_TIMER ) - HB_ULONG timer = timeout <= 0 ? 0 : hb_dateMilliSeconds(); + HB_MAXUINT timer = timeout <= 0 ? 0 : hb_dateMilliSeconds(); #endif for( ;; ) @@ -1392,7 +1392,7 @@ static int hb_socketSelectRD( HB_SOCKET sd, HB_LONG timeout ) continue; #else { - HB_ULONG timecurr = hb_dateMilliSeconds(); + HB_MAXUINT timecurr = hb_dateMilliSeconds(); if( timecurr > timer ) { timeout -= timecurr - timer; @@ -1409,13 +1409,13 @@ static int hb_socketSelectRD( HB_SOCKET sd, HB_LONG timeout ) ( iResult > 0 && FD_ISSET( sd, &rfds ) ? 1 : 0 ); } -static int hb_socketSelectWR( HB_SOCKET sd, HB_LONG timeout ) +static int hb_socketSelectWR( HB_SOCKET sd, HB_MAXINT timeout ) { struct timeval tv, * ptv; fd_set wfds; int iResult; #if !defined( HB_HAS_SELECT_TIMER ) - HB_ULONG timer = timeout <= 0 ? 0 : hb_dateMilliSeconds(); + HB_MAXUINT timer = timeout <= 0 ? 0 : hb_dateMilliSeconds(); #endif for( ;; ) @@ -1440,7 +1440,7 @@ static int hb_socketSelectWR( HB_SOCKET sd, HB_LONG timeout ) continue; #else { - HB_ULONG timecurr = hb_dateMilliSeconds(); + HB_MAXUINT timecurr = hb_dateMilliSeconds(); if( timecurr > timer ) { timeout -= timecurr - timer; @@ -1457,7 +1457,7 @@ static int hb_socketSelectWR( HB_SOCKET sd, HB_LONG timeout ) ( iResult > 0 && FD_ISSET( sd, &wfds ) ? 1 : 0 ); } -static int hb_socketSelectWRE( HB_SOCKET sd, HB_LONG timeout ) +static int hb_socketSelectWRE( HB_SOCKET sd, HB_MAXINT timeout ) { struct timeval tv, * ptv; fd_set wfds, * pefds; @@ -1466,7 +1466,7 @@ static int hb_socketSelectWRE( HB_SOCKET sd, HB_LONG timeout ) #endif int iResult; #if !defined( HB_HAS_SELECT_TIMER ) - HB_ULONG timer = timeout <= 0 ? 0 : hb_dateMilliSeconds(); + HB_MAXUINT timer = timeout <= 0 ? 0 : hb_dateMilliSeconds(); #endif for( ;; ) @@ -1502,7 +1502,7 @@ static int hb_socketSelectWRE( HB_SOCKET sd, HB_LONG timeout ) continue; #else { - HB_ULONG timecurr = hb_dateMilliSeconds(); + HB_MAXUINT timecurr = hb_dateMilliSeconds(); if( timecurr > timer ) { timeout -= timecurr - timer; @@ -2085,7 +2085,7 @@ int hb_socketListen( HB_SOCKET sd, int iBacklog ) return ret; } -HB_SOCKET hb_socketAccept( HB_SOCKET sd, void ** pSockAddr, unsigned * puiLen, HB_LONG timeout ) +HB_SOCKET hb_socketAccept( HB_SOCKET sd, void ** pSockAddr, unsigned * puiLen, HB_MAXINT timeout ) { HB_SOCKET newsd = HB_NO_SOCKET; int ret; @@ -2139,7 +2139,7 @@ HB_SOCKET hb_socketAccept( HB_SOCKET sd, void ** pSockAddr, unsigned * puiLen, H return newsd; } -int hb_socketConnect( HB_SOCKET sd, const void * pSockAddr, unsigned uiLen, HB_LONG timeout ) +int hb_socketConnect( HB_SOCKET sd, const void * pSockAddr, unsigned uiLen, HB_MAXINT timeout ) { int ret, blk; @@ -2171,7 +2171,7 @@ int hb_socketConnect( HB_SOCKET sd, const void * pSockAddr, unsigned uiLen, HB_L return ret; } -long hb_socketSend( HB_SOCKET sd, const void * data, long len, int flags, HB_LONG timeout ) +long hb_socketSend( HB_SOCKET sd, const void * data, long len, int flags, HB_MAXINT timeout ) { long lSent = 0; @@ -2209,7 +2209,7 @@ long hb_socketSend( HB_SOCKET sd, const void * data, long len, int flags, HB_LON } long hb_socketSendTo( HB_SOCKET sd, const void * data, long len, int flags, - const void * pSockAddr, unsigned uiSockLen, HB_LONG timeout ) + const void * pSockAddr, unsigned uiSockLen, HB_MAXINT timeout ) { long lSent = 0; @@ -2243,7 +2243,7 @@ long hb_socketSendTo( HB_SOCKET sd, const void * data, long len, int flags, return lSent; } -long hb_socketRecv( HB_SOCKET sd, void * data, long len, int flags, HB_LONG timeout ) +long hb_socketRecv( HB_SOCKET sd, void * data, long len, int flags, HB_MAXINT timeout ) { long lReceived = 0; @@ -2272,7 +2272,7 @@ long hb_socketRecv( HB_SOCKET sd, void * data, long len, int flags, HB_LONG time return lReceived; } -long hb_socketRecvFrom( HB_SOCKET sd, void * data, long len, int flags, void ** pSockAddr, unsigned * puiSockLen, HB_LONG timeout ) +long hb_socketRecvFrom( HB_SOCKET sd, void * data, long len, int flags, void ** pSockAddr, unsigned * puiSockLen, HB_MAXINT timeout ) { long lReceived = 0; @@ -2506,7 +2506,7 @@ int hb_socketSetMulticast( HB_SOCKET sd, int af, const char * szAddr ) return -1; } -int hb_socketSelectRead( HB_SOCKET sd, HB_LONG timeout ) +int hb_socketSelectRead( HB_SOCKET sd, HB_MAXINT timeout ) { int ret; @@ -2517,7 +2517,7 @@ int hb_socketSelectRead( HB_SOCKET sd, HB_LONG timeout ) return ret; } -int hb_socketSelectWrite( HB_SOCKET sd, HB_LONG timeout ) +int hb_socketSelectWrite( HB_SOCKET sd, HB_MAXINT timeout ) { int ret; @@ -2528,7 +2528,7 @@ int hb_socketSelectWrite( HB_SOCKET sd, HB_LONG timeout ) return ret; } -int hb_socketSelectWriteEx( HB_SOCKET sd, HB_LONG timeout ) +int hb_socketSelectWriteEx( HB_SOCKET sd, HB_MAXINT timeout ) { int ret; @@ -2542,7 +2542,7 @@ int hb_socketSelectWriteEx( HB_SOCKET sd, HB_LONG timeout ) int hb_socketSelect( PHB_ITEM pArrayRD, HB_BOOL fSetRD, PHB_ITEM pArrayWR, HB_BOOL fSetWR, PHB_ITEM pArrayEX, HB_BOOL fSetEX, - HB_LONG timeout, HB_SOCKET_FUNC pFunc ) + HB_MAXINT timeout, HB_SOCKET_FUNC pFunc ) { HB_SOCKET maxsd, sd; int i, ret; diff --git a/harbour/src/rtl/hbstrfmt.c b/harbour/src/rtl/hbstrfmt.c index bc56098d99..371820a07f 100644 --- a/harbour/src/rtl/hbstrfmt.c +++ b/harbour/src/rtl/hbstrfmt.c @@ -219,7 +219,7 @@ PHB_ITEM hb_strFormat( PHB_ITEM pItemReturn, PHB_ITEM pItemFormat, int iCount, P fSign = 0; if( HB_IS_NUMERIC( pItem ) ) { - iSize = sizeof( HB_LONG ) * 3 + 1; + iSize = sizeof( HB_MAXINT ) * 3 + 1; pStr2 = pStr = ( char * ) hb_xgrab( iSize + 1 ); hb_itemStrBuf( pStr, pItem, iSize, 0 ); while( *pStr2 == ' ' ) diff --git a/harbour/src/rtl/hbznet.c b/harbour/src/rtl/hbznet.c index 85511624ac..8395aac207 100644 --- a/harbour/src/rtl/hbznet.c +++ b/harbour/src/rtl/hbznet.c @@ -196,7 +196,7 @@ static void hb_znetEncrypt( PHB_ZNETSTREAM pStream, Bytef * data ) /* read data using stream structure */ -long hb_znetRead( PHB_ZNETSTREAM pStream, HB_SOCKET sd, void * buffer, long len, HB_LONG timeout ) +long hb_znetRead( PHB_ZNETSTREAM pStream, HB_SOCKET sd, void * buffer, long len, HB_MAXINT timeout ) { long rec = 0; @@ -279,7 +279,7 @@ long hb_znetRead( PHB_ZNETSTREAM pStream, HB_SOCKET sd, void * buffer, long len, return len == 0 ? rec : len; } -static long hb_znetStreamWrite( PHB_ZNETSTREAM pStream, HB_SOCKET sd, HB_LONG timeout ) +static long hb_znetStreamWrite( PHB_ZNETSTREAM pStream, HB_SOCKET sd, HB_MAXINT timeout ) { long tosnd = HB_ZNET_BUFSIZE - pStream->wr.avail_out; long snd = 0, rest = 0; @@ -355,7 +355,7 @@ static long hb_znetStreamWrite( PHB_ZNETSTREAM pStream, HB_SOCKET sd, HB_LONG ti /* flush data in stream structure - return number of bytes left in the * buffer which were not sent */ -long hb_znetFlush( PHB_ZNETSTREAM pStream, HB_SOCKET sd, HB_LONG timeout ) +long hb_znetFlush( PHB_ZNETSTREAM pStream, HB_SOCKET sd, HB_MAXINT timeout ) { uInt uiSize = HB_ZNET_BUFSIZE - ( pStream->crypt ? -2 : 0 ); @@ -378,7 +378,7 @@ long hb_znetFlush( PHB_ZNETSTREAM pStream, HB_SOCKET sd, HB_LONG timeout ) /* write data using stream structure */ -long hb_znetWrite( PHB_ZNETSTREAM pStream, HB_SOCKET sd, const void * buffer, long len, HB_LONG timeout, long * plast ) +long hb_znetWrite( PHB_ZNETSTREAM pStream, HB_SOCKET sd, const void * buffer, long len, HB_MAXINT timeout, long * plast ) { long snd = 0; diff --git a/harbour/src/rtl/idle.c b/harbour/src/rtl/idle.c index 3984a20e8b..3ff97bd1fc 100644 --- a/harbour/src/rtl/idle.c +++ b/harbour/src/rtl/idle.c @@ -150,7 +150,7 @@ void hb_idleSleep( double dSeconds ) { if( dSeconds >= 0 ) { - HB_ULONG end_timer = hb_dateMilliSeconds() + ( HB_ULONG ) ( dSeconds * 1000 ); + HB_MAXUINT end_timer = hb_dateMilliSeconds() + ( HB_MAXUINT ) ( dSeconds * 1000 ); while( hb_dateMilliSeconds() < end_timer && hb_vmRequestQuery() == 0 ) hb_idleState(); diff --git a/harbour/src/rtl/itemseri.c b/harbour/src/rtl/itemseri.c index aeeeecce73..2c27106684 100644 --- a/harbour/src/rtl/itemseri.c +++ b/harbour/src/rtl/itemseri.c @@ -278,7 +278,7 @@ static HB_SIZE hb_itemSerialSize( PHB_ITEM pItem, HB_BOOL fNumSize, PHB_CYCLIC_REF * pRefPtr, HB_SIZE ulOffset ) { HB_SIZE ulSize, ulLen, u; - HB_LONG lVal; + HB_MAXINT lVal; USHORT uiClass; PHB_ITEM pDefVal; const char * szVal; @@ -430,7 +430,7 @@ static HB_SIZE hb_serializeItem( PHB_ITEM pItem, HB_BOOL fNumSize, HB_UCHAR * pBuffer, HB_SIZE ulOffset, PHB_CYCLIC_REF pRef ) { - HB_LONG lVal; + HB_MAXINT lVal; double d; int iWidth, iDecimal; long l, l2; diff --git a/harbour/src/rtl/minmax.c b/harbour/src/rtl/minmax.c index 0f98e6e1fd..1d627b1b40 100644 --- a/harbour/src/rtl/minmax.c +++ b/harbour/src/rtl/minmax.c @@ -65,8 +65,8 @@ HB_FUNC( MAX ) { if( HB_IS_NUMINT( p1 ) && HB_IS_NUMINT( p2 ) ) { - HB_LONG l1 = hb_itemGetNInt( p1 ); - HB_LONG l2 = hb_itemGetNInt( p2 ); + HB_MAXINT l1 = hb_itemGetNInt( p1 ); + HB_MAXINT l2 = hb_itemGetNInt( p2 ); if( l1 >= l2 ) hb_itemReturn( p1 ); @@ -126,8 +126,8 @@ HB_FUNC( MIN ) { if( HB_IS_NUMINT( p1 ) && HB_IS_NUMINT( p2 ) ) { - HB_LONG l1 = hb_itemGetNInt( p1 ); - HB_LONG l2 = hb_itemGetNInt( p2 ); + HB_MAXINT l1 = hb_itemGetNInt( p1 ); + HB_MAXINT l2 = hb_itemGetNInt( p2 ); if( l1 <= l2 ) hb_itemReturn( p1 ); diff --git a/harbour/src/rtl/seconds.c b/harbour/src/rtl/seconds.c index 4315dd4737..958ebb4059 100644 --- a/harbour/src/rtl/seconds.c +++ b/harbour/src/rtl/seconds.c @@ -60,7 +60,7 @@ HB_FUNC( SECONDS ) HB_FUNC( HB_MILLISECONDS ) { - hb_retnint( ( HB_LONG ) hb_dateMilliSeconds() ); + hb_retnint( ( HB_MAXINT ) hb_dateMilliSeconds() ); } HB_FUNC( HB_CLOCKS2SECS ) diff --git a/harbour/src/rtl/val.c b/harbour/src/rtl/val.c index d495d51f2a..e7f43b7328 100644 --- a/harbour/src/rtl/val.c +++ b/harbour/src/rtl/val.c @@ -64,7 +64,7 @@ HB_FUNC( VAL ) const char * szText = hb_itemGetCPtr( pText ); int iWidth, iDec, iLen = ( int ) hb_itemGetCLen( pText ); HB_BOOL fDbl; - HB_LONG lValue; + HB_MAXINT lValue; double dValue; fDbl = hb_valStrnToNum( szText, iLen, &lValue, &dValue , &iDec, &iWidth ); diff --git a/harbour/src/vm/arrays.c b/harbour/src/vm/arrays.c index e8be38e171..d24fc7b61c 100644 --- a/harbour/src/vm/arrays.c +++ b/harbour/src/vm/arrays.c @@ -596,7 +596,7 @@ HB_LONGLONG hb_arrayGetNLL( PHB_ITEM pArray, HB_SIZE ulIndex ) } #endif -HB_LONG hb_arrayGetNInt( PHB_ITEM pArray, HB_SIZE ulIndex ) +HB_MAXINT hb_arrayGetNInt( PHB_ITEM pArray, HB_SIZE ulIndex ) { HB_TRACE(HB_TR_DEBUG, ("hb_arrayGetNLL(%p, %lu)", pArray, ulIndex)); @@ -803,7 +803,7 @@ HB_BOOL hb_arraySetNLL( PHB_ITEM pArray, HB_SIZE ulIndex, HB_LONGLONG llNumber ) } #endif -HB_BOOL hb_arraySetNInt( PHB_ITEM pArray, HB_SIZE ulIndex, HB_LONG lNumber ) +HB_BOOL hb_arraySetNInt( PHB_ITEM pArray, HB_SIZE ulIndex, HB_MAXINT lNumber ) { HB_TRACE(HB_TR_DEBUG, ("hb_arraySetNInt(%p, %lu, %" PFHL "d)", pArray, ulIndex, lNumber)); diff --git a/harbour/src/vm/extend.c b/harbour/src/vm/extend.c index b7832561e1..183fb44e38 100644 --- a/harbour/src/vm/extend.c +++ b/harbour/src/vm/extend.c @@ -617,7 +617,7 @@ HB_LONGLONG hb_parnll( int iParam ) } #endif -HB_LONG hb_parnint( int iParam ) +HB_MAXINT hb_parnint( int iParam ) { HB_STACK_TLS_PRELOAD @@ -631,14 +631,14 @@ HB_LONG hb_parnint( int iParam ) pItem = hb_itemUnRef( pItem ); if( HB_IS_LONG( pItem ) ) - return ( HB_LONG ) pItem->item.asLong.value; + return ( HB_MAXINT ) pItem->item.asLong.value; else if( HB_IS_INTEGER( pItem ) ) - return ( HB_LONG ) pItem->item.asInteger.value; + return ( HB_MAXINT ) pItem->item.asInteger.value; else if( HB_IS_DOUBLE( pItem ) ) #if defined( __GNUC__ ) - return ( HB_LONG ) ( HB_ULONG ) pItem->item.asDouble.value; + return ( HB_MAXINT ) ( HB_MAXUINT ) pItem->item.asDouble.value; #else - return ( HB_LONG ) pItem->item.asDouble.value; + return ( HB_MAXINT ) pItem->item.asDouble.value; #endif } @@ -1185,7 +1185,7 @@ HB_LONGLONG hb_parvnll( int iParam, ... ) } #endif -HB_LONG hb_parvnint( int iParam, ... ) +HB_MAXINT hb_parvnint( int iParam, ... ) { HB_STACK_TLS_PRELOAD @@ -1199,14 +1199,14 @@ HB_LONG hb_parvnint( int iParam, ... ) pItem = hb_itemUnRef( pItem ); if( HB_IS_LONG( pItem ) ) - return ( HB_LONG ) pItem->item.asLong.value; + return ( HB_MAXINT ) pItem->item.asLong.value; else if( HB_IS_INTEGER( pItem ) ) - return ( HB_LONG ) pItem->item.asInteger.value; + return ( HB_MAXINT ) pItem->item.asInteger.value; else if( HB_IS_DOUBLE( pItem ) ) #if defined( __GNUC__ ) - return ( HB_LONG ) ( HB_ULONG ) pItem->item.asDouble.value; + return ( HB_MAXINT ) ( HB_MAXUINT ) pItem->item.asDouble.value; #else - return ( HB_LONG ) pItem->item.asDouble.value; + return ( HB_MAXINT ) pItem->item.asDouble.value; #endif else if( HB_IS_ARRAY( pItem ) ) { @@ -1479,7 +1479,7 @@ void hb_retnll( HB_LONGLONG llNumber ) #endif #undef hb_retnint -void hb_retnint( HB_LONG lNumber ) +void hb_retnint( HB_MAXINT lNumber ) { HB_STACK_TLS_PRELOAD @@ -1541,7 +1541,7 @@ void hb_retnlllen( HB_LONGLONG llNumber, int iWidth ) #endif #undef hb_retnintlen -void hb_retnintlen( HB_LONG lNumber, int iWidth ) +void hb_retnintlen( HB_MAXINT lNumber, int iWidth ) { HB_STACK_TLS_PRELOAD @@ -1874,7 +1874,7 @@ int hb_stornll( HB_LONGLONG llValue, int iParam ) } #endif -int hb_stornint( HB_LONG lValue, int iParam ) +int hb_stornint( HB_MAXINT lValue, int iParam ) { HB_STACK_TLS_PRELOAD @@ -2345,7 +2345,7 @@ int hb_storvnll( HB_LONGLONG llValue, int iParam, ... ) } #endif -int hb_storvnint( HB_LONG lValue, int iParam, ... ) +int hb_storvnint( HB_MAXINT lValue, int iParam, ... ) { HB_STACK_TLS_PRELOAD diff --git a/harbour/src/vm/hashes.c b/harbour/src/vm/hashes.c index 1da4f8d662..ba7cd2cd6c 100644 --- a/harbour/src/vm/hashes.c +++ b/harbour/src/vm/hashes.c @@ -192,8 +192,8 @@ static int hb_hashItemCmp( PHB_ITEM pKey1, PHB_ITEM pKey2, int iFlags ) } else if( HB_IS_NUMINT( pKey1 ) && HB_IS_NUMINT( pKey2 ) ) { - HB_LONG l1 = HB_ITEM_GET_NUMINTRAW( pKey1 ), - l2 = HB_ITEM_GET_NUMINTRAW( pKey2 ); + HB_MAXINT l1 = HB_ITEM_GET_NUMINTRAW( pKey1 ), + l2 = HB_ITEM_GET_NUMINTRAW( pKey2 ); return l1 < l2 ? -1 : ( l1 > l2 ? 1 : 0 ); } else if( HB_IS_NUMERIC( pKey2 ) ) diff --git a/harbour/src/vm/hvm.c b/harbour/src/vm/hvm.c index 50549c6a97..23c327960a 100644 --- a/harbour/src/vm/hvm.c +++ b/harbour/src/vm/hvm.c @@ -176,7 +176,7 @@ static void hb_vmPushMacroBlock( const BYTE * pCode, HB_SIZE ulSize, USHORT u static void hb_vmPushDoubleConst( double dNumber, int iWidth, int iDec ); /* Pushes a double constant (pcode) */ static void hb_vmPushLocal( int iLocal ); /* pushes the containts of a local onto the stack */ static void hb_vmPushLocalByRef( int iLocal ); /* pushes a local by refrence onto the stack */ -static void hb_vmPushHBLong( HB_LONG lNumber ); /* pushes a HB_LONG number onto the stack */ +static void hb_vmPushHBLong( HB_MAXINT lNumber ); /* pushes a HB_MAXINT number onto the stack */ #if !defined( HB_LONG_LONG_OFF ) static void hb_vmPushLongLongConst( HB_LONGLONG lNumber ); /* Pushes a long long constant (pcode) */ #endif @@ -2934,7 +2934,7 @@ static void hb_vmAddInt( HB_ITEM_PTR pResult, LONG lAdd ) if( HB_IS_NUMINT( pResult ) ) { - HB_LONG lVal = HB_ITEM_GET_NUMINTRAW( pResult ), lResult; + HB_MAXINT lVal = HB_ITEM_GET_NUMINTRAW( pResult ), lResult; lResult = lVal + lAdd; @@ -3000,7 +3000,7 @@ static void hb_vmNegate( void ) if( pItem->item.asInteger.value < -HB_INT_MAX ) { #if HB_LONG_MAX > HB_INT_MAX - HB_LONG lValue = ( HB_LONG ) pItem->item.asInteger.value; + HB_MAXINT lValue = ( HB_MAXINT ) pItem->item.asInteger.value; pItem->type = HB_IT_LONG; pItem->item.asLong.value = -lValue; pItem->item.asLong.length = HB_LONG_EXPLENGTH( -lValue ); @@ -3122,9 +3122,9 @@ static void hb_vmPlus( HB_ITEM_PTR pResult, HB_ITEM_PTR pItem1, HB_ITEM_PTR pIte if( HB_IS_NUMINT( pItem1 ) && HB_IS_NUMINT( pItem2 ) ) { - HB_LONG lNumber1 = HB_ITEM_GET_NUMINTRAW( pItem1 ); - HB_LONG lNumber2 = HB_ITEM_GET_NUMINTRAW( pItem2 ); - HB_LONG lResult = lNumber1 + lNumber2; + HB_MAXINT lNumber1 = HB_ITEM_GET_NUMINTRAW( pItem1 ); + HB_MAXINT lNumber2 = HB_ITEM_GET_NUMINTRAW( pItem2 ); + HB_MAXINT lResult = lNumber1 + lNumber2; if( HB_IS_COMPLEX( pResult ) ) hb_itemClear( pResult ); @@ -3238,9 +3238,9 @@ static void hb_vmMinus( HB_ITEM_PTR pResult, HB_ITEM_PTR pItem1, HB_ITEM_PTR pIt if( HB_IS_NUMINT( pItem1 ) && HB_IS_NUMINT( pItem2 ) ) { - HB_LONG lNumber1 = HB_ITEM_GET_NUMINTRAW( pItem1 ); - HB_LONG lNumber2 = HB_ITEM_GET_NUMINTRAW( pItem2 ); - HB_LONG lResult = lNumber1 - lNumber2; + HB_MAXINT lNumber1 = HB_ITEM_GET_NUMINTRAW( pItem1 ); + HB_MAXINT lNumber2 = HB_ITEM_GET_NUMINTRAW( pItem2 ); + HB_MAXINT lResult = lNumber1 - lNumber2; if( HB_IS_COMPLEX( pResult ) ) hb_itemClear( pResult ); @@ -3349,8 +3349,8 @@ static void hb_vmMult( HB_ITEM_PTR pResult, HB_ITEM_PTR pItem1, HB_ITEM_PTR pIte HB_LONG_MIN / HB_INT_MIN >= HB_INT_MIN && 1 if( HB_IS_INTEGER( pItem1 ) && HB_IS_INTEGER( pItem2 ) ) { - HB_LONG lResult = ( HB_LONG ) pItem1->item.asInteger.value * - ( HB_LONG ) pItem2->item.asInteger.value; + HB_MAXINT lResult = ( HB_MAXINT ) pItem1->item.asInteger.value * + ( HB_MAXINT ) pItem2->item.asInteger.value; if( HB_IS_COMPLEX( pResult ) ) hb_itemClear( pResult ); HB_ITEM_PUT_NUMINTRAW( pResult, lResult ); @@ -3385,7 +3385,7 @@ static void hb_vmDivide( HB_ITEM_PTR pResult, HB_ITEM_PTR pItem1, HB_ITEM_PTR pI if( HB_IS_NUMINT( pItem1 ) && HB_IS_NUMINT( pItem2 ) ) { - HB_LONG lDivisor = HB_ITEM_GET_NUMINTRAW( pItem2 ); + HB_MAXINT lDivisor = HB_ITEM_GET_NUMINTRAW( pItem2 ); if( lDivisor == 0 ) { @@ -3399,7 +3399,7 @@ static void hb_vmDivide( HB_ITEM_PTR pResult, HB_ITEM_PTR pItem1, HB_ITEM_PTR pI } else { - HB_LONG lNumber1 = HB_ITEM_GET_NUMINTRAW( pItem1 ); + HB_MAXINT lNumber1 = HB_ITEM_GET_NUMINTRAW( pItem1 ); hb_itemPutND( pResult, ( double ) lNumber1 / ( double ) lDivisor ); } } @@ -3447,7 +3447,7 @@ static void hb_vmModulus( HB_ITEM_PTR pResult, HB_ITEM_PTR pItem1, HB_ITEM_PTR p if( HB_IS_NUMINT( pItem1 ) && HB_IS_NUMINT( pItem2 ) ) { - HB_LONG lDivisor = HB_ITEM_GET_NUMINTRAW( pItem2 ); + HB_MAXINT lDivisor = HB_ITEM_GET_NUMINTRAW( pItem2 ); if( lDivisor == 0 ) { @@ -3539,7 +3539,7 @@ static void hb_vmInc( PHB_ITEM pItem ) { #if HB_INT_MAX < HB_LONG_MAX pItem->type = HB_IT_LONG; - pItem->item.asLong.value = ( HB_LONG ) pItem->item.asInteger.value + 1; + pItem->item.asLong.value = ( HB_MAXINT ) pItem->item.asInteger.value + 1; pItem->item.asLong.length = HB_LONG_EXPLENGTH( pItem->item.asLong.value ); #else pItem->type = HB_IT_DOUBLE; @@ -3604,7 +3604,7 @@ static void hb_vmDec( PHB_ITEM pItem ) { #if HB_INT_MIN > HB_LONG_MIN pItem->type = HB_IT_LONG; - pItem->item.asLong.value = ( HB_LONG ) pItem->item.asInteger.value - 1; + pItem->item.asLong.value = ( HB_MAXINT ) pItem->item.asInteger.value - 1; pItem->item.asLong.length = HB_LONG_EXPLENGTH( pItem->item.asLong.value ); #else pItem->type = HB_IT_DOUBLE; @@ -6485,13 +6485,13 @@ void hb_vmPushNumber( double dNumber, int iDec ) hb_vmPushInteger( ( int ) dNumber ); else if( HB_DBL_LIM_LONG( dNumber ) ) - hb_vmPushHBLong( ( HB_LONG ) dNumber ); + hb_vmPushHBLong( ( HB_MAXINT ) dNumber ); else hb_vmPushDouble( dNumber, hb_stackSetStruct()->HB_SET_DECIMALS ); } -static int hb_vmCalcIntWidth( HB_LONG lNumber ) +static int hb_vmCalcIntWidth( HB_MAXINT lNumber ) { int iWidth; @@ -6544,7 +6544,7 @@ static void hb_vmPushLongConst( long lNumber ) HB_TRACE(HB_TR_DEBUG, ("hb_vmPushLongConst(%ld)", lNumber)); pItem->type = HB_IT_LONG; - pItem->item.asLong.value = ( HB_LONG ) lNumber; + pItem->item.asLong.value = ( HB_MAXINT ) lNumber; pItem->item.asLong.length = ( USHORT ) hb_vmCalcIntWidth( lNumber ); } #endif @@ -6560,7 +6560,7 @@ void hb_vmPushLong( long lNumber ) HB_ITEM_PUT_LONGRAW( pItem, lNumber ); } -static void hb_vmPushHBLong( HB_LONG lNumber ) +static void hb_vmPushHBLong( HB_MAXINT lNumber ) { HB_STACK_TLS_PRELOAD PHB_ITEM pItem = hb_stackAllocItem(); @@ -6581,12 +6581,12 @@ static void hb_vmPushLongLongConst( HB_LONGLONG llNumber ) HB_TRACE(HB_TR_DEBUG, ("hb_vmPushLongLongConst(%" PFLL "d)", llNumber)); pItem->type = HB_IT_LONG; - pItem->item.asLong.value = ( HB_LONG ) llNumber; + pItem->item.asLong.value = ( HB_MAXINT ) llNumber; pItem->item.asLong.length = ( USHORT ) hb_vmCalcIntWidth( llNumber ); } #endif -void hb_vmPushNumInt( HB_LONG lNumber ) +void hb_vmPushNumInt( HB_MAXINT lNumber ) { if( HB_LIM_INT( lNumber ) ) hb_vmPushInteger( ( int ) lNumber ); @@ -9551,7 +9551,7 @@ HB_BOOL hb_xvmEqualInt( LONG lValue ) } else if( HB_IS_LONG( pItem ) ) { - pItem->item.asLogical.value = pItem->item.asLong.value == ( HB_LONG ) lValue; + pItem->item.asLogical.value = pItem->item.asLong.value == ( HB_MAXINT ) lValue; pItem->type = HB_IT_LOGICAL; } else if( HB_IS_DOUBLE( pItem ) ) @@ -9604,7 +9604,7 @@ HB_BOOL hb_xvmEqualIntIs( LONG lValue, HB_BOOL * pfValue ) } else if( HB_IS_LONG( pItem ) ) { - * pfValue = pItem->item.asLong.value == ( HB_LONG ) lValue; + * pfValue = pItem->item.asLong.value == ( HB_MAXINT ) lValue; hb_stackDec(); } else if( HB_IS_DOUBLE( pItem ) ) @@ -9670,7 +9670,7 @@ HB_BOOL hb_xvmNotEqualInt( LONG lValue ) } else if( HB_IS_LONG( pItem ) ) { - pItem->item.asLogical.value = pItem->item.asLong.value != ( HB_LONG ) lValue; + pItem->item.asLogical.value = pItem->item.asLong.value != ( HB_MAXINT ) lValue; pItem->type = HB_IT_LOGICAL; } else if( HB_IS_DOUBLE( pItem ) ) @@ -9723,7 +9723,7 @@ HB_BOOL hb_xvmNotEqualIntIs( LONG lValue, HB_BOOL * pfValue ) } else if( HB_IS_LONG( pItem ) ) { - * pfValue = pItem->item.asLong.value != ( HB_LONG ) lValue; + * pfValue = pItem->item.asLong.value != ( HB_MAXINT ) lValue; hb_stackDec(); } else if( HB_IS_DOUBLE( pItem ) ) @@ -9789,7 +9789,7 @@ HB_BOOL hb_xvmLessThenInt( LONG lValue ) } else if( HB_IS_LONG( pItem ) ) { - pItem->item.asLogical.value = pItem->item.asLong.value < ( HB_LONG ) lValue; + pItem->item.asLogical.value = pItem->item.asLong.value < ( HB_MAXINT ) lValue; pItem->type = HB_IT_LOGICAL; } else if( HB_IS_DOUBLE( pItem ) ) @@ -9837,7 +9837,7 @@ HB_BOOL hb_xvmLessThenIntIs( LONG lValue, HB_BOOL * pfValue ) } else if( HB_IS_LONG( pItem ) ) { - * pfValue = pItem->item.asLong.value < ( HB_LONG ) lValue; + * pfValue = pItem->item.asLong.value < ( HB_MAXINT ) lValue; hb_stackDec(); } else if( HB_IS_DOUBLE( pItem ) ) @@ -9898,7 +9898,7 @@ HB_BOOL hb_xvmLessEqualThenInt( LONG lValue ) } else if( HB_IS_LONG( pItem ) ) { - pItem->item.asLogical.value = pItem->item.asLong.value <= ( HB_LONG ) lValue; + pItem->item.asLogical.value = pItem->item.asLong.value <= ( HB_MAXINT ) lValue; pItem->type = HB_IT_LOGICAL; } else if( HB_IS_DOUBLE( pItem ) ) @@ -9946,7 +9946,7 @@ HB_BOOL hb_xvmLessEqualThenIntIs( LONG lValue, HB_BOOL * pfValue ) } else if( HB_IS_LONG( pItem ) ) { - * pfValue = pItem->item.asLong.value <= ( HB_LONG ) lValue; + * pfValue = pItem->item.asLong.value <= ( HB_MAXINT ) lValue; hb_stackDec(); } else if( HB_IS_DOUBLE( pItem ) ) @@ -10007,7 +10007,7 @@ HB_BOOL hb_xvmGreaterThenInt( LONG lValue ) } else if( HB_IS_LONG( pItem ) ) { - pItem->item.asLogical.value = pItem->item.asLong.value > ( HB_LONG ) lValue; + pItem->item.asLogical.value = pItem->item.asLong.value > ( HB_MAXINT ) lValue; pItem->type = HB_IT_LOGICAL; } else if( HB_IS_DOUBLE( pItem ) ) @@ -10055,7 +10055,7 @@ HB_BOOL hb_xvmGreaterThenIntIs( LONG lValue, HB_BOOL * pfValue ) } else if( HB_IS_LONG( pItem ) ) { - * pfValue = pItem->item.asLong.value > ( HB_LONG ) lValue; + * pfValue = pItem->item.asLong.value > ( HB_MAXINT ) lValue; hb_stackDec(); } else if( HB_IS_DOUBLE( pItem ) ) @@ -10116,7 +10116,7 @@ HB_BOOL hb_xvmGreaterEqualThenInt( LONG lValue ) } else if( HB_IS_LONG( pItem ) ) { - pItem->item.asLogical.value = pItem->item.asLong.value >= ( HB_LONG ) lValue; + pItem->item.asLogical.value = pItem->item.asLong.value >= ( HB_MAXINT ) lValue; pItem->type = HB_IT_LOGICAL; } else if( HB_IS_DOUBLE( pItem ) ) @@ -10164,7 +10164,7 @@ HB_BOOL hb_xvmGreaterEqualThenIntIs( LONG lValue, HB_BOOL * pfValue ) } else if( HB_IS_LONG( pItem ) ) { - * pfValue = pItem->item.asLong.value >= ( HB_LONG ) lValue; + * pfValue = pItem->item.asLong.value >= ( HB_MAXINT ) lValue; hb_stackDec(); } else if( HB_IS_DOUBLE( pItem ) ) diff --git a/harbour/src/vm/itemapi.c b/harbour/src/vm/itemapi.c index 3507fa07d2..5d827bc415 100644 --- a/harbour/src/vm/itemapi.c +++ b/harbour/src/vm/itemapi.c @@ -651,23 +651,23 @@ long hb_itemGetNL( PHB_ITEM pItem ) return 0; } -HB_LONG hb_itemGetNInt( PHB_ITEM pItem ) +HB_MAXINT hb_itemGetNInt( PHB_ITEM pItem ) { HB_TRACE(HB_TR_DEBUG, ("hb_itemGetNL(%p)", pItem)); if( pItem ) { if( HB_IS_LONG( pItem ) ) - return ( HB_LONG ) pItem->item.asLong.value; + return ( HB_MAXINT ) pItem->item.asLong.value; else if( HB_IS_INTEGER( pItem ) ) - return ( HB_LONG ) pItem->item.asInteger.value; + return ( HB_MAXINT ) pItem->item.asInteger.value; else if( HB_IS_DOUBLE( pItem ) ) #if defined( __GNUC__ ) - return ( HB_LONG ) ( HB_ULONG ) pItem->item.asDouble.value; + return ( HB_MAXINT ) ( HB_MAXUINT ) pItem->item.asDouble.value; #else - return ( HB_LONG ) pItem->item.asDouble.value; + return ( HB_MAXINT ) pItem->item.asDouble.value; #endif } @@ -978,7 +978,7 @@ PHB_ITEM hb_itemPutNLL( PHB_ITEM pItem, HB_LONGLONG llNumber ) #if HB_LONG_MAX >= LONGLONG_MAX pItem->type = HB_IT_LONG; - pItem->item.asLong.value = ( HB_LONG ) llNumber; + pItem->item.asLong.value = ( HB_MAXINT ) llNumber; pItem->item.asLong.length = HB_LONG_LENGTH( llNumber ); #else pItem->type = HB_IT_DOUBLE; @@ -990,7 +990,7 @@ PHB_ITEM hb_itemPutNLL( PHB_ITEM pItem, HB_LONGLONG llNumber ) } #endif -PHB_ITEM hb_itemPutNInt( PHB_ITEM pItem, HB_LONG lNumber ) +PHB_ITEM hb_itemPutNInt( PHB_ITEM pItem, HB_MAXINT lNumber ) { HB_TRACE(HB_TR_DEBUG, ("hb_itemPutNInt(%p, %" PFHL "d)", pItem, lNumber)); @@ -1019,7 +1019,7 @@ PHB_ITEM hb_itemPutNInt( PHB_ITEM pItem, HB_LONG lNumber ) return pItem; } -PHB_ITEM hb_itemPutNIntLen( PHB_ITEM pItem, HB_LONG lNumber, int iWidth ) +PHB_ITEM hb_itemPutNIntLen( PHB_ITEM pItem, HB_MAXINT lNumber, int iWidth ) { HB_TRACE(HB_TR_DEBUG, ("hb_itemPutNIntLen(%p, %" PFHL "d, %d)", pItem, lNumber, iWidth)); @@ -1049,7 +1049,7 @@ PHB_ITEM hb_itemPutNLen( PHB_ITEM pItem, double dNumber, int iWidth, int iDec ) if( iDec == 0 ) { - HB_LONG lNumber = ( HB_LONG ) dNumber; + HB_MAXINT lNumber = ( HB_MAXINT ) dNumber; if( ( double ) lNumber == dNumber ) { @@ -1193,7 +1193,7 @@ PHB_ITEM hb_itemPutNLLen( PHB_ITEM pItem, long lNumber, int iWidth ) iWidth = HB_LONG_LENGTH( lNumber ); pItem->type = HB_IT_LONG; - pItem->item.asLong.value = ( HB_LONG ) lNumber; + pItem->item.asLong.value = ( HB_MAXINT ) lNumber; pItem->item.asLong.length = iWidth; #endif @@ -1218,7 +1218,7 @@ PHB_ITEM hb_itemPutNLLLen( PHB_ITEM pItem, HB_LONGLONG llNumber, int iWidth ) iWidth = HB_LONG_LENGTH( llNumber ); pItem->type = HB_IT_LONG; - pItem->item.asLong.value = ( HB_LONG ) llNumber; + pItem->item.asLong.value = ( HB_MAXINT ) llNumber; pItem->item.asLong.length = ( USHORT ) iWidth; #else pItem->type = HB_IT_DOUBLE; @@ -2390,7 +2390,7 @@ HB_BOOL hb_itemStrBuf( char * szResult, PHB_ITEM pNumber, int iSize, int iDec ) } else { - HB_LONG lNumber; + HB_MAXINT lNumber; if( HB_IS_INTEGER( pNumber ) ) lNumber = pNumber->item.asInteger.value; diff --git a/harbour/src/vm/macro.c b/harbour/src/vm/macro.c index 905aef33a0..e3d123d1fe 100644 --- a/harbour/src/vm/macro.c +++ b/harbour/src/vm/macro.c @@ -1244,7 +1244,7 @@ void hb_macroGenPushSymbol( const char * szSymbolName, HB_BOOL bFunction, HB_COM } /* generates the pcode to push a long number on the virtual machine stack */ -void hb_macroGenPushLong( HB_LONG lNumber, HB_COMP_DECL ) +void hb_macroGenPushLong( HB_MAXINT lNumber, HB_COMP_DECL ) { if( lNumber == 0 ) { @@ -1365,7 +1365,7 @@ void hb_macroGenPopMemvar( const char * szVarName, HB_COMP_DECL ) void hb_macroGenPopAliasedVar( const char * szVarName, HB_BOOL bPushAliasValue, const char * szAlias, - HB_LONG lWorkarea, HB_COMP_DECL ) + HB_MAXINT lWorkarea, HB_COMP_DECL ) { HB_TRACE(HB_TR_DEBUG, ("hb_macroGenPopAliasedVar(%s->%s)",szAlias,szVarName)); @@ -1457,7 +1457,7 @@ void hb_macroGenPushMemvarRef( const char * szVarName, HB_COMP_DECL ) void hb_macroGenPushAliasedVar( const char * szVarName, HB_BOOL bPushAliasValue, const char * szAlias, - HB_LONG lWorkarea, HB_COMP_DECL ) + HB_MAXINT lWorkarea, HB_COMP_DECL ) { HB_TRACE(HB_TR_DEBUG, ("hb_macroGenPushAliasedVar(%s->%s)",szAlias,szVarName)); diff --git a/harbour/src/vm/task.c b/harbour/src/vm/task.c index e9683acbe6..17ee3d35f8 100644 --- a/harbour/src/vm/task.c +++ b/harbour/src/vm/task.c @@ -144,7 +144,7 @@ typedef struct _HB_TASKINFO HB_BOOL detached; HB_BOOL stop; - HB_LONG wakeup; + HB_MAXINT wakeup; char * stack; long stack_size; @@ -205,7 +205,7 @@ static PHB_TASKMTX s_mutexList = NULL; static int s_iTaskID = 0; -static HB_LONG hb_taskTimeStop( unsigned long ulMilliSec ) +static HB_MAXINT hb_taskTimeStop( unsigned long ulMilliSec ) { if( ulMilliSec == HB_TASK_INFINITE_WAIT ) return HB_TASK_INFINITE_DELAY; @@ -213,22 +213,22 @@ static HB_LONG hb_taskTimeStop( unsigned long ulMilliSec ) { #if defined( __DJGPP__ ) /* uclock_t uclock() * 1000 / UCLOCKS_PER_SEC */ - return ( HB_LONG ) clock() * 1000 / CLOCKS_PER_SEC + ulMilliSec; + return ( HB_MAXINT ) clock() * 1000 / CLOCKS_PER_SEC + ulMilliSec; #elif _POSIX_C_SOURCE >= 199309L struct timespec ts; clock_gettime( CLOCK_REALTIME, &ts ); - return ( HB_LONG ) ts.tv_sec * 1000 + ts.tv_nsec / 1000000 + ulMilliSec; + return ( HB_MAXINT ) ts.tv_sec * 1000 + ts.tv_nsec / 1000000 + ulMilliSec; #elif defined( HB_OS_UNIX ) struct timeval tv; gettimeofday( &tv, NULL ); - return ( HB_LONG ) tv.tv_sec * 1000 + tv.tv_usec / 1000 + ulMilliSec; + return ( HB_MAXINT ) tv.tv_sec * 1000 + tv.tv_usec / 1000 + ulMilliSec; #else - return ( HB_LONG ) clock() * 1000 / CLOCKS_PER_SEC + ulMilliSec; + return ( HB_MAXINT ) clock() * 1000 / CLOCKS_PER_SEC + ulMilliSec; #endif } } -static void hb_taskFreeze( HB_LONG wakeup ) +static void hb_taskFreeze( HB_MAXINT wakeup ) { #if defined( HB_OS_DOS ) while( wakeup > hb_taskTimeStop( 0 ) ) diff --git a/harbour/src/vm/thread.c b/harbour/src/vm/thread.c index 991c945660..0c9c629b38 100644 --- a/harbour/src/vm/thread.c +++ b/harbour/src/vm/thread.c @@ -1215,7 +1215,7 @@ static int hb_threadWait( PHB_THREADSTATE * pThreads, int iThreads, else ts.tv_sec = ts.tv_nsec = 0; #else - HB_ULONG timer; + HB_MAXUINT timer; if( ulMilliSec != HB_THREAD_INFINITE_WAIT ) timer = hb_dateMilliSeconds() + ulMilliSec; @@ -1273,7 +1273,7 @@ static int hb_threadWait( PHB_THREADSTATE * pThreads, int iThreads, # endif if( !fExit && timer ) { - HB_ULONG curr = hb_dateMilliSeconds(); + HB_MAXUINT curr = hb_dateMilliSeconds(); if( timer <= curr ) fExit = HB_TRUE; else