2010-07-14 12:49 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)

* contrib/hbct/screen2.c
  * contrib/hbct/token2.c
  * contrib/hbct/charsprd.c
  * contrib/hbct/atadjust.c
  * contrib/hbct/ctwin.c
  * contrib/hbct/maxline.c
  * contrib/hbct/dattime3.c
  * contrib/hbct/misc2.c
  * contrib/hbct/ctchksum.c
  * contrib/hbct/screen1.c
  * contrib/hbct/token1.c
  * contrib/hbct/atnum.c
  * contrib/hbct/blank.c
  * contrib/hbct/ctcrypt.c
  * contrib/hbct/disk.c
  * contrib/hbct/ctstrfil.c
  * contrib/hbct/dattime2.c
  * contrib/hbct/expand.c
  * contrib/hbct/numat.c
  * contrib/hbct/atrepl.c
  * contrib/hbct/ctpad.c
  * contrib/hbct/print.c
    * HB_SIZE/HB_ISIZ/HB_FOFFSET variables renamed.
      (verified with msvc64 obj comparison)

  * contrib/hbct/token1.c
    ! Fixed to use HB_SIZE_MAX instead of literal limit.
This commit is contained in:
Viktor Szakats
2010-07-14 10:50:32 +00:00
parent 533b75b205
commit 3238aea36d
23 changed files with 302 additions and 273 deletions

View File

@@ -16,6 +16,35 @@
The license applies to all entries newer than 2009-04-28.
*/
2010-07-14 12:49 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* contrib/hbct/screen2.c
* contrib/hbct/token2.c
* contrib/hbct/charsprd.c
* contrib/hbct/atadjust.c
* contrib/hbct/ctwin.c
* contrib/hbct/maxline.c
* contrib/hbct/dattime3.c
* contrib/hbct/misc2.c
* contrib/hbct/ctchksum.c
* contrib/hbct/screen1.c
* contrib/hbct/token1.c
* contrib/hbct/atnum.c
* contrib/hbct/blank.c
* contrib/hbct/ctcrypt.c
* contrib/hbct/disk.c
* contrib/hbct/ctstrfil.c
* contrib/hbct/dattime2.c
* contrib/hbct/expand.c
* contrib/hbct/numat.c
* contrib/hbct/atrepl.c
* contrib/hbct/ctpad.c
* contrib/hbct/print.c
* HB_SIZE/HB_ISIZ/HB_FOFFSET variables renamed.
(verified with msvc64 obj comparison)
* contrib/hbct/token1.c
! Fixed to use HB_SIZE_MAX instead of literal limit.
2010-07-14 12:25 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* utils/hbmk2/Makefile
* utils/hbmk2/hbmk2.prg

View File

@@ -112,7 +112,7 @@ HB_FUNC( ATADJUST )
int iAtLike = ct_getatlike();
char cAtLike = ct_getatlikechar();
HB_SIZE sIgnore, sMatchStrLen = 0;
HB_SIZE ulCounter;
HB_SIZE nCounter;
const char *pc = NULL;
char cFillChar;
@@ -161,17 +161,17 @@ HB_FUNC( ATADJUST )
sAdjustPosition--; /* makes live easier since C indices start at zero ! */
/* nth match or last match ? */
if( HB_ISNUM( 4 ) && ( ulCounter = hb_parns( 4 ) ) != 0 )
if( HB_ISNUM( 4 ) && ( nCounter = hb_parns( 4 ) ) != 0 )
{
/* find the <ulCounter>th match */
/* find the <nCounter>th match */
const char *pcSubStr;
HB_SIZE sSubStrLen;
HB_SIZE ulMatchCounter = 0;
HB_SIZE nMatchCounter = 0;
pcSubStr = pcString;
sSubStrLen = sStrLen;
while( ulMatchCounter < ulCounter )
while( nMatchCounter < nCounter )
{
switch ( iAtLike )
{
@@ -192,12 +192,12 @@ HB_FUNC( ATADJUST )
if( pc == NULL )
{
/* no match found; if this happens at this point,
there are no <ulCounter> matches, so return */
there are no <nCounter> matches, so return */
hb_retclen( pcString, sStrLen );
return;
}
ulMatchCounter++;
nMatchCounter++;
if( iMultiPass )
pcSubStr = pc + 1;
else
@@ -205,7 +205,7 @@ HB_FUNC( ATADJUST )
sSubStrLen = sStrLen - ( pcSubStr - pcString );
}
}
else /* ( HB_ISNUM( 4 ) && ( (ulCounter = hb_parns( 4 ) ) != 0 ) */
else /* ( HB_ISNUM( 4 ) && ( ( nCounter = hb_parns( 4 ) ) != 0 ) */
{
/* we have to find the last match */
switch ( iAtLike )

View File

@@ -75,7 +75,7 @@ static void do_atnum( int iSwitch )
int iAtLike = ct_getatlike();
char cAtLike = ct_getatlikechar();
HB_SIZE sIgnore, sMatchStrLen = 0;
HB_SIZE ulCounter;
HB_SIZE nCounter;
const char *pc = NULL;
/* eventually ignore some characters */
@@ -137,17 +137,17 @@ static void do_atnum( int iSwitch )
}
/* nth match or last match ? */
if( HB_ISNUM( 3 ) && ( ulCounter = hb_parns( 3 ) ) != 0 )
if( HB_ISNUM( 3 ) && ( nCounter = hb_parns( 3 ) ) != 0 )
{
/* find the <ulCounter>th match */
/* find the <nCounter>th match */
const char *pcSubStr;
HB_SIZE sSubStrLen;
HB_SIZE ulMatchCounter = 0;
HB_SIZE nMatchCounter = 0;
pcSubStr = pcString;
sSubStrLen = sStrLen;
while( ulMatchCounter < ulCounter )
while( nMatchCounter < nCounter )
{
switch ( iAtLike )
{
@@ -168,7 +168,7 @@ static void do_atnum( int iSwitch )
if( pc == NULL )
{
/* no match found; if this happens at this point,
there are no <ulCounter> matches, so return an empty string */
there are no <nCounter> matches, so return an empty string */
switch ( iSwitch )
{
case DO_ATNUM_AFTERATNUM:
@@ -185,7 +185,7 @@ static void do_atnum( int iSwitch )
}
return;
}
ulMatchCounter++;
nMatchCounter++;
if( iMultiPass )
pcSubStr = pc + 1;
@@ -194,7 +194,7 @@ static void do_atnum( int iSwitch )
sSubStrLen = sStrLen - ( pcSubStr - pcString );
}
}
else /* ( HB_ISNUM( 3 ) && ( ulCounter = hb_parns( 3 ) ) != 0 ) */
else /* ( HB_ISNUM( 3 ) && ( nCounter = hb_parns( 3 ) ) != 0 ) */
{
/* we have to find the last match and return the
string after that last match */

View File

@@ -133,7 +133,7 @@ HB_FUNC( ATREPL )
int iAtLike = ct_getatlike();
char cAtLike = ct_getatlikechar();
HB_SIZE nIgnore, nMatchStrLen = 0;
HB_SIZE ulCounter;
HB_SIZE nCounter;
char *pc;
const char *pcReplacement;
@@ -166,13 +166,13 @@ HB_FUNC( ATREPL )
iReplaceMode = hb_parl( 5 );
/* n-th match or last match ? */
ulCounter = hb_parns( 4 );
nCounter = hb_parns( 4 );
/* little trick: */
if( iReplaceMode == 0 && ulCounter == 0 )
ulCounter = HB_SIZE_MAX;
if( iReplaceMode == 0 && nCounter == 0 )
nCounter = HB_SIZE_MAX;
if( ulCounter != 0 )
if( nCounter != 0 )
{
/* depending on iReplaceMode: replace all occurences including the nth one
or only the nth occurence
@@ -180,7 +180,7 @@ HB_FUNC( ATREPL )
all occurences are replaced */
char *pcRetSubStr;
HB_SIZE sRetSubStrLen;
HB_SIZE ulMatchCounter = 0;
HB_SIZE nMatchCounter = 0;
nRetStrLen = nStrLen;
pcRetStr = ( char * ) hb_xgrab( nRetStrLen + 1 );
@@ -189,7 +189,7 @@ HB_FUNC( ATREPL )
pcRetSubStr = pcRetStr + nIgnore;
sRetSubStrLen = nRetStrLen - nIgnore;
while( ulMatchCounter < ulCounter )
while( nMatchCounter < nCounter )
{
switch ( iAtLike )
{
@@ -213,10 +213,10 @@ HB_FUNC( ATREPL )
return;
}
ulMatchCounter++;
nMatchCounter++;
/* replace match ? */
if( ( iReplaceMode == 0 ) || ( ulMatchCounter == ulCounter ) )
if( ( iReplaceMode == 0 ) || ( nMatchCounter == nCounter ) )
{
if( nMatchStrLen < nReplaceLen )
{
@@ -252,7 +252,7 @@ HB_FUNC( ATREPL )
sRetSubStrLen = nRetStrLen - ( pcRetSubStr - pcRetStr );
}
}
else /* ( ulCounter != 0 ) */
else /* ( nCounter != 0 ) */
{
/* find and replace last match */
nRetStrLen = nStrLen;

View File

@@ -86,14 +86,14 @@ HB_FUNC( BLANK )
if( pMode && hb_itemGetL( pMode ) )
{
HB_SIZE lLen = hb_itemGetCLen( pItem );
char * szResult = ( char * ) hb_xgrab( lLen + 1 );
HB_SIZE nLen = hb_itemGetCLen( pItem );
char * szResult = ( char * ) hb_xgrab( nLen + 1 );
hb_xmemset( szResult, ' ', lLen );
hb_xmemset( szResult, ' ', nLen );
if( bRef )
hb_storclen( szResult, lLen, 1 );
hb_storclen( szResult, nLen, 1 );
if( bRet )
hb_retclen_buffer( szResult, lLen );
hb_retclen_buffer( szResult, nLen );
else
hb_xfree( szResult );
}

View File

@@ -56,70 +56,70 @@
HB_FUNC( CHARSPREAD )
{
HB_SIZE ulLen = hb_parclen( 1 );
HB_SIZE nLen = hb_parclen( 1 );
if( ulLen == 0 )
if( nLen == 0 )
hb_retc_null();
else
{
HB_ISIZ lSize = hb_parns( 2 );
HB_ISIZ nSize = hb_parns( 2 );
if( lSize < 0 || ( HB_SIZE ) lSize <= ulLen )
if( nSize < 0 || ( HB_SIZE ) nSize <= nLen )
hb_itemReturn( hb_param( 1, HB_IT_ANY ) );
else
{
const char * szText = hb_parc( 1 );
char * szDest, cDelim = ' ';
HB_ISIZ iTokens = 0, iRepl, iRest, iFirst, i;
HB_SIZE ul, ulDst, ulRest;
HB_ISIZ nTokens = 0, iRepl, iRest, iFirst, i;
HB_SIZE ul, nDst, nRest;
if( HB_ISCHAR( 3 ) )
cDelim = hb_parc( 3 )[0];
cDelim = hb_parc( 3 )[ 0 ];
else if( HB_ISNUM( 3 ) )
cDelim = ( char ) hb_parni( 3 );
for( ul = 0; ul < ulLen; ++ul )
for( ul = 0; ul < nLen; ++ul )
{
if( szText[ul] == cDelim )
if( szText[ ul ] == cDelim )
{
iTokens++;
while( ul + 1 < ulLen && szText[ul + 1] == cDelim )
nTokens++;
while( ul + 1 < nLen && szText[ ul + 1 ] == cDelim )
++ul;
}
}
if( iTokens == 0 )
if( nTokens == 0 )
{
hb_itemReturn( hb_param( 1, HB_IT_ANY ) );
}
else
{
ulRest = ( HB_SIZE ) lSize - ulLen;
iRepl = ulRest / iTokens;
iRest = ulRest % iTokens;
nRest = ( HB_SIZE ) nSize - nLen;
iRepl = nRest / nTokens;
iRest = nRest % nTokens;
iFirst = ( iRest + 1 ) >> 1;
iRest >>= 1;
szDest = ( char * ) hb_xgrab( lSize + 1 );
for( ulDst = ul = 0; ul < ulLen; ++ul )
szDest = ( char * ) hb_xgrab( nSize + 1 );
for( nDst = ul = 0; ul < nLen; ++ul )
{
szDest[ulDst++] = szText[ul];
if( szText[ul] == cDelim )
szDest[ nDst++ ] = szText[ul];
if( szText[ ul ] == cDelim )
{
while( ul + 1 < ulLen && szText[ul + 1] == cDelim )
szDest[ulDst++] = szText[++ul];
while( ul + 1 < nLen && szText[ ul + 1 ] == cDelim )
szDest[ nDst++ ] = szText[ ++ul ];
i = iRepl;
if( iFirst )
{
--iFirst;
++i;
}
else if( iTokens <= iRest )
else if( nTokens <= iRest )
++i;
while( --i >= 0 )
szDest[ulDst++] = cDelim;
iTokens--;
szDest[ nDst++ ] = cDelim;
nTokens--;
}
}
hb_retclen_buffer( szDest, lSize );
hb_retclen_buffer( szDest, nSize );
}
}
}

View File

@@ -55,12 +55,12 @@
HB_FUNC( CHECKSUM )
{
const HB_UCHAR * pbyString = ( const HB_UCHAR * ) hb_parc( 1 );
HB_SIZE ulLen = hb_parclen( 1 );
HB_SIZE ulPos;
HB_U32 ulResult = 0;
HB_SIZE nLen = hb_parclen( 1 );
HB_SIZE nPos;
HB_U32 u32Result = 0;
for( ulPos = 0; ulPos < ulLen; ulPos++ )
ulResult += pbyString[ ulPos ] | ( pbyString[ ulPos + 1 ] << 8 );
for( nPos = 0; nPos < nLen; nPos++ )
u32Result += pbyString[ nPos ] | ( pbyString[ nPos + 1 ] << 8 );
hb_retnint( ( HB_U32 ) ( ( ulResult & 0x00FFFFFF ) | ( ( ulLen & 0xFF ) << 24 ) ) );
hb_retnint( ( HB_U32 ) ( ( u32Result & 0x00FFFFFF ) | ( ( nLen & 0xFF ) << 24 ) ) );
}

View File

@@ -54,29 +54,29 @@
HB_FUNC( CRYPT )
{
HB_SIZE ulCryptLen = hb_parclen( 2 );
HB_SIZE nCryptLen = hb_parclen( 2 );
if( ulCryptLen >= 2 )
if( nCryptLen >= 2 )
{
const HB_BYTE * pbyCrypt = ( const HB_BYTE * ) hb_parc( 2 );
HB_SIZE ulCryptPos = 0;
HB_SIZE nCryptPos = 0;
const HB_BYTE * pbyString = ( const HB_BYTE * ) hb_parc( 1 );
HB_SIZE ulStringLen = hb_parclen( 1 );
HB_SIZE ulStringPos;
HB_SIZE nStringLen = hb_parclen( 1 );
HB_SIZE nStringPos;
HB_BYTE * pbyResult = ( HB_BYTE * ) hb_xgrab( ulStringLen + 1 );
HB_BYTE * pbyResult = ( HB_BYTE * ) hb_xgrab( nStringLen + 1 );
HB_USHORT uiCount2 =
( ( ( HB_USHORT ) ( pbyCrypt[ ulCryptPos ] + ( HB_USHORT ) ( pbyCrypt[ ulCryptPos + 1 ] * 256 ) ) ) &
0xFFFF ) ^ ( ( HB_USHORT ) ulCryptLen & 0xFFFF );
( ( ( HB_USHORT ) ( pbyCrypt[ nCryptPos ] + ( HB_USHORT ) ( pbyCrypt[ nCryptPos + 1 ] * 256 ) ) ) &
0xFFFF ) ^ ( ( HB_USHORT ) nCryptLen & 0xFFFF );
HB_USHORT uiCount1 = 0xAAAA;
for( ulStringPos = 0; ulStringPos < ulStringLen; )
for( nStringPos = 0; nStringPos < nStringLen; )
{
HB_USHORT uiTmpCount1 = uiCount1;
HB_USHORT uiTmpCount2 = uiCount2;
HB_BYTE byte = pbyString[ ulStringPos ] ^ pbyCrypt[ ulCryptPos++ ];
HB_BYTE byte = pbyString[ nStringPos ] ^ pbyCrypt[ nCryptPos++ ];
HB_USHORT tmp;
uiTmpCount2 =
@@ -119,13 +119,13 @@ HB_FUNC( CRYPT )
uiCount1 = uiTmpCount1;
pbyResult[ ulStringPos++ ] = byte ^ HB_LOBYTE( uiTmpCount1 );
pbyResult[ nStringPos++ ] = byte ^ HB_LOBYTE( uiTmpCount1 );
if( ulCryptPos == ulCryptLen )
ulCryptPos = 0;
if( nCryptPos == nCryptLen )
nCryptPos = 0;
}
hb_retclen_buffer( ( char * ) pbyResult, ulStringLen );
hb_retclen_buffer( ( char * ) pbyResult, nStringLen );
}
else
hb_retc_null();

View File

@@ -66,12 +66,12 @@ static void do_pad( int iSwitch )
const char *pcString = hb_parc( 1 );
HB_SIZE sStrLen = hb_parclen( 1 );
char *pcRet, *pc;
HB_ISIZ lRetLen;
HB_ISIZ nRetLen;
HB_SIZE sRetLen;
char cFill;
lRetLen = hb_parns( 2 );
if( lRetLen <= 0 )
nRetLen = hb_parns( 2 );
if( nRetLen <= 0 )
{
int iArgErrorMode = ct_getargerrormode();
@@ -86,7 +86,7 @@ static void do_pad( int iSwitch )
hb_retc_null();
return;
}
sRetLen = ( HB_SIZE ) lRetLen;
sRetLen = ( HB_SIZE ) nRetLen;
if( hb_parclen( 3 ) > 0 )
cFill = *( hb_parc( 3 ) );

View File

@@ -101,13 +101,13 @@ HB_FUNC( CSETSAFETY )
ct_setsafety( hb_parl( 1 ) );
}
static HB_SIZE ct_StrFile( const char * pFileName, const char * pcStr, HB_SIZE ulLen, HB_BOOL bOverwrite, HB_FOFFSET lOffset,
static HB_SIZE ct_StrFile( const char * pFileName, const char * pcStr, HB_SIZE nLen, HB_BOOL bOverwrite, HB_FOFFSET nOffset,
HB_BOOL bTrunc )
{
HB_FHANDLE hFile;
HB_BOOL bOpen = HB_FALSE;
HB_BOOL bFile = hb_fsFile( pFileName );
HB_SIZE ulWrite = 0;
HB_SIZE nWrite = 0;
if( bFile && bOverwrite )
{
@@ -121,18 +121,18 @@ static HB_SIZE ct_StrFile( const char * pFileName, const char * pcStr, HB_SIZE u
if( hFile != FS_ERROR )
{
if( lOffset )
hb_fsSeekLarge( hFile, lOffset, FS_SET );
if( nOffset )
hb_fsSeekLarge( hFile, nOffset, FS_SET );
else if( bOpen )
hb_fsSeek( hFile, 0, FS_END );
ulWrite = hb_fsWriteLarge( hFile, pcStr, ulLen );
if( ( ulWrite == ulLen ) && bOpen && bTrunc )
nWrite = hb_fsWriteLarge( hFile, pcStr, nLen );
if( ( nWrite == nLen ) && bOpen && bTrunc )
hb_fsWrite( hFile, NULL, 0 );
hb_fsClose( hFile );
}
return ulWrite;
return nWrite;
}
HB_FUNC( STRFILE )
@@ -155,34 +155,34 @@ HB_FUNC( FILESTR )
if( hFile != FS_ERROR )
{
HB_FOFFSET lFileSize = hb_fsSeekLarge( hFile, 0, FS_END );
HB_FOFFSET lPos = hb_fsSeekLarge( hFile, ( HB_FOFFSET ) hb_parnint( 3 ), FS_SET );
HB_ISIZ lLength;
HB_FOFFSET nFileSize = hb_fsSeekLarge( hFile, 0, FS_END );
HB_FOFFSET nPos = hb_fsSeekLarge( hFile, ( HB_FOFFSET ) hb_parnint( 3 ), FS_SET );
HB_ISIZ nLength;
char * pcResult, * pCtrlZ;
HB_BOOL bCtrlZ = hb_parl( 4 );
if( HB_ISNUM( 2 ) )
{
lLength = hb_parns( 2 );
if( lLength > ( HB_ISIZ ) ( lFileSize - lPos ) )
lLength = ( HB_ISIZ ) ( lFileSize - lPos );
nLength = hb_parns( 2 );
if( nLength > ( HB_ISIZ ) ( nFileSize - nPos ) )
nLength = ( HB_ISIZ ) ( nFileSize - nPos );
}
else
lLength = ( HB_ISIZ ) ( lFileSize - lPos );
nLength = ( HB_ISIZ ) ( nFileSize - nPos );
pcResult = ( char * ) hb_xgrab( lLength + 1 );
if( lLength > 0 )
lLength = hb_fsReadLarge( hFile, pcResult, ( HB_SIZE ) lLength );
pcResult = ( char * ) hb_xgrab( nLength + 1 );
if( nLength > 0 )
nLength = hb_fsReadLarge( hFile, pcResult, ( HB_SIZE ) nLength );
if( bCtrlZ )
{
pCtrlZ = ( char * ) memchr( pcResult, 26, lLength );
pCtrlZ = ( char * ) memchr( pcResult, 26, nLength );
if( pCtrlZ )
lLength = pCtrlZ - pcResult;
nLength = pCtrlZ - pcResult;
}
hb_fsClose( hFile );
hb_retclen_buffer( pcResult, lLength );
hb_retclen_buffer( pcResult, nLength );
}
else
hb_retc_null();
@@ -196,15 +196,15 @@ HB_FUNC( SCREENFILE )
if( HB_ISCHAR( 1 ) )
{
char * pBuffer;
HB_SIZE ulSize;
HB_SIZE nSize;
hb_gtRectSize( 0, 0, hb_gtMaxRow(), hb_gtMaxCol(), &ulSize );
pBuffer = ( char * ) hb_xgrab( ulSize );
hb_gtRectSize( 0, 0, hb_gtMaxRow(), hb_gtMaxCol(), &nSize );
pBuffer = ( char * ) hb_xgrab( nSize );
hb_gtSave( 0, 0, hb_gtMaxRow(), hb_gtMaxCol(), pBuffer );
hb_retns( ct_StrFile( hb_parc( 1 ), pBuffer,
ulSize, hb_parl( 2 ),
nSize, hb_parl( 2 ),
( HB_FOFFSET ) hb_parnint( 3 ), hb_parl( 4 ) ) );
hb_xfree( pBuffer );
}
@@ -221,22 +221,22 @@ HB_FUNC( FILESCREEN )
if( hFile != FS_ERROR )
{
char * pBuffer;
HB_SIZE ulSize;
HB_SIZE lLength;
HB_SIZE nSize;
HB_SIZE nLength;
if( HB_ISNUM( 2 ) )
hb_fsSeekLarge( hFile, ( HB_FOFFSET ) hb_parnint( 2 ), FS_SET );
hb_gtRectSize( 0, 0, hb_gtMaxRow(), hb_gtMaxCol(), &ulSize );
pBuffer = ( char * ) hb_xgrab( ulSize );
hb_gtRectSize( 0, 0, hb_gtMaxRow(), hb_gtMaxCol(), &nSize );
pBuffer = ( char * ) hb_xgrab( nSize );
lLength = hb_fsReadLarge( hFile, pBuffer, ulSize );
nLength = hb_fsReadLarge( hFile, pBuffer, nSize );
hb_gtRest( 0, 0, hb_gtMaxRow(), hb_gtMaxCol(), pBuffer );
hb_xfree( pBuffer );
hb_fsClose( hFile );
hb_retns( lLength );
hb_retns( nLength );
}
else
hb_retns( 0 );

View File

@@ -177,7 +177,7 @@ static int hb_ctw_CalcShadowWidth( int iRows, int iCols )
static void hb_ctw_SetMap( PHB_GTCTW pCTW, int * piMap, int iWindow, int iTop, int iLeft, int iBottom, int iRight, int iNested )
{
HB_SIZE lIndex;
HB_SIZE nIndex;
int i;
HB_TRACE(HB_TR_DEBUG, ("hb_ctw_SetMap(%p,%p,%d,%d,%d,%d,%d,%d)", pCTW, piMap, iWindow, iTop, iLeft, iBottom, iRight, iNested));
@@ -195,9 +195,9 @@ static void hb_ctw_SetMap( PHB_GTCTW pCTW, int * piMap, int iWindow, int iTop, i
{
while( iTop <= iBottom )
{
lIndex = iTop * pCTW->iMapWidth + iLeft;
for( i = iLeft; i <= iRight; ++i, ++lIndex )
piMap[ lIndex ] = iWindow;
nIndex = iTop * pCTW->iMapWidth + iLeft;
for( i = iLeft; i <= iRight; ++i, ++nIndex )
piMap[ nIndex ] = iWindow;
++iTop;
}
}
@@ -205,9 +205,9 @@ static void hb_ctw_SetMap( PHB_GTCTW pCTW, int * piMap, int iWindow, int iTop, i
{
while( iTop <= iBottom )
{
lIndex = iTop * pCTW->iMapWidth + iLeft;
for( i = iLeft; i <= iRight; ++i, ++lIndex )
piMap[ lIndex ] = iWindow | ( piMap[ lIndex ] != 0 ? iNested : 0 );
nIndex = iTop * pCTW->iMapWidth + iLeft;
for( i = iLeft; i <= iRight; ++i, ++nIndex )
piMap[ nIndex ] = iWindow | ( piMap[ nIndex ] != 0 ? iNested : 0 );
++iTop;
}
}
@@ -215,13 +215,13 @@ static void hb_ctw_SetMap( PHB_GTCTW pCTW, int * piMap, int iWindow, int iTop, i
static void hb_ctw_ClearMap( PHB_GTCTW pCTW )
{
HB_SIZE ulSize;
HB_SIZE nSize;
HB_TRACE(HB_TR_DEBUG, ("hb_ctw_ClearMap(%p)", pCTW));
ulSize = ( HB_SIZE ) pCTW->iMapHeight * pCTW->iMapWidth * sizeof( int );
memset( pCTW->pWindowMap, 0, ulSize );
memset( pCTW->pShadowMap, 0, ulSize );
nSize = ( HB_SIZE ) pCTW->iMapHeight * pCTW->iMapWidth * sizeof( int );
memset( pCTW->pWindowMap, 0, nSize );
memset( pCTW->pShadowMap, 0, nSize );
}
static void hb_ctw_TouchLines( PHB_GTCTW pCTW, int iFrom, int iTo )
@@ -594,15 +594,15 @@ static int hb_ctw_CreateWindow( PHB_GTCTW pCTW, int iTop, int iLeft, int iBottom
if( pCTW->iMaxWindow == 0 )
{
HB_SIZE ulSize;
HB_SIZE nSize;
HB_GTSELF_GETSIZE( pCTW->pGT, &pCTW->iMapHeight, &pCTW->iMapWidth );
pCTW->iShadowWidth = hb_ctw_CalcShadowWidth( pCTW->iMapHeight, pCTW->iMapWidth );
if( !pCTW->fBoardSet )
hb_ctw_SetWindowBoard( pCTW, 0, 0, pCTW->iMapHeight - 1, pCTW->iMapWidth - 1 );
ulSize = ( HB_SIZE ) pCTW->iMapHeight * pCTW->iMapWidth * sizeof( int );
pCTW->pWindowMap = ( int * ) hb_xgrab( ulSize );
pCTW->pShadowMap = ( int * ) hb_xgrab( ulSize );
nSize = ( HB_SIZE ) pCTW->iMapHeight * pCTW->iMapWidth * sizeof( int );
pCTW->pWindowMap = ( int * ) hb_xgrab( nSize );
pCTW->pShadowMap = ( int * ) hb_xgrab( nSize );
hb_ctw_ClearMap( pCTW );
pCTW->iMaxWindow = HB_CTWIN_ALLOC;
@@ -1318,7 +1318,7 @@ static int hb_ctw_gt_MaxRow( PHB_GT pGT )
*/
#define WRITECON_BUFFER_SIZE 512
static void hb_ctw_gt_WriteCon( PHB_GT pGT, const char * pText, HB_SIZE ulLength )
static void hb_ctw_gt_WriteCon( PHB_GT pGT, const char * pText, HB_SIZE nLength )
{
int iLen = 0;
HB_BOOL bDisp = HB_FALSE;
@@ -1326,7 +1326,7 @@ static void hb_ctw_gt_WriteCon( PHB_GT pGT, const char * pText, HB_SIZE ulLength
int iRow, iCol, iMaxRow, iMaxCol;
char szString[ WRITECON_BUFFER_SIZE ];
HB_TRACE(HB_TR_DEBUG, ("hb_ctw_gt_WriteCon(%p,%p,%" HB_PFS "u)", pGT, pText, ulLength));
HB_TRACE(HB_TR_DEBUG, ("hb_ctw_gt_WriteCon(%p,%p,%" HB_PFS "u)", pGT, pText, nLength));
iMaxRow = HB_GTSELF_MAXROW( pGT );
iMaxCol = HB_GTSELF_MAXCOL( pGT );
@@ -1350,7 +1350,7 @@ static void hb_ctw_gt_WriteCon( PHB_GT pGT, const char * pText, HB_SIZE ulLength
HB_GTSELF_SETPOS( pGT, iRow, iCol );
}
while( ulLength-- )
while( nLength-- )
{
char ch = *pText++;
@@ -1396,7 +1396,7 @@ static void hb_ctw_gt_WriteCon( PHB_GT pGT, const char * pText, HB_SIZE ulLength
{
++iRow;
++pText;
--ulLength;
--nLength;
}
bDisp = HB_TRUE;
break;
@@ -1413,7 +1413,7 @@ static void hb_ctw_gt_WriteCon( PHB_GT pGT, const char * pText, HB_SIZE ulLength
bDisp = HB_TRUE;
}
if( bDisp || ulLength == 0 )
if( bDisp || nLength == 0 )
{
if( iLen )
HB_GTSELF_WRITE( pGT, szString, iLen );
@@ -1814,14 +1814,14 @@ static HB_BOOL hb_ctw_gt_Resize( PHB_GT pGT, int iRows, int iCols )
if( pCTW->iMaxWindow > 0 )
{
HB_SIZE ulSize;
HB_SIZE nSize;
pCTW->iMapHeight = iRows;
pCTW->iMapWidth = iCols;
pCTW->iShadowWidth = hb_ctw_CalcShadowWidth( pCTW->iMapHeight, pCTW->iMapWidth );
ulSize = ( HB_SIZE ) pCTW->iMapHeight * pCTW->iMapWidth * sizeof( int );
pCTW->pWindowMap = ( int * ) hb_xrealloc( pCTW->pWindowMap, ulSize );
pCTW->pShadowMap = ( int * ) hb_xrealloc( pCTW->pShadowMap, ulSize );
nSize = ( HB_SIZE ) pCTW->iMapHeight * pCTW->iMapWidth * sizeof( int );
pCTW->pWindowMap = ( int * ) hb_xrealloc( pCTW->pWindowMap, nSize );
pCTW->pShadowMap = ( int * ) hb_xrealloc( pCTW->pShadowMap, nSize );
}
if( pCTW->fBoardSet )
hb_ctw_SetWindowBoard( pCTW, 0, 0, iRows - 1, iCols - 1 );

View File

@@ -135,17 +135,17 @@ static int ct_doy( long lDate )
*/
HB_FUNC( CTODOW )
{
HB_SIZE ulLen = hb_parclen( 1 );
HB_SIZE nLen = hb_parclen( 1 );
int iDow = 0;
if( ulLen )
if( nLen )
{
const char *szParam = hb_parc( 1 );
for( iDow = 7; iDow > 0; iDow-- )
{
const char * szDow = hb_langDGetItem( HB_LANG_ITEM_BASE_DAY + iDow - 1 );
if( hb_strnicmp( szDow, szParam, ulLen ) == 0 )
if( hb_strnicmp( szDow, szParam, nLen ) == 0 )
break;
}
}
@@ -183,16 +183,16 @@ HB_FUNC( CTODOW )
*/
HB_FUNC( CTOMONTH )
{
HB_SIZE ulLen = hb_parclen( 1 );
HB_SIZE nLen = hb_parclen( 1 );
int iMonth = 0;
if( ulLen )
if( nLen )
{
const char *szParam = hb_parc( 1 );
for( iMonth = 12; iMonth > 0; iMonth-- )
{
const char * szMonth = hb_langDGetItem( HB_LANG_ITEM_BASE_MONTH + iMonth - 1 );
if( hb_strnicmp( szMonth, szParam, ulLen ) == 0 )
if( hb_strnicmp( szMonth, szParam, nLen ) == 0 )
break;
}
}

View File

@@ -137,23 +137,23 @@ HB_FUNC( WAITPERIOD )
hb_retl( d < s_dTimeCounter );
}
static HB_BOOL _hb_timeValid( const char * szTime, HB_SIZE ulLen, int * piDecode )
static HB_BOOL _hb_timeValid( const char * szTime, HB_SIZE nLen, int * piDecode )
{
HB_BOOL fValid = HB_FALSE;
if( ulLen == 2 || ulLen == 5 || ulLen == 8 || ulLen == 11 )
if( nLen == 2 || nLen == 5 || nLen == 8 || nLen == 11 )
{
static const int s_iMax[] = { 23, 59, 59, 99 };
int i, iVal;
HB_SIZE ul;
fValid = HB_TRUE;
for( ul = 0; fValid && ul < ulLen; ++ul )
for( ul = 0; fValid && ul < nLen; ++ul )
{
fValid = ul % 3 == 2 ? szTime[ul] == ':' :
( szTime[ul] >= '0' && szTime[ul] <= '9' );
}
for( ul = 0, i = 0; fValid && ul < ulLen; ul += 3, ++i )
for( ul = 0, i = 0; fValid && ul < nLen; ul += 3, ++i )
{
iVal = 10 * ( szTime[ul] - '0' ) + ( szTime[ul + 1] - '0' );
fValid = iVal <= s_iMax[i];

View File

@@ -113,18 +113,18 @@ HB_FUNC( DIRNAME )
HB_FUNC( DRIVETYPE )
{
#if defined( HB_OS_WIN ) && ! defined( HB_OS_WIN_CE )
HB_SIZE ulSize = hb_parclen( 1 ) + 2; /* allow space for '\0' & ":\" */
char * pszDrive = ( char * ) hb_xgrab( ulSize + 1 );
HB_SIZE nSize = hb_parclen( 1 ) + 2; /* allow space for '\0' & ":\" */
char * pszDrive = ( char * ) hb_xgrab( nSize + 1 );
LPTSTR lpDrive;
int iType;
hb_strncpy( pszDrive, hb_parcx( 1 ), ulSize );
hb_strncpy( pszDrive, hb_parcx( 1 ), nSize );
if( strstr( pszDrive, ":" ) == NULL )
hb_strncat( pszDrive, ":", ulSize );
hb_strncat( pszDrive, ":", nSize );
if( strstr( pszDrive, "\\" ) == NULL )
hb_strncat( pszDrive, "\\", ulSize );
hb_strncat( pszDrive, "\\", nSize );
lpDrive = HB_TCHAR_CONVTO( pszDrive );
switch( GetDriveType( lpDrive ) )

View File

@@ -55,12 +55,12 @@
HB_FUNC( EXPAND )
{
HB_SIZE ulLen = hb_parclen( 1 ), ulSize, ul;
HB_SIZE nLen = hb_parclen( 1 ), ulSize, ul;
if( ulLen > 0 )
if( nLen > 0 )
{
const char * szText = hb_parc( 1 );
if( ulLen == 1 )
if( nLen == 1 )
hb_retclen( szText, 1 );
else
{
@@ -90,10 +90,10 @@ HB_FUNC( EXPAND )
else
cRepl = ' ';
}
ulSize = ( ulLen - 1 ) * ( iRepl + 1 ) + 1;
ulSize = ( nLen - 1 ) * ( iRepl + 1 ) + 1;
szPtr = szDest = ( char * ) hb_xgrab( ulSize + 1 );
*szPtr++ = szText[0];
for( ul = 1; ul < ulLen; ++ul )
for( ul = 1; ul < nLen; ++ul )
{
for( i = 0; i < iRepl; ++i )
*szPtr++ = cRepl;

View File

@@ -55,29 +55,29 @@
HB_FUNC( MAXLINE )
{
HB_ISIZ lLength = 0;
HB_ISIZ nLength = 0;
if( HB_ISCHAR( 1 ) )
{
const char *pcString = hb_parc( 1 );
const char *pBuffer;
HB_ISIZ lStrLen = hb_parclen( 1 );
const char * pcString = hb_parc( 1 );
const char * pBuffer;
HB_ISIZ nStrLen = hb_parclen( 1 );
while( lStrLen > 0 )
while( nStrLen > 0 )
{
pBuffer = ( char * ) memchr( pcString, 13, lStrLen );
pBuffer = ( char * ) memchr( pcString, 13, nStrLen );
if( ! pBuffer )
pBuffer = pcString + lStrLen;
pBuffer = pcString + nStrLen;
if( pBuffer - pcString > lLength )
lLength = pBuffer - pcString;
if( pBuffer - pcString > nLength )
nLength = pBuffer - pcString;
pBuffer++;
if( *pBuffer == 10 )
pBuffer++;
lStrLen -= pBuffer - pcString;
nStrLen -= pBuffer - pcString;
pcString = pBuffer;
}
}
hb_retns( lLength );
hb_retns( nLength );
}

View File

@@ -61,16 +61,16 @@ HB_FUNC( COMPLEMENT )
{
if( HB_IS_STRING( pItem ) )
{
HB_SIZE ulLen = hb_itemGetCLen( pItem ), ulPos;
HB_SIZE nLen = hb_itemGetCLen( pItem ), ulPos;
if( ulLen > 0 )
if( nLen > 0 )
{
const char *szSrc = hb_itemGetCPtr( pItem );
char *szBuffer = ( char * ) hb_xgrab( ulLen + 1 );
char *szBuffer = ( char * ) hb_xgrab( nLen + 1 );
for( ulPos = 0; ulPos < ulLen; ulPos++ )
for( ulPos = 0; ulPos < nLen; ulPos++ )
szBuffer[ulPos] = ~szSrc[ulPos];
hb_retclen_buffer( szBuffer, ulLen );
hb_retclen_buffer( szBuffer, nLen );
}
else
hb_retc_null();

View File

@@ -95,7 +95,7 @@ HB_FUNC( NUMAT )
int iAtLike = ct_getatlike();
char cAtLike = ct_getatlikechar();
HB_SIZE sIgnore, sMatchStrLen = 0, sSubStrLen;
HB_SIZE ulCounter;
HB_SIZE nCounter;
const char *pc, *pcSubStr;
/* eventually ignore some characters */
@@ -122,7 +122,7 @@ HB_FUNC( NUMAT )
sStrLen -= sIgnore;
}
ulCounter = 0;
nCounter = 0;
pcSubStr = pcString;
sSubStrLen = sStrLen;
@@ -144,7 +144,7 @@ HB_FUNC( NUMAT )
default:
pc = NULL;
}
ulCounter++;
nCounter++;
if( iMultiPass )
pcSubStr = pc + 1;
else
@@ -153,7 +153,7 @@ HB_FUNC( NUMAT )
}
while( pc != NULL );
hb_retns( ulCounter - 1 );
hb_retns( nCounter - 1 );
}
else /* ( HB_ISCHAR( 1 ) && HB_ISCHAR( 2 ) ) */
{

View File

@@ -188,33 +188,33 @@ HB_FUNC( PRINTSEND )
char szChr[ 2 ] = { ' ', '\0' };
char szPort[ 5 ] = { 'l', 'p', 't', '1', '\0' };
const char * szStr = NULL;
HB_SIZE usLen = 0, usRet = 0;
HB_SIZE nLen = 0, nRet = 0;
if( HB_ISNUM( 1 ) )
{
szChr[ 0 ] = ( char ) hb_parni( 1 );
szStr = szChr;
usLen = 1;
nLen = 1;
}
else if( HB_ISCHAR( 1 ) )
{
szStr = hb_parc( 1 );
usLen = hb_parclen( 1 );
nLen = hb_parclen( 1 );
}
if( HB_ISNUM( 2 ) )
szPort[ 3 ] = ( char ) hb_parni( 2 ) + '0';
if( usLen )
if( nLen )
{
HB_FHANDLE hFile = hb_fsOpen( szPort, FO_WRITE );
if( hFile != FS_ERROR )
{
usRet = hb_fsWriteLarge( hFile, szStr, usLen );
nRet = hb_fsWriteLarge( hFile, szStr, nLen );
hb_fsClose( hFile );
}
}
hb_retns( usRet );
hb_retns( nRet );
#else

View File

@@ -146,19 +146,19 @@ HB_FUNC( SCREENATTR )
HB_FUNC( SCREENMIX )
{
HB_SIZE ulLen = hb_parclen( 1 );
HB_SIZE nLen = hb_parclen( 1 );
if( ulLen )
if( nLen )
{
const char * szText = hb_parc( 1 );
const char * szAttr;
HB_SIZE ulAttr = hb_parclen( 2 ), ul = 0;
HB_SIZE nAttr = hb_parclen( 2 ), ul = 0;
int iRow, iCol, i;
if( ulAttr == 0 )
if( nAttr == 0 )
{
szAttr = " ";
ulAttr = 1;
nAttr = 1;
}
else
szAttr = hb_parc( 2 );
@@ -181,13 +181,13 @@ HB_FUNC( SCREENMIX )
if( ++iRow > hb_gtMaxRow() )
break;
--szText;
++ulLen;
++nLen;
i = iCol;
}
else if( ++ul == ulAttr )
else if( ++ul == nAttr )
ul = 0;
}
while( --ulLen );
while( --nLen );
hb_gtEndWrite();
}
}
@@ -229,9 +229,9 @@ HB_FUNC( SCREENMIX )
HB_FUNC( SAYSCREEN )
{
HB_SIZE ulLen = hb_parclen( 1 );
HB_SIZE nLen = hb_parclen( 1 );
if( ulLen )
if( nLen )
{
const char * szText = hb_parc( 1 );
int iRow, iCol, i;
@@ -256,13 +256,13 @@ HB_FUNC( SAYSCREEN )
{
if( ++iRow > hb_gtMaxRow() )
break;
++ulLen;
++nLen;
i = iCol;
}
else
hb_gtPutChar( iRow, i++, iColor, bAttr, ( HB_UCHAR ) *szText++ );
}
while( --ulLen );
while( --nLen );
hb_gtEndWrite();
}
}
@@ -702,12 +702,12 @@ HB_FUNC( SCREENTEXT )
{
int iTop, iLeft, iBottom, iRight;
char * pBuffer, * szText;
HB_SIZE ulSize;
HB_SIZE nSize;
if( hb_ctGetWinCord( &iTop, &iLeft, &iBottom, &iRight ) )
{
ulSize = ( HB_SIZE ) ( iBottom - iTop + 1 ) * ( iRight - iLeft + 1 );
szText = pBuffer = ( char * ) hb_xgrab( ulSize + 1 );
nSize = ( HB_SIZE ) ( iBottom - iTop + 1 ) * ( iRight - iLeft + 1 );
szText = pBuffer = ( char * ) hb_xgrab( nSize + 1 );
while( iTop <= iBottom )
{
int iCol = iLeft;
@@ -722,7 +722,7 @@ HB_FUNC( SCREENTEXT )
}
++iTop;
}
hb_retclen_buffer( pBuffer, ulSize );
hb_retclen_buffer( pBuffer, nSize );
}
else
hb_retc_null();

View File

@@ -58,9 +58,9 @@
HB_FUNC( SAYDOWN )
{
HB_SIZE ulLen = hb_parclen( 1 );
HB_SIZE nLen = hb_parclen( 1 );
if( ulLen )
if( nLen )
{
const char * szText = hb_parc( 1 );
int iRow, iCol, iMaxRow, iMaxCol;
@@ -80,11 +80,11 @@ HB_FUNC( SAYDOWN )
{
int iColor = hb_gtGetCurrColor();
if( ulLen > ( HB_SIZE ) ( iMaxRow - iRow + 1 ) )
ulLen = ( HB_SIZE ) ( iMaxRow - iRow + 1 );
if( nLen > ( HB_SIZE ) ( iMaxRow - iRow + 1 ) )
nLen = ( HB_SIZE ) ( iMaxRow - iRow + 1 );
hb_gtBeginWrite();
while( ulLen-- )
while( nLen-- )
{
hb_gtPutChar( iRow++, iCol, iColor, 0, ( HB_UCHAR ) *szText++ );
if( lDelay )
@@ -103,12 +103,12 @@ HB_FUNC( SAYDOWN )
HB_FUNC( SAYSPREAD )
{
HB_SIZE ulLen = hb_parclen( 1 );
HB_SIZE nLen = hb_parclen( 1 );
if( ulLen )
if( nLen )
{
const char * szText = hb_parc( 1 );
HB_SIZE ulPos, ul;
HB_SIZE nPos, ul;
int iRow, iCol, iMaxRow, iMaxCol;
long lDelay;
@@ -127,20 +127,20 @@ HB_FUNC( SAYSPREAD )
{
int iColor = hb_gtGetCurrColor();
ulPos = ulLen >> 1;
ulLen = ulLen & 1;
if( !ulLen )
nPos = nLen >> 1;
nLen = nLen & 1;
if( !nLen )
{
ulLen = 2;
--ulPos;
nLen = 2;
--nPos;
}
hb_gtBeginWrite();
do
{
for( ul = 0; ul < ulLen && iCol + ( int ) ul <= iMaxCol; ++ul )
hb_gtPutChar( iRow, iCol + ( int ) ul, iColor, 0, ( HB_UCHAR ) szText[ulPos + ul] );
ulLen += 2;
for( ul = 0; ul < nLen && iCol + ( int ) ul <= iMaxCol; ++ul )
hb_gtPutChar( iRow, iCol + ( int ) ul, iColor, 0, ( HB_UCHAR ) szText[nPos + ul] );
nLen += 2;
if( lDelay )
{
hb_gtEndWrite();
@@ -148,7 +148,7 @@ HB_FUNC( SAYSPREAD )
hb_gtBeginWrite();
}
}
while( ulPos-- && iCol-- );
while( nPos-- && iCol-- );
/* CT3 does not respect iCol in the above condition */
hb_gtEndWrite();
}
@@ -164,7 +164,7 @@ HB_FUNC( SAYMOVEIN )
if( iLen )
{
const char * szText = hb_parc( 1 );
HB_SIZE ulChars, ul;
HB_SIZE nChars, ul;
int iRow, iCol, iMaxRow, iMaxCol, iNewCol;
long lDelay;
HB_BOOL fBack;
@@ -188,7 +188,7 @@ HB_FUNC( SAYMOVEIN )
iCol += iLen - 1;
else
szText += iLen - 1;
ulChars = 1;
nChars = 1;
hb_gtBeginWrite();
do
@@ -197,19 +197,19 @@ HB_FUNC( SAYMOVEIN )
{
if( iCol <= iMaxCol )
{
for( ul = 0; ul < ulChars; ++ul )
for( ul = 0; ul < nChars; ++ul )
hb_gtPutChar( iRow, iCol + ( int ) ul, iColor, 0, ( HB_UCHAR ) szText[ul] );
}
--iCol;
}
else
{
for( ul = 0; ul < ulChars; ++ul )
for( ul = 0; ul < nChars; ++ul )
hb_gtPutChar( iRow, iCol + ( int ) ul, iColor, 0, ( HB_UCHAR ) szText[ul] );
--szText;
}
if( ( int ) ulChars + iCol <= iMaxCol )
++ulChars;
if( ( int ) nChars + iCol <= iMaxCol )
++nChars;
if( lDelay )
{
@@ -316,7 +316,7 @@ HB_FUNC( SCREENSTR )
{
int iRow, iCol, iMaxRow, iMaxCol, iC;
char * pBuffer, * szText;
HB_SIZE ulSize, ulCount = HB_SIZE_MAX;
HB_SIZE nSize, ulCount = HB_SIZE_MAX;
hb_gtGetPos( &iRow, &iCol );
if( HB_ISNUM( 1 ) )
@@ -330,12 +330,12 @@ HB_FUNC( SCREENSTR )
if( iRow >= 0 && iRow <= iMaxRow && iCol >= 0 && iCol <= iMaxCol && ulCount )
{
ulSize = ( HB_SIZE ) ( iMaxRow - iRow + 1 ) * ( iMaxCol - iCol + 1 );
if( ulSize > ulCount )
ulSize = ulCount;
ulCount = ulSize;
ulSize <<= 1;
szText = pBuffer = ( char * ) hb_xgrab( ulSize + 1 );
nSize = ( HB_SIZE ) ( iMaxRow - iRow + 1 ) * ( iMaxCol - iCol + 1 );
if( nSize > ulCount )
nSize = ulCount;
ulCount = nSize;
nSize <<= 1;
szText = pBuffer = ( char * ) hb_xgrab( nSize + 1 );
do
{
iC = iCol;
@@ -352,7 +352,7 @@ HB_FUNC( SCREENSTR )
}
while( ulCount && ++iRow <= iMaxRow );
hb_retclen_buffer( pBuffer, ulSize );
hb_retclen_buffer( pBuffer, nSize );
}
else
hb_retc_null();
@@ -360,12 +360,12 @@ HB_FUNC( SCREENSTR )
HB_FUNC( STRSCREEN )
{
HB_SIZE ulLen = hb_parclen( 1 );
HB_SIZE nLen = hb_parclen( 1 );
if( ulLen & 1 )
ulLen--;
if( nLen & 1 )
nLen--;
if( ulLen )
if( nLen )
{
const char * szText = hb_parc( 1 );
int iRow, iCol, iMaxRow, iMaxCol, iC;
@@ -389,11 +389,11 @@ HB_FUNC( STRSCREEN )
HB_USHORT usChar = ( HB_UCHAR ) *szText++;
int iColor = ( HB_UCHAR ) *szText++;
hb_gtPutChar( iRow, iC, iColor, 0, usChar );
ulLen -= 2;
nLen -= 2;
}
while( ulLen && ++iC <= iMaxCol );
while( nLen && ++iC <= iMaxCol );
}
while( ulLen && ++iRow <= iMaxRow );
while( nLen && ++iRow <= iMaxRow );
hb_gtEndWrite();
}
}

View File

@@ -104,14 +104,14 @@ static void do_token1( int iSwitch )
HB_SIZE sStrLen = hb_parclen( 1 );
const char *pcSeparatorStr;
HB_SIZE sSeparatorStrLen;
HB_SIZE ulTokenCounter = 0;
HB_SIZE ulSkip;
HB_SIZE nTokenCounter = 0;
HB_SIZE nSkip;
const char *pcSubStr;
char *pcRet = NULL;
HB_SIZE sSubStrLen;
HB_SIZE sRetStrLen = 0;
HB_SIZE ulToken = 0;
HB_SIZE ulSkipCnt;
HB_SIZE nToken = 0;
HB_SIZE nSkipCnt;
const char *pc;
/* separator string */
@@ -126,27 +126,27 @@ static void do_token1( int iSwitch )
/* token counter */
if( iSwitch != DO_TOKEN1_NUMTOKEN )
ulTokenCounter = hb_parns( 3 );
if( ulTokenCounter == 0 )
ulTokenCounter = HB_SIZE_MAX;
nTokenCounter = hb_parns( 3 );
if( nTokenCounter == 0 )
nTokenCounter = HB_SIZE_MAX;
/* skip width */
if( iSwitch == DO_TOKEN1_NUMTOKEN )
{
if( HB_ISNUM( 3 ) )
ulSkip = hb_parns( 3 );
nSkip = hb_parns( 3 );
else
ulSkip = HB_SIZE_MAX;
nSkip = HB_SIZE_MAX;
}
else
{
if( HB_ISNUM( 4 ) )
ulSkip = hb_parns( 4 );
nSkip = hb_parns( 4 );
else
ulSkip = HB_SIZE_MAX;
nSkip = HB_SIZE_MAX;
}
if( ulSkip == 0 )
ulSkip = HB_SIZE_MAX;
if( nSkip == 0 )
nSkip = HB_SIZE_MAX;
/* prepare return value for TOKENUPPER/TOKENLOWER */
if( iSwitch == DO_TOKEN1_TOKENLOWER || iSwitch == DO_TOKEN1_TOKENUPPER )
@@ -164,19 +164,19 @@ static void do_token1( int iSwitch )
hb_xmemcpy( pcRet, pcString, sRetStrLen );
}
/* find the <ulTokenCounter>th token */
/* find the <nTokenCounter>th token */
pcSubStr = pcString;
sSubStrLen = sStrLen;
/* scan start condition */
pc = pcSubStr - 1;
while( ulToken < ulTokenCounter )
while( nToken < nTokenCounter )
{
HB_SIZE sMatchedPos = sSeparatorStrLen;
/* Skip the left ulSkip successive separators */
ulSkipCnt = 0;
/* Skip the left nSkip successive separators */
nSkipCnt = 0;
do
{
sSubStrLen -= ( pc - pcSubStr ) + 1;
@@ -191,9 +191,9 @@ static void do_token1( int iSwitch )
else
s_iPostSeparator = -1;
}
ulSkipCnt++;
nSkipCnt++;
}
while( ulSkipCnt < ulSkip && pc == pcSubStr );
while( nSkipCnt < nSkip && pc == pcSubStr );
if( sSubStrLen == 0 )
{
@@ -219,7 +219,7 @@ static void do_token1( int iSwitch )
break;
}
case DO_TOKEN1_NUMTOKEN:
hb_retns( ulToken );
hb_retns( nToken );
break;
case DO_TOKEN1_ATTOKEN:
@@ -266,21 +266,21 @@ static void do_token1( int iSwitch )
break;
}
ulToken++;
nToken++;
if( pc == NULL )
{
pc = pcSubStr + sSubStrLen; /* little trick for return values */
break; /* we must leave the while loop even if we have not
yet found the <ulTokenCounter>th token */
yet found the <nTokenCounter>th token */
}
/* should we find the last token, but string ends with tokenizer, i.e.
pc points to the last character at the moment ?
-> break here ! */
if( ulTokenCounter == 0xFFFFFFFFUL )
if( nTokenCounter == HB_SIZE_MAX )
{
if( ulSkip == 0xFFFFFFFFUL )
if( nSkip == HB_SIZE_MAX )
{
const char *t;
HB_BOOL bLast = HB_TRUE;
@@ -299,7 +299,7 @@ static void do_token1( int iSwitch )
else if( pc + 1 == pcString + sStrLen )
break;
}
} /* while( ulToken < ulTokenCounter ) */
} /* while( nToken < nTokenCounter ) */
switch ( iSwitch )
{
@@ -307,8 +307,8 @@ static void do_token1( int iSwitch )
{
char cRet;
if( ( ulTokenCounter == 0xFFFFFFFFUL ) ||
( ulToken == ulTokenCounter ) )
if( ( nTokenCounter == HB_SIZE_MAX ) ||
( nToken == nTokenCounter ) )
hb_retclen( pcSubStr, pc - pcSubStr );
else
hb_retc_null();
@@ -326,12 +326,12 @@ static void do_token1( int iSwitch )
break;
}
case DO_TOKEN1_NUMTOKEN:
hb_retns( ulToken );
hb_retns( nToken );
break;
case DO_TOKEN1_ATTOKEN:
if( ( ulTokenCounter == 0xFFFFFFFFUL ) ||
( ulToken == ulTokenCounter ) )
if( ( nTokenCounter == HB_SIZE_MAX ) ||
( nToken == nTokenCounter ) )
hb_retns( pcSubStr - pcString + 1 );
else
hb_retns( 0 );

View File

@@ -375,7 +375,7 @@ HB_FUNC( TOKENINIT )
HB_SIZE sStrLen = hb_parclen( 1 );
const char *pcSeparatorStr;
HB_SIZE sSeparatorStrLen;
HB_SIZE ulSkipCnt, ulSkip;
HB_SIZE nSkipCnt, nSkip;
const char *pcSubStr, *pc;
HB_SIZE sSubStrLen;
TOKEN_ENVIRONMENT sTokenEnvironment;
@@ -393,11 +393,11 @@ HB_FUNC( TOKENINIT )
/* skip width */
if( HB_ISNUM( 3 ) )
ulSkip = hb_parns( 3 );
nSkip = hb_parns( 3 );
else
ulSkip = HB_SIZE_MAX;
if( ulSkip == 0 )
ulSkip = HB_SIZE_MAX;
nSkip = HB_SIZE_MAX;
if( nSkip == 0 )
nSkip = HB_SIZE_MAX;
/* allocate new token environment */
if( ( sTokenEnvironment = sTokEnvNew() ) == NULL )
@@ -424,17 +424,17 @@ HB_FUNC( TOKENINIT )
{
HB_SIZE sMatchedPos = sSeparatorStrLen;
/* ulSkip */
ulSkipCnt = 0;
/* nSkip */
nSkipCnt = 0;
do
{
sSubStrLen -= ( pc - pcSubStr ) + 1;
pcSubStr = pc + 1;
pc = ct_at_charset_forward( pcSubStr, sSubStrLen, pcSeparatorStr,
sSeparatorStrLen, &sMatchedPos );
ulSkipCnt++;
nSkipCnt++;
}
while( ulSkipCnt < ulSkip && pc == pcSubStr );
while( nSkipCnt < nSkip && pc == pcSubStr );
if( sSubStrLen == 0 )
break;