diff --git a/harbour/ChangeLog b/harbour/ChangeLog index dc9b341574..adf22fed5e 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,44 @@ past entries belonging to author(s): Viktor Szakats. */ +2010-02-07 13:16 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) + * src/vm/fm.c + * src/vm/extrap.c + * src/common/hbarch.c + * src/nortl/nortl.c + * src/rtl/binnum.c + * src/rtl/hbbffnc.c + * src/rtl/hbznet.c + * src/rtl/hbbfish.c + * src/rtl/hbbyte.c + * src/rtl/binnumx.c + * src/rdd/dbfcdx/dbfcdx1.c + * src/rdd/dbf1.c + * src/rdd/hsx/hsx.c + * src/rdd/dbffpt/dbffpt1.c + * src/rdd/hbsix/sxcrypt.c + * src/compiler/cmdcheck.c + * include/hbgtcore.h + * include/hbdefs.h + * include/hbbfish.h + * contrib/hbct/bitnum.c + * contrib/hbct/ctwin.c + * contrib/xpp/binnumx.c + * contrib/hbnetio/netiocli.c + * contrib/hbnetio/netiosrv.c + * contrib/hbbmcdx/bmdbfcdx.c + * contrib/hbbtree/hb_btree.c + * UINT16 -> HB_U16 + * UINT32 -> HB_U32 + * UINT64 -> HB_U64 + * INT16 -> HB_I16 + * INT32 -> HB_I32 + * INT64 -> HB_I64 + + * contrib/hbct/bitnum.c + ! Fixed INTNEG(), INTPOS(). Second 'l32bit' + parameter was working in reverse. + 2010-02-07 12:17 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/src/rdd/dbfcdx/dbfcdx1.c * minor code cleanup diff --git a/harbour/contrib/hbbmcdx/bmdbfcdx.c b/harbour/contrib/hbbmcdx/bmdbfcdx.c index d330acb228..1dc2f12877 100644 --- a/harbour/contrib/hbbmcdx/bmdbfcdx.c +++ b/harbour/contrib/hbbmcdx/bmdbfcdx.c @@ -678,7 +678,7 @@ static LPCDXKEY hb_cdxKeyPutItem( LPCDXKEY pKey, PHB_ITEM pItem, ULONG ulRec, LP case 'N': if( pTag->uiLen == 4 ) { - UINT32 uiVal = ( UINT32 ) hb_itemGetNI( pItem ) + 0x80000000; + HB_U32 uiVal = ( HB_U32 ) hb_itemGetNI( pItem ) + 0x80000000; HB_PUT_BE_UINT32( ptr, uiVal ); ulLen = 4; } @@ -753,7 +753,7 @@ static PHB_ITEM hb_cdxKeyGetItem( LPCDXKEY pKey, PHB_ITEM pItem, LPCDXTAG pTag, case 'N': if( pKey->len == 4 ) { - INT32 iVal = ( INT32 ) ( HB_GET_BE_UINT32( pKey->val ) ) - 0x80000000; + HB_I32 iVal = ( HB_I32 ) ( HB_GET_BE_UINT32( pKey->val ) ) - 0x80000000; pItem = hb_itemPutNI( pItem, iVal ); } else @@ -2450,7 +2450,7 @@ static void hb_cdxPageStore( LPCDXPAGE pPage ) else if( pPage->iKeys > pPage->TagParent->MaxKeys ) hb_cdxErrInternal( "hb_cdxPageStore: number of keys exceed!." ); #endif - HB_PUT_LE_UINT16( pPage->node.intNode.attr, ( UINT16 ) pPage->PageType ); + HB_PUT_LE_UINT16( pPage->node.intNode.attr, ( HB_U16 ) pPage->PageType ); HB_PUT_LE_UINT16( pPage->node.intNode.nKeys, pPage->iKeys ); HB_PUT_LE_UINT32( pPage->node.intNode.leftPtr, pPage->Left ); HB_PUT_LE_UINT32( pPage->node.intNode.rightPtr, pPage->Right ); @@ -10268,7 +10268,7 @@ static void hb_cdxTagDoIndex( LPCDXTAG pTag, HB_BOOL fReindex ) case HB_IT_DOUBLE: if( pTag->uiLen == 4 ) { - UINT32 uiVal = ( UINT32 ) hb_itemGetNI( pItem ) + 0x80000000; + HB_U32 uiVal = ( HB_U32 ) hb_itemGetNI( pItem ) + 0x80000000; HB_PUT_BE_UINT32( &cTemp[0], uiVal ); hb_cdxSortKeyAdd( pSort, pArea->dbfarea.ulRecNo, cTemp, 4 ); } diff --git a/harbour/contrib/hbbtree/hb_btree.c b/harbour/contrib/hbbtree/hb_btree.c index 2007cd4569..36b5339909 100644 --- a/harbour/contrib/hbbtree/hb_btree.c +++ b/harbour/contrib/hbbtree/hb_btree.c @@ -57,7 +57,7 @@ TODO: TOFIX: - remove UNION's as they hide 32/64 size problems - - use UINT32 as the standard data type of file reading/writing + - use HB_U32 as the standard data type of file reading/writing - in-memory btree's cause a fatal error; this is a work in progress */ @@ -585,7 +585,7 @@ static void HeaderWrite( struct hb_BTree * pBTree ) { BYTE TmpHeader[ HB_BTREE_HEADERSIZE ]; BYTE * pHeader = &TmpHeader[ 0 ]; - UINT32 uiHeaderSize = HB_BTREE_HEADERSIZE; + HB_U32 uiHeaderSize = HB_BTREE_HEADERSIZE; /* header [4 bytes] @@ -601,10 +601,10 @@ static void HeaderWrite( struct hb_BTree * pBTree ) hb_xmemcpy( pHeader, HEADER_ID, sizeof( HEADER_ID ) - 1 ); pHeader += sizeof( HEADER_ID ) - 1; HB_PUT_LE_UINT32( pHeader, uiHeaderSize ); pHeader += 4; - HB_PUT_LE_UINT32( pHeader, ( UINT32 ) pBTree->usPageSize ); pHeader += 4; - HB_PUT_LE_UINT32( pHeader, ( UINT32 ) pBTree->usKeySize ); pHeader += 4; - HB_PUT_LE_UINT32( pHeader, ( UINT32 ) pBTree->usMaxKeys ); pHeader += 4; - HB_PUT_LE_UINT32( pHeader, ( UINT32 ) pBTree->usMinKeys ); pHeader += 4; + HB_PUT_LE_UINT32( pHeader, ( HB_U32 ) pBTree->usPageSize ); pHeader += 4; + HB_PUT_LE_UINT32( pHeader, ( HB_U32 ) pBTree->usKeySize ); pHeader += 4; + HB_PUT_LE_UINT32( pHeader, ( HB_U32 ) pBTree->usMaxKeys ); pHeader += 4; + HB_PUT_LE_UINT32( pHeader, ( HB_U32 ) pBTree->usMinKeys ); pHeader += 4; HB_PUT_LE_UINT32( pHeader, pBTree->ulFlags ); pHeader = &TmpHeader[ 64 ]; @@ -1489,10 +1489,10 @@ struct hb_BTree * hb_BTreeNew( const char * FileName, USHORT usPageSize, USHORT ( usPageSize - ( sizeof count + sizeof branch[0] ) ) / ( sizeof branch[0] + sizeof key ) - 1 */ - /* this assumes that the count field and a branch field are UINT32 */ + /* this assumes that the count field and a branch field are HB_U32 */ #define MAXKEYS( pagesize, keysize, flags ) \ - ( ( ( pagesize ) - ( sizeof( UINT32 ) + sizeof( UINT32 ) ) ) / \ - ( sizeof( UINT32 ) \ + ( ( ( pagesize ) - ( sizeof( HB_U32 ) + sizeof( HB_U32 ) ) ) / \ + ( sizeof( HB_U32 ) \ + ( ( ( flags ) & HB_BTREE_INMEMORY ) == HB_BTREE_INMEMORY \ ? sizeof( PHB_ITEM * ) \ : ( keysize ) ) ) - 1 \ @@ -1602,11 +1602,11 @@ struct hb_BTree *hb_BTreeOpen( const char *FileName, ULONG ulFlags, ULONG ulBuff } pHeader += sizeof( HEADER_ID ) - 1; /* the trailing null byte */ - pHeader += sizeof( UINT32 ); /* skip over the header size (HB_BTREE_HEADERSIZE) field */ - pBTree->usPageSize = ( UINT16 ) HB_GET_LE_UINT32( pHeader ); pHeader += 4; - pBTree->usKeySize = ( UINT16 ) HB_GET_LE_UINT32( pHeader ); pHeader += 4; - pBTree->usMaxKeys = ( UINT16 ) HB_GET_LE_UINT32( pHeader ); pHeader += 4; - pBTree->usMinKeys = ( UINT16 ) HB_GET_LE_UINT32( pHeader ); pHeader += 4; + pHeader += sizeof( HB_U32 ); /* skip over the header size (HB_BTREE_HEADERSIZE) field */ + pBTree->usPageSize = ( HB_U16 ) HB_GET_LE_UINT32( pHeader ); pHeader += 4; + pBTree->usKeySize = ( HB_U16 ) HB_GET_LE_UINT32( pHeader ); pHeader += 4; + pBTree->usMaxKeys = ( HB_U16 ) HB_GET_LE_UINT32( pHeader ); pHeader += 4; + pBTree->usMinKeys = ( HB_U16 ) HB_GET_LE_UINT32( pHeader ); pHeader += 4; pBTree->ulFlags = HB_GET_LE_UINT32( pHeader ) | ( ulFlags & HB_BTREE_READONLY ); pHeader = &TmpHeader[ 64 ]; @@ -1734,7 +1734,7 @@ HB_FUNC( HB_BTREENEW ) /* hb_BTreeNew( CHAR cFileName, int nPageSize, int nKeyS int iPageSize = hb_parni( 2 ); int iKeySize = hb_parni( 3 ); ULONG ulFlags = hb_parnl( 4 ); - int iMaxKeys = MAXKEYS( ( UINT32 ) iPageSize, ( UINT32 ) iKeySize, ulFlags ); + int iMaxKeys = MAXKEYS( ( HB_U32 ) iPageSize, ( HB_U32 ) iKeySize, ulFlags ); int iMinKeys = MINKEYS( iMaxKeys ); HB_TRACE( HB_TR_DEBUG, ( SRCLINENO ) ); diff --git a/harbour/contrib/hbct/bitnum.c b/harbour/contrib/hbct/bitnum.c index 691140c6d0..8ab9d1fb82 100644 --- a/harbour/contrib/hbct/bitnum.c +++ b/harbour/contrib/hbct/bitnum.c @@ -294,9 +294,9 @@ HB_FUNC( INTNEG ) HB_BOOL f32Bit = hb_parl( 2 ); if( f32Bit ) - hb_retnint( ( INT16 ) lValue ); + hb_retnint( ( HB_I32 ) lValue ); else - hb_retnint( ( INT32 ) lValue ); + hb_retnint( ( HB_I16 ) lValue ); } else hb_retni( 0 ); @@ -311,13 +311,13 @@ HB_FUNC( INTPOS ) HB_BOOL f32Bit = hb_parl( 2 ); if( f32Bit ) - hb_retnint( ( UINT16 ) lValue ); - else #ifndef HB_LONG_LONG_OFF - hb_retnint( ( UINT32 ) lValue ); + hb_retnint( ( HB_U32 ) lValue ); #else - hb_retnlen( ( UINT32 ) lValue, 0, 0 ); + hb_retnlen( ( HB_U32 ) lValue, 0, 0 ); #endif + else + hb_retnint( ( HB_U16 ) lValue ); } else hb_retni( 0 ); diff --git a/harbour/contrib/hbct/ctwin.c b/harbour/contrib/hbct/ctwin.c index a811f1fe67..a39411a92b 100644 --- a/harbour/contrib/hbct/ctwin.c +++ b/harbour/contrib/hbct/ctwin.c @@ -2102,7 +2102,7 @@ static int hb_ctw_gt_ReadKey( PHB_GT pGT, int iEventMask ) } /* helper function */ -static UINT32 hb_ctw_gt_cellValue( PHB_GT pGT, int iRow, int iCol ) +static HB_U32 hb_ctw_gt_cellValue( PHB_GT pGT, int iRow, int iCol ) { HB_SCREENCELL cell; int iColor; diff --git a/harbour/contrib/hbnetio/netiocli.c b/harbour/contrib/hbnetio/netiocli.c index 0a6f729180..bd8967ef71 100644 --- a/harbour/contrib/hbnetio/netiocli.c +++ b/harbour/contrib/hbnetio/netiocli.c @@ -549,7 +549,7 @@ static PHB_CONCLI s_fileConnect( const char ** pFilename, if( hb_socketConnect( sd, pSockAddr, uiLen, iTimeOut ) == 0 ) { BYTE msgbuf[ NETIO_MSGLEN ]; - UINT16 len = ( UINT16 ) strlen( NETIO_LOGINSTRID ); + HB_U16 len = ( HB_U16 ) strlen( NETIO_LOGINSTRID ); HB_PUT_LE_UINT32( &msgbuf[ 0 ], NETIO_LOGIN ); HB_PUT_LE_UINT16( &msgbuf[ 4 ], len ); @@ -750,7 +750,7 @@ HB_FUNC( NETIO_DISCONNECT ) hb_retl( fDisconnected ); } -static const char * s_netio_params( int iMsg, const char * pszName, UINT32 * pSize, char ** pFree ) +static const char * s_netio_params( int iMsg, const char * pszName, HB_U32 * pSize, char ** pFree ) { int iPCount = iMsg == NETIO_PROCIS ? 0 : hb_pcount(), i; char * data = NULL, * itmData; @@ -771,7 +771,7 @@ static const char * s_netio_params( int iMsg, const char * pszName, UINT32 * pSi } *pFree = data; - *pSize = ( UINT32 ) size; + *pSize = ( HB_U32 ) size; return data ? data : pszName; } @@ -791,7 +791,7 @@ static HB_BOOL s_netio_procexec( const char * pszProcName, int iMsg ) BYTE msgbuf[ NETIO_MSGLEN ]; const char * data; char * buffer; - UINT32 size; + HB_U32 size; data = s_netio_params( iMsg, pszProcName, &size, &buffer ); HB_PUT_LE_UINT32( &msgbuf[ 0 ], iMsg ); @@ -902,7 +902,7 @@ static HB_BOOL s_fileExists( const char * pFilename, char * pRetPath ) if( s_fileConLock( conn ) ) { BYTE msgbuf[ NETIO_MSGLEN ]; - UINT16 len = ( UINT16 ) strlen( pFilename ); + HB_U16 len = ( HB_U16 ) strlen( pFilename ); HB_PUT_LE_UINT32( &msgbuf[ 0 ], NETIO_EXISTS ); HB_PUT_LE_UINT16( &msgbuf[ 4 ], len ); @@ -930,7 +930,7 @@ static HB_BOOL s_fileDelete( const char * pFilename ) if( s_fileConLock( conn ) ) { BYTE msgbuf[ NETIO_MSGLEN ]; - UINT16 len = ( UINT16 ) strlen( pFilename ); + HB_U16 len = ( HB_U16 ) strlen( pFilename ); HB_PUT_LE_UINT32( &msgbuf[ 0 ], NETIO_DELETE ); HB_PUT_LE_UINT16( &msgbuf[ 4 ], len ); @@ -960,8 +960,8 @@ static HB_BOOL s_fileRename( const char * pszFileName, const char * pszNewName ) if( s_fileConLock( conn ) ) { BYTE msgbuf[ NETIO_MSGLEN ]; - UINT16 len1 = ( UINT16 ) strlen( pszFileName ); - UINT16 len2 = ( UINT16 ) strlen( pszNewName ); + HB_U16 len1 = ( HB_U16 ) strlen( pszFileName ); + HB_U16 len2 = ( HB_U16 ) strlen( pszNewName ); BYTE * pBuffer = ( BYTE * ) hb_xgrab( len1 + len2 ); memcpy( pBuffer, pszFileName, len1 ); @@ -996,7 +996,7 @@ static PHB_FILE s_fileOpen( const char * pFilename, const char * pDefExt, if( s_fileConLock( conn ) ) { BYTE msgbuf[ NETIO_MSGLEN ]; - UINT16 len = ( UINT16 ) strlen( pszFile ); + HB_U16 len = ( HB_U16 ) strlen( pszFile ); HB_PUT_LE_UINT32( &msgbuf[ 0 ], NETIO_OPEN ); HB_PUT_LE_UINT16( &msgbuf[ 4 ], len ); diff --git a/harbour/contrib/hbnetio/netiosrv.c b/harbour/contrib/hbnetio/netiosrv.c index 7724495b75..fefa87b05f 100644 --- a/harbour/contrib/hbnetio/netiosrv.c +++ b/harbour/contrib/hbnetio/netiosrv.c @@ -694,7 +694,7 @@ HB_FUNC( NETIO_SERVER ) HB_ERRCODE errCode = 0, errFsCode; long len = 0, size, size2; int iFileNo; - UINT32 uiMsg; + HB_U32 uiMsg; USHORT uiFalgs; char * szExt; PHB_FILE pFile; diff --git a/harbour/contrib/xpp/binnumx.c b/harbour/contrib/xpp/binnumx.c index f4b5b5c71f..ff68151a82 100644 --- a/harbour/contrib/xpp/binnumx.c +++ b/harbour/contrib/xpp/binnumx.c @@ -57,7 +57,7 @@ HB_FUNC( BIN2U ) { PHB_ITEM pItem = hb_param( 1, HB_IT_STRING ); - UINT32 uiResult = 0; + HB_U32 uiResult = 0; if( pItem ) { @@ -77,7 +77,7 @@ HB_FUNC( BIN2U ) HB_FUNC( U2BIN ) { char szResult[ 4 ]; - UINT32 uiValue = ( UINT32 ) hb_parnint( 1 ); + HB_U32 uiValue = ( HB_U32 ) hb_parnint( 1 ); HB_PUT_LE_UINT32( szResult, uiValue ); hb_retclen( szResult, 4 ); } @@ -85,7 +85,7 @@ HB_FUNC( U2BIN ) HB_FUNC( W2BIN ) { char szResult[ 2 ]; - UINT16 uiValue = ( UINT16 ) hb_parni( 1 ); + HB_U16 uiValue = ( HB_U16 ) hb_parni( 1 ); HB_PUT_LE_UINT16( szResult, uiValue ); hb_retclen( szResult, 4 ); } diff --git a/harbour/include/hbbfish.h b/harbour/include/hbbfish.h index d5f1cd1f8e..8b02fde6fd 100644 --- a/harbour/include/hbbfish.h +++ b/harbour/include/hbbfish.h @@ -69,17 +69,17 @@ HB_EXTERN_BEGIN typedef struct { - UINT32 P[ SUBKEYS_COUNT ]; - UINT32 S1[ SBOX_ENTRIES ]; - UINT32 S2[ SBOX_ENTRIES ]; - UINT32 S3[ SBOX_ENTRIES ]; - UINT32 S4[ SBOX_ENTRIES ]; + HB_U32 P[ SUBKEYS_COUNT ]; + HB_U32 S1[ SBOX_ENTRIES ]; + HB_U32 S2[ SBOX_ENTRIES ]; + HB_U32 S3[ SBOX_ENTRIES ]; + HB_U32 S4[ SBOX_ENTRIES ]; } HB_BLOWFISH; extern HB_EXPORT void hb_blowfishInit( HB_BLOWFISH * bf, const void * keydata, int keylen ); -extern HB_EXPORT void hb_blowfishEncrypt( const HB_BLOWFISH * bf, UINT32 * xl, UINT32 * xr ); -extern HB_EXPORT void hb_blowfishDecrypt( const HB_BLOWFISH * bf, UINT32 * xl, UINT32 * xr ); +extern HB_EXPORT void hb_blowfishEncrypt( const HB_BLOWFISH * bf, HB_U32 * xl, HB_U32 * xr ); +extern HB_EXPORT void hb_blowfishDecrypt( const HB_BLOWFISH * bf, HB_U32 * xl, HB_U32 * xr ); HB_EXTERN_END diff --git a/harbour/include/hbdefs.h b/harbour/include/hbdefs.h index 06dbf656a7..c9676a70a7 100644 --- a/harbour/include/hbdefs.h +++ b/harbour/include/hbdefs.h @@ -581,7 +581,7 @@ typedef HB_MAXUINT HB_VMMAXUINT; /* type of HB_ITEM */ /* typedef USHORT HB_TYPE; */ -typedef UINT32 HB_TYPE; +typedef HB_U32 HB_TYPE; /* type of reference counter */ typedef unsigned long HB_COUNTER; @@ -737,27 +737,27 @@ typedef unsigned char HB_U8; #define HB_HIBYTE( w ) ( ( BYTE ) ( ( ( w ) >> 8 ) & 0xFF ) ) #define HB_ULBYTE( w ) ( ( BYTE ) ( ( ( w ) >> 16 ) & 0xFF ) ) #define HB_UHBYTE( w ) ( ( BYTE ) ( ( ( w ) >> 24 ) & 0xFF ) ) -#define HB_LOWORD( l ) ( ( UINT16 ) ( l ) ) -#define HB_HIWORD( l ) ( ( UINT16 ) ( ( ( l ) >> 16 ) & 0xFFFF ) ) -#define HB_MKSHORT( lo, hi ) ( ( SHORT ) ( ( ( INT16 ) ( hi ) ) << 8 ) | ( lo ) ) -#define HB_MKUSHORT( lo, hi ) ( ( USHORT ) ( ( ( UINT16 ) ( hi ) ) << 8 ) | ( lo ) ) +#define HB_LOWORD( l ) ( ( HB_U16 ) ( l ) ) +#define HB_HIWORD( l ) ( ( HB_U16 ) ( ( ( l ) >> 16 ) & 0xFFFF ) ) +#define HB_MKSHORT( lo, hi ) ( ( SHORT ) ( ( ( HB_I16 ) ( hi ) ) << 8 ) | ( lo ) ) +#define HB_MKUSHORT( lo, hi ) ( ( USHORT ) ( ( ( HB_U16 ) ( hi ) ) << 8 ) | ( lo ) ) #define HB_MKLONG( b1, b2, b3, b4 ) ( ( LONG ) \ - ( ( ( ( INT32 ) ( b4 ) ) << 24 ) | \ - ( ( ( INT32 ) ( b3 ) ) << 16 ) | \ - ( ( ( INT32 ) ( b2 ) ) << 8 ) | \ - ( ( ( INT32 ) ( b1 ) ) ) ) ) + ( ( ( ( HB_I32 ) ( b4 ) ) << 24 ) | \ + ( ( ( HB_I32 ) ( b3 ) ) << 16 ) | \ + ( ( ( HB_I32 ) ( b2 ) ) << 8 ) | \ + ( ( ( HB_I32 ) ( b1 ) ) ) ) ) #define HB_MKULONG( b1, b2, b3, b4 ) ( ( ULONG ) \ - ( ( ( ( UINT32 ) ( b4 ) ) << 24 ) | \ - ( ( ( UINT32 ) ( b3 ) ) << 16 ) | \ - ( ( ( UINT32 ) ( b2 ) ) << 8 ) | \ - ( ( ( UINT32 ) ( b1 ) ) ) ) ) + ( ( ( ( HB_U32 ) ( b4 ) ) << 24 ) | \ + ( ( ( HB_U32 ) ( b3 ) ) << 16 ) | \ + ( ( ( HB_U32 ) ( b2 ) ) << 8 ) | \ + ( ( ( HB_U32 ) ( b1 ) ) ) ) ) -#define HB_SWAP_UINT16( w ) ( ( UINT16 ) ( ( ( ( UINT16 ) ( w ) & 0xFF00 ) >> 8 ) | \ - ( ( ( UINT16 ) ( w ) & 0x00FF ) << 8 ) ) ) -#define HB_SWAP_UINT32( w ) ( ( UINT32 ) ( ( ( ( UINT32 ) ( w ) & 0x000000FF ) << 24 ) | \ - ( ( ( UINT32 ) ( w ) & 0x0000FF00 ) << 8 ) | \ - ( ( ( UINT32 ) ( w ) & 0x00FF0000 ) >> 8 ) | \ - ( ( ( UINT32 ) ( w ) & 0xFF000000 ) >> 24 ) ) ) +#define HB_SWAP_UINT16( w ) ( ( HB_U16 ) ( ( ( ( HB_U16 ) ( w ) & 0xFF00 ) >> 8 ) | \ + ( ( ( HB_U16 ) ( w ) & 0x00FF ) << 8 ) ) ) +#define HB_SWAP_UINT32( w ) ( ( HB_U32 ) ( ( ( ( HB_U32 ) ( w ) & 0x000000FF ) << 24 ) | \ + ( ( ( HB_U32 ) ( w ) & 0x0000FF00 ) << 8 ) | \ + ( ( ( HB_U32 ) ( w ) & 0x00FF0000 ) >> 8 ) | \ + ( ( ( HB_U32 ) ( w ) & 0xFF000000 ) >> 24 ) ) ) #ifndef PFLL @@ -772,14 +772,14 @@ typedef unsigned char HB_U8; #endif -#define HB_SWAP_UINT64( w ) ( ( UINT64 ) ( ( ( ( UINT64 ) ( w ) & HB_LL( 0x00000000000000FF ) ) << 56 ) | \ - ( ( ( UINT64 ) ( w ) & HB_LL( 0x000000000000FF00 ) ) << 40 ) | \ - ( ( ( UINT64 ) ( w ) & HB_LL( 0x0000000000FF0000 ) ) << 24 ) | \ - ( ( ( UINT64 ) ( w ) & HB_LL( 0x00000000FF000000 ) ) << 8 ) | \ - ( ( ( UINT64 ) ( w ) & HB_LL( 0x000000FF00000000 ) ) >> 8 ) | \ - ( ( ( UINT64 ) ( w ) & HB_LL( 0x0000FF0000000000 ) ) >> 24 ) | \ - ( ( ( UINT64 ) ( w ) & HB_LL( 0x00FF000000000000 ) ) >> 40 ) | \ - ( ( ( UINT64 ) ( w ) & HB_LL( 0xFF00000000000000 ) ) >> 56 ) ) ) +#define HB_SWAP_UINT64( w ) ( ( HB_U64 ) ( ( ( ( HB_U64 ) ( w ) & HB_LL( 0x00000000000000FF ) ) << 56 ) | \ + ( ( ( HB_U64 ) ( w ) & HB_LL( 0x000000000000FF00 ) ) << 40 ) | \ + ( ( ( HB_U64 ) ( w ) & HB_LL( 0x0000000000FF0000 ) ) << 24 ) | \ + ( ( ( HB_U64 ) ( w ) & HB_LL( 0x00000000FF000000 ) ) << 8 ) | \ + ( ( ( HB_U64 ) ( w ) & HB_LL( 0x000000FF00000000 ) ) >> 8 ) | \ + ( ( ( HB_U64 ) ( w ) & HB_LL( 0x0000FF0000000000 ) ) >> 24 ) | \ + ( ( ( HB_U64 ) ( w ) & HB_LL( 0x00FF000000000000 ) ) >> 40 ) | \ + ( ( ( HB_U64 ) ( w ) & HB_LL( 0xFF00000000000000 ) ) >> 56 ) ) ) /* * on some machines it's not safe to directly access pointers stored @@ -832,27 +832,27 @@ typedef unsigned char HB_U8; #else # if defined( HB_BIG_ENDIAN ) # if defined( HB_ARCH_64BIT ) -# define HB_PUT_PTR( p, v ) HB_PUT_BE_UINT64( p, ( UINT64 ) ( v ) ) +# define HB_PUT_PTR( p, v ) HB_PUT_BE_UINT64( p, ( HB_U64 ) ( v ) ) # define HB_GET_PTR( p ) ( ( void * ) HB_GET_BE_UINT64( p ) ) # else -# define HB_PUT_PTR( p, v ) HB_PUT_BE_UINT32( p, ( UINT32 ) ( v ) ) +# define HB_PUT_PTR( p, v ) HB_PUT_BE_UINT32( p, ( HB_U32 ) ( v ) ) # define HB_GET_PTR( p ) ( ( void * ) HB_GET_BE_UINT32( p ) ) # endif # else # if defined( HB_ARCH_64BIT ) -# define HB_PUT_PTR( p, v ) HB_PUT_LE_UINT64( p, ( UINT64 ) ( v ) ) +# define HB_PUT_PTR( p, v ) HB_PUT_LE_UINT64( p, ( HB_U64 ) ( v ) ) # define HB_GET_PTR( p ) ( ( void * ) HB_GET_LE_UINT64( p ) ) # else -# define HB_PUT_PTR( p, v ) HB_PUT_LE_UINT32( p, ( UINT32 ) ( v ) ) +# define HB_PUT_PTR( p, v ) HB_PUT_LE_UINT32( p, ( HB_U32 ) ( v ) ) # define HB_GET_PTR( p ) ( ( void * ) HB_GET_LE_UINT32( p ) ) # endif # endif #endif #if defined( HB_BIG_ENDIAN ) -# define HB_PUT_UINT32( p, v ) HB_PUT_BE_UINT32( p, ( UINT32 ) ( v ) ) +# define HB_PUT_UINT32( p, v ) HB_PUT_BE_UINT32( p, ( HB_U32 ) ( v ) ) # define HB_GET_UINT32( p ) HB_GET_BE_UINT32( p ) #else -# define HB_PUT_UINT32( p, v ) HB_PUT_LE_UINT32( p, ( UINT32 ) ( v ) ) +# define HB_PUT_UINT32( p, v ) HB_PUT_LE_UINT32( p, ( HB_U32 ) ( v ) ) # define HB_GET_UINT32( p ) HB_GET_LE_UINT32( p ) #endif @@ -878,20 +878,20 @@ typedef unsigned char HB_U8; typedef union { - UINT16 val; + HB_U16 val; BYTE buf[2]; } HB_U16CAST, * PHB_U16CAST; typedef union { - UINT32 val; + HB_U32 val; BYTE buf[4]; } HB_U32CAST, * PHB_U32CAST; # if !defined( HB_LONG_LONG_OFF ) || defined( HB_ARCH_64BIT ) typedef union { - UINT64 val; + HB_U64 val; BYTE buf[8]; } HB_U64CAST, * PHB_U64CAST; # endif @@ -901,7 +901,7 @@ typedef unsigned char HB_U8; double val; BYTE buf[8]; # if !defined( HB_LONG_LONG_OFF ) || defined( HB_ARCH_64BIT ) - UINT64 i64; + HB_U64 i64; # endif } HB_DBLCAST, * PHB_DBLCAST; @@ -919,21 +919,21 @@ typedef unsigned char HB_U8; memcpy( buf, u.buf, sizeof( void * ) ); } - static __inline__ UINT16 _hb_get_std_uint16( const BYTE * buf ) + static __inline__ HB_U16 _hb_get_std_uint16( const BYTE * buf ) { HB_U16CAST u; memcpy( u.buf, buf, sizeof( u.buf ) ); return u.val; } - static __inline__ void _hb_put_std_uint16( BYTE * buf, UINT16 val ) + static __inline__ void _hb_put_std_uint16( BYTE * buf, HB_U16 val ) { HB_U16CAST u; u.val = val; memcpy( buf, u.buf, sizeof( u.buf ) ); } - static __inline__ UINT16 _hb_get_rev_uint16( const BYTE * buf ) + static __inline__ HB_U16 _hb_get_rev_uint16( const BYTE * buf ) { HB_U16CAST u; u.buf[ 0 ] = buf[ 1 ]; @@ -941,7 +941,7 @@ typedef unsigned char HB_U8; return u.val; } - static __inline__ void _hb_put_rev_uint16( BYTE * buf, UINT16 val ) + static __inline__ void _hb_put_rev_uint16( BYTE * buf, HB_U16 val ) { HB_U16CAST u; u.val = val; @@ -949,21 +949,21 @@ typedef unsigned char HB_U8; buf[ 1 ] = u.buf[ 0 ]; } - static __inline__ UINT32 _hb_get_std_uint32( const BYTE * buf ) + static __inline__ HB_U32 _hb_get_std_uint32( const BYTE * buf ) { HB_U32CAST u; memcpy( u.buf, buf, sizeof( u.buf ) ); return u.val; } - static __inline__ void _hb_put_std_uint32( BYTE * buf, UINT32 val ) + static __inline__ void _hb_put_std_uint32( BYTE * buf, HB_U32 val ) { HB_U32CAST u; u.val = val; memcpy( buf, u.buf, sizeof( u.buf ) ); } - static __inline__ UINT32 _hb_get_rev_uint32( const BYTE * buf ) + static __inline__ HB_U32 _hb_get_rev_uint32( const BYTE * buf ) { HB_U32CAST u; # if HB_BUILTIN_BSWAP @@ -978,7 +978,7 @@ typedef unsigned char HB_U8; # endif } - static __inline__ void _hb_put_rev_uint32( BYTE * buf, UINT32 val ) + static __inline__ void _hb_put_rev_uint32( BYTE * buf, HB_U32 val ) { HB_U32CAST u; # if HB_BUILTIN_BSWAP @@ -994,21 +994,21 @@ typedef unsigned char HB_U8; } # if !defined( HB_LONG_LONG_OFF ) || defined( HB_ARCH_64BIT ) - static __inline__ UINT64 _hb_get_std_uint64( const BYTE * buf ) + static __inline__ HB_U64 _hb_get_std_uint64( const BYTE * buf ) { HB_U64CAST u; memcpy( u.buf, buf, sizeof( u.buf ) ); return u.val; } - static __inline__ void _hb_put_std_uint64( BYTE * buf, UINT64 val ) + static __inline__ void _hb_put_std_uint64( BYTE * buf, HB_U64 val ) { HB_U64CAST u; u.val = val; memcpy( buf, u.buf, sizeof( u.buf ) ); } - static __inline__ UINT64 _hb_get_rev_uint64( const BYTE * buf ) + static __inline__ HB_U64 _hb_get_rev_uint64( const BYTE * buf ) { HB_U64CAST u; # if HB_BUILTIN_BSWAP @@ -1027,7 +1027,7 @@ typedef unsigned char HB_U8; # endif } - static __inline__ void _hb_put_rev_uint64( BYTE * buf, UINT64 val ) + static __inline__ void _hb_put_rev_uint64( BYTE * buf, HB_U64 val ) { HB_U64CAST u; # if HB_BUILTIN_BSWAP @@ -1181,32 +1181,32 @@ typedef unsigned char HB_U8; # if !defined( HB_STRICT_ALIGNMENT ) && defined( HB_LITTLE_ENDIAN ) - #define HB_GET_LE_UINT16( p ) ( *( UINT16 * )( p ) ) - #define HB_PUT_LE_UINT16( p, w ) ( *( UINT16 * )( p ) = ( UINT16 ) ( w ) ) - #define HB_GET_LE_UINT32( p ) ( *( UINT32 * )( p ) ) - #define HB_PUT_LE_UINT32( p, l ) ( *( UINT32 * )( p ) = ( UINT32 ) ( l ) ) - #define HB_GET_LE_UINT64( p ) ( *( UINT64 * )( p ) ) - #define HB_PUT_LE_UINT64( p, q ) ( *( UINT64 * )( p ) = ( UINT64 ) ( q ) ) + #define HB_GET_LE_UINT16( p ) ( *( HB_U16 * )( p ) ) + #define HB_PUT_LE_UINT16( p, w ) ( *( HB_U16 * )( p ) = ( HB_U16 ) ( w ) ) + #define HB_GET_LE_UINT32( p ) ( *( HB_U32 * )( p ) ) + #define HB_PUT_LE_UINT32( p, l ) ( *( HB_U32 * )( p ) = ( HB_U32 ) ( l ) ) + #define HB_GET_LE_UINT64( p ) ( *( HB_U64 * )( p ) ) + #define HB_PUT_LE_UINT64( p, q ) ( *( HB_U64 * )( p ) = ( HB_U64 ) ( q ) ) # else - #define HB_GET_LE_UINT16( p ) ( ( UINT16 ) \ - ( ( ( UINT16 ) (( BYTE * )( p ))[0] ) | \ - ( ( UINT16 ) (( BYTE * )( p ))[1] << 8 ) ) ) - #define HB_GET_LE_UINT32( p ) ( ( UINT32 ) \ - ( ( ( UINT32 ) (( BYTE * )( p ))[0] ) | \ - ( ( UINT32 ) (( BYTE * )( p ))[1] << 8 ) | \ - ( ( UINT32 ) (( BYTE * )( p ))[2] << 16 ) | \ - ( ( UINT32 ) (( BYTE * )( p ))[3] << 24 ) ) ) - #define HB_GET_LE_UINT64( p ) ( ( UINT64 ) \ - ( ( ( UINT64 ) (( BYTE * )( p ))[0] ) | \ - ( ( UINT64 ) (( BYTE * )( p ))[1] << 8 ) | \ - ( ( UINT64 ) (( BYTE * )( p ))[2] << 16 ) | \ - ( ( UINT64 ) (( BYTE * )( p ))[3] << 24 ) | \ - ( ( UINT64 ) (( BYTE * )( p ))[4] << 32 ) | \ - ( ( UINT64 ) (( BYTE * )( p ))[5] << 40 ) | \ - ( ( UINT64 ) (( BYTE * )( p ))[6] << 48 ) | \ - ( ( UINT64 ) (( BYTE * )( p ))[7] << 56 ) ) ) + #define HB_GET_LE_UINT16( p ) ( ( HB_U16 ) \ + ( ( ( HB_U16 ) (( BYTE * )( p ))[0] ) | \ + ( ( HB_U16 ) (( BYTE * )( p ))[1] << 8 ) ) ) + #define HB_GET_LE_UINT32( p ) ( ( HB_U32 ) \ + ( ( ( HB_U32 ) (( BYTE * )( p ))[0] ) | \ + ( ( HB_U32 ) (( BYTE * )( p ))[1] << 8 ) | \ + ( ( HB_U32 ) (( BYTE * )( p ))[2] << 16 ) | \ + ( ( HB_U32 ) (( BYTE * )( p ))[3] << 24 ) ) ) + #define HB_GET_LE_UINT64( p ) ( ( HB_U64 ) \ + ( ( ( HB_U64 ) (( BYTE * )( p ))[0] ) | \ + ( ( HB_U64 ) (( BYTE * )( p ))[1] << 8 ) | \ + ( ( HB_U64 ) (( BYTE * )( p ))[2] << 16 ) | \ + ( ( HB_U64 ) (( BYTE * )( p ))[3] << 24 ) | \ + ( ( HB_U64 ) (( BYTE * )( p ))[4] << 32 ) | \ + ( ( HB_U64 ) (( BYTE * )( p ))[5] << 40 ) | \ + ( ( HB_U64 ) (( BYTE * )( p ))[6] << 48 ) | \ + ( ( HB_U64 ) (( BYTE * )( p ))[7] << 56 ) ) ) #define HB_PUT_LE_UINT16( p, w ) do { \ (( BYTE * )( p ))[0] = ( BYTE )( w ); \ @@ -1232,32 +1232,32 @@ typedef unsigned char HB_U8; # if !defined( HB_STRICT_ALIGNMENT ) && defined( HB_BIG_ENDIAN ) - #define HB_GET_BE_UINT16( p ) ( *( UINT16 * )( p ) ) - #define HB_PUT_BE_UINT16( p, w ) ( *( UINT16 * )( p ) = ( UINT16 ) ( w ) ) - #define HB_GET_BE_UINT32( p ) ( *( UINT32 * )( p ) ) - #define HB_PUT_BE_UINT32( p, l ) ( *( UINT32 * )( p ) = ( UINT32 ) ( l ) ) - #define HB_GET_BE_UINT64( p ) ( *( UINT64 * )( p ) ) - #define HB_PUT_BE_UINT64( p, q ) ( *( UINT64 * )( p ) = ( UINT64 ) ( q ) ) + #define HB_GET_BE_UINT16( p ) ( *( HB_U16 * )( p ) ) + #define HB_PUT_BE_UINT16( p, w ) ( *( HB_U16 * )( p ) = ( HB_U16 ) ( w ) ) + #define HB_GET_BE_UINT32( p ) ( *( HB_U32 * )( p ) ) + #define HB_PUT_BE_UINT32( p, l ) ( *( HB_U32 * )( p ) = ( HB_U32 ) ( l ) ) + #define HB_GET_BE_UINT64( p ) ( *( HB_U64 * )( p ) ) + #define HB_PUT_BE_UINT64( p, q ) ( *( HB_U64 * )( p ) = ( HB_U64 ) ( q ) ) # else - #define HB_GET_BE_UINT16( p ) ( ( UINT16 ) \ - ( ( ( UINT16 ) (( BYTE * )( p ))[0] << 8 ) | \ - ( ( UINT16 ) (( BYTE * )( p ))[1] ) ) ) - #define HB_GET_BE_UINT32( p ) ( ( UINT32 ) \ - ( ( ( UINT32 ) (( BYTE * )( p ))[0] << 24 ) | \ - ( ( UINT32 ) (( BYTE * )( p ))[1] << 16 ) | \ - ( ( UINT32 ) (( BYTE * )( p ))[2] << 8 ) | \ - ( ( UINT32 ) (( BYTE * )( p ))[3] ) ) ) - #define HB_GET_BE_UINT64( p ) ( ( UINT64 ) \ - ( ( ( UINT64 ) (( BYTE * )( p ))[0] << 56 ) | \ - ( ( UINT64 ) (( BYTE * )( p ))[1] << 48 ) | \ - ( ( UINT64 ) (( BYTE * )( p ))[2] << 40 ) | \ - ( ( UINT64 ) (( BYTE * )( p ))[3] << 32 ) | \ - ( ( UINT64 ) (( BYTE * )( p ))[4] << 24 ) | \ - ( ( UINT64 ) (( BYTE * )( p ))[5] << 16 ) | \ - ( ( UINT64 ) (( BYTE * )( p ))[6] << 8 ) | \ - ( ( UINT64 ) (( BYTE * )( p ))[7] ) ) ) + #define HB_GET_BE_UINT16( p ) ( ( HB_U16 ) \ + ( ( ( HB_U16 ) (( BYTE * )( p ))[0] << 8 ) | \ + ( ( HB_U16 ) (( BYTE * )( p ))[1] ) ) ) + #define HB_GET_BE_UINT32( p ) ( ( HB_U32 ) \ + ( ( ( HB_U32 ) (( BYTE * )( p ))[0] << 24 ) | \ + ( ( HB_U32 ) (( BYTE * )( p ))[1] << 16 ) | \ + ( ( HB_U32 ) (( BYTE * )( p ))[2] << 8 ) | \ + ( ( HB_U32 ) (( BYTE * )( p ))[3] ) ) ) + #define HB_GET_BE_UINT64( p ) ( ( HB_U64 ) \ + ( ( ( HB_U64 ) (( BYTE * )( p ))[0] << 56 ) | \ + ( ( HB_U64 ) (( BYTE * )( p ))[1] << 48 ) | \ + ( ( HB_U64 ) (( BYTE * )( p ))[2] << 40 ) | \ + ( ( HB_U64 ) (( BYTE * )( p ))[3] << 32 ) | \ + ( ( HB_U64 ) (( BYTE * )( p ))[4] << 24 ) | \ + ( ( HB_U64 ) (( BYTE * )( p ))[5] << 16 ) | \ + ( ( HB_U64 ) (( BYTE * )( p ))[6] << 8 ) | \ + ( ( HB_U64 ) (( BYTE * )( p ))[7] ) ) ) #define HB_PUT_BE_UINT16( p, w ) do { \ (( BYTE * )( p ))[0] = ( BYTE )( (w) >> 8 ); \ @@ -1416,29 +1416,29 @@ typedef unsigned char HB_U8; * 24 bit integers are not directly supported by any processor we used so far * so we always have to build them from BYTEs and cannot use C casting */ -#define HB_GET_LE_INT24( p ) ( ( INT32 ) \ - ( ( ( INT32 ) (( BYTE * )( p ))[0] ) | \ - ( ( INT32 ) (( BYTE * )( p ))[1] << 8 ) | \ - ( ( INT32 ) (( BYTE * )( p ))[2] << 16 ) | \ - ( ( INT32 ) ((( BYTE * )( p ))[2] & 0x80 ? 0xFF : 0x00 ) << 24 ) ) ) -#define HB_GET_LE_UINT24( p ) ( ( UINT32 ) \ - ( ( ( UINT32 ) (( BYTE * )( p ))[0] ) | \ - ( ( UINT32 ) (( BYTE * )( p ))[1] << 8 ) | \ - ( ( UINT32 ) (( BYTE * )( p ))[2] << 16 ) ) ) +#define HB_GET_LE_INT24( p ) ( ( HB_I32 ) \ + ( ( ( HB_I32 ) (( BYTE * )( p ))[0] ) | \ + ( ( HB_I32 ) (( BYTE * )( p ))[1] << 8 ) | \ + ( ( HB_I32 ) (( BYTE * )( p ))[2] << 16 ) | \ + ( ( HB_I32 ) ((( BYTE * )( p ))[2] & 0x80 ? 0xFF : 0x00 ) << 24 ) ) ) +#define HB_GET_LE_UINT24( p ) ( ( HB_U32 ) \ + ( ( ( HB_U32 ) (( BYTE * )( p ))[0] ) | \ + ( ( HB_U32 ) (( BYTE * )( p ))[1] << 8 ) | \ + ( ( HB_U32 ) (( BYTE * )( p ))[2] << 16 ) ) ) #define HB_PUT_LE_UINT24( p, u ) do { \ (( BYTE * )( p ))[0] = ( BYTE )( u ); \ (( BYTE * )( p ))[1] = ( BYTE )( (u) >> 8 ); \ (( BYTE * )( p ))[2] = ( BYTE )( (u) >> 16 ); \ } while ( 0 ) -#define HB_GET_BE_INT24( p ) ( ( INT32 ) \ - ( ( ( INT32 ) (( BYTE * )( p ))[2] ) | \ - ( ( INT32 ) (( BYTE * )( p ))[1] << 8 ) | \ - ( ( INT32 ) (( BYTE * )( p ))[0] << 16 ) | \ - ( ( INT32 ) ((( BYTE * )( p ))[0] & 0x80 ? 0xFF : 0x00 ) << 24 ) ) ) -#define HB_GET_BE_UINT24( p ) ( ( UINT32 ) \ - ( ( ( UINT32 ) (( BYTE * )( p ))[2] ) | \ - ( ( UINT32 ) (( BYTE * )( p ))[1] << 8 ) | \ - ( ( UINT32 ) (( BYTE * )( p ))[0] << 16 ) ) ) +#define HB_GET_BE_INT24( p ) ( ( HB_I32 ) \ + ( ( ( HB_I32 ) (( BYTE * )( p ))[2] ) | \ + ( ( HB_I32 ) (( BYTE * )( p ))[1] << 8 ) | \ + ( ( HB_I32 ) (( BYTE * )( p ))[0] << 16 ) | \ + ( ( HB_I32 ) ((( BYTE * )( p ))[0] & 0x80 ? 0xFF : 0x00 ) << 24 ) ) ) +#define HB_GET_BE_UINT24( p ) ( ( HB_U32 ) \ + ( ( ( HB_U32 ) (( BYTE * )( p ))[2] ) | \ + ( ( HB_U32 ) (( BYTE * )( p ))[1] << 8 ) | \ + ( ( HB_U32 ) (( BYTE * )( p ))[0] << 16 ) ) ) #define HB_PUT_BE_UINT24( p, u ) do { \ (( BYTE * )( p ))[2] = ( BYTE )( u ); \ (( BYTE * )( p ))[1] = ( BYTE )( (u) >> 8 ); \ @@ -1446,9 +1446,9 @@ typedef unsigned char HB_U8; } while ( 0 ) -#define HB_GET_LE_INT16( p ) (( INT16 ) HB_GET_LE_UINT16( p )) -#define HB_GET_LE_INT32( p ) (( INT32 ) HB_GET_LE_UINT32( p )) -#define HB_GET_LE_INT64( p ) (( INT64 ) HB_GET_LE_UINT64( p )) +#define HB_GET_LE_INT16( p ) (( HB_I16 ) HB_GET_LE_UINT16( p )) +#define HB_GET_LE_INT32( p ) (( HB_I32 ) HB_GET_LE_UINT32( p )) +#define HB_GET_LE_INT64( p ) (( HB_I64 ) HB_GET_LE_UINT64( p )) #define HB_PCODE_MKSHORT( p ) (( SHORT ) HB_GET_LE_INT16( p )) #define HB_PCODE_MKUSHORT( p ) (( USHORT ) HB_GET_LE_UINT16( p )) diff --git a/harbour/include/hbgtcore.h b/harbour/include/hbgtcore.h index c6da9fac37..8156caac78 100644 --- a/harbour/include/hbgtcore.h +++ b/harbour/include/hbgtcore.h @@ -262,11 +262,11 @@ typedef union { struct { - UINT16 usChar; + HB_U16 usChar; BYTE bColor; BYTE bAttr; } c; - UINT32 uiValue; + HB_U32 uiValue; } HB_SCREENCELL; typedef HB_SCREENCELL * PHB_SCREENCELL; diff --git a/harbour/src/common/hbarch.c b/harbour/src/common/hbarch.c index d1eb5b7c28..7adac8b82e 100644 --- a/harbour/src/common/hbarch.c +++ b/harbour/src/common/hbarch.c @@ -66,7 +66,7 @@ */ #define HB_MANTISSA_BITS 52 -#define HB_MANTISSA_MASK ( ( ( UINT64 ) 1 << HB_MANTISSA_BITS ) - 1 ) +#define HB_MANTISSA_MASK ( ( ( HB_U64 ) 1 << HB_MANTISSA_BITS ) - 1 ) #define HB_EXPONENT_BITS 11 #define HB_EXPONENT_MASK ( ( 1 << HB_EXPONENT_BITS ) - 1 ) #define HB_EXPONENT_ADD 0x3ff @@ -76,7 +76,7 @@ void hb_put_ieee754( BYTE * ptr, double d ) int iExp, iSig; double df; #if defined( HB_LONG_LONG_OFF ) - UINT32 l1, l2; + HB_U32 l1, l2; HB_TRACE(HB_TR_DEBUG, ("hb_put_ieee754(%p, %f)", ptr, d)); @@ -88,17 +88,17 @@ void hb_put_ieee754( BYTE * ptr, double d ) else { df = frexp( iSig ? -d : d, &iExp ); - l1 = ( UINT32 ) ldexp( df, HB_MANTISSA_BITS + 1 ); - l2 = ( UINT32 ) ldexp( df, HB_MANTISSA_BITS + 1 - 32 ) & - ( ( ( UINT32 ) 1 << ( HB_MANTISSA_BITS - 32 ) ) - 1 ); - l2 |= ( UINT32 ) ( ( iExp + HB_EXPONENT_ADD - 1 ) & HB_EXPONENT_MASK ) << + l1 = ( HB_U32 ) ldexp( df, HB_MANTISSA_BITS + 1 ); + l2 = ( HB_U32 ) ldexp( df, HB_MANTISSA_BITS + 1 - 32 ) & + ( ( ( HB_U32 ) 1 << ( HB_MANTISSA_BITS - 32 ) ) - 1 ); + l2 |= ( HB_U32 ) ( ( iExp + HB_EXPONENT_ADD - 1 ) & HB_EXPONENT_MASK ) << ( HB_MANTISSA_BITS - 32 ); } - l2 |= ( UINT32 ) iSig << ( HB_MANTISSA_BITS + HB_EXPONENT_BITS - 32 ); + l2 |= ( HB_U32 ) iSig << ( HB_MANTISSA_BITS + HB_EXPONENT_BITS - 32 ); HB_PUT_LE_UINT32( ptr, l1 ); HB_PUT_LE_UINT32( ptr + 4, l2 ); #else - UINT64 ll; + HB_U64 ll; HB_TRACE(HB_TR_DEBUG, ("hb_put_ieee754(%p, %f)", ptr, d)); @@ -110,11 +110,11 @@ void hb_put_ieee754( BYTE * ptr, double d ) else { df = frexp( iSig ? -d : d, &iExp ); - ll = ( UINT64 ) ldexp( df, HB_MANTISSA_BITS + 1 ) & HB_MANTISSA_MASK; - ll |= ( UINT64 ) ( ( iExp + HB_EXPONENT_ADD - 1 ) & HB_EXPONENT_MASK ) << + ll = ( HB_U64 ) ldexp( df, HB_MANTISSA_BITS + 1 ) & HB_MANTISSA_MASK; + ll |= ( HB_U64 ) ( ( iExp + HB_EXPONENT_ADD - 1 ) & HB_EXPONENT_MASK ) << HB_MANTISSA_BITS; } - ll |= ( UINT64 ) iSig << ( HB_MANTISSA_BITS + HB_EXPONENT_BITS ); + ll |= ( HB_U64 ) iSig << ( HB_MANTISSA_BITS + HB_EXPONENT_BITS ); HB_PUT_LE_UINT64( ptr, ll ); #endif } @@ -123,7 +123,7 @@ double hb_get_ieee754( const BYTE * ptr ) { int iExp, iSig; #if defined( HB_LONG_LONG_OFF ) - UINT32 l1, l2; + HB_U32 l1, l2; double d; HB_TRACE(HB_TR_DEBUG, ("hb_get_ieee754(%p)", ptr)); @@ -132,15 +132,15 @@ double hb_get_ieee754( const BYTE * ptr ) l2 = HB_GET_LE_UINT32( ptr + 4 ); iSig = ( int ) ( l2 >> ( HB_MANTISSA_BITS + HB_EXPONENT_BITS - 32 ) ) & 1; iExp = ( int ) ( ( l2 >> ( HB_MANTISSA_BITS - 32 ) ) & HB_EXPONENT_MASK ); - l2 &= ( ( UINT32 ) 1 << ( HB_MANTISSA_BITS - 32 ) ) - 1; + l2 &= ( ( HB_U32 ) 1 << ( HB_MANTISSA_BITS - 32 ) ) - 1; if( ( l1 | l2 | iExp ) != 0 ) - l2 |= ( UINT32 ) 1 << ( HB_MANTISSA_BITS - 32 ); + l2 |= ( HB_U32 ) 1 << ( HB_MANTISSA_BITS - 32 ); d = ldexp( ( double ) l2, 32 ) + ( double ) l1; return ldexp( iSig ? -d : d, iExp - HB_MANTISSA_BITS - HB_EXPONENT_ADD ); #else - UINT64 ll; + HB_U64 ll; HB_TRACE(HB_TR_DEBUG, ("hb_get_ieee754(%p)", ptr)); @@ -149,12 +149,12 @@ double hb_get_ieee754( const BYTE * ptr ) iExp = ( int ) ( ( ll >> HB_MANTISSA_BITS ) & HB_EXPONENT_MASK ); ll &= HB_MANTISSA_MASK; if( ( ll | iExp ) != 0 ) - ll |= ( UINT64 ) 1 << HB_MANTISSA_BITS; - /* the casting form UINT64 to INT64 is necessary for some - compilers which does not support UINT64 -> double conversion + ll |= ( HB_U64 ) 1 << HB_MANTISSA_BITS; + /* the casting form HB_U64 to HB_I64 is necessary for some + compilers which does not support HB_U64 -> double conversion It will not change results because there is only up to 53bits set in mantissa */ - return ldexp( iSig ? -( double ) ( INT64 ) ll : ( double ) ( INT64 ) ll, + return ldexp( iSig ? -( double ) ( HB_I64 ) ll : ( double ) ( HB_I64 ) ll, iExp - HB_MANTISSA_BITS - HB_EXPONENT_ADD ); #endif } @@ -163,7 +163,7 @@ void hb_put_ord_ieee754( BYTE * ptr, double d ) { int iExp, iSig; double df; - UINT32 l1, l2; + HB_U32 l1, l2; HB_TRACE(HB_TR_DEBUG, ("hb_put_ord_ieee754(%p, %f)", ptr, d)); @@ -175,10 +175,10 @@ void hb_put_ord_ieee754( BYTE * ptr, double d ) else { df = frexp( iSig ? -d : d, &iExp ); - l1 = ( UINT32 ) ldexp( df, HB_MANTISSA_BITS + 1 ); - l2 = ( UINT32 ) ldexp( df, HB_MANTISSA_BITS + 1 - 32 ) & - ( ( ( UINT32 ) 1 << ( HB_MANTISSA_BITS - 32 ) ) - 1 ); - l2 |= ( UINT32 ) ( ( iExp + HB_EXPONENT_ADD - 1 ) & HB_EXPONENT_MASK ) << + l1 = ( HB_U32 ) ldexp( df, HB_MANTISSA_BITS + 1 ); + l2 = ( HB_U32 ) ldexp( df, HB_MANTISSA_BITS + 1 - 32 ) & + ( ( ( HB_U32 ) 1 << ( HB_MANTISSA_BITS - 32 ) ) - 1 ); + l2 |= ( HB_U32 ) ( ( iExp + HB_EXPONENT_ADD - 1 ) & HB_EXPONENT_MASK ) << ( HB_MANTISSA_BITS - 32 ); } if( iSig ) @@ -197,7 +197,7 @@ void hb_put_ord_ieee754( BYTE * ptr, double d ) double hb_get_ord_ieee754( const BYTE * ptr ) { int iExp, iSig; - UINT32 l1, l2; + HB_U32 l1, l2; double d; HB_TRACE(HB_TR_DEBUG, ("hb_get_ord_ieee754(%p)", ptr)); @@ -211,10 +211,10 @@ double hb_get_ord_ieee754( const BYTE * ptr ) l1 ^= 0xFFFFFFFFL; } iExp = ( ( l2 >> ( HB_MANTISSA_BITS - 32 ) ) & HB_EXPONENT_MASK ); - l2 &= ( ( UINT32 ) 1 << ( HB_MANTISSA_BITS - 32 ) ) - 1; + l2 &= ( ( HB_U32 ) 1 << ( HB_MANTISSA_BITS - 32 ) ) - 1; if( ( l1 | l2 | iExp ) != 0 ) - l2 |= ( UINT32 ) 1 << ( HB_MANTISSA_BITS - 32 ); + l2 |= ( HB_U32 ) 1 << ( HB_MANTISSA_BITS - 32 ); d = ldexp( ( double ) l2, 32 ) + ( double ) l1; return ldexp( iSig ? -d : d, iExp - HB_MANTISSA_BITS - HB_EXPONENT_ADD ); @@ -289,7 +289,7 @@ double hb_get_std_double( const BYTE * ptr ) */ double hb_get_le_uint64( const BYTE * ptr ) { - UINT32 l1, l2; + HB_U32 l1, l2; HB_TRACE(HB_TR_DEBUG, ("hb_get_le_uint64(%p)", ptr)); @@ -300,8 +300,8 @@ double hb_get_le_uint64( const BYTE * ptr ) double hb_get_le_int64( const BYTE * ptr ) { - UINT32 l1; - INT32 l2; + HB_U32 l1; + HB_I32 l2; HB_TRACE(HB_TR_DEBUG, ("hb_get_le_int64(%p)", ptr)); @@ -312,12 +312,12 @@ double hb_get_le_int64( const BYTE * ptr ) void hb_put_le_uint64( BYTE * ptr, double d ) { - UINT32 l1, l2; + HB_U32 l1, l2; HB_TRACE(HB_TR_DEBUG, ("hb_put_le_uint64(%p)", ptr)); - l1 = ( UINT32 ) ( d ); - l2 = ( UINT32 ) ( d / 4294967296.0 ); + l1 = ( HB_U32 ) ( d ); + l2 = ( HB_U32 ) ( d / 4294967296.0 ); HB_PUT_LE_UINT32( ptr, l1 ); HB_PUT_LE_UINT32( ptr + 4, l2 ); } diff --git a/harbour/src/compiler/cmdcheck.c b/harbour/src/compiler/cmdcheck.c index 16ad96fee3..9e549ab047 100644 --- a/harbour/src/compiler/cmdcheck.c +++ b/harbour/src/compiler/cmdcheck.c @@ -76,14 +76,14 @@ static ULONG PackDateTime( void ) { struct { - UINT32 second : 6; /* bits: 0 - 5 */ - UINT32 minute : 6; /* bits: 6 - 11 */ - UINT32 hour : 5; /* bits: 12 - 16 */ - UINT32 day : 5; /* bits: 16 - 21 */ - UINT32 month : 4; /* bits: 22 - 25 */ - UINT32 year : 6; /* bits: 26 - 31 */ + HB_U32 second : 6; /* bits: 0 - 5 */ + HB_U32 minute : 6; /* bits: 6 - 11 */ + HB_U32 hour : 5; /* bits: 12 - 16 */ + HB_U32 day : 5; /* bits: 16 - 21 */ + HB_U32 month : 4; /* bits: 22 - 25 */ + HB_U32 year : 6; /* bits: 26 - 31 */ } ts; - UINT32 val; + HB_U32 val; } u; int iYear, iMonth, iDay, iHour, iMinute, iSecond, iMillisec; diff --git a/harbour/src/nortl/nortl.c b/harbour/src/nortl/nortl.c index 79238c278b..b65cf5a308 100644 --- a/harbour/src/nortl/nortl.c +++ b/harbour/src/nortl/nortl.c @@ -81,7 +81,7 @@ typedef struct _HB_MEMINFO struct _HB_MEMINFO * pPrevBlock; struct _HB_MEMINFO * pNextBlock; ULONG ulSize; - UINT32 Signature; + HB_U32 Signature; } HB_MEMINFO, * PHB_MEMINFO; #ifdef HB_ALLOC_ALIGNMENT @@ -107,7 +107,7 @@ void * hb_xgrab( ULONG ulSize ) /* allocates fixed memory, exits on failu hb_errInternal( HB_EI_XGRABNULLSIZE, "hb_xgrab requested to allocate zero bytes", NULL, NULL ); #ifdef HB_FM_STATISTICS - pMem = malloc( ulSize + HB_MEMINFO_SIZE + sizeof( UINT32 ) ); + pMem = malloc( ulSize + HB_MEMINFO_SIZE + sizeof( HB_U32 ) ); if( pMem ) { if( s_pMemBlocks ) @@ -164,7 +164,7 @@ void * hb_xrealloc( void * pMem, ULONG ulSize ) /* reallocates memory */ HB_PUT_LE_UINT32( ( ( BYTE * ) pMem ) + ulMemSize, 0 ); - pResult = realloc( pMemBlock, ulSize + HB_MEMINFO_SIZE + sizeof( UINT32 ) ); + pResult = realloc( pMemBlock, ulSize + HB_MEMINFO_SIZE + sizeof( HB_U32 ) ); if( pResult ) { if( s_pMemBlocks == pMemBlock ) diff --git a/harbour/src/rdd/dbf1.c b/harbour/src/rdd/dbf1.c index ee7bffc498..0979d24850 100644 --- a/harbour/src/rdd/dbf1.c +++ b/harbour/src/rdd/dbf1.c @@ -2417,17 +2417,17 @@ static HB_ERRCODE hb_dbfPutValue( DBFAREAP pArea, USHORT uiIndex, PHB_ITEM pItem pArea->pRecord[ pArea->pFieldOffset[ uiIndex ] ] = ( signed char ) lVal; break; case 2: - HB_PUT_LE_UINT16( pArea->pRecord + pArea->pFieldOffset[ uiIndex ], ( UINT16 ) lVal ); + HB_PUT_LE_UINT16( pArea->pRecord + pArea->pFieldOffset[ uiIndex ], ( HB_U16 ) lVal ); break; case 3: - HB_PUT_LE_UINT24( pArea->pRecord + pArea->pFieldOffset[ uiIndex ], ( UINT32 ) lVal ); + HB_PUT_LE_UINT24( pArea->pRecord + pArea->pFieldOffset[ uiIndex ], ( HB_U32 ) lVal ); break; case 4: - HB_PUT_LE_UINT32( pArea->pRecord + pArea->pFieldOffset[ uiIndex ], ( UINT32 ) lVal ); + HB_PUT_LE_UINT32( pArea->pRecord + pArea->pFieldOffset[ uiIndex ], ( HB_U32 ) lVal ); break; case 8: #ifndef HB_LONG_LONG_OFF - HB_PUT_LE_UINT64( pArea->pRecord + pArea->pFieldOffset[ uiIndex ], ( UINT64 ) lVal ); + HB_PUT_LE_UINT64( pArea->pRecord + pArea->pFieldOffset[ uiIndex ], ( HB_U64 ) lVal ); #else HB_PUT_LE_UINT64( pArea->pRecord + pArea->pFieldOffset[ uiIndex ], dVal ); #endif @@ -2449,7 +2449,7 @@ static HB_ERRCODE hb_dbfPutValue( DBFAREAP pArea, USHORT uiIndex, PHB_ITEM pItem HB_DBL_LIM_INT32( hb_itemGetND( pItem ) ) : HB_LIM_INT32( lVal ) ) { - HB_PUT_LE_UINT32( pArea->pRecord + pArea->pFieldOffset[ uiIndex ], ( UINT32 ) lVal ); + HB_PUT_LE_UINT32( pArea->pRecord + pArea->pFieldOffset[ uiIndex ], ( HB_U32 ) lVal ); } else { diff --git a/harbour/src/rdd/dbfcdx/dbfcdx1.c b/harbour/src/rdd/dbfcdx/dbfcdx1.c index e4e51f13af..32f08afda8 100644 --- a/harbour/src/rdd/dbfcdx/dbfcdx1.c +++ b/harbour/src/rdd/dbfcdx/dbfcdx1.c @@ -555,7 +555,7 @@ static LPCDXKEY hb_cdxKeyPutItem( LPCDXKEY pKey, PHB_ITEM pItem, ULONG ulRec, LP case 'N': if( pTag->uiLen == 4 ) { - UINT32 uiVal = ( UINT32 ) hb_itemGetNI( pItem ) + 0x80000000; + HB_U32 uiVal = ( HB_U32 ) hb_itemGetNI( pItem ) + 0x80000000; HB_PUT_BE_UINT32( ptr, uiVal ); ulLen = 4; } @@ -627,7 +627,7 @@ static PHB_ITEM hb_cdxKeyGetItem( LPCDXKEY pKey, PHB_ITEM pItem, LPCDXTAG pTag, case 'N': if( pKey->len == 4 ) { - INT32 iVal = ( INT32 ) ( HB_GET_BE_UINT32( pKey->val ) ) - 0x80000000; + HB_I32 iVal = ( HB_I32 ) ( HB_GET_BE_UINT32( pKey->val ) ) - 0x80000000; pItem = hb_itemPutNI( pItem, iVal ); } else @@ -2309,7 +2309,7 @@ static void hb_cdxPageStore( LPCDXPAGE pPage ) else if( pPage->iKeys > pPage->TagParent->MaxKeys ) hb_cdxErrInternal( "hb_cdxPageStore: number of keys exceed!." ); #endif - HB_PUT_LE_UINT16( pPage->node.intNode.attr, ( UINT16 ) pPage->PageType ); + HB_PUT_LE_UINT16( pPage->node.intNode.attr, ( HB_U16 ) pPage->PageType ); HB_PUT_LE_UINT16( pPage->node.intNode.nKeys, pPage->iKeys ); HB_PUT_LE_UINT32( pPage->node.intNode.leftPtr, pPage->Left ); HB_PUT_LE_UINT32( pPage->node.intNode.rightPtr, pPage->Right ); @@ -9544,7 +9544,7 @@ static void hb_cdxTagDoIndex( LPCDXTAG pTag, HB_BOOL fReindex ) case HB_IT_DOUBLE: if( pTag->uiLen == 4 ) { - UINT32 uiVal = ( UINT32 ) hb_itemGetNI( pItem ) + 0x80000000; + HB_U32 uiVal = ( HB_U32 ) hb_itemGetNI( pItem ) + 0x80000000; HB_PUT_BE_UINT32( &cTemp[0], uiVal ); hb_cdxSortKeyAdd( pSort, pArea->dbfarea.ulRecNo, cTemp, 4 ); } diff --git a/harbour/src/rdd/dbffpt/dbffpt1.c b/harbour/src/rdd/dbffpt/dbffpt1.c index 1fbcd22956..4c97176018 100644 --- a/harbour/src/rdd/dbffpt/dbffpt1.c +++ b/harbour/src/rdd/dbffpt/dbffpt1.c @@ -3549,7 +3549,7 @@ static HB_ERRCODE hb_fptPutVarField( FPTAREAP pArea, USHORT uiIndex, PHB_ITEM pI { return EDBF_DATAWIDTH; } - HB_PUT_LE_UINT32( pFieldBuf, ( UINT32 ) lVal ); + HB_PUT_LE_UINT32( pFieldBuf, ( HB_U32 ) lVal ); } else if( pField->uiLen < 6 ) { @@ -3605,7 +3605,7 @@ static HB_ERRCODE hb_fptPutVarField( FPTAREAP pArea, USHORT uiIndex, PHB_ITEM pI if( !HB_IS_DOUBLE( pItem ) && HB_LIM_INT32( lVal ) ) { - HB_PUT_LE_UINT32( pFieldBuf, ( UINT32 ) lVal ); + HB_PUT_LE_UINT32( pFieldBuf, ( HB_U32 ) lVal ); uiType = HB_VF_INT; } else @@ -3965,7 +3965,7 @@ static HB_ERRCODE hb_fptCreateMemFile( FPTAREAP pArea, LPDBOPENINFO pCreateInfo ulSize = sizeof( FPTHEADER ); if( pArea->area.rddID == s_uiRddIdBLOB ) { - HB_PUT_LE_UINT16( fptHeader.flexSize, ( UINT16 ) pArea->ulMemoBlockSize ); + HB_PUT_LE_UINT16( fptHeader.flexSize, ( HB_U16 ) pArea->ulMemoBlockSize ); } } } @@ -3973,12 +3973,12 @@ static HB_ERRCODE hb_fptCreateMemFile( FPTAREAP pArea, LPDBOPENINFO pCreateInfo if( pArea->bMemoType == DB_MEMO_SMT || pArea->bMemoType == DB_MEMO_DBT ) { HB_PUT_LE_UINT32( fptHeader.nextBlock, ulNextBlock ); - HB_PUT_LE_UINT32( fptHeader.blockSize, ( UINT32 ) pArea->ulMemoBlockSize ); + HB_PUT_LE_UINT32( fptHeader.blockSize, ( HB_U32 ) pArea->ulMemoBlockSize ); } else { HB_PUT_BE_UINT32( fptHeader.nextBlock, ulNextBlock ); - HB_PUT_BE_UINT32( fptHeader.blockSize, ( UINT32 ) pArea->ulMemoBlockSize ); + HB_PUT_BE_UINT32( fptHeader.blockSize, ( HB_U32 ) pArea->ulMemoBlockSize ); } if( hb_fileWriteAt( pArea->pMemoFile, &fptHeader, ulSize, 0 ) != ulSize ) return HB_FAILURE; diff --git a/harbour/src/rdd/hbsix/sxcrypt.c b/harbour/src/rdd/hbsix/sxcrypt.c index 07f28368b9..9ebd8c0c15 100644 --- a/harbour/src/rdd/hbsix/sxcrypt.c +++ b/harbour/src/rdd/hbsix/sxcrypt.c @@ -60,9 +60,9 @@ #define rnd_mul1 0x0de6d #define rnd_mul2 0x0278d -static UINT32 hb_sxInitSeed( const char * pKeyVal, UINT16 * puiKey ) +static HB_U32 hb_sxInitSeed( const char * pKeyVal, HB_U16 * puiKey ) { - UINT32 ulSeed = 0; + HB_U32 ulSeed = 0; int i; for( i = 0; i < 7; i++ ) @@ -71,22 +71,22 @@ static UINT32 hb_sxInitSeed( const char * pKeyVal, UINT16 * puiKey ) HB_GET_LE_UINT16( &pKeyVal[i] ); } ulSeed |= 1; - *puiKey = ( UINT16 ) ulSeed; + *puiKey = ( HB_U16 ) ulSeed; return ( ulSeed << 16 ) + ( ulSeed >> 16 ); } -static UINT32 hb_sxNextSeed( UINT32 ulSeed, const char * pKeyVal, UINT16 * puiKey ) +static HB_U32 hb_sxNextSeed( HB_U32 ulSeed, const char * pKeyVal, HB_U16 * puiKey ) { - UINT32 ulTemp1, ulTemp2; - UINT16 uiSeedLo, uiSeedHi; + HB_U32 ulTemp1, ulTemp2; + HB_U16 uiSeedLo, uiSeedHi; - uiSeedLo = ( UINT16 ) ulSeed; - ulTemp1 = ( UINT32 ) rnd_mul1 * ( UINT32 ) uiSeedLo; - ulTemp2 = ( UINT32 ) rnd_mul2 * ( UINT32 ) uiSeedLo + ( ulTemp1 >> 16 ); - uiSeedLo = ( UINT16 ) ulTemp1; - ulTemp1 = ( UINT32 ) rnd_mul1 * ( ulSeed >> 16 ); - uiSeedHi = ( UINT16 ) ( ulTemp1 + ulTemp2 ); - ulSeed = ( ( UINT32 ) uiSeedHi << 16 ) + ( UINT32 ) uiSeedLo; + uiSeedLo = ( HB_U16 ) ulSeed; + ulTemp1 = ( HB_U32 ) rnd_mul1 * ( HB_U32 ) uiSeedLo; + ulTemp2 = ( HB_U32 ) rnd_mul2 * ( HB_U32 ) uiSeedLo + ( ulTemp1 >> 16 ); + uiSeedLo = ( HB_U16 ) ulTemp1; + ulTemp1 = ( HB_U32 ) rnd_mul1 * ( ulSeed >> 16 ); + uiSeedHi = ( HB_U16 ) ( ulTemp1 + ulTemp2 ); + ulSeed = ( ( HB_U32 ) uiSeedHi << 16 ) + ( HB_U32 ) uiSeedLo; uiSeedHi |= 1; *puiKey = uiSeedHi + HB_GET_LE_UINT16( pKeyVal ); return ulSeed; @@ -94,8 +94,8 @@ static UINT32 hb_sxNextSeed( UINT32 ulSeed, const char * pKeyVal, UINT16 * puiKe void hb_sxEnCrypt( const char * pSrc, char * pDst, const char * pKeyVal, HB_SIZE ulLen ) { - UINT32 ulSeed; - UINT16 uiKey; + HB_U32 ulSeed; + HB_U16 uiKey; UCHAR ucChar, ucShft; HB_SIZE ul; int i; @@ -115,8 +115,8 @@ void hb_sxEnCrypt( const char * pSrc, char * pDst, const char * pKeyVal, HB_SIZE void hb_sxDeCrypt( const char * pSrc, char * pDst, const char * pKeyVal, HB_SIZE ulLen ) { - UINT32 ulSeed; - UINT16 uiKey; + HB_U32 ulSeed; + HB_U16 uiKey; UCHAR ucChar, ucShft; HB_SIZE ul; int i; diff --git a/harbour/src/rdd/hsx/hsx.c b/harbour/src/rdd/hsx/hsx.c index 084d8c4bfb..fd7a24b2f6 100644 --- a/harbour/src/rdd/hsx/hsx.c +++ b/harbour/src/rdd/hsx/hsx.c @@ -664,8 +664,8 @@ static int hb_hsxHdrFlush( int iHandle ) uiBits++; HB_PUT_LE_UINT32( pHeader->recCount, pHSX->ulRecCount ); - HB_PUT_LE_UINT32( pHeader->recSize, ( UINT32 ) pHSX->uiRecordSize ); - HB_PUT_LE_UINT32( pHeader->recSizeBits, ( UINT32 ) uiBits ); + HB_PUT_LE_UINT32( pHeader->recSize, ( HB_U32 ) pHSX->uiRecordSize ); + HB_PUT_LE_UINT32( pHeader->recSizeBits, ( HB_U32 ) uiBits ); HB_PUT_LE_UINT16( pHeader->ignoreCase, pHSX->fIgnoreCase ? 1 : 0 ); HB_PUT_LE_UINT16( pHeader->filterType, pHSX->iFilterType ); HB_PUT_LE_UINT32( pHeader->hashLetters, pHSX->fUseHash ? 1 : 0 ); diff --git a/harbour/src/rtl/binnum.c b/harbour/src/rtl/binnum.c index e36f84c35a..92f06ae806 100644 --- a/harbour/src/rtl/binnum.c +++ b/harbour/src/rtl/binnum.c @@ -57,7 +57,7 @@ HB_FUNC( BIN2W ) { PHB_ITEM pItem = hb_param( 1, HB_IT_STRING ); - UINT16 uiResult = 0; + HB_U16 uiResult = 0; if( pItem ) { @@ -74,7 +74,7 @@ HB_FUNC( BIN2W ) HB_FUNC( BIN2I ) { PHB_ITEM pItem = hb_param( 1, HB_IT_STRING ); - INT16 iResult = 0; + HB_I16 iResult = 0; if( pItem ) { @@ -91,7 +91,7 @@ HB_FUNC( BIN2I ) HB_FUNC( BIN2L ) { PHB_ITEM pItem = hb_param( 1, HB_IT_STRING ); - INT32 iResult = 0; + HB_I32 iResult = 0; if( pItem ) { @@ -111,7 +111,7 @@ HB_FUNC( BIN2L ) HB_FUNC( I2BIN ) { char szResult[ 2 ]; - INT16 iValue = ( INT16 ) hb_parni( 1 ); + HB_I16 iValue = ( HB_I16 ) hb_parni( 1 ); HB_PUT_LE_UINT16( szResult, iValue ); hb_retclen( szResult, 2 ); } @@ -119,7 +119,7 @@ HB_FUNC( I2BIN ) HB_FUNC( L2BIN ) { char szResult[ 4 ]; - INT32 iValue = ( INT32 ) hb_parnl( 1 ); + HB_I32 iValue = ( HB_I32 ) hb_parnl( 1 ); HB_PUT_LE_UINT32( szResult, iValue ); hb_retclen( szResult, 4 ); } diff --git a/harbour/src/rtl/binnumx.c b/harbour/src/rtl/binnumx.c index d8a7905abb..58756e9ce6 100644 --- a/harbour/src/rtl/binnumx.c +++ b/harbour/src/rtl/binnumx.c @@ -61,7 +61,7 @@ HB_FUNC( BIN2U ) { PHB_ITEM pItem = hb_param( 1, HB_IT_STRING ); - UINT32 uiResult = 0; + HB_U32 uiResult = 0; if( pItem ) { @@ -81,7 +81,7 @@ HB_FUNC( BIN2U ) HB_FUNC( U2BIN ) { char szResult[ 4 ]; - UINT32 uiValue = ( UINT32 ) hb_parnint( 1 ); + HB_U32 uiValue = ( HB_U32 ) hb_parnint( 1 ); HB_PUT_LE_UINT32( szResult, uiValue ); hb_retclen( szResult, 4 ); } @@ -89,7 +89,7 @@ HB_FUNC( U2BIN ) HB_FUNC( W2BIN ) { char szResult[ 2 ]; - UINT16 uiValue = ( UINT16 ) hb_parni( 1 ); + HB_U16 uiValue = ( HB_U16 ) hb_parni( 1 ); HB_PUT_LE_UINT16( szResult, uiValue ); hb_retclen( szResult, 4 ); } diff --git a/harbour/src/rtl/hbbffnc.c b/harbour/src/rtl/hbbffnc.c index f6df43dae5..2d8991bf74 100644 --- a/harbour/src/rtl/hbbffnc.c +++ b/harbour/src/rtl/hbbffnc.c @@ -96,7 +96,7 @@ HB_FUNC( HB_BLOWFISHENCRYPT ) pszData[ ulSize - 1 ] = ( char ) ( ulSize - ulLen ); for( ulLen = 0; ulLen < ulSize; ulLen += 8 ) { - UINT32 xl, xr; + HB_U32 xl, xr; xl = HB_GET_BE_UINT32( &pszData[ ulLen ] ); xr = HB_GET_BE_UINT32( &pszData[ ulLen + 4 ] ); hb_blowfishEncrypt( bf, &xl, &xr ); @@ -132,7 +132,7 @@ HB_FUNC( HB_BLOWFISHDECRYPT ) pszSource = hb_itemGetCPtr( pData ); for( ulLen = 0; ulLen < ulSize; ulLen += 8 ) { - UINT32 xl, xr; + HB_U32 xl, xr; xl = HB_GET_BE_UINT32( &pszSource[ ulLen ] ); xr = HB_GET_BE_UINT32( &pszSource[ ulLen + 4 ] ); hb_blowfishDecrypt( bf, &xl, &xr ); diff --git a/harbour/src/rtl/hbbfish.c b/harbour/src/rtl/hbbfish.c index 1efbb5041d..bedc52fb20 100644 --- a/harbour/src/rtl/hbbfish.c +++ b/harbour/src/rtl/hbbfish.c @@ -253,9 +253,9 @@ const HB_BLOWFISH s_blowFishInit = #define F( x ) ( ( ( S1( a(x) ) + S2( b(x) ) ) ^ S3( c(x) ) ) + S4( d(x) ) ) #define R( X, n ) ( F( X ) ^ P( n ) ) -void hb_blowfishEncrypt( const HB_BLOWFISH * bf, UINT32 * xl, UINT32 * xr ) +void hb_blowfishEncrypt( const HB_BLOWFISH * bf, HB_U32 * xl, HB_U32 * xr ) { - UINT32 xL = *xl, xR = *xr; + HB_U32 xL = *xl, xR = *xr; xL ^= P( 0 ); xR ^= R( xL, 1 ); xL ^= R( xR, 2 ); @@ -272,9 +272,9 @@ void hb_blowfishEncrypt( const HB_BLOWFISH * bf, UINT32 * xl, UINT32 * xr ) *xl = xR; } -void hb_blowfishDecrypt( const HB_BLOWFISH * bf, UINT32 * xl, UINT32 * xr ) +void hb_blowfishDecrypt( const HB_BLOWFISH * bf, HB_U32 * xl, HB_U32 * xr ) { - UINT32 xL = *xl, xR = *xr; + HB_U32 xL = *xl, xR = *xr; xL ^= P( 17 ); xR ^= R( xL, 16 ); xL ^= R( xR, 15 ); @@ -300,7 +300,7 @@ void hb_blowfishDecrypt( const HB_BLOWFISH * bf, UINT32 * xl, UINT32 * xr ) void hb_blowfishInit( HB_BLOWFISH * bf, const void * keydata, int keylen ) { unsigned char * key = ( unsigned char * ) keydata; - UINT32 xL, xR; + HB_U32 xL, xR; int i, j, l; memcpy( bf, &s_blowFishInit, sizeof( s_blowFishInit ) ); diff --git a/harbour/src/rtl/hbbyte.c b/harbour/src/rtl/hbbyte.c index efcce13964..446212240a 100644 --- a/harbour/src/rtl/hbbyte.c +++ b/harbour/src/rtl/hbbyte.c @@ -71,7 +71,7 @@ HB_FUNC( HB_BYTESWAPI ) if( hb_numParam( 1, &lValue ) ) { - INT16 iVal = ( INT16 ) HB_SWAP_UINT16( lValue ); + HB_I16 iVal = ( HB_I16 ) HB_SWAP_UINT16( lValue ); hb_retnint( iVal ); } } @@ -82,7 +82,7 @@ HB_FUNC( HB_BYTESWAPW ) if( hb_numParam( 1, &lValue ) ) { - UINT16 uiVal = ( UINT16 ) HB_SWAP_UINT16( lValue ); + HB_U16 uiVal = ( HB_U16 ) HB_SWAP_UINT16( lValue ); hb_retnint( uiVal ); } } @@ -93,7 +93,7 @@ HB_FUNC( HB_BYTESWAPL ) if( hb_numParam( 1, &lValue ) ) { - INT32 iVal = ( INT32 ) HB_SWAP_UINT32( lValue ); + HB_I32 iVal = ( HB_I32 ) HB_SWAP_UINT32( lValue ); hb_retnint( iVal ); } } @@ -104,7 +104,7 @@ HB_FUNC( HB_BYTESWAPU ) if( hb_numParam( 1, &lValue ) ) { - UINT32 uiVal = ( UINT32 ) HB_SWAP_UINT32( lValue ); + HB_U32 uiVal = ( HB_U32 ) HB_SWAP_UINT32( lValue ); hb_retnint( uiVal ); } } diff --git a/harbour/src/rtl/hbznet.c b/harbour/src/rtl/hbznet.c index 8d9108f37a..85511624ac 100644 --- a/harbour/src/rtl/hbznet.c +++ b/harbour/src/rtl/hbznet.c @@ -176,7 +176,7 @@ void hb_znetEncryptKey( PHB_ZNETSTREAM pStream, const void * keydata, int keylen static void hb_znetDecrypt( PHB_ZNETSTREAM pStream, Bytef * data ) { - UINT32 xl, xr; + HB_U32 xl, xr; xl = HB_GET_BE_UINT32( data ); xr = HB_GET_BE_UINT32( data + 4 ); hb_blowfishDecrypt( pStream->bf, &xl, &xr ); @@ -186,7 +186,7 @@ static void hb_znetDecrypt( PHB_ZNETSTREAM pStream, Bytef * data ) static void hb_znetEncrypt( PHB_ZNETSTREAM pStream, Bytef * data ) { - UINT32 xl, xr; + HB_U32 xl, xr; xl = HB_GET_BE_UINT32( data ); xr = HB_GET_BE_UINT32( data + 4 ); hb_blowfishEncrypt( pStream->bf, &xl, &xr ); @@ -290,9 +290,9 @@ static long hb_znetStreamWrite( PHB_ZNETSTREAM pStream, HB_SOCKET sd, HB_LONG ti if( size > 2 ) { - UINT16 uiLen = ( UINT16 ) ( size - 2 ); + HB_U16 uiLen = ( HB_U16 ) ( size - 2 ); HB_PUT_BE_UINT16( pStream->crypt_out, uiLen ); - uiLen = ( UINT16 ) ( ( ( size + 7 ) ^ 0x07 ) & 0x07 ); + uiLen = ( HB_U16 ) ( ( ( size + 7 ) ^ 0x07 ) & 0x07 ); if( ( uInt ) uiLen > pStream->wr.avail_out ) { /* it may happen only if encryption was enabled in non empty diff --git a/harbour/src/vm/extrap.c b/harbour/src/vm/extrap.c index 8e8f2ca06a..78c434374a 100644 --- a/harbour/src/vm/extrap.c +++ b/harbour/src/vm/extrap.c @@ -120,15 +120,15 @@ static LONG WINAPI hb_winExceptionHandler( struct _EXCEPTION_POINTERS * pExcepti " CS:RIP:%04X:0x%016" PFLL "X SS:RSP:%04X:0x%016" PFLL "X\n" " DS:%04X ES:%04X FS:%04X GS:%04X\n" " Flags:%08X\n", - ( UINT32 ) pExceptionInfo->ExceptionRecord->ExceptionCode, + ( HB_U32 ) pExceptionInfo->ExceptionRecord->ExceptionCode, ( HB_PTRDIFF ) pExceptionInfo->ExceptionRecord->ExceptionAddress, pCtx->Rax, pCtx->Rbx, pCtx->Rcx, pCtx->Rdx, pCtx->Rsi, pCtx->Rdi, pCtx->Rbp, pCtx->R8 , pCtx->R9 , pCtx->R10, pCtx->R11, pCtx->R12, pCtx->R13, pCtx->R14, pCtx->R15, - ( UINT32 ) pCtx->SegCs, pCtx->Rip, ( UINT32 ) pCtx->SegSs, pCtx->Rsp, - ( UINT32 ) pCtx->SegDs, ( UINT32 ) pCtx->SegEs, ( UINT32 ) pCtx->SegFs, ( UINT32 ) pCtx->SegGs, - ( UINT32 ) pCtx->EFlags ); + ( HB_U32 ) pCtx->SegCs, pCtx->Rip, ( HB_U32 ) pCtx->SegSs, pCtx->Rsp, + ( HB_U32 ) pCtx->SegDs, ( HB_U32 ) pCtx->SegEs, ( HB_U32 ) pCtx->SegFs, ( HB_U32 ) pCtx->SegGs, + ( HB_U32 ) pCtx->EFlags ); /* TODO: 64-bit stack trace. See: - StackWalk64() @@ -159,13 +159,13 @@ static LONG WINAPI hb_winExceptionHandler( struct _EXCEPTION_POINTERS * pExcepti " CS:EIP:%04X:%08X SS:ESP:%04X:%08X\n" " DS:%04X ES:%04X FS:%04X GS:%04X\n" " Flags:%08X\n", - ( UINT32 ) pExceptionInfo->ExceptionRecord->ExceptionCode, - ( UINT32 ) pExceptionInfo->ExceptionRecord->ExceptionAddress, - ( UINT32 ) pCtx->Eax, ( UINT32 ) pCtx->Ebx, ( UINT32 ) pCtx->Ecx, ( UINT32 ) pCtx->Edx, - ( UINT32 ) pCtx->Esi, ( UINT32 ) pCtx->Edi, ( UINT32 ) pCtx->Ebp, - ( UINT32 ) pCtx->SegCs, ( UINT32 ) pCtx->Eip, ( UINT32 ) pCtx->SegSs, ( UINT32 ) pCtx->Esp, - ( UINT32 ) pCtx->SegDs, ( UINT32 ) pCtx->SegEs, ( UINT32 ) pCtx->SegFs, ( UINT32 ) pCtx->SegGs, - ( UINT32 ) pCtx->EFlags ); + ( HB_U32 ) pExceptionInfo->ExceptionRecord->ExceptionCode, + ( HB_U32 ) pExceptionInfo->ExceptionRecord->ExceptionAddress, + ( HB_U32 ) pCtx->Eax, ( HB_U32 ) pCtx->Ebx, ( HB_U32 ) pCtx->Ecx, ( HB_U32 ) pCtx->Edx, + ( HB_U32 ) pCtx->Esi, ( HB_U32 ) pCtx->Edi, ( HB_U32 ) pCtx->Ebp, + ( HB_U32 ) pCtx->SegCs, ( HB_U32 ) pCtx->Eip, ( HB_U32 ) pCtx->SegSs, ( HB_U32 ) pCtx->Esp, + ( HB_U32 ) pCtx->SegDs, ( HB_U32 ) pCtx->SegEs, ( HB_U32 ) pCtx->SegFs, ( HB_U32 ) pCtx->SegGs, + ( HB_U32 ) pCtx->EFlags ); hb_strncat( errmsg, " CS:EIP:", errmsglen ); pc = ( unsigned char * ) pCtx->Eip; diff --git a/harbour/src/vm/fm.c b/harbour/src/vm/fm.c index b25fadb710..e3d372a770 100644 --- a/harbour/src/vm/fm.c +++ b/harbour/src/vm/fm.c @@ -269,7 +269,7 @@ static HB_BOOL s_fInitedFM = HB_FALSE; typedef struct _HB_MEMINFO { - UINT32 u32Signature; + HB_U32 u32Signature; HB_SIZE ulSize; USHORT uiProcLine; char szProcName[ HB_SYMBOL_NAME_LEN + 1 ]; @@ -291,7 +291,7 @@ typedef struct _HB_MEMINFO #define HB_FM_SETSIG( p, n ) HB_PUT_UINT32( ( BYTE * ) ( p ) + ( n ), HB_MEMINFO_SIGNATURE ) #define HB_FM_CLRSIG( p, n ) HB_PUT_UINT32( ( BYTE * ) ( p ) + ( n ), 0 ) -#define HB_ALLOC_SIZE( n ) ( ( n ) + ( s_fStatistic ? _HB_MEMINFO_SIZE + sizeof( UINT32 ) : HB_COUNTER_OFFSET ) ) +#define HB_ALLOC_SIZE( n ) ( ( n ) + ( s_fStatistic ? _HB_MEMINFO_SIZE + sizeof( HB_U32 ) : HB_COUNTER_OFFSET ) ) #define HB_FM_PTR( p ) ( ( PHB_MEMINFO ) ( ( BYTE * ) ( p ) - HB_MEMINFO_SIZE ) ) #define HB_FM_BLOCKSIZE( p ) ( s_fStatistic ? HB_FM_PTR( pMem )->ulSize : 0 )