2017-09-07 08:38 UTC Viktor Szakats (vszakats users.noreply.github.com)

* contrib/hbct/charsprd.c
  * contrib/hbct/dattime3.c
  * contrib/hbct/expand.c
  * contrib/hbct/misc2.c
  * contrib/hbct/screen2.c
  * contrib/hbcurl/core.c
  * contrib/hbfship/strpeek.c
  * contrib/hbnetio/netiocli.c
  * contrib/hbwin/olecore.c
  * contrib/rddads/adsx.c
  * contrib/rddads/rddads.h
  * contrib/rddsql/sqlmix.c
  * contrib/sddmy/core.c
  * contrib/sddpg/core.c
  * contrib/xhb/hbcompat.h
  * contrib/xhb/hbxml.c
  * contrib/xhb/xhb.h
  * src/common/hbstr.c
  * src/compiler/harbour.y
  * src/compiler/harbour.yyc
  * src/compiler/hbcmplib.c
  * src/macro/macrolex.c
  * src/rdd/dbffpt/dbffpt1.c
  * src/rdd/hbsix/sxcompr.c
  * src/rdd/hbsix/sxcrypt.c
  * src/rdd/hbsix/sxtable.c
  * src/rdd/hsx/hsx.c
  * src/rtl/cdpapi.c
  * src/rtl/gtcrs/gtcrs.c
  * src/rtl/gtxwc/gtxwc.c
  * src/rtl/hbtoken.c
  * src/rtl/net.c
  * src/rtl/netusr.c
  * src/vm/hvm.c
    * update HB_SIZE variable name prefixes to use `n` instead of `ul`
    % adjust some variables
    % sync variables scopes and some other minor things with 3.4 fork
This commit is contained in:
Viktor Szakats
2017-09-07 08:39:50 +00:00
parent f496daa711
commit d55bdd18b7
35 changed files with 661 additions and 614 deletions

View File

@@ -1418,9 +1418,9 @@ static HB_ERRCODE hb_fptReadRawSMTItem( FPTAREAP pArea, PHB_ITEM pItem, HB_FOFFS
{
if( iTrans == FPT_TRANS_CP && ulLen > 0 )
{
HB_SIZE ulSize = ulLen + 1;
HB_SIZE nSize = ulLen + 1;
HB_SIZE nLen = ulLen;
hb_cdpnDup3( pBuffer, ulLen, pBuffer, &nLen, &pBuffer, &ulSize,
hb_cdpnDup3( pBuffer, ulLen, pBuffer, &nLen, &pBuffer, &nSize,
pArea->area.cdPage, hb_vmCDP() );
ulLen = ( HB_ULONG ) nLen;
}
@@ -1837,9 +1837,9 @@ static HB_ERRCODE hb_fptReadSixItem( FPTAREAP pArea, HB_BYTE ** pbMemoBuf, HB_BY
{
if( iTrans == FPT_TRANS_CP && ulLen > 0 )
{
HB_SIZE ulSize = ulLen;
pszStr = hb_cdpnDup( pszStr, &ulSize, pArea->area.cdPage, hb_vmCDP() );
hb_itemPutCLPtr( pItem, pszStr, ulSize );
HB_SIZE nSize = ulLen;
pszStr = hb_cdpnDup( pszStr, &nSize, pArea->area.cdPage, hb_vmCDP() );
hb_itemPutCLPtr( pItem, pszStr, nSize );
}
else
hb_itemPutCL( pItem, pszStr, ulLen );
@@ -2766,9 +2766,9 @@ static HB_ERRCODE hb_fptGetMemo( FPTAREAP pArea, HB_USHORT uiIndex, PHB_ITEM pIt
if( iTrans == FPT_TRANS_CP && ulSize != 0 )
{
HB_SIZE nSize = ulSize;
HB_SIZE ulBufSize = ulSize + 1;
HB_SIZE nBufSize = ulSize + 1;
hb_cdpnDup3( pBuffer, ulSize, pBuffer, &nSize,
&pBuffer, &ulBufSize,
&pBuffer, &nBufSize,
pArea->area.cdPage, hb_vmCDP() );
ulSize = ( HB_ULONG ) nSize;
}
@@ -2792,9 +2792,9 @@ static HB_ERRCODE hb_fptGetMemo( FPTAREAP pArea, HB_USHORT uiIndex, PHB_ITEM pIt
if( iTrans == FPT_TRANS_CP && ulSize != 0 )
{
HB_SIZE nSize = ulSize;
HB_SIZE ulBufSize = ulSize + 1;
HB_SIZE nBufSize = ulSize + 1;
hb_cdpnDup3( pBuffer, ulSize, pBuffer, &nSize,
&pBuffer, &ulBufSize,
&pBuffer, &nBufSize,
pArea->area.cdPage, hb_vmCDP() );
ulSize = ( HB_ULONG ) nSize;
}
@@ -2886,9 +2886,9 @@ static HB_ERRCODE hb_fptGetMemo( FPTAREAP pArea, HB_USHORT uiIndex, PHB_ITEM pIt
if( iTrans == FPT_TRANS_CP && ulSize != 0 )
{
HB_SIZE nSize = ulSize;
HB_SIZE ulBufSize = ulSize + 1;
HB_SIZE nBufSize = ulSize + 1;
hb_cdpnDup3( pBuffer, ulSize, pBuffer, &nSize,
&pBuffer, &ulBufSize,
&pBuffer, &nBufSize,
pArea->area.cdPage, hb_vmCDP() );
ulSize = ( HB_ULONG ) nSize;
}
@@ -3800,21 +3800,21 @@ static HB_ERRCODE hb_fptPutVarField( FPTAREAP pArea, HB_USHORT uiIndex, PHB_ITEM
}
else if( HB_IS_STRING( pItem ) )
{
HB_SIZE ulLen = hb_itemGetCLen( pItem );
HB_SIZE nLen = hb_itemGetCLen( pItem );
pBlock = ( const HB_BYTE * ) hb_itemGetCPtr( pItem );
if( ulLen > HB_VF_CHAR )
ulLen = HB_VF_CHAR;
if( ulLen > 0 && ( pField->uiFlags & HB_FF_BINARY ) == 0 &&
if( nLen > HB_VF_CHAR )
nLen = HB_VF_CHAR;
if( nLen > 0 && ( pField->uiFlags & HB_FF_BINARY ) == 0 &&
hb_vmCDP() != pArea->area.cdPage )
{
pBlock = pAlloc = ( HB_BYTE * )
hb_cdpnDup( ( const char * ) pBlock, &ulLen,
hb_cdpnDup( ( const char * ) pBlock, &nLen,
hb_vmCDP(), pArea->area.cdPage );
if( ulLen > HB_VF_CHAR )
ulLen = HB_VF_CHAR;
if( nLen > HB_VF_CHAR )
nLen = HB_VF_CHAR;
}
uiType = ( HB_USHORT ) ulLen;
uiType = ( HB_USHORT ) nLen;
if( uiType <= pField->uiLen - 2 )
{
memcpy( pFieldBuf, pBlock, uiType );

View File

@@ -179,8 +179,7 @@ typedef struct _HB_LZSSX_COMPR
HB_SIZE outBuffPos;
HB_BOOL fOutFree;
HB_SIZE ulMaxSize;
HB_SIZE ulOutSize;
HB_SIZE nOutSize;
HB_BOOL fResult;
HB_BOOL fContinue;
@@ -227,8 +226,7 @@ static PHB_LZSSX_COMPR hb_LZSSxInit(
pCompr->outBuffPos = 0;
pCompr->fOutFree = ( pOutput != NULL && pDstBuf == NULL );
pCompr->ulMaxSize = 0;
pCompr->ulOutSize = 0;
pCompr->nOutSize = 0;
pCompr->fResult = HB_TRUE;
pCompr->fContinue = HB_FALSE;
@@ -256,7 +254,7 @@ static HB_BOOL hb_LZSSxFlush( PHB_LZSSX_COMPR pCompr )
}
else
{
pCompr->ulOutSize += pCompr->outBuffPos;
pCompr->nOutSize += pCompr->outBuffPos;
pCompr->outBuffPos = 0;
}
}

View File

@@ -1,10 +1,10 @@
/*
* SIX compatible functions:
* hb_sxEnCrypt()
* hb_sxDeCrypt()
* hb_sxEnCrypt()
* hb_sxDeCrypt()
*
* sx_Encrypt()
* sx_Decrypt()
* sx_Encrypt()
* sx_Decrypt()
*
* Copyright 2007 Przemyslaw Czerpak <druzus / at / priv.onet.pl>
*
@@ -90,17 +90,18 @@ void hb_sxEnCrypt( const char * pSrc, char * pDst, const char * pKeyVal, HB_SIZE
{
HB_U32 ulSeed;
HB_U16 uiKey;
HB_UCHAR ucChar, ucShft;
HB_SIZE ul;
HB_SIZE nPos;
int i;
ulSeed = hb_sxInitSeed( pKeyVal, &uiKey );
for( ul = 0, i = 0; ul < nLen; ul++ )
for( nPos = 0, i = 0; nPos < nLen; nPos++ )
{
ucChar = ( HB_UCHAR ) pSrc[ ul ];
HB_UCHAR ucChar, ucShft;
ucChar = ( HB_UCHAR ) pSrc[ nPos ];
ucShft = ( HB_UCHAR ) ( uiKey & 0x07 );
pDst[ ul ] = ( ( ucChar >> ucShft ) + ( ucChar << ( 8 - ucShft ) ) +
( uiKey & 0xFF ) );
pDst[ nPos ] = ( ( ucChar >> ucShft ) + ( ucChar << ( 8 - ucShft ) ) +
( uiKey & 0xFF ) );
ulSeed = hb_sxNextSeed( ulSeed, &pKeyVal[ i ], &uiKey );
if( ++i == 7 )
i = 0;
@@ -111,16 +112,17 @@ void hb_sxDeCrypt( const char * pSrc, char * pDst, const char * pKeyVal, HB_SIZE
{
HB_U32 ulSeed;
HB_U16 uiKey;
HB_UCHAR ucChar, ucShft;
HB_SIZE ul;
HB_SIZE nPos;
int i;
ulSeed = hb_sxInitSeed( pKeyVal, &uiKey );
for( ul = 0, i = 0; ul < nLen; ul++ )
for( nPos = 0, i = 0; nPos < nLen; nPos++ )
{
ucChar = ( HB_UCHAR ) pSrc[ ul ] - ( uiKey & 0xFF );
HB_UCHAR ucChar, ucShft;
ucChar = ( HB_UCHAR ) pSrc[ nPos ] - ( uiKey & 0xFF );
ucShft = ( HB_UCHAR ) ( uiKey & 0x07 );
pDst[ ul ] = ( ( ucChar << ucShft ) + ( ucChar >> ( 8 - ucShft ) ) );
pDst[ nPos ] = ( ( ucChar << ucShft ) + ( ucChar >> ( 8 - ucShft ) ) );
ulSeed = hb_sxNextSeed( ulSeed, &pKeyVal[ i ], &uiKey );
if( ++i == 7 )
i = 0;
@@ -131,7 +133,6 @@ static HB_BOOL _hb_sxGetKey( PHB_ITEM pKeyItem, char * pKeyVal )
{
HB_BOOL fResult = HB_FALSE;
PHB_ITEM pItem = NULL;
HB_SIZE nKey;
if( ! ( hb_itemType( pKeyItem ) & HB_IT_STRING ) )
{
@@ -146,7 +147,7 @@ static HB_BOOL _hb_sxGetKey( PHB_ITEM pKeyItem, char * pKeyVal )
}
if( hb_itemType( pKeyItem ) & HB_IT_STRING )
{
nKey = hb_itemGetCLen( pKeyItem );
HB_SIZE nKey = hb_itemGetCLen( pKeyItem );
if( nKey )
memcpy( pKeyVal, hb_itemGetCPtr( pKeyItem ), HB_MIN( nKey, 8 ) );
if( nKey < 8 )

View File

@@ -1,22 +1,22 @@
/*
* SIX compatible functions:
* sx_GetLocks()
* sx_IsFLocked()
* sx_IsReadonly()
* sx_IsShared()
* sx_IDType()
* sx_TableType()
* sx_TableName()
* sx_Rollback()
* sx_Rlock()
* sx_Unlock()
* sx_SetPass()
* sx_DbfEncrypt()
* sx_DbfDecrypt()
* sx_MemoPack()
* sx_SetTurbo()
* sx_TurboArea()
* _sxOpenInit() (internal function used by _sx_IniInit())
* sx_GetLocks()
* sx_IsFLocked()
* sx_IsReadonly()
* sx_IsShared()
* sx_IDType()
* sx_TableType()
* sx_TableName()
* sx_Rollback()
* sx_Rlock()
* sx_Unlock()
* sx_SetPass()
* sx_DbfEncrypt()
* sx_DbfDecrypt()
* sx_MemoPack()
* sx_SetTurbo()
* sx_TurboArea()
* _sxOpenInit() (internal function used by _sx_IniInit())
*
* Copyright 2007 Przemyslaw Czerpak <druzus / at / priv.onet.pl>
*
@@ -220,23 +220,23 @@ HB_FUNC( SX_RLOCK )
{
AREAP pArea = ( AREAP ) hb_rddGetCurrentWorkAreaPointer();
HB_BOOL fResult = HB_FALSE;
PHB_ITEM pResult = NULL, pRecords;
PHB_ITEM pResult = NULL;
if( pArea )
{
PHB_ITEM pRecords = hb_param( 1, HB_IT_ARRAY );
DBLOCKINFO dbLockInfo;
dbLockInfo.fResult = HB_FALSE;
dbLockInfo.uiMethod = DBLM_MULTIPLE;
pRecords = hb_param( 1, HB_IT_ARRAY );
if( pRecords )
{
HB_SIZE ul, nLen = hb_arrayLen( pRecords );
HB_SIZE nPos, nLen = hb_arrayLen( pRecords );
pResult = hb_itemArrayNew( nLen );
for( ul = 1; ul <= nLen; ++ul )
for( nPos = 1; nPos <= nLen; ++nPos )
{
dbLockInfo.itmRecID = hb_arrayGetItemPtr( pRecords, ul );
dbLockInfo.itmRecID = hb_arrayGetItemPtr( pRecords, nPos );
SELF_LOCK( pArea, &dbLockInfo );
hb_arraySetL( pResult, ul, dbLockInfo.fResult );
hb_arraySetL( pResult, nPos, dbLockInfo.fResult );
}
}
else
@@ -262,10 +262,10 @@ HB_FUNC( SX_UNLOCK )
PHB_ITEM pRecords = hb_param( 1, HB_IT_ARRAY );
if( pRecords )
{
HB_SIZE ul, nLen = hb_arrayLen( pRecords );
for( ul = 1; ul <= nLen; ++ul )
HB_SIZE nPos, nLen = hb_arrayLen( pRecords );
for( nPos = 1; nPos <= nLen; ++nPos )
{
SELF_UNLOCK( pArea, hb_arrayGetItemPtr( pRecords, ul ) );
SELF_UNLOCK( pArea, hb_arrayGetItemPtr( pRecords, nPos ) );
}
}
else
@@ -301,7 +301,7 @@ HB_FUNC( SX_SETPASS )
( iPCount < 4 || HB_ISNUM( 4 ) ) )
{
/* Set pending password for table which will be open
* 3-rd and 4-th parameters are optional Harbour extensions
* 3rd and 4th parameters are optional Harbour extensions
* with RDD name and connection number.
*/
LPRDDNODE pRDDNode;

View File

@@ -499,7 +499,7 @@ static int hb_hsxStrCmp( const char * pSub, HB_SIZE nSub, const char * pStr, HB_
{
HB_BOOL fResult = HB_FALSE;
HB_UCHAR c1, c2;
HB_SIZE ul;
HB_SIZE nPos;
if( nSub == 0 )
return HSX_SUCCESSFALSE;
@@ -507,10 +507,10 @@ static int hb_hsxStrCmp( const char * pSub, HB_SIZE nSub, const char * pStr, HB_
while( ! fResult && nLen >= nSub )
{
fResult = HB_TRUE;
for( ul = 0; fResult && ul < nSub; ul++ )
for( nPos = 0; fResult && nPos < nSub; nPos++ )
{
c1 = ( HB_UCHAR ) pSub[ ul ];
c2 = ( HB_UCHAR ) pStr[ ul ];
c1 = ( HB_UCHAR ) pSub[ nPos ];
c2 = ( HB_UCHAR ) pStr[ nPos ];
if( fNoCase )
{
if( iFilter == 3 )
@@ -1284,7 +1284,7 @@ static int hb_hsxVerify( int iHandle, const char * szText, HB_SIZE nLen,
iResult = HSX_SUCCESSFALSE;
else
{
HB_SIZE ul, ull;
HB_SIZE nPos1, nPos2;
switch( iType )
{
@@ -1298,31 +1298,31 @@ static int hb_hsxVerify( int iHandle, const char * szText, HB_SIZE nLen,
break;
case HSX_VERIFY_AND:
iResult = HSX_SUCCESS;
for( ul = 0; ul < nSub && iResult == HSX_SUCCESS; ul++ )
for( nPos1 = 0; nPos1 < nSub && iResult == HSX_SUCCESS; nPos1++ )
{
while( szSub[ ul ] == ' ' && ul < nSub )
++ul;
ull = ul;
while( szSub[ ull ] != ' ' && ull < nSub )
++ull;
iResult = hb_hsxStrCmp( &szSub[ ul ], ull - ul, szText, nLen,
while( szSub[ nPos1 ] == ' ' && nPos1 < nSub )
++nPos1;
nPos2 = nPos1;
while( szSub[ nPos2 ] != ' ' && nPos2 < nSub )
++nPos2;
iResult = hb_hsxStrCmp( &szSub[ nPos1 ], nPos2 - nPos1, szText, nLen,
pHSX->fIgnoreCase, pHSX->iFilterType );
ul = ull;
nPos1 = nPos2;
}
break;
#if 0
case HSX_VERIFY_OR:
iResult = HSX_SUCCESSFALSE;
for( ul = 0; ul < nSub && iResult == HSX_SUCCESSFALSE; ul++ )
for( nPos1 = 0; nPos1 < nSub && iResult == HSX_SUCCESSFALSE; nPos1++ )
{
while( szSub[ ul ] == ' ' && ul < nSub )
++ul;
ull = ul;
while( szSub[ ull ] != ' ' && ull < nSub )
++ull;
iResult = hb_hsxStrCmp( &szSub[ ul ], ull - ul, szText, nLen,
while( szSub[ nPos1 ] == ' ' && nPos1 < nSub )
++nPos1;
nPos2 = nPos1;
while( szSub[ nPos2 ] != ' ' && nPos2 < nSub )
++nPos2;
iResult = hb_hsxStrCmp( &szSub[ nPos1 ], nPos2 - nPos1, szText, nLen,
pHSX->fIgnoreCase, pHSX->iFilterType );
ul = ull;
nPos1 = nPos2;
}
break;
#endif
@@ -1836,7 +1836,7 @@ HB_FUNC( HS_FILTER )
{
const char * szText = hb_parc( 2 );
char * pBuff = NULL;
HB_SIZE nLen = hb_parclen( 2 ), ull, ul;
HB_SIZE nLen = hb_parclen( 2 );
HB_ULONG ulRecords = 0;
int iHandle = -1, iResult = HSX_BADPARMS;
HB_BOOL fNew = HB_FALSE, fToken = HB_TRUE;
@@ -1894,17 +1894,19 @@ HB_FUNC( HS_FILTER )
/* to be SIX compatible divide given text on space delimited tokens */
if( fToken )
{
HB_SIZE nPos2, nPos1;
iResult = HSX_SUCCESS;
for( ul = 0; ul < nLen && iResult == HSX_SUCCESS; ul++ )
for( nPos1 = 0; nPos1 < nLen && iResult == HSX_SUCCESS; nPos1++ )
{
while( szText[ ul ] == ' ' && ul < nLen )
++ul;
ull = ul;
while( szText[ ull ] != ' ' && ull < nLen )
++ull;
iResult = hb_hsxFilter( iHandle, &szText[ ul ], ull - ul,
while( szText[ nPos1 ] == ' ' && nPos1 < nLen )
++nPos1;
nPos2 = nPos1;
while( szText[ nPos2 ] != ' ' && nPos2 < nLen )
++nPos2;
iResult = hb_hsxFilter( iHandle, &szText[ nPos1 ], nPos2 - nPos1,
hb_param( 3, HB_IT_ANY ), HSX_VERIFY_PHRASE );
ul = ull;
nPos1 = nPos2;
}
}
else