2010-06-19 16:24 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)

* include/hbdefs.h
    + Adjusted HB_SIZE_MAX value for Win64 after recent changes.

  * src/vm/hashfunc.c
  * src/vm/hvm.c
  * src/debug/dbgentry.c
  * src/common/hbwin.c
  * src/common/hbfsapi.c
  * src/common/hbstr.c
  * src/rtl/lennum.c
  * src/rtl/hbzlibgz.c
  * src/rtl/hbtoken.c
  * src/rtl/hbmd5.c
  * src/rtl/hbregex.c
  * src/rtl/hbzlib.c
  * src/rtl/gtpca/gtpca.c
  * contrib/hbct/screen2.c
  * contrib/hbct/token2.c
  * contrib/hbct/charsprd.c
  * contrib/hbct/charlist.c
  * contrib/hbct/charsort.c
  * contrib/hbct/maxline.c
  * contrib/hbct/wordrepl.c
  * contrib/hbct/charrepl.c
  * contrib/hbct/charswap.c
  * contrib/hbct/pos1.c
  * contrib/hbct/token1.c
  * contrib/hbct/charmirr.c
  * contrib/hbct/relation.c
  * contrib/hbct/atnum.c
  * contrib/hbct/count.c
  * contrib/hbct/ctstrfil.c
  * contrib/hbct/posdiff.c
  * contrib/hbct/addascii.c
  * contrib/hbct/pos2.c
  * contrib/hbct/numat.c
  * contrib/hbct/atrepl.c
  * contrib/hbct/print.c
  * contrib/xhb/txtline.c
  * contrib/hbgt/strright.c
  * contrib/hbgt/chrtotal.c
  * contrib/hbgt/strcount.c
  * contrib/hbgt/ascposgt.c
  * contrib/hbgt/strleft.c
  * contrib/hbgt/chrcount.c
  * contrib/hbgt/strcspn.c
  * contrib/hbgt/atdiff.c
  * contrib/hbbz2/hbbz2.c
  * contrib/hbmemio/memio.c
  * contrib/hbclipsm/num.c
  * contrib/hbclipsm/date.c
  * contrib/hbmisc/stringsx.c
  * contrib/hbmisc/spd.c
    + Using new size API.
      NOTE: This will be a longer process as there many current variations
            to pass sizes (*nint(), *ni(), *nl()) and there is no warning
            issued in several of these.
            Please also note that not all updates files became fully clean.
            I will post a list of remaining warnings.
    + Type cleanup:
        int -> HB_ISIZ
    + Added casts at component boundaries.
    % Deleted unnecessary '( HB_SIZE )' casts.
    + ULONG_MAX -> HB_SIZE_MAX
    * 'hb_retl( 0 )' -> 'hb_retl( HB_FALSE )'
    * 'hb_retl( 1 )' -> 'hb_retl( HB_TRUE )'
    ! CSETSAFETY() fixed to return and accept logical parameters
      instead of returning numeric, checking for logical but retrieving
      numeric.

  * src/common/hbwin.c
    * DWORD -> int to be in sync with Windows API declarations.

  ; NOTE: I left out RDDs and VM from the areas I scanned, please
          modify them. F.e. we will need a hb_vmPushSize().

  ; Peer review (by as much eyeballs as possible) is appreciated.
This commit is contained in:
Viktor Szakats
2010-06-19 14:26:56 +00:00
parent 0c2f806800
commit d4d9a5f4e5
52 changed files with 319 additions and 236 deletions

View File

@@ -16,6 +16,85 @@
The license applies to all entries newer than 2009-04-28.
*/
2010-06-19 16:24 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* include/hbdefs.h
+ Adjusted HB_SIZE_MAX value for Win64 after recent changes.
* src/vm/hashfunc.c
* src/vm/hvm.c
* src/debug/dbgentry.c
* src/common/hbwin.c
* src/common/hbfsapi.c
* src/common/hbstr.c
* src/rtl/lennum.c
* src/rtl/hbzlibgz.c
* src/rtl/hbtoken.c
* src/rtl/hbmd5.c
* src/rtl/hbregex.c
* src/rtl/hbzlib.c
* src/rtl/gtpca/gtpca.c
* contrib/hbct/screen2.c
* contrib/hbct/token2.c
* contrib/hbct/charsprd.c
* contrib/hbct/charlist.c
* contrib/hbct/charsort.c
* contrib/hbct/maxline.c
* contrib/hbct/wordrepl.c
* contrib/hbct/charrepl.c
* contrib/hbct/charswap.c
* contrib/hbct/pos1.c
* contrib/hbct/token1.c
* contrib/hbct/charmirr.c
* contrib/hbct/relation.c
* contrib/hbct/atnum.c
* contrib/hbct/count.c
* contrib/hbct/ctstrfil.c
* contrib/hbct/posdiff.c
* contrib/hbct/addascii.c
* contrib/hbct/pos2.c
* contrib/hbct/numat.c
* contrib/hbct/atrepl.c
* contrib/hbct/print.c
* contrib/xhb/txtline.c
* contrib/hbgt/strright.c
* contrib/hbgt/chrtotal.c
* contrib/hbgt/strcount.c
* contrib/hbgt/ascposgt.c
* contrib/hbgt/strleft.c
* contrib/hbgt/chrcount.c
* contrib/hbgt/strcspn.c
* contrib/hbgt/atdiff.c
* contrib/hbbz2/hbbz2.c
* contrib/hbmemio/memio.c
* contrib/hbclipsm/num.c
* contrib/hbclipsm/date.c
* contrib/hbmisc/stringsx.c
* contrib/hbmisc/spd.c
+ Using new size API.
NOTE: This will be a longer process as there many current variations
to pass sizes (*nint(), *ni(), *nl()) and there is no warning
issued in several of these.
Please also note that not all updates files became fully clean.
I will post a list of remaining warnings.
+ Type cleanup:
int -> HB_ISIZ
+ Added casts at component boundaries.
% Deleted unnecessary '( HB_SIZE )' casts.
+ ULONG_MAX -> HB_SIZE_MAX
* 'hb_retl( 0 )' -> 'hb_retl( HB_FALSE )'
* 'hb_retl( 1 )' -> 'hb_retl( HB_TRUE )'
! CSETSAFETY() fixed to return and accept logical parameters
instead of returning numeric, checking for logical but retrieving
numeric.
* src/common/hbwin.c
* DWORD -> int to be in sync with Windows API declarations.
; NOTE: I left out RDDs and VM from the areas I scanned, please
modify them. F.e. we will need a hb_vmPushSize().
; Peer review (by as much eyeballs as possible) is appreciated.
2010-06-19 14:12 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* src/vm/itemapi.c
* src/vm/arrays.c

View File

@@ -89,7 +89,7 @@ static int hb_bz2Compress( const char * szSrc, HB_SIZE nSrc,
stream.avail_in = ( unsigned int ) nSrc;
stream.next_out = szDst;
stream.avail_out = *pnDst;
stream.avail_out = ( unsigned int ) *pnDst;
stream.bzalloc = hb_bz2Alloc;
stream.bzfree = hb_bz2Free;
@@ -177,7 +177,7 @@ static int hb_bz2Uncompress( const char * szSrc, HB_SIZE nSrc,
stream.avail_in = ( unsigned int ) nSrc;
stream.next_out = szDst;
stream.avail_out = *pnDst;
stream.avail_out = ( unsigned int ) *pnDst;
stream.bzalloc = hb_bz2Alloc;
stream.bzfree = hb_bz2Free;

View File

@@ -63,9 +63,9 @@ HB_FUNC( MDY )
char szDate[ 9 ];
char szFormatted[ 11 ];
char * szReturn;
int iBufferLen;
int iYearLen;
int iLen;
HB_ISIZ iBufferLen;
HB_ISIZ iYearLen;
HB_ISIZ iLen;
hb_dateDecode( hb_pardl( 1 ), &iYear, &iMonth, &iDay );
hb_dateFormat( hb_pardsbuff( szDate, 1 ), szFormatted, "MM/DD/YYYY" );
@@ -93,9 +93,9 @@ HB_FUNC( DMY )
char szDate[ 9 ];
char szFormatted[ 11 ];
char * szReturn;
int iBufferLen;
int iYearLen;
int iLen;
HB_ISIZ iBufferLen;
HB_ISIZ iYearLen;
HB_ISIZ iLen;
hb_dateDecode( hb_pardl( 1 ), &iYear, &iMonth, &iDay );
hb_dateFormat( hb_pardsbuff( szDate, 1 ), szFormatted, "MM/DD/YYYY" );

View File

@@ -124,7 +124,7 @@ HB_FUNC( NUMGETLEN )
hb_xfree( szBuffer );
}
hb_retnl( ulLen );
hb_retns( ulLen );
}
/* RtoD( <nRadians> ) --> nDegrees

View File

@@ -152,7 +152,7 @@ HB_FUNC( ADDASCII )
}
/* return string unchanged */
if( iNoRet )
hb_retl( 0 );
hb_retl( HB_FALSE );
else
hb_retclen( pcSource, sLen );
return;
@@ -195,7 +195,7 @@ HB_FUNC( ADDASCII )
if( iNoRet )
{
hb_retl( 0 );
hb_retl( HB_FALSE );
hb_xfree( pcResult );
}
else
@@ -215,7 +215,7 @@ HB_FUNC( ADDASCII )
if( pSubst != NULL )
hb_itemReturnRelease( pSubst );
else if( iNoRet )
hb_retl( 0 );
hb_retl( HB_FALSE );
else
hb_retc_null();
}

View File

@@ -80,7 +80,7 @@ static void do_atnum( int iSwitch )
/* eventually ignore some characters */
if( HB_ISNUM( 4 ) )
sIgnore = ( HB_SIZE ) hb_parnl( 4 );
sIgnore = hb_parns( 4 );
else
sIgnore = 0;
@@ -124,7 +124,7 @@ static void do_atnum( int iSwitch )
ct_error( ( HB_USHORT ) iArgErrorMode, EG_ARG, CT_ERROR_ATNUM, NULL, HB_ERR_FUNCNAME, 0,
EF_CANDEFAULT, HB_ERR_ARGS_BASEPARAMS );
}
hb_retni( 0 );
hb_retns( 0 );
break;
}
}
@@ -137,7 +137,7 @@ static void do_atnum( int iSwitch )
}
/* nth match or last match ? */
if( HB_ISNUM( 3 ) && ( ulCounter = hb_parnl( 3 ) ) != 0 )
if( HB_ISNUM( 3 ) && ( ulCounter = hb_parns( 3 ) ) != 0 )
{
/* find the <ulCounter>th match */
const char *pcSubStr;
@@ -180,7 +180,7 @@ static void do_atnum( int iSwitch )
case DO_ATNUM_ATNUM:
/* ATNUM */
hb_retni( 0 );
hb_retns( 0 );
break;
}
return;
@@ -194,7 +194,7 @@ static void do_atnum( int iSwitch )
sSubStrLen = sStrLen - ( pcSubStr - pcString );
}
}
else /* ( HB_ISNUM( 3 ) && ( ulCounter = hb_parnl( 3 ) ) != 0 ) */
else /* ( HB_ISNUM( 3 ) && ( ulCounter = hb_parns( 3 ) ) != 0 ) */
{
/* we have to find the last match and return the
string after that last match */
@@ -227,7 +227,7 @@ static void do_atnum( int iSwitch )
case DO_ATNUM_ATNUM:
/* ATNUM */
hb_retni( 0 );
hb_retns( 0 );
break;
}
return;
@@ -254,9 +254,9 @@ static void do_atnum( int iSwitch )
#if defined( __POCC__ ) && ( __POCC__ >= 500 ) && defined( HB_OS_WIN_64 )
/* NOTE: Workaround for Pelles C 5.00.13 AMD64 mode internal error:
'fatal error: Internal error: reduce_tree()' [vszakats]. */
hb_retnl( pc - pcString + sIgnore + 1 );
hb_retns( pc - pcString + sIgnore + 1 );
#else
hb_retnl( pc - ( pcString - sIgnore ) + 1 );
hb_retns( pc - ( pcString - sIgnore ) + 1 );
#endif
break;
}
@@ -303,7 +303,7 @@ static void do_atnum( int iSwitch )
if( pSubst != NULL )
hb_itemReturnRelease( pSubst );
else
hb_retni( 0 );
hb_retns( 0 );
break;
}
}

View File

@@ -143,7 +143,7 @@ HB_FUNC( ATREPL )
HB_SIZE nRetStrLen;
/* eventually ignore some characters */
nIgnore = ( HB_SIZE ) hb_parnl( 6 );
nIgnore = hb_parns( 6 );
if( nIgnore >= nStrLen )
{
@@ -166,11 +166,11 @@ HB_FUNC( ATREPL )
iReplaceMode = hb_parl( 5 );
/* n-th match or last match ? */
ulCounter = hb_parnl( 4 );
ulCounter = hb_parns( 4 );
/* little trick: */
if( iReplaceMode == 0 && ulCounter == 0 )
ulCounter = ULONG_MAX;
ulCounter = HB_SIZE_MAX;
if( ulCounter != 0 )
{

View File

@@ -160,7 +160,7 @@ static void do_list( int iSwitch )
PHB_ITEM pArray = hb_itemArrayNew( 256 );
for( sCnt = 0; sCnt < 256; sCnt++ )
hb_arraySetNL( pArray, sCnt + 1, asCharCnt[sCnt] );
hb_arraySetNS( pArray, sCnt + 1, asCharCnt[sCnt] );
hb_itemReturnRelease( pArray );
break;
}

View File

@@ -132,7 +132,7 @@ HB_FUNC( CHARMIRR )
HB_ERR_FUNCNAME, 0, EF_CANDEFAULT, HB_ERR_ARGS_BASEPARAMS );
}
if( iNoRet )
hb_retl( 0 );
hb_retl( HB_FALSE );
else
hb_retc_null();
return;
@@ -165,7 +165,7 @@ HB_FUNC( CHARMIRR )
if( iNoRet )
{
hb_retl( 0 );
hb_retl( HB_FALSE );
hb_xfree( pcRet );
}
else
@@ -186,7 +186,7 @@ HB_FUNC( CHARMIRR )
if( pSubst != NULL )
hb_itemReturnRelease( pSubst );
else if( iNoRet )
hb_retl( 0 );
hb_retl( HB_FALSE );
else
hb_retc_null();
}

View File

@@ -146,7 +146,7 @@ HB_FUNC( CHARREPL )
{
if( iNoRet )
{
hb_retl( 0 );
hb_retl( HB_FALSE );
}
else
{
@@ -213,7 +213,7 @@ HB_FUNC( CHARREPL )
if( iNoRet )
{
hb_retl( 0 );
hb_retl( HB_FALSE );
hb_xfree( pcRet );
}
else
@@ -237,7 +237,7 @@ HB_FUNC( CHARREPL )
if( pSubst != NULL )
hb_itemReturnRelease( pSubst );
else if( iNoRet )
hb_retl( 0 );
hb_retl( HB_FALSE );
else if( HB_ISCHAR( 2 ) )
hb_retclen( hb_parc( 2 ), hb_parclen( 2 ) );
else

View File

@@ -235,7 +235,7 @@ HB_FUNC( CHARSORT )
HB_ERR_ARGS_BASEPARAMS );
}
if( iNoRet )
hb_retl( 0 );
hb_retl( HB_FALSE );
else
hb_retc_null();
return;
@@ -255,7 +255,7 @@ HB_FUNC( CHARSORT )
if( iNoRet )
{
hb_retl( 0 );
hb_retl( HB_FALSE );
hb_xfree( pcRet );
}
else
@@ -276,7 +276,7 @@ HB_FUNC( CHARSORT )
if( pSubst != NULL )
hb_itemReturnRelease( pSubst );
else if( iNoRet )
hb_retl( 0 );
hb_retl( HB_FALSE );
else
hb_retc_null();
}

View File

@@ -70,7 +70,7 @@ HB_FUNC( CHARSPREAD )
{
const char * szText = hb_parc( 1 );
char * szDest, cDelim = ' ';
int iTokens = 0, iRepl, iRest, iFirst, i;
HB_ISIZ iTokens = 0, iRepl, iRest, iFirst, i;
HB_SIZE ul, ulDst, ulRest;
if( HB_ISCHAR( 3 ) )

View File

@@ -148,7 +148,7 @@ static void do_charswap( int iSwitch )
}
if( iNoRet )
hb_retl( 0 );
hb_retl( HB_FALSE );
else
hb_retclen( pcRet, sRetIndex );
hb_xfree( pcRet );
@@ -179,7 +179,7 @@ static void do_charswap( int iSwitch )
if( pSubst != NULL )
hb_itemReturnRelease( pSubst );
else if( iNoRet )
hb_retl( 0 );
hb_retl( HB_FALSE );
else
hb_retc_null();
}

View File

@@ -100,7 +100,7 @@ static void do_count( int iSwitch )
break;
}
hb_retnl( sRetVal );
hb_retns( sRetVal );
}
else /* if( HB_ISCHAR( 1 ) ) */
{
@@ -119,7 +119,7 @@ static void do_count( int iSwitch )
if( pSubst != NULL )
hb_itemReturnRelease( pSubst );
else
hb_retni( 0 );
hb_retns( 0 );
}
}

View File

@@ -59,7 +59,7 @@
#include "ctstrfil.h"
static int s_iFileAttr = HB_FA_NORMAL;
static HB_BOOL s_bSafety = 0;
static HB_BOOL s_bSafety = HB_FALSE;
void ct_setfcreate( int iFileAttr )
{
@@ -95,10 +95,10 @@ HB_BOOL ct_getsafety( void )
HB_FUNC( CSETSAFETY )
{
hb_retni( ct_getsafety() );
hb_retl( ct_getsafety() );
if( HB_ISLOG( 1 ) )
ct_setsafety( hb_parnl( 1 ) );
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,
@@ -139,12 +139,12 @@ HB_FUNC( STRFILE )
{
if( HB_ISCHAR( 1 ) && HB_ISCHAR( 2 ) )
{
hb_retnl( ct_StrFile( hb_parc( 2 ), hb_parc( 1 ),
hb_retns( ct_StrFile( hb_parc( 2 ), hb_parc( 1 ),
hb_parclen( 1 ), hb_parl( 3 ),
( HB_FOFFSET ) hb_parnint( 4 ), hb_parl( 5 ) ) );
}
else
hb_retni( 0 );
hb_retns( 0 );
}
HB_FUNC( FILESTR )
@@ -163,7 +163,7 @@ HB_FUNC( FILESTR )
if( HB_ISNUM( 2 ) )
{
lLength = hb_parnl( 2 );
lLength = hb_parns( 2 );
if( lLength > ( HB_ISIZ ) ( lFileSize - lPos ) )
lLength = ( HB_ISIZ ) ( lFileSize - lPos );
}
@@ -203,13 +203,13 @@ HB_FUNC( SCREENFILE )
hb_gtSave( 0, 0, hb_gtMaxRow(), hb_gtMaxCol(), pBuffer );
hb_retnl( ct_StrFile( hb_parc( 1 ), pBuffer,
hb_retns( ct_StrFile( hb_parc( 1 ), pBuffer,
ulSize, hb_parl( 2 ),
( HB_FOFFSET ) hb_parnint( 3 ), hb_parl( 4 ) ) );
hb_xfree( pBuffer );
}
else
hb_retni( 0 );
hb_retns( 0 );
}
HB_FUNC( FILESCREEN )
@@ -236,11 +236,11 @@ HB_FUNC( FILESCREEN )
hb_xfree( pBuffer );
hb_fsClose( hFile );
hb_retnl( lLength );
hb_retns( lLength );
}
else
hb_retni( 0 );
hb_retns( 0 );
}
else
hb_retni( 0 );
hb_retns( 0 );
}

View File

@@ -79,5 +79,5 @@ HB_FUNC( MAXLINE )
pcString = pBuffer;
}
}
hb_retnl( lLength );
hb_retns( lLength );
}

View File

@@ -100,7 +100,7 @@ HB_FUNC( NUMAT )
/* eventually ignore some characters */
if( HB_ISNUM( 3 ) )
sIgnore = ( HB_SIZE ) hb_parnl( 3 );
sIgnore = hb_parns( 3 );
else
sIgnore = 0;
@@ -153,7 +153,7 @@ HB_FUNC( NUMAT )
}
while( pc != NULL );
hb_retnl( ulCounter - 1 );
hb_retns( ulCounter - 1 );
}
else /* ( HB_ISCHAR( 1 ) && HB_ISCHAR( 2 ) ) */
{

View File

@@ -84,7 +84,7 @@ static void do_pos1( int iSwitch )
if( hb_parclen( 1 ) == 0 )
{
hb_retni( 0 );
hb_retns( 0 );
return;
}
else
@@ -94,7 +94,7 @@ static void do_pos1( int iSwitch )
if( hb_parclen( 2 ) == 0 )
{
hb_retni( 0 );
hb_retns( 0 );
return;
}
else
@@ -114,7 +114,7 @@ static void do_pos1( int iSwitch )
iMode = 0;
if( HB_ISNUM( iParamShift + 3 ) )
sIgnore = ( HB_SIZE ) hb_parnl( iParamShift + 3 );
sIgnore = hb_parns( iParamShift + 3 );
else
sIgnore = 0;
@@ -143,11 +143,11 @@ static void do_pos1( int iSwitch )
if( ( iMode && !iDoRet ) || ( !iMode && iDoRet ) )
{
hb_retnl( puc - pcString + 1 );
hb_retns( puc - pcString + 1 );
return;
}
}
hb_retni( 0 );
hb_retns( 0 );
}
else /* ISCHAR (1) etc. */
{
@@ -183,7 +183,7 @@ static void do_pos1( int iSwitch )
if( pSubst != NULL )
hb_itemReturnRelease( pSubst );
else
hb_retni( 0 );
hb_retns( 0 );
}
}

View File

@@ -103,11 +103,11 @@ HB_FUNC( POSCHAR )
if( HB_ISCHAR( 2 ) )
cReplace = *( hb_parc( 2 ) );
else
cReplace = ( char ) ( hb_parnl( 2 ) % 256 );
cReplace = ( char ) ( hb_parns( 2 ) % 256 );
if( HB_ISNUM( 3 ) )
{
sPosition = hb_parnl( 3 );
sPosition = hb_parns( 3 );
if( sPosition == 0 )
sPosition = sStrLen;
}
@@ -209,13 +209,13 @@ HB_FUNC( POSDEL )
char *pcRet;
if( HB_ISNUM( 3 ) )
sDelLen = hb_parnl( 3 );
sDelLen = hb_parns( 3 );
else
sDelLen = 1; /* set new standard behavior */
if( HB_ISNUM( 2 ) )
{
sStartPos = hb_parnl( 2 );
sStartPos = hb_parns( 2 );
if( sStartPos == 0 || sStartPos > sStrLen - sDelLen + 1 )
sStartPos = sStrLen - sDelLen + 1;
}
@@ -311,7 +311,7 @@ HB_FUNC( POSINS )
if( HB_ISNUM( 3 ) )
{
sStartPos = hb_parnl( 3 );
sStartPos = hb_parns( 3 );
if( sStartPos == 0 )
sStartPos = sStrLen;
}
@@ -426,7 +426,7 @@ HB_FUNC( POSREPL )
if( HB_ISNUM( 3 ) )
{
sStartPos = hb_parnl( 3 );
sStartPos = hb_parns( 3 );
if( sStartPos == 0 )
{
if( sReplLen > sStrLen )

View File

@@ -96,7 +96,7 @@ HB_FUNC( POSDIFF )
HB_SIZE sIgnore;
if( HB_ISNUM( 3 ) )
sIgnore = hb_parnl( 3 );
sIgnore = hb_parns( 3 );
else
sIgnore = 0;
@@ -109,7 +109,7 @@ HB_FUNC( POSDIFF )
ct_error( ( HB_USHORT ) iArgErrorMode, EG_ARG, CT_ERROR_POSDIFF, NULL,
HB_ERR_FUNCNAME, 0, EF_CANDEFAULT, HB_ERR_ARGS_BASEPARAMS );
}
hb_retni( 0 );
hb_retns( 0 );
return;
}
@@ -120,7 +120,7 @@ HB_FUNC( POSDIFF )
{
if( *pc1 != *pc2 )
{
hb_retnl( ( pc1 - pcString1 ) + 1 );
hb_retns( ( pc1 - pcString1 ) + 1 );
return;
}
pc1++;
@@ -128,9 +128,9 @@ HB_FUNC( POSDIFF )
}
if( sStrLen1 != sStrLen2 )
hb_retnl( ( sStrLen1 < sStrLen2 ? sStrLen1 : sStrLen2 ) + 1 );
hb_retns( ( sStrLen1 < sStrLen2 ? sStrLen1 : sStrLen2 ) + 1 );
else
hb_retni( 0 );
hb_retns( 0 );
}
else /* ( HB_ISCHAR( 1 ) && HB_ISCHAR( 2 ) ) */
{
@@ -147,9 +147,9 @@ HB_FUNC( POSDIFF )
if( pSubst != NULL )
hb_itemReturnRelease( pSubst );
else if( HB_ISCHAR( 1 ) || HB_ISCHAR( 2 ) )
hb_retnl( 1 );
hb_retns( 1 );
else
hb_retni( 0 );
hb_retns( 0 );
}
}
@@ -194,12 +194,12 @@ HB_FUNC( POSEQUAL )
HB_SIZE sIgnore, sCompare, sCompareCnt, sRet = 0;
if( HB_ISNUM( 4 ) )
sIgnore = hb_parnl( 4 );
sIgnore = hb_parns( 4 );
else
sIgnore = 0;
if( HB_ISNUM( 3 ) )
sCompare = hb_parnl( 3 );
sCompare = hb_parns( 3 );
else
sCompare = ( sStrLen1 < sStrLen2 ? sStrLen1 : sStrLen2 ) - sIgnore;
@@ -212,7 +212,7 @@ HB_FUNC( POSEQUAL )
ct_error( ( HB_USHORT ) iArgErrorMode, EG_ARG, CT_ERROR_POSEQUAL, NULL,
HB_ERR_FUNCNAME, 0, EF_CANDEFAULT, HB_ERR_ARGS_BASEPARAMS );
}
hb_retni( 0 );
hb_retns( 0 );
return;
}
@@ -225,7 +225,7 @@ HB_FUNC( POSEQUAL )
ct_error( ( HB_USHORT ) iArgErrorMode, EG_ARG, CT_ERROR_POSEQUAL, NULL,
HB_ERR_FUNCNAME, 0, EF_CANDEFAULT, HB_ERR_ARGS_BASEPARAMS );
}
hb_retni( 0 );
hb_retns( 0 );
return;
}
@@ -244,7 +244,7 @@ HB_FUNC( POSEQUAL )
sCompareCnt++;
if( sCompareCnt == sCompare )
{
hb_retnl( sRet );
hb_retns( sRet );
return;
}
}
@@ -256,7 +256,7 @@ HB_FUNC( POSEQUAL )
pc1++;
pc2++;
}
hb_retni( 0 );
hb_retns( 0 );
}
else /* ( HB_ISCHAR( 1 ) && HB_ISCHAR( 2 ) ) */
{
@@ -273,6 +273,6 @@ HB_FUNC( POSEQUAL )
if( pSubst != NULL )
hb_itemReturnRelease( pSubst );
else
hb_retni( 0 );
hb_retns( 0 );
}
}

View File

@@ -214,11 +214,11 @@ HB_FUNC( PRINTSEND )
hb_fsClose( hFile );
}
}
hb_retnl( usRet );
hb_retns( usRet );
#else
hb_retnl( 0 );
hb_retns( 0 );
#endif
}

View File

@@ -105,7 +105,7 @@ HB_FUNC( CHARRELA )
/* check for empty strings */
if( ( sStrToMatchLen1 == 0 ) || ( sStrToMatchLen2 == 0 ) )
{
hb_retni( 0 );
hb_retns( 0 );
return;
}
@@ -126,7 +126,7 @@ HB_FUNC( CHARRELA )
if( pc1 - pcString1 == pc2 - pcString2 )
{
/* correlation found */
hb_retnl( ( pc1 - pcString1 ) + 1 );
hb_retns( ( pc1 - pcString1 ) + 1 );
return;
}
else
@@ -143,7 +143,7 @@ HB_FUNC( CHARRELA )
}
}
hb_retni( 0 );
hb_retns( 0 );
}
else /* HB_ISCHAR( 1 ) && HB_ISCHAR( 2 ) && HB_ISCHAR( 3 ) && HB_ISCHAR( 4 ) */
{
@@ -160,7 +160,7 @@ HB_FUNC( CHARRELA )
if( pSubst != NULL )
hb_itemReturnRelease( pSubst );
else
hb_retni( 0 );
hb_retns( 0 );
}
}

View File

@@ -316,7 +316,7 @@ HB_FUNC( SCREENSTR )
{
int iRow, iCol, iMaxRow, iMaxCol, iC;
char * pBuffer, * szText;
HB_SIZE ulSize, ulCount = ULONG_MAX;
HB_SIZE ulSize, ulCount = HB_SIZE_MAX;
hb_gtGetPos( &iRow, &iCol );
if( HB_ISNUM( 1 ) )
@@ -324,7 +324,7 @@ HB_FUNC( SCREENSTR )
if( HB_ISNUM( 2 ) )
iCol = hb_parni( 2 );
if( HB_ISNUM( 3 ) )
ulCount = hb_parnl( 3 );
ulCount = hb_parns( 3 );
iMaxRow = hb_gtMaxRow();
iMaxCol = hb_gtMaxCol();

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_ULONG ulTokenCounter = 0;
HB_ULONG ulSkip;
HB_SIZE ulTokenCounter = 0;
HB_SIZE ulSkip;
const char *pcSubStr;
char *pcRet = NULL;
HB_SIZE sSubStrLen;
HB_SIZE sRetStrLen = 0;
HB_ULONG ulToken = 0;
HB_ULONG ulSkipCnt;
HB_SIZE ulToken = 0;
HB_SIZE ulSkipCnt;
const char *pc;
/* separator string */
@@ -126,27 +126,27 @@ static void do_token1( int iSwitch )
/* token counter */
if( iSwitch != DO_TOKEN1_NUMTOKEN )
ulTokenCounter = hb_parnl( 3 );
ulTokenCounter = hb_parns( 3 );
if( ulTokenCounter == 0 )
ulTokenCounter = ULONG_MAX;
ulTokenCounter = HB_SIZE_MAX;
/* skip width */
if( iSwitch == DO_TOKEN1_NUMTOKEN )
{
if( HB_ISNUM( 3 ) )
ulSkip = hb_parnl( 3 );
ulSkip = hb_parns( 3 );
else
ulSkip = ULONG_MAX;
ulSkip = HB_SIZE_MAX;
}
else
{
if( HB_ISNUM( 4 ) )
ulSkip = hb_parnl( 4 );
ulSkip = hb_parns( 4 );
else
ulSkip = ULONG_MAX;
ulSkip = HB_SIZE_MAX;
}
if( ulSkip == 0 )
ulSkip = ULONG_MAX;
ulSkip = HB_SIZE_MAX;
/* prepare return value for TOKENUPPER/TOKENLOWER */
if( iSwitch == DO_TOKEN1_TOKENLOWER || iSwitch == DO_TOKEN1_TOKENUPPER )
@@ -154,7 +154,7 @@ static void do_token1( int iSwitch )
if( sStrLen == 0 )
{
if( iNoRef )
hb_retl( 0 );
hb_retl( HB_FALSE );
else
hb_retc_null();
return;
@@ -219,11 +219,11 @@ static void do_token1( int iSwitch )
break;
}
case DO_TOKEN1_NUMTOKEN:
hb_retnl( ulToken );
hb_retns( ulToken );
break;
case DO_TOKEN1_ATTOKEN:
hb_retni( 0 );
hb_retns( 0 );
break;
case DO_TOKEN1_TOKENLOWER:
@@ -234,7 +234,7 @@ static void do_token1( int iSwitch )
if( iNoRef )
{
hb_xfree( pcRet );
hb_retl( 0 );
hb_retl( HB_FALSE );
}
else
hb_retclen_buffer( pcRet, sRetStrLen );
@@ -326,15 +326,15 @@ static void do_token1( int iSwitch )
break;
}
case DO_TOKEN1_NUMTOKEN:
hb_retnl( ulToken );
hb_retns( ulToken );
break;
case DO_TOKEN1_ATTOKEN:
if( ( ulTokenCounter == 0xFFFFFFFFUL ) ||
( ulToken == ulTokenCounter ) )
hb_retnl( pcSubStr - pcString + 1 );
hb_retns( pcSubStr - pcString + 1 );
else
hb_retni( 0 );
hb_retns( 0 );
break;
case DO_TOKEN1_TOKENLOWER:
@@ -345,7 +345,7 @@ static void do_token1( int iSwitch )
if( iNoRef )
{
hb_xfree( pcRet );
hb_retl( 0 );
hb_retl( HB_FALSE );
}
else
hb_retclen_buffer( pcRet, sRetStrLen );
@@ -386,7 +386,7 @@ static void do_token1( int iSwitch )
else if( !iNoRef )
hb_retc_null();
else
hb_retl( 0 );
hb_retl( HB_FALSE );
break;
}
case DO_TOKEN1_TOKENLOWER:
@@ -409,7 +409,7 @@ static void do_token1( int iSwitch )
else if( !iNoRef )
hb_retc_null();
else
hb_retl( 0 );
hb_retl( HB_FALSE );
break;
}
case DO_TOKEN1_NUMTOKEN:
@@ -429,7 +429,7 @@ static void do_token1( int iSwitch )
if( pSubst != NULL )
hb_itemReturnRelease( pSubst );
else
hb_retni( 0 );
hb_retns( 0 );
break;
}
}

View File

@@ -375,7 +375,7 @@ HB_FUNC( TOKENINIT )
HB_SIZE sStrLen = hb_parclen( 1 );
const char *pcSeparatorStr;
HB_SIZE sSeparatorStrLen;
HB_ULONG ulSkipCnt, ulSkip;
HB_SIZE ulSkipCnt, ulSkip;
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_parnl( 3 );
ulSkip = hb_parns( 3 );
else
ulSkip = ULONG_MAX;
ulSkip = HB_SIZE_MAX;
if( ulSkip == 0 )
ulSkip = ULONG_MAX;
ulSkip = HB_SIZE_MAX;
/* allocate new token environment */
if( ( sTokenEnvironment = sTokEnvNew() ) == NULL )
@@ -410,7 +410,7 @@ HB_FUNC( TOKENINIT )
NULL, HB_ERR_FUNCNAME, 0, EF_CANDEFAULT,
HB_ERR_ARGS_BASEPARAMS );
}
hb_retl( 0 );
hb_retl( HB_FALSE );
return;
}
@@ -456,7 +456,7 @@ HB_FUNC( TOKENINIT )
HB_ERR_ARGS_BASEPARAMS );
}
sTokEnvDel( sTokenEnvironment );
hb_retl( 0 );
hb_retl( HB_FALSE );
return;
}
@@ -474,7 +474,7 @@ HB_FUNC( TOKENINIT )
{
sTokSet( sTokenEnvironment );
}
hb_retl( 1 );
hb_retl( HB_TRUE );
}
else /* HB_ISCHAR( 1 ) */
{
@@ -509,7 +509,7 @@ HB_FUNC( TOKENINIT )
if( pSubst != NULL )
hb_itemReturnRelease( pSubst );
else
hb_retl( 0 );
hb_retl( HB_FALSE );
}
}
}
@@ -626,7 +626,7 @@ HB_FUNC( TOKENNEXT )
/* nth token or next token ? */
if( HB_ISNUM( 2 ) )
{
psTokenPosition = sTokEnvGetPosIndex( sTokenEnvironment, hb_parnl( 2 ) - 1 );
psTokenPosition = sTokEnvGetPosIndex( sTokenEnvironment, hb_parns( 2 ) - 1 );
/* no increment here */
}
else
@@ -734,7 +734,7 @@ HB_FUNC( TOKENNUM )
sTokenEnvironment = s_sTokenEnvironment;
if( ( void * ) sTokenEnvironment != NULL )
hb_retnl( sTokEnvGetCnt( sTokenEnvironment ) );
hb_retns( sTokEnvGetCnt( sTokenEnvironment ) );
else
{
PHB_ITEM pSubst = NULL;
@@ -749,7 +749,7 @@ HB_FUNC( TOKENNUM )
if( pSubst != NULL )
hb_itemReturnRelease( pSubst );
else
hb_retni( 0 );
hb_retns( 0 );
}
}
@@ -823,7 +823,7 @@ HB_FUNC( TOKENEND )
hb_itemReturnRelease( pSubst );
else
/* it is CTIII behaviour to return .T. if there's no string TOKENINIT'ed */
hb_retl( 1 );
hb_retl( HB_TRUE );
}
}
@@ -871,10 +871,10 @@ HB_FUNC( TOKENEXIT )
if( s_sTokenEnvironment != NULL )
{
sTokExit( NULL );
hb_retl( 1 );
hb_retl( HB_TRUE );
}
else
hb_retl( 0 );
hb_retl( HB_FALSE );
}
@@ -958,12 +958,12 @@ HB_FUNC( TOKENAT )
ct_error( ( HB_USHORT ) iArgErrorMode, EG_ARG, CT_ERROR_TOKENAT,
NULL, HB_ERR_FUNCNAME, 0, EF_CANDEFAULT, HB_ERR_ARGS_BASEPARAMS );
}
hb_retni( 0 );
hb_retns( 0 );
return;
}
if( HB_ISNUM( 2 ) )
sCurrentIndex = hb_parnl( 2 ) - 1;
sCurrentIndex = hb_parns( 2 ) - 1;
else
sCurrentIndex = sTokEnvGetPtr( sTokenEnvironment );
@@ -977,14 +977,14 @@ HB_FUNC( TOKENAT )
ct_error( ( HB_USHORT ) iArgErrorMode, EG_ARG, CT_ERROR_TOKENAT, NULL,
HB_ERR_FUNCNAME, 0, EF_CANDEFAULT, HB_ERR_ARGS_BASEPARAMS );
}
hb_retni( 0 );
hb_retns( 0 );
return;
}
if( iSeparatorPos )
hb_retnl( psTokenPosition->sEndPos + 1 );
hb_retns( psTokenPosition->sEndPos + 1 );
else
hb_retnl( psTokenPosition->sStartPos + 1 );
hb_retns( psTokenPosition->sStartPos + 1 );
}

View File

@@ -206,7 +206,7 @@ HB_FUNC( WORDREPL )
if( iNoRet )
{
hb_retl( 0 );
hb_retl( HB_FALSE );
hb_xfree( pcRet );
}
else
@@ -230,7 +230,7 @@ HB_FUNC( WORDREPL )
if( pSubst != NULL )
hb_itemReturnRelease( pSubst );
else if( iNoRet )
hb_retl( 0 );
hb_retl( HB_FALSE );
else if( HB_ISCHAR( 2 ) )
hb_retclen( hb_parc( 2 ), hb_parclen( 2 ) );
else

View File

@@ -26,7 +26,7 @@ HB_FUNC( GT_ASCPOS )
if (HB_ISCHAR(1) && HB_ISNUM(2)) {
s = hb_parc(1);
p = hb_parnl(2);
p = hb_parns(2);
p--; /* decrement p to adjust for c strings */
/* starting at position 0 */

View File

@@ -40,10 +40,10 @@ HB_FUNC( GT_ATDIFF )
pos++;
if (pos > len) /* strings match exactly!!! */
hb_retnl(0);
hb_retns(0);
else
hb_retnl(pos);
hb_retns(pos);
} else {
hb_retni(-1); /* parameter mismatch - error -1 */
hb_retns(-1); /* parameter mismatch - error -1 */
}
}

View File

@@ -35,8 +35,8 @@ HB_FUNC( GT_CHRCOUNT )
if (*s1 == *s2) /* character matches s1 */
count++; /* increment counter */
hb_retnl(count); /* return result */
hb_retns(count); /* return result */
} else {
hb_retnl(-1); /* parameter mismatch - error -1 */
hb_retns(-1); /* parameter mismatch - error -1 */
}
}

View File

@@ -35,8 +35,8 @@ HB_FUNC( GT_CHRTOTAL )
if (s1[p1] == s2[p2])
count++; /* increment counter */
hb_retnl(count); /* return result */
hb_retns(count); /* return result */
} else {
hb_retnl(-1); /* parameter mismatch - error -1 */
hb_retns(-1); /* parameter mismatch - error -1 */
}
}

View File

@@ -48,8 +48,8 @@ HB_FUNC( GT_STRCOUNT )
count++;
}
hb_retnl(count); /* return result */
hb_retns(count); /* return result */
} else {
hb_retnl(-1); /* parameter mismatch - error -1 */
hb_retns(-1); /* parameter mismatch - error -1 */
}
}

View File

@@ -39,8 +39,8 @@ HB_FUNC( GT_STRCSPN )
if (p2 < l2)
break;
}
hb_retnl(p1);
hb_retns(p1);
} else {
hb_retnl(-1); /* parameter mismatch - error -1 */
hb_retns(-1); /* parameter mismatch - error -1 */
}
}

View File

@@ -39,9 +39,9 @@ HB_FUNC( GT_STRLEFT )
if (p2 == l2)
break;
}
hb_retnl(p1);
hb_retns(p1);
} else {
hb_retnl(-1); /* parameter mismatch - error NullStr */
hb_retns(-1); /* parameter mismatch - error NullStr */
}
}

View File

@@ -39,9 +39,9 @@ HB_FUNC( GT_STRRIGHT )
if (p2 == l2)
break;
}
hb_retnl(l1 - p1 - 1);
hb_retns(l1 - p1 - 1);
} else {
hb_retnl(-1); /* parameter mismatch - error NullStr */
hb_retns(-1); /* parameter mismatch - error NullStr */
}
}

View File

@@ -732,7 +732,7 @@ static PHB_FILE s_fileOpen( const char * szName, const char * szDefExt, HB_USHOR
HB_FHANDLE hFile;
char szNameNew[ HB_PATH_MAX + 1 ];
HB_USHORT uiFlags;
HB_ULONG ulLen;
HB_SIZE ulLen;
HB_SYMBOL_UNUSED( pPaths );
HB_SYMBOL_UNUSED( pError );

View File

@@ -330,7 +330,7 @@ HB_FUNC( SQL_SPRINTF )
} /* f == Index % of n */
if( f < i ){
i -= 2; /* i == strlen(cParFrm) */
hb_itemPutNL( pItmPar, ulResPos + f );
hb_itemPutNS( pItmPar, ulResPos + f );
}else{
iErrorPar = 1; break;
}

View File

@@ -58,7 +58,7 @@ static const char *hb_strtoken(const char *szText,
HB_FUNC( STRTOKEN )
{
const char *szText;
HB_ISIZ lIndex = hb_parnl(2);
HB_ISIZ lIndex = hb_parns(2);
char cDelimiter = *hb_parc(3);
HB_ISIZ lLen;
@@ -67,7 +67,7 @@ HB_FUNC( STRTOKEN )
szText = hb_strtoken(hb_parc(1), hb_parclen(1), lIndex, cDelimiter, &lLen);
hb_stornl(lLen, 4);
hb_storns(lLen, 4);
hb_retclen(szText, lLen);
}

View File

@@ -195,7 +195,7 @@ HB_FUNC( HB_TABEXPAND )
{
const char * szText = hb_parcx( 1 );
HB_ISIZ lStrLen = hb_parclen( 1 );
HB_SIZE uiTabLen = hb_parnl( 2 );
HB_SIZE uiTabLen = hb_parns( 2 );
HB_SIZE uiTabCount = 0;
HB_ISIZ lPos, lSize;
char * szRet;
@@ -247,7 +247,7 @@ HB_FUNC( HB_READLINE )
ulTextLen = hb_parclen(1);
uiTabLen = hb_parclen(4);
ulStartOffset = hb_parnl( 6 );
ulStartOffset = hb_parns( 6 );
if( ! ( HB_ISARRAY( 2 ) || HB_ISCHAR( 2 ) ) )
{
@@ -297,8 +297,8 @@ HB_FUNC( HB_READLINE )
hb_storl( bFound, 7 );
hb_storl( bEOF, 8 );
hb_stornl( lEnd + ulStartOffset + 1, 9 );
hb_stornl( ulEndOffset + ulStartOffset + 1, 10 );
hb_storns( lEnd + ulStartOffset + 1, 9 );
hb_storns( ulEndOffset + ulStartOffset + 1, 10 );
if( bAlloc_Term1 )
hb_itemRelease( pTerm1 );

View File

@@ -625,7 +625,11 @@ typedef HB_U32 HB_FATTR;
#endif
/* maximum index size */
#define HB_SIZE_MAX ULONG_MAX
#if defined( HB_OS_WIN_64 )
# define HB_SIZE_MAX ULONGLONG_MAX
#else
# define HB_SIZE_MAX ULONG_MAX
#endif
/* maximum length of double number in decimal representation:
log10(2^1024) ~ 308.25 */

View File

@@ -146,7 +146,7 @@ PHB_FNAME hb_fsFNameSplit( const char * pszFileName )
if( pszFileName )
{
char * pszPos, cDirSep;
int iSize, iPos;
HB_ISIZ iSize, iPos;
iPos = iSize = hb_strnlen( pszFileName, HB_PATH_MAX - 1 );
cDirSep = ( char ) hb_setGetDirSeparator();

View File

@@ -535,7 +535,7 @@ double hb_numDecConv( double dNum, int iDec )
return hb_numRound( dNum, 0 );
}
static HB_BOOL hb_str2number( HB_BOOL fPCode, const char* szNum, HB_SIZE ulLen, HB_MAXINT * lVal, double * dVal, int * piDec, int * piWidth )
static HB_BOOL hb_str2number( HB_BOOL fPCode, const char * szNum, HB_SIZE ulLen, HB_MAXINT * lVal, double * dVal, int * piDec, int * piWidth )
{
HB_BOOL fDbl = HB_FALSE, fDec = HB_FALSE, fNeg, fHex = HB_FALSE;
HB_SIZE ulPos = 0;

View File

@@ -68,19 +68,19 @@ static HB_SIZE hb_wcnlen( const wchar_t * szText, HB_SIZE count )
void hb_wcntombcpy( char * dstA, const wchar_t * srcW, HB_SIZE ulLen )
{
WideCharToMultiByte( CP_ACP, 0, srcW, -1, dstA, ulLen, NULL, NULL );
dstA[ ulLen ] = '\0';
WideCharToMultiByte( CP_ACP, 0, srcW, -1, dstA, ( int ) ulLen, NULL, NULL );
dstA[ ( int ) ulLen ] = '\0';
}
void hb_mbntowccpy( wchar_t * dstW, const char * srcA, HB_SIZE ulLen )
{
MultiByteToWideChar( CP_ACP, 0, srcA, -1, dstW, ulLen );
dstW[ ulLen ] = L'\0';
MultiByteToWideChar( CP_ACP, 0, srcA, -1, dstW, ( int ) ulLen );
dstW[ ( int ) ulLen ] = L'\0';
}
wchar_t * hb_mbtowc( const char * srcA )
{
DWORD length;
int length;
wchar_t *dstW;
length = MultiByteToWideChar( CP_ACP, 0, srcA, -1, NULL, 0 );
@@ -92,7 +92,7 @@ wchar_t * hb_mbtowc( const char * srcA )
char * hb_wctomb( const wchar_t * srcW )
{
DWORD length;
int length;
char *dstA;
length = WideCharToMultiByte( CP_ACP, 0, srcW, -1, NULL, 0, NULL, NULL );
@@ -104,13 +104,13 @@ char * hb_wctomb( const wchar_t * srcW )
wchar_t * hb_mbntowc( const char * srcA, HB_SIZE ulLen )
{
DWORD length;
int length;
wchar_t *dstW;
ulLen = hb_strnlen( srcA, ulLen );
length = MultiByteToWideChar( CP_ACP, 0, srcA, ulLen, NULL, 0 );
length = MultiByteToWideChar( CP_ACP, 0, srcA, ( int ) ulLen, NULL, 0 );
dstW = ( wchar_t * ) hb_xgrab( ( length + 1 ) * sizeof( wchar_t ) );
MultiByteToWideChar( CP_ACP, 0, srcA, ulLen, dstW, length );
MultiByteToWideChar( CP_ACP, 0, srcA, ( int ) ulLen, dstW, length );
dstW[ length ] = L'\0';
return dstW;
@@ -118,13 +118,13 @@ wchar_t * hb_mbntowc( const char * srcA, HB_SIZE ulLen )
char * hb_wcntomb( const wchar_t * srcW, HB_SIZE ulLen )
{
DWORD length;
int length;
char *dstA;
ulLen = hb_wcnlen( srcW, ulLen );
length = WideCharToMultiByte( CP_ACP, 0, srcW, ulLen, NULL, 0, NULL, NULL );
length = WideCharToMultiByte( CP_ACP, 0, srcW, ( int ) ulLen, NULL, 0, NULL, NULL );
dstA = ( char * ) hb_xgrab( length + 1 );
WideCharToMultiByte( CP_ACP, 0, srcW, ulLen, dstA, length, NULL, NULL );
WideCharToMultiByte( CP_ACP, 0, srcW, ( int ) ulLen, dstA, length, NULL, NULL );
dstA[ length ] = '\0';
return dstA;

View File

@@ -714,7 +714,7 @@ static void hb_dbgAddStatic( HB_DEBUGINFO * info, const char * szName, int nInde
static void hb_dbgAddStopLines( PHB_ITEM pItem )
{
int i, nLinesLen;
HB_ISIZ i, nLinesLen;
HB_DBGCOMMON_LOCK
@@ -724,8 +724,8 @@ static void hb_dbgAddStopLines( PHB_ITEM pItem )
}
else
{
int j;
int nItemLen = hb_itemSize( pItem );
HB_ISIZ j;
HB_ISIZ nItemLen = hb_itemSize( pItem );
nLinesLen = hb_itemSize( s_common.pStopLines );
@@ -743,17 +743,17 @@ static void hb_dbgAddStopLines( PHB_ITEM pItem )
if( !strcmp( hb_arrayGetCPtr( pLines, 1 ), szModule ) )
{
/* Merge stopline info */
int nOrigMin = hb_arrayGetNL( pLines, 2 );
int nNewMin = hb_arrayGetNL( pEntry, 2 );
int nOrigLen = hb_arrayGetCLen( pLines, 3 );
int nNewLen = hb_arrayGetCLen( pEntry, 3 );
int nMin = HB_MIN( nNewMin, nOrigMin );
int nMax = HB_MAX( nNewMin + ( nNewLen << 3 ) - 1,
nOrigMin + ( nOrigLen << 3 ) - 1 );
HB_ISIZ nOrigMin = hb_arrayGetNS( pLines, 2 );
HB_ISIZ nNewMin = hb_arrayGetNS( pEntry, 2 );
HB_ISIZ nOrigLen = hb_arrayGetCLen( pLines, 3 );
HB_ISIZ nNewLen = hb_arrayGetCLen( pEntry, 3 );
HB_ISIZ nMin = HB_MIN( nNewMin, nOrigMin );
HB_ISIZ nMax = HB_MAX( nNewMin + ( nNewLen << 3 ) - 1,
nOrigMin + ( nOrigLen << 3 ) - 1 );
const char * pOrigBuffer = hb_arrayGetCPtr( pLines, 3 );
const char * pNewBuffer = hb_arrayGetCPtr( pEntry, 3 );
int nLen = ( ( nMax - nMin ) >> 3 ) + 1;
int k;
HB_ISIZ nLen = ( ( nMax - nMin ) >> 3 ) + 1;
HB_ISIZ k;
char * pBuffer = ( char * ) hb_xgrab( nLen + 1 );
hb_xmemset( pBuffer, 0, nLen );
@@ -766,7 +766,7 @@ static void hb_dbgAddStopLines( PHB_ITEM pItem )
for( k = 0; k < nOrigLen; k++ )
pBuffer[ nOrigMin + k ] |= pOrigBuffer[ k ];
hb_arraySetNL( pLines, 2, nMin );
hb_arraySetNS( pLines, 2, nMin );
if( !hb_arraySetCLPtr( pLines, 3, pBuffer, nLen ) )
hb_xfree( pBuffer );
bFound = HB_TRUE;
@@ -1047,7 +1047,7 @@ static PHB_ITEM hb_dbgEvalMakeBlock( HB_WATCHPOINT * watch )
PHB_ITEM pBlock;
HB_BOOL bAfterId = HB_FALSE;
char * s;
int buffsize;
HB_ISIZ buffsize;
watch->nVars = 0;
while( watch->szExpr[ i ] )
@@ -1350,8 +1350,8 @@ PHB_ITEM hb_dbgGetExpressionValue( void * handle, const char *expression )
PHB_ITEM hb_dbgGetSourceFiles( void * handle )
{
PHB_ITEM ret;
int nModules;
int i;
HB_ISIZ nModules;
HB_ISIZ i;
/* HB_DEBUGINFO * info = ( HB_DEBUGINFO * ) handle; */
HB_SYMBOL_UNUSED( handle );
@@ -1403,8 +1403,8 @@ static HB_BOOL hb_dbgIsBreakPoint( HB_DEBUGINFO * info, const char * szModule, i
HB_BOOL hb_dbgIsValidStopLine( void * handle, const char * szModule, int nLine )
{
HB_BOOL fResult = HB_FALSE;
int nModules;
int i;
HB_ISIZ nModules;
HB_ISIZ i;
/* HB_DEBUGINFO * info = ( HB_DEBUGINFO * ) handle; */
HB_SYMBOL_UNUSED( handle );

View File

@@ -835,7 +835,7 @@ static void hb_gt_pca_Redraw( PHB_GT pGT, int iRow, int iCol, int iSize )
s_sTransBuf, &ulLen,
&s_sTransBuf, &s_ulTransBufSize,
s_cdpHost, s_cdpTerm );
hb_gt_pca_AnsiPutStr( iRow, iCol, iColor2, buffer, ulLen );
hb_gt_pca_AnsiPutStr( iRow, iCol, iColor2, buffer, ( int ) ulLen );
}
else
hb_gt_pca_AnsiPutStr( iRow, iCol, iColor2, s_sLineBuf, iLen );
@@ -857,7 +857,7 @@ static void hb_gt_pca_Redraw( PHB_GT pGT, int iRow, int iCol, int iSize )
s_sTransBuf, &ulLen,
&s_sTransBuf, &s_ulTransBufSize,
s_cdpHost, s_cdpTerm );
hb_gt_pca_AnsiPutStr( iRow, iCol, iColor2, buffer, ulLen );
hb_gt_pca_AnsiPutStr( iRow, iCol, iColor2, buffer, ( int ) ulLen );
}
else
hb_gt_pca_AnsiPutStr( iRow, iCol, iColor2, s_sLineBuf, iLen );

View File

@@ -259,7 +259,7 @@ void hb_md5( const void * data, HB_SIZE ulLen, char * digest )
const unsigned char * ucdata = ( const unsigned char * ) data;
HB_UCHAR buf[ 128 ];
MD5_BUF md5;
int i, n;
HB_ISIZ i, n;
/* perform startup procedures */
hb_md5accinit( md5.accum );

View File

@@ -105,7 +105,7 @@ static int hb_regexec( PHB_REGEX pRegEx, const char * szString, HB_SIZE ulLen,
int iResult, i;
iResult = pcre_exec( pRegEx->re_pcre, NULL /* pcre_extra */,
szString, ulLen, 0 /* startoffset */,
szString, ( int ) ulLen, 0 /* startoffset */,
pRegEx->iEFlags, aMatches, HB_REGMATCH_SIZE( iMatches ) );
if( iResult == 0 )
{
@@ -194,8 +194,8 @@ HB_FUNC( HB_ATX )
if( pRegEx )
{
HB_SIZE ulLen = hb_itemGetCLen( pString );
HB_SIZE ulStart = hb_parnl( 4 );
HB_SIZE ulEnd = ( HB_SIZE ) hb_parnldef( 5, ulLen );
HB_SIZE ulStart = hb_parns( 4 );
HB_SIZE ulEnd = hb_parnsdef( 5, ulLen );
if( ulLen && ulStart <= ulLen && ulStart <= ulEnd )
{
@@ -224,13 +224,13 @@ HB_FUNC( HB_ATX )
hb_regexFree( pRegEx );
hb_stornl( ulStart, 4 );
hb_stornl( ulLen, 5 );
hb_storns( ulStart, 4 );
hb_storns( ulLen, 5 );
}
else
{
hb_stornl( 0, 4 );
hb_stornl( 0, 5 );
hb_storns( 0, 4 );
hb_storns( 0, 5 );
}
}
else
@@ -337,15 +337,15 @@ static HB_BOOL hb_regex( int iRequest )
/* matched string */
hb_arraySetCL( pMatch, 1, pszString + iSO, iEO - iSO );
/* begin of match */
hb_arraySetNI( pMatch, 2, iSO + 1 );
hb_arraySetNS( pMatch, 2, iSO + 1 );
/* End of match */
hb_arraySetNI( pMatch, 3, iEO );
hb_arraySetNS( pMatch, 3, iEO );
}
else
{
hb_arraySetCL( pMatch, 1, NULL, 0 );
hb_arraySetNI( pMatch, 2, 0 );
hb_arraySetNI( pMatch, 3, 0 );
hb_arraySetNS( pMatch, 2, 0 );
hb_arraySetNS( pMatch, 3, 0 );
}
}
hb_itemReturnRelease( pRetArray );
@@ -384,15 +384,15 @@ static HB_BOOL hb_regex( int iRequest )
/* matched string */
hb_arraySetCL( pMatch, 1, pszString + iSO, iEO - iSO );
/* begin of match */
hb_arraySetNI( pMatch, 2, ulOffSet + iSO + 1 );
hb_arraySetNS( pMatch, 2, ulOffSet + iSO + 1 );
/* End of match */
hb_arraySetNI( pMatch, 3, ulOffSet + iEO );
hb_arraySetNS( pMatch, 3, ulOffSet + iEO );
}
else
{
hb_arraySetCL( pMatch, 1, NULL, 0 );
hb_arraySetNI( pMatch, 2, 0 );
hb_arraySetNI( pMatch, 3, 0 );
hb_arraySetNS( pMatch, 2, 0 );
hb_arraySetNS( pMatch, 3, 0 );
}
}
else
@@ -421,15 +421,15 @@ static HB_BOOL hb_regex( int iRequest )
/* matched string */
hb_arraySetCL( pMatch, 1, pszString + iSO, iEO - iSO );
/* begin of match */
hb_arraySetNI( pMatch, 2, ulOffSet + iSO + 1 );
hb_arraySetNS( pMatch, 2, ulOffSet + iSO + 1 );
/* End of match */
hb_arraySetNI( pMatch, 3, ulOffSet + iEO );
hb_arraySetNS( pMatch, 3, ulOffSet + iEO );
}
else
{
hb_arraySetCL( pMatch, 1, NULL, 0 );
hb_arraySetNI( pMatch, 2, 0 );
hb_arraySetNI( pMatch, 3, 0 );
hb_arraySetNS( pMatch, 2, 0 );
hb_arraySetNS( pMatch, 3, 0 );
}
}
else

View File

@@ -241,9 +241,9 @@ HB_FUNC( HB_TOKENCOUNT )
int iFlags;
if( hb_tokenParam( 2, 0, &szLine, &ulLen, &szDelim, &ulDelim, &iFlags ) )
hb_retnint( hb_tokenCount( szLine, ulLen, szDelim, ulDelim, iFlags ) );
hb_retns( hb_tokenCount( szLine, ulLen, szDelim, ulDelim, iFlags ) );
else
hb_retni( 0 );
hb_retns( 0 );
}
HB_FUNC( HB_TOKENGET )
@@ -255,7 +255,7 @@ HB_FUNC( HB_TOKENGET )
if( hb_tokenParam( 3, 0, &szLine, &ulLen, &szDelim, &ulDelim, &iFlags ) )
{
szLine = hb_tokenGet( szLine, ulLen, szDelim, ulDelim, iFlags,
hb_parnl( 2 ), &ulLen );
hb_parns( 2 ), &ulLen );
hb_retclen( szLine, ulLen );
}
else
@@ -272,7 +272,7 @@ HB_FUNC( HB_TOKENPTR )
HB_SIZE ulLen, ulDelim, ulSkip, ulToken;
int iFlags;
if( hb_tokenParam( 3, hb_parnl( 2 ), &szLine, &ulLen, &szDelim, &ulDelim, &iFlags ) )
if( hb_tokenParam( 3, hb_parns( 2 ), &szLine, &ulLen, &szDelim, &ulDelim, &iFlags ) )
{
szToken = hb_tokenGet( szLine, ulLen, szDelim, ulDelim, iFlags,
1, &ulToken );
@@ -282,13 +282,13 @@ HB_FUNC( HB_TOKENPTR )
ulSkip = hb_parclen( 1 ) + 1;
/* return position to start next search from */
hb_stornl( ulSkip, 2 );
hb_storns( ulSkip, 2 );
/* return token */
hb_retclen( szToken, ulToken );
}
else
{
hb_stornl( 0, 2 );
hb_storns( 0, 2 );
hb_retc_null();
}
}

View File

@@ -131,7 +131,7 @@ HB_FUNC( HB_ZCOMPRESSBOUND )
#endif
else if( HB_ISNUM( 1 ) )
#if defined( _HB_Z_COMPRESSBOUND )
hb_retnint( compressBound( ( uLong ) hb_parnint( 1 ) ) );
hb_retnint( compressBound( ( uLong ) hb_parns( 1 ) ) );
#else
hb_retnint( 0 );
#endif
@@ -193,7 +193,7 @@ HB_FUNC( HB_ZCOMPRESS )
}
else
{
ulDstLen = HB_ISNUM( 2 ) ? ( uLong ) hb_parnint( 2 ) :
ulDstLen = HB_ISNUM( 2 ) ? ( uLong ) hb_parns( 2 ) :
#if defined( _HB_Z_COMPRESSBOUND )
compressBound( ( uLong ) ulLen );
#else
@@ -262,8 +262,8 @@ HB_FUNC( HB_ZUNCOMPRESS )
}
else
{
ulDstLen = HB_ISNUM( 2 ) ? ( uLong ) hb_parnint( 2 ) :
hb_zlibUncompressedSize( szData, ulLen, &iResult );
ulDstLen = ( uLong ) ( HB_ISNUM( 2 ) ? hb_parns( 2 ) :
hb_zlibUncompressedSize( szData, ulLen, &iResult ) );
if( iResult == Z_OK )
{
pDest = ( char * ) hb_xalloc( ulDstLen + 1 );

View File

@@ -178,7 +178,7 @@ HB_FUNC( HB_GZREAD )
if( ulLim < ulLen )
ulLen = ulLim;
}
hb_retni( gzread( gz, szBuffer, ulLen ) );
hb_retni( gzread( gz, szBuffer, ( unsigned ) ulLen ) );
}
}
else
@@ -195,8 +195,8 @@ HB_FUNC( HB_GZWRITE )
{
gzFile gz = hb_gzParam( 1 );
if( gz )
hb_retni( gzwrite( gz, szData, HB_ISNUM( 3 ) ?
( HB_SIZE ) hb_parnl( 3 ) : hb_parclen( 2 ) ) );
hb_retni( gzwrite( gz, szData,
( unsigned ) ( HB_ISNUM( 3 ) ? hb_parns( 3 ) : hb_parclen( 2 ) ) ) );
}
else
hb_errRT_BASE_SubstR( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );

View File

@@ -70,5 +70,5 @@ HB_FUNC( LENNUM )
}
}
hb_retnl( ulLen );
hb_retns( ulLen );
}

View File

@@ -185,7 +185,7 @@ HB_FUNC( HB_HKEYAT )
if( pHash && pPos )
{
PHB_ITEM pKey = hb_hashGetKeyAt( pHash, hb_itemGetNL( pPos ) );
PHB_ITEM pKey = hb_hashGetKeyAt( pHash, hb_itemGetNS( pPos ) );
if( pKey )
hb_itemReturn( pKey );
else
@@ -203,7 +203,7 @@ HB_FUNC( HB_HVALUEAT )
if( pHash && pPos )
{
PHB_ITEM pItem = hb_hashGetValueAt( pHash, hb_itemGetNL( pPos ) );
PHB_ITEM pItem = hb_hashGetValueAt( pHash, hb_itemGetNS( pPos ) );
if( pItem )
{
if( pValue )
@@ -226,8 +226,8 @@ HB_FUNC( HB_HPAIRAT )
if( pHash && pPos )
{
PHB_ITEM pKey = hb_hashGetKeyAt( pHash, hb_itemGetNL( pPos ) );
PHB_ITEM pValue = hb_hashGetValueAt( pHash, hb_itemGetNL( pPos ) );
PHB_ITEM pKey = hb_hashGetKeyAt( pHash, hb_itemGetNS( pPos ) );
PHB_ITEM pValue = hb_hashGetValueAt( pHash, hb_itemGetNS( pPos ) );
if( pKey && pValue )
{
PHB_ITEM pDstKey = hb_param( 3, HB_IT_BYREF );
@@ -259,7 +259,7 @@ HB_FUNC( HB_HDELAT )
if( pHash && pPos )
{
if( hb_hashDelAt( pHash, hb_itemGetNL( pPos ) ) )
if( hb_hashDelAt( pHash, hb_itemGetNS( pPos ) ) )
hb_itemReturn( pHash );
else
hb_errRT_BASE( EG_BOUND, 1133, NULL, hb_langDGetErrorDesc( EG_ARRASSIGN ), 2, pHash, pPos );
@@ -327,10 +327,10 @@ HB_FUNC( HB_HCOPY )
{
HB_SIZE ulLen = hb_hashLen( pSource ), ulStart, ulCount;
ulStart = hb_parnl( 3 );
ulStart = hb_parns( 3 );
if( !ulStart )
++ulStart;
ulCount = HB_ISNUM( 4 ) ? ( HB_SIZE ) hb_parnl( 4 ) : ulLen - ulStart + 1;
ulCount = HB_ISNUM( 4 ) ? ( HB_SIZE ) hb_parns( 4 ) : ulLen - ulStart + 1;
while( ulCount-- )
{
@@ -400,10 +400,10 @@ HB_FUNC( HB_HEVAL )
{
HB_SIZE ulLen = hb_hashLen( pHash ), ulStart, ulCount;
ulStart = hb_parnl( 3 );
ulStart = hb_parns( 3 );
if( !ulStart )
++ulStart;
ulCount = HB_ISNUM( 4 ) ? ( HB_SIZE ) hb_parnl( 4 ) : ulLen - ulStart + 1;
ulCount = HB_ISNUM( 4 ) ? ( HB_SIZE ) hb_parns( 4 ) : ulLen - ulStart + 1;
while( ulCount-- )
{
@@ -439,10 +439,10 @@ HB_FUNC( HB_HSCAN )
HB_BOOL fExact = hb_parl( 5 ), fFound = HB_FALSE;
HB_SIZE ulLen = hb_hashLen( pHash ), ulStart, ulCount;
ulStart = hb_parnl( 3 );
ulStart = hb_parns( 3 );
if( !ulStart )
++ulStart;
ulCount = HB_ISNUM( 4 ) ? ( HB_SIZE ) hb_parnl( 4 ) : ulLen - ulStart + 1;
ulCount = HB_ISNUM( 4 ) ? ( HB_SIZE ) hb_parns( 4 ) : ulLen - ulStart + 1;
if( HB_IS_BLOCK( pValue ) )
{
@@ -770,7 +770,7 @@ HB_FUNC( HB_HALLOCATE )
if( pHash && pValue )
{
HB_ISIZ lMem = hb_itemGetNL( pValue );
HB_ISIZ lMem = hb_itemGetNS( pValue );
if( lMem >= 0 )
hb_hashPreallocate( pHash, lMem );
}

View File

@@ -5614,7 +5614,7 @@ static void hb_vmPushAParams( void )
pCount = hb_stackAllocItem();
hb_itemCopy( pCount, pArray->item.asArray.value->pItems );
hb_itemMove( pArray, pCount );
hb_itemPutNL( pCount, ulLen );
hb_itemPutNS( pCount, ulLen );
}
else
hb_itemPutNL( pArray, 0 );