2008-09-05 18:12 UTC+0200 Viktor Szakats (harbour.01 syenar hu)

* contrib/hbapollo/apollo.c
   * contrib/hbclipsm/gauge.c
   * contrib/hbct/atadjust.c
   * contrib/hbct/atnum.c
   * contrib/hbct/atrepl.c
   * contrib/hbct/ctstr.c
   * contrib/hbct/ctwfunc.c
   * contrib/hbct/dattime2.c
   * contrib/hbct/dattime3.c
   * contrib/hbct/files.c
   * contrib/hbct/pack.c
   * contrib/hbct/print.c
   * contrib/hbct/setrc.c
   * contrib/hbfbird/firebird.c
   * contrib/hbhpdf/harupdf.c
   * contrib/hbmisc/hb_f.c
   * contrib/hbmzip/hbmzip.c
   * contrib/hbnf/descendn.c
   * contrib/hbnf/dispc.c
   * contrib/hbnf/ftattr.c
   * contrib/hbnf/ftshadow.c
   * contrib/hbnf/fttext.c
   * contrib/hbodbc/odbc.c
   * contrib/hbole/ole2.c
   * contrib/hbw32/dllcall.c
   * contrib/hbw32/tprinter.c
   * contrib/rddads/ads1.c
   * contrib/xhb/cstructc.c
   * contrib/xhb/hbxml.c
   * contrib/xhb/xhbmsgs.c
   * utils/hbmake/hbmgauge.c
     ! Fixed some MSVS 2008 -W4 warnings.
     ; There are quite some more.

   * contrib/hbhpdf/harupdf.c
     ! HPDF_ADDPAGELABEL() accepting first parameter wrongly.

   * contrib/hbfbird/firebird.c
     ! FBQUERY() potential GPF when using value from freed memory.

   * doc/whatsnew.txt
     * Updated for latest fixes.
This commit is contained in:
Viktor Szakats
2008-09-05 16:16:17 +00:00
parent ae70c2a356
commit ad9d0f3c47
33 changed files with 545 additions and 488 deletions

View File

@@ -8,6 +8,50 @@
2008-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org)
*/
2008-09-05 18:12 UTC+0200 Viktor Szakats (harbour.01 syenar hu)
* contrib/hbapollo/apollo.c
* contrib/hbclipsm/gauge.c
* contrib/hbct/atadjust.c
* contrib/hbct/atnum.c
* contrib/hbct/atrepl.c
* contrib/hbct/ctstr.c
* contrib/hbct/ctwfunc.c
* contrib/hbct/dattime2.c
* contrib/hbct/dattime3.c
* contrib/hbct/files.c
* contrib/hbct/pack.c
* contrib/hbct/print.c
* contrib/hbct/setrc.c
* contrib/hbfbird/firebird.c
* contrib/hbhpdf/harupdf.c
* contrib/hbmisc/hb_f.c
* contrib/hbmzip/hbmzip.c
* contrib/hbnf/descendn.c
* contrib/hbnf/dispc.c
* contrib/hbnf/ftattr.c
* contrib/hbnf/ftshadow.c
* contrib/hbnf/fttext.c
* contrib/hbodbc/odbc.c
* contrib/hbole/ole2.c
* contrib/hbw32/dllcall.c
* contrib/hbw32/tprinter.c
* contrib/rddads/ads1.c
* contrib/xhb/cstructc.c
* contrib/xhb/hbxml.c
* contrib/xhb/xhbmsgs.c
* utils/hbmake/hbmgauge.c
! Fixed some MSVS 2008 -W4 warnings.
; There are quite some more.
* contrib/hbhpdf/harupdf.c
! HPDF_ADDPAGELABEL() accepting first parameter wrongly.
* contrib/hbfbird/firebird.c
! FBQUERY() potential GPF when using value from freed memory.
* doc/whatsnew.txt
* Updated for latest fixes.
2008-09-05 17:41 UTC+0100 Miguel Angel Marchuet <miguelangel@marchuet.net>
* contrib/hbbmcdx/bmdbfcdx.c
! fixed dirty index reading.

View File

@@ -110,10 +110,10 @@ HB_FUNC( SX_CREATEEXEC )
* --------------------------------------------------*/
HB_FUNC( SX_CREATEFIELD )
{
sx_CreateField( ( PBYTE ) hb_parc( 1 ), /* Field name */
( PBYTE ) hb_parc( 2 ), /* Field type */
hb_parni( 3 ), /* Field lenght */
hb_parni( 4 ) ); /* Field decimals */
sx_CreateField( ( PBYTE ) hb_parc( 1 ), /* Field name */
( PBYTE ) hb_parc( 2 ), /* Field type */
( SHORT ) hb_parni( 3 ), /* Field lenght */
( SHORT ) hb_parni( 4 ) ); /* Field decimals */
}
@@ -124,10 +124,10 @@ HB_FUNC( SX_CREATEFIELD )
HB_FUNC( SX_CREATENEW )
{
hb_retni(
sx_CreateNew( ( PBYTE ) hb_parc( 1 ), /* Field name */
( PBYTE ) hb_parc( 2 ), /* Alias */
hb_parni( 3 ), /* RDE Type */
hb_parni( 4 ) ) ); /* The maximum number of fields to be added to the file structure */
sx_CreateNew( ( PBYTE ) hb_parc( 1 ), /* Field name */
( PBYTE ) hb_parc( 2 ), /* Alias */
( SHORT ) hb_parni( 3 ), /* RDE Type */
( SHORT ) hb_parni( 4 ) ) ); /* The maximum number of fields to be added to the file structure */
}
@@ -216,7 +216,7 @@ HB_FUNC( SX_INDEXTAG )
sx_IndexTag( ( PBYTE ) hb_parc( 1 ), /* Field name */
( PBYTE ) hb_parc( 2 ), /* Tag name */
( PBYTE ) hb_parc( 3 ), /* Index expression as a string */
hb_parni( 4 ), /* Option (0=Standard) (1=Unique) (2=Roll-Your-Own) */
( SHORT ) hb_parni( 4 ), /* Option (0=Standard) (1=Unique) (2=Roll-Your-Own) */
hb_parl( 5 ), /* True for a descend index */
( PBYTE ) hb_parc( 6) ) ); /* Condition */
}
@@ -257,13 +257,13 @@ HB_FUNC( SX_REPLACE )
switch( hb_parni( 2 ) )
{
case R_INTEGER :
case R_JULIAN : sx_Replace( ( PBYTE ) hb_parc( 1 ), hb_parni( 2 ), ( void * ) hb_parni( 3) ); break;
case R_LOGICAL : sx_Replace( ( PBYTE ) hb_parc( 1 ), hb_parni( 2 ), ( void * ) hb_parni( 3) ); break; /* TODO: somthing is wrong here... */
case R_LONG : sx_Replace( ( PBYTE ) hb_parc( 1 ), hb_parni( 2 ), ( void * ) hb_parnl( 3) ); break;
case R_JULIAN : sx_Replace( ( PBYTE ) hb_parc( 1 ), ( SHORT ) hb_parni( 2 ), ( void * ) hb_parni( 3 ) ); break;
case R_LOGICAL : sx_Replace( ( PBYTE ) hb_parc( 1 ), ( SHORT ) hb_parni( 2 ), ( void * ) hb_parni( 3 ) ); break; /* TODO: somthing is wrong here... */
case R_LONG : sx_Replace( ( PBYTE ) hb_parc( 1 ), ( SHORT ) hb_parni( 2 ), ( void * ) hb_parnl( 3 ) ); break;
case R_DOUBLE :
{
double d = hb_parnd( 3 );
sx_Replace( ( PBYTE ) hb_parc( 1 ), hb_parni( 2 ), ( void * ) &d );
sx_Replace( ( PBYTE ) hb_parc( 1 ), ( SHORT ) hb_parni( 2 ), ( void * ) &d );
break;
}
case R_CHAR :
@@ -271,8 +271,8 @@ HB_FUNC( SX_REPLACE )
case R_MEMO :
case R_BITMAP :
case R_BLOBFILE:
case R_BLOBPTR : sx_Replace( ( PBYTE ) hb_parc( 1 ), hb_parni( 2 ), ( void * ) hb_parc( 3) ); break;
default: sx_Replace( ( PBYTE ) hb_parc( 1 ), hb_parni( 2 ), ( void * ) hb_parc( 3) );
case R_BLOBPTR : sx_Replace( ( PBYTE ) hb_parc( 1 ), ( SHORT ) hb_parni( 2 ), ( void * ) hb_parc( 3 ) ); break;
default: sx_Replace( ( PBYTE ) hb_parc( 1 ), ( SHORT ) hb_parni( 2 ), ( void * ) hb_parc( 3 ) );
}
}
@@ -313,7 +313,7 @@ HB_FUNC( SX_SELECT )
* --------------------------------------------------*/
HB_FUNC( SX_SETCENTURY )
{
sx_SetCentury( hb_parl( 1 ) ); /* If True, the century digits will be returned.
sx_SetCentury( hb_parl( 1 ) ? 1 : 0 ); /* If True, the century digits will be returned.
* If False, they will not. */
}
@@ -324,8 +324,8 @@ HB_FUNC( SX_SETCENTURY )
* --------------------------------------------------*/
HB_FUNC( SX_SETDATEFORMAT )
{
sx_SetDateFormat( hb_parni( 1 ) ); /* If True, the century digits will be returned.
* If False, they will not. */
sx_SetDateFormat( hb_parl( 1 ) ? 1 : 0 ); /* If True, the century digits will be returned.
* If False, they will not. */
}
@@ -334,8 +334,8 @@ HB_FUNC( SX_SETDATEFORMAT )
* --------------------------------------------------*/
HB_FUNC( SX_SETMEMOBLOCKSIZE )
{
sx_SetMemoBlockSize( hb_parni( 1 ) ); /* The new default block size.
* The size must be a value from 1 through 1024. */
sx_SetMemoBlockSize( ( WORD ) hb_parni( 1 ) ); /* The new default block size.
* The size must be a value from 1 through 1024. */
}
/* -----------------20/01/2002 13:33-----------------
@@ -344,7 +344,7 @@ HB_FUNC( SX_SETMEMOBLOCKSIZE )
* --------------------------------------------------*/
HB_FUNC( SX_SETORDER )
{
hb_retni( sx_SetOrder( hb_parni( 1 ) ) ); /* Selects an existing order as the controlling index order. */
hb_retni( sx_SetOrder( ( SHORT ) hb_parni( 1 ) ) ); /* Selects an existing order as the controlling index order. */
}
@@ -353,7 +353,7 @@ HB_FUNC( SX_SETORDER )
* --------------------------------------------------*/
HB_FUNC( SX_SETSOFTSEEK )
{
sx_SetSoftSeek( hb_parl( 1 ) ); /* True to set softseek ON */
sx_SetSoftSeek( hb_parl( 1 ) ? 1 : 0 ); /* True to set softseek ON */
}
@@ -362,7 +362,7 @@ HB_FUNC( SX_SETSOFTSEEK )
* --------------------------------------------------*/
HB_FUNC( SX_SKIP )
{
sx_Skip( hb_parni( 1 ) ); /* Number of records to skip */
sx_Skip( hb_parnl( 1 ) ); /* Number of records to skip */
}
@@ -374,8 +374,8 @@ HB_FUNC( SX_SYSPROP )
{
int i = hb_parni( 2 );
hb_retni(
sx_SysProp( hb_parni( 1 ), /* One of the predefined constant values. See Apollo.ch */
( void * ) &i ));
sx_SysProp( ( WORD ) hb_parni( 1 ), /* One of the predefined constant values. See Apollo.ch */
( void * ) &i ) );
}
/*
HB_FUNC( SX_DISABLEAUTOOPEN )
@@ -395,8 +395,8 @@ HB_FUNC( SX_USE )
hb_retni(
sx_Use( ( PBYTE ) hb_parc( 1 ), /* Filename */
( PBYTE ) hb_parc( 2 ), /* Alias */
hb_parni( 3 ), /* OpenMode */
hb_parni( 4) )); /* RDE Type */
( SHORT ) hb_parni( 3 ), /* OpenMode */
( SHORT ) hb_parni( 4 ) ) ); /* RDE Type */
}

View File

@@ -70,11 +70,11 @@
static void hb_gaugeUpdate( PHB_ITEM pArray, float fPercent )
{
int iCenter = ( ( hb_arrayGetNL( pArray, B_RIGHT ) - hb_arrayGetNL( pArray, B_LEFT ) ) / 2 ) + 1;
int iRatio = hb_arrayGetNL( pArray, B_RIGHT ) - hb_arrayGetNL( pArray, B_LEFT ) - 1;
int iRow;
int iCols;
int iMax;
SHORT iCenter = ( SHORT ) ( ( ( hb_arrayGetNI( pArray, B_RIGHT ) - hb_arrayGetNI( pArray, B_LEFT ) ) / 2 ) + 1 );
SHORT iRatio = ( SHORT ) ( hb_arrayGetNI( pArray, B_RIGHT ) - hb_arrayGetNI( pArray, B_LEFT ) - 1 );
SHORT iRow;
SHORT iCols;
SHORT iMax;
char szOldColor[ HB_CLRSTR_LEN ];
char * szStr = " ";
char szPct[ 5 ];
@@ -83,25 +83,29 @@ static void hb_gaugeUpdate( PHB_ITEM pArray, float fPercent )
hb_gtSetColorStr( hb_arrayGetCPtr( pArray, B_BARCOLOR ) );
fPercent = ( fPercent < 0 ? 0 : ( fPercent > 1 ? 1 : fPercent ) );
iCols = (int) (fPercent * iRatio);
iCols = ( SHORT ) ( fPercent * iRatio );
if( hb_arrayGetL( pArray, B_DISPLAYNUM ) )
{
snprintf( szPct, sizeof( szPct ), "%3.0f%%", fPercent * 100 );
hb_gtWriteAt( (USHORT) hb_arrayGetNL( pArray, B_TOP ),
(USHORT) iCenter + 2, (BYTE *) szPct, 4 );
hb_gtWriteAt( ( SHORT ) hb_arrayGetNI( pArray, B_TOP ),
iCenter + 2,
( BYTE * ) szPct, 4 );
}
hb_gtBox( hb_arrayGetNI( pArray, B_TOP ) + 1, hb_arrayGetNI( pArray, B_LEFT ) + 1,
hb_arrayGetNI( pArray, B_BOTTOM ) - 1, hb_arrayGetNI( pArray, B_RIGHT ) - 1,
hb_gtBox( ( SHORT ) hb_arrayGetNI( pArray, B_TOP ) + 1,
( SHORT ) hb_arrayGetNI( pArray, B_LEFT ) + 1,
( SHORT ) hb_arrayGetNI( pArray, B_BOTTOM ) - 1,
( SHORT ) hb_arrayGetNI( pArray, B_RIGHT ) - 1,
( BYTE * ) szStr );
iMax = hb_arrayGetNL( pArray, B_BOTTOM ) - hb_arrayGetNL( pArray, B_TOP ) - 1;
iMax = ( SHORT ) ( hb_arrayGetNI( pArray, B_BOTTOM ) - hb_arrayGetNI( pArray, B_TOP ) - 1 );
for( iRow = 1; iRow <= iMax; iRow++ )
{
hb_gtRepChar( (USHORT) (iRow + hb_arrayGetNL( pArray, B_TOP )),
(USHORT) (hb_arrayGetNL( pArray, B_LEFT ) + 1),
( BYTE ) * hb_arrayGetCPtr( pArray, B_BARCHAR ), iCols );
hb_gtRepChar( ( SHORT ) ( hb_arrayGetNI( pArray, B_TOP ) + iRow ),
( SHORT ) ( hb_arrayGetNI( pArray, B_LEFT ) + 1 ),
( BYTE ) * hb_arrayGetCPtr( pArray, B_BARCHAR ),
iCols );
}
hb_gtSetColorStr( szOldColor );
@@ -146,28 +150,29 @@ HB_FUNC( GAUGEDISPLAY )
if( pArray )
{
int iCenter = ( ( hb_arrayGetNL( pArray, B_RIGHT ) - hb_arrayGetNL( pArray, B_LEFT ) ) / 2 ) + 1;
SHORT iCenter = ( SHORT ) ( ( ( hb_arrayGetNI( pArray, B_RIGHT ) - hb_arrayGetNI( pArray, B_LEFT ) ) / 2 ) + 1 );
char szOldColor[ HB_CLRSTR_LEN ];
char * szStr = " ";
hb_gtGetColorStr( szOldColor );
hb_gtSetColorStr( hb_arrayGetCPtr( pArray, B_BACKCOLOR ) );
hb_gtBox( (SHORT) hb_arrayGetNL( pArray, B_TOP ),
(SHORT) hb_arrayGetNL( pArray, B_LEFT ),
(SHORT) hb_arrayGetNL( pArray, B_BOTTOM ),
(SHORT) hb_arrayGetNL( pArray, B_RIGHT ),
(BYTE *) szStr );
hb_gtBox( ( SHORT) hb_arrayGetNI( pArray, B_TOP ),
( SHORT) hb_arrayGetNI( pArray, B_LEFT ),
( SHORT) hb_arrayGetNI( pArray, B_BOTTOM ),
( SHORT) hb_arrayGetNI( pArray, B_RIGHT ),
( BYTE * ) szStr );
hb_gtBox( (SHORT) hb_arrayGetNL( pArray, B_TOP ),
(SHORT) hb_arrayGetNL( pArray, B_LEFT ),
(SHORT) hb_arrayGetNL( pArray, B_BOTTOM ),
(SHORT) hb_arrayGetNL( pArray, B_RIGHT ),
(BYTE *) B_BOXLINES );
hb_gtBox( ( SHORT ) hb_arrayGetNI( pArray, B_TOP ),
( SHORT ) hb_arrayGetNI( pArray, B_LEFT ),
( SHORT ) hb_arrayGetNI( pArray, B_BOTTOM ),
( SHORT ) hb_arrayGetNI( pArray, B_RIGHT ),
( BYTE * ) B_BOXLINES );
if( hb_arrayGetL( pArray, B_DISPLAYNUM ) )
hb_gtWriteAt( (USHORT) hb_arrayGetNL( pArray, B_TOP ),
iCenter, ( BYTE * ) "[ ]", 8 );
hb_gtWriteAt( ( SHORT ) hb_arrayGetNI( pArray, B_TOP ),
iCenter,
( BYTE * ) "[ ]", 8 );
hb_gtSetColorStr( szOldColor );

View File

@@ -111,7 +111,7 @@ HB_FUNC( ATADJUST )
int iMultiPass = ct_getatmupa();
int iAtLike = ct_getatlike();
char cAtLike = ct_getatlikechar();
size_t sIgnore, sMatchStrLen;
size_t sIgnore, sMatchStrLen = 0;
ULONG ulCounter;
char *pc = NULL;

View File

@@ -74,7 +74,7 @@ static void do_atnum( int iSwitch )
int iMultiPass = ct_getatmupa();
int iAtLike = ct_getatlike();
char cAtLike = ct_getatlikechar();
size_t sIgnore, sMatchStrLen;
size_t sIgnore, sMatchStrLen = 0;
ULONG ulCounter;
char *pc = NULL;

View File

@@ -132,7 +132,7 @@ HB_FUNC( ATREPL )
int iMultiPass = ct_getatmupa();
int iAtLike = ct_getatlike();
char cAtLike = ct_getatlikechar();
size_t sIgnore, sMatchStrLen;
size_t sIgnore, sMatchStrLen = 0;
ULONG ulCounter;
char *pc;

View File

@@ -471,7 +471,7 @@ HB_FUNC( CSETATMUPA )
*/
static int siAtLikeMode = 0; /* TODO: make this tread safe */
static int scAtLikeChar = '?'; /* TODO: make this tread safe */
static char scAtLikeChar = '?'; /* TODO: make this tread safe */
void ct_setatlike( int iNewMode )
{

View File

@@ -217,7 +217,7 @@ HB_FUNC( WBOX )
memcpy( szBoxBuf, pWBoxFrames[ iFrame ], 9 );
if( ( iFrame & 4 ) == 0 )
{
szBoxBuf[ 8 ] = hb_gtGetClearChar();
szBoxBuf[ 8 ] = ( char ) hb_gtGetClearChar();
}
szBoxBuf[ 9 ] = '0';
szBox = szBoxBuf;

View File

@@ -317,7 +317,7 @@ HB_FUNC( DMY )
if( iDay < 10 )
{
szMDY[iLen] = iDay + 0x30;
szMDY[iLen] = ( char ) iDay + 0x30;
iLen++;
}
else
@@ -415,7 +415,7 @@ HB_FUNC( MDY )
szMDY[iLen++] = ' ';
if( iDay < 10 )
{
szMDY[iLen] = iDay + 0x30;
szMDY[iLen] = ( char ) iDay + 0x30;
iLen++;
}
else

View File

@@ -294,10 +294,10 @@ HB_FUNC( SETTIME )
#if defined(HB_OS_WIN_32)
SYSTEMTIME st;
GetLocalTime( &st );
st.wHour = iTime[0];
st.wMinute = iTime[1];
st.wSecond = iTime[2];
st.wMilliseconds = iTime[3] * 10;
st.wHour = ( WORD ) iTime[0];
st.wMinute = ( WORD ) iTime[1];
st.wSecond = ( WORD ) iTime[2];
st.wMilliseconds = ( WORD ) iTime[3] * 10;
fResult = SetLocalTime( &st );
#elif defined( HB_OS_LINUX ) && !defined( __WATCOMC__ )
/* stime exists only in SVr4, SVID, X/OPEN and Linux */
@@ -380,10 +380,10 @@ HB_FUNC( SETDATE )
#if defined(HB_OS_WIN_32)
SYSTEMTIME st;
GetLocalTime( &st );
st.wYear = iYear;
st.wMonth = iMonth;
st.wDay = iDay;
st.wDayOfWeek = hb_dateJulianDOW( lDate );
st.wYear = ( WORD ) iYear;
st.wMonth = ( WORD ) iMonth;
st.wDay = ( WORD ) iDay;
st.wDayOfWeek = ( WORD ) hb_dateJulianDOW( lDate );
fResult = SetLocalTime( &st );
#elif defined( HB_OS_LINUX ) && !defined( __WATCOMC__ )
/* stime exists only in SVr4, SVID, X/OPEN and Linux */

View File

@@ -248,15 +248,15 @@ HB_FUNC( SETFDATI )
GetLocalTime( &st );
if( pDate )
{
st.wYear = year;
st.wMonth = month;
st.wDay = day;
st.wYear = ( WORD ) year;
st.wMonth = ( WORD ) month;
st.wDay = ( WORD ) day;
}
if( pTime )
{
st.wHour = hour;
st.wMinute = minute;
st.wSecond = second;
st.wHour = ( WORD ) hour;
st.wMinute = ( WORD ) minute;
st.wSecond = ( WORD ) second;
}
SystemTimeToFileTime( &st, &local_ft );
LocalFileTimeToFileTime( &local_ft, &ft );

View File

@@ -75,7 +75,7 @@ HB_FUNC( CHARPACK )
while( n_count < n_max && in[n_in + n_count] == c )
n_count++;
out[n_out++] = 0;
out[n_out++] = n_count;
out[n_out++] = ( unsigned char ) n_count;
out[n_out++] = c;
n_in += n_count;
}

View File

@@ -91,7 +91,7 @@
HB_FUNC( PRINTSTAT )
{
USHORT uiPort = ISNUM( 1 ) ? hb_parni( 1 ) : 1;
USHORT uiPort = ISNUM( 1 ) ? ( USHORT ) hb_parni( 1 ) : 1;
int Status = 0;
#if defined(HB_OS_DOS)
@@ -142,7 +142,7 @@ HB_FUNC( PRINTSTAT )
HB_FUNC( PRINTREADY )
{
USHORT uiPort = ISNUM( 1 ) ? hb_parni( 1 ) : 1;
USHORT uiPort = ISNUM( 1 ) ? ( USHORT ) hb_parni( 1 ) : 1;
int Status = 0;
#if defined(HB_OS_DOS)

View File

@@ -57,12 +57,12 @@ HB_FUNC( SETRC )
BOOL fRow = ISNUM( 1 ), fCol = ISNUM( 2 );
if( fRow && fCol )
hb_gtSetPos( hb_parni( 1 ), hb_parni( 2 ) );
hb_gtSetPos( ( SHORT ) hb_parni( 1 ), ( SHORT ) hb_parni( 2 ) );
else
{
SHORT sRow, sCol;
hb_gtGetPos( &sRow, &sCol );
hb_gtSetPos( fRow ? hb_parni( 1 ) : sRow, fCol ? hb_parni( 2 ) : sCol );
hb_gtSetPos( fRow ? ( SHORT ) hb_parni( 1 ) : sRow, fCol ? ( SHORT ) hb_parni( 2 ) : sCol );
}
hb_retc( NULL );

View File

@@ -82,12 +82,12 @@ HB_FUNC( FBCREATEDB )
ISC_STATUS status[ 20 ];
char create_db[ MAX_BUFFER ];
char * db_name = hb_parcx( 1 );
char * user = hb_parcx( 2 );
char * pass = hb_parcx( 3 );
int page = hb_parni( 4 );
char * charset = hb_parcx( 5 );
int dialect = hb_parni( 6 );
char * db_name = hb_parcx( 1 );
char * user = hb_parcx( 2 );
char * pass = hb_parcx( 3 );
int page = hb_parni( 4 );
char * charset = hb_parcx( 5 );
unsigned short dialect = ( unsigned short ) hb_parni( 6 );
snprintf( create_db, sizeof( create_db ),
"CREATE DATABASE '%s' USER '%s' PASSWORD '%s' PAGE_SIZE = %i DEFAULT CHARACTER SET %s",
@@ -110,7 +110,7 @@ HB_FUNC( FBCONNECT )
char * user = hb_parcx( 2 );
char * passwd = hb_parcx( 3 );
char dpb[ 128 ];
int i = 0;
short i = 0;
int len;
/* TOFIX: Possible buffer overflow. Use snprintf(). */
@@ -121,14 +121,14 @@ HB_FUNC( FBCONNECT )
len = ( int ) ( sizeof( dpb ) - i - 4 );
dpb[ i++ ] = ( char ) len;
hb_strncpy( &( dpb[ i ] ), user, len );
i += len;
i += ( short ) len;
dpb[ i++ ] = isc_dpb_password;
len = strlen( passwd );
if( len > ( int ) ( sizeof( dpb ) - i - 2 ) )
len = ( int ) ( sizeof( dpb ) - i - 2 );
dpb[ i++ ] = len;
dpb[ i++ ] = ( char ) len;
hb_strncpy( &( dpb[ i ] ), passwd, len );
i += len;
i += ( short ) len;
if( isc_attach_database( status, 0, db_connect, &db, i, dpb ) )
hb_retnl( isc_sqlcode( status ) );
@@ -153,7 +153,7 @@ HB_FUNC( FBERROR )
{
char msg[ MAX_BUFFER ];
isc_sql_interprete( hb_parni( 1 ) /* sqlcode */,
isc_sql_interprete( ( short ) hb_parni( 1 ) /* sqlcode */,
msg,
sizeof( msg ) );
@@ -201,7 +201,7 @@ HB_FUNC( FBEXECUTE )
char * exec_str = hb_parcx( 2 );
ISC_STATUS status[ 20 ];
ISC_STATUS status_rollback[ 20 ];
int dialect = hb_parni( 3 );
unsigned short dialect = ( unsigned short ) hb_parni( 3 );
if( ISPOINTER( 4 ) )
{
@@ -247,8 +247,7 @@ HB_FUNC( FBQUERY )
XSQLVAR * var;
char sel_str[ MAX_LEN ];
int dialect = ISNUM( 3 ) ? hb_parni( 3 ) : DIALECT;
int n;
unsigned short dialect = ISNUM( 3 ) ? ( unsigned short ) hb_parni( 3 ) : DIALECT;
int i;
int dtype;
int num_cols;
@@ -297,8 +296,10 @@ HB_FUNC( FBQUERY )
/* Relocate necessary number of columns */
if( sqlda->sqld > sqlda->sqln )
{
hb_xfree( sqlda );
ISC_SHORT n;
n = sqlda->sqld;
hb_xfree( sqlda );
sqlda = ( XSQLDA * ) hb_xgrab( XSQLDA_LENGTH( n ) );
sqlda->sqln = n;
sqlda->version = 1;
@@ -371,7 +372,7 @@ HB_FUNC( FBQUERY )
hb_arraySetPtr( qry_handle, 3, ( void * ) trans );
hb_arraySetNL( qry_handle, 4, ( long ) num_cols );
hb_arraySetNL( qry_handle, 5, ( long ) dialect );
hb_arraySetNI( qry_handle, 5, ( int ) dialect );
hb_arraySet( qry_handle, 6, aNew );
hb_itemReturnRelease( qry_handle );
@@ -387,7 +388,7 @@ HB_FUNC( FBFETCH )
isc_stmt_handle stmt = ( isc_stmt_handle ) hb_itemGetPtr( hb_itemArrayGet( aParam, 1 ) );
ISC_STATUS status[ MAX_FIELDS ];
XSQLDA * sqlda = ( XSQLDA * ) hb_itemGetPtr( hb_itemArrayGet( aParam, 2 ) );
int dialect = hb_itemGetNI( hb_itemArrayGet( aParam, 5 ) );
unsigned short dialect = ( unsigned short ) hb_itemGetNI( hb_itemArrayGet( aParam, 5 ) );
long fetch_stat;
/* TOFIX */

File diff suppressed because it is too large Load Diff

View File

@@ -57,40 +57,38 @@
#define b_size 4096
#define c_size 4096
static long hb_hbfskip( int recs );
static long last_rec[10];
static long recno[10];
static long offset[10];
static int handles[10];
static int area = 0;
static char *b;
static char *c;
static long last_off[10];
static long lastbyte[10];
static int isEof[10];
static long last_rec[ 10 ];
static long recno[ 10 ];
static long offset[ 10 ];
static HB_FHANDLE handles[ 10 ];
static int area = 0;
static char * b;
static char * c;
static long last_off[ 10 ];
static long lastbyte[ 10 ];
static int isEof[ 10 ];
HB_FUNC( HB_FUSE )
{
PHB_ITEM arg1_it = hb_param(1,HB_IT_STRING);
PHB_ITEM arg2_it = hb_param(2,HB_IT_NUMERIC);
PHB_ITEM arg1_it = hb_param( 1, HB_IT_STRING );
PHB_ITEM arg2_it = hb_param( 2, HB_IT_NUMERIC );
int open_flags;
if ( arg1_it ) {
if( arg2_it )
open_flags = hb_parni(2);
open_flags = hb_parni( 2 );
else
open_flags = 0;
handles[area] = hb_fsOpen( ( BYTE * ) hb_parc(1), open_flags );
handles[area] = hb_fsOpen( ( BYTE * ) hb_parc( 1 ), ( SHORT ) open_flags );
offset[area] = 0;
recno[area] = 1;
b = ( char * )hb_xgrab( b_size );
c = ( char * )hb_xgrab( c_size );
lastbyte[area] = hb_fsSeek( handles[area], 0L, FS_END );
isEof[area] = (lastbyte[area] == 0);
hb_retni( handles[area] );
b = ( char * ) hb_xgrab( b_size );
c = ( char * ) hb_xgrab( c_size );
lastbyte[area] = hb_fsSeek( handles[ area ], 0L, FS_END );
isEof[area] = ( lastbyte[ area ] == 0 );
hb_retni( handles[ area ] );
}
else {
hb_fsClose( handles[area] );
@@ -110,15 +108,10 @@ HB_FUNC( HB_FUSE )
HB_FUNC( HB_FRECNO )
{
hb_retnl( recno[area] );
hb_retnl( recno[ area ] );
}
HB_FUNC( HB_FSKIP )
{
hb_hbfskip( ISNUM( 1 ) ? hb_parni(1) : 1 );
}
static long hb_hbfskip( int recs )
{
long read_pos;
@@ -186,6 +179,11 @@ static long hb_hbfskip( int recs )
return ( recno[area] );
}
HB_FUNC( HB_FSKIP )
{
hb_hbfskip( ISNUM( 1 ) ? hb_parni(1) : 1 );
}
HB_FUNC( HB_FREADLN )
{
int x;

View File

@@ -949,12 +949,12 @@ static int hb_unzipExtractCurrentFile( unzFile hUnzip, const char* szFileName, c
FILETIME ftutc, ft;
SYSTEMTIME st;
st.wSecond = ufi.tmu_date.tm_sec;
st.wMinute = ufi.tmu_date.tm_min;
st.wHour = ufi.tmu_date.tm_hour;
st.wDay = ufi.tmu_date.tm_mday;
st.wMonth = ufi.tmu_date.tm_mon + 1;
st.wYear = ufi.tmu_date.tm_year;
st.wSecond = ( WORD ) ufi.tmu_date.tm_sec;
st.wMinute = ( WORD ) ufi.tmu_date.tm_min;
st.wHour = ( WORD ) ufi.tmu_date.tm_hour;
st.wDay = ( WORD ) ufi.tmu_date.tm_mday;
st.wMonth = ( WORD ) ufi.tmu_date.tm_mon + 1;
st.wYear = ( WORD ) ufi.tmu_date.tm_year;
st.wMilliseconds = 0;
if( SystemTimeToFileTime( &st, &ft ) &&

View File

@@ -53,10 +53,10 @@ HB_FUNC( FT_DESCEND )
#if defined(HB_OS_DOS) || defined(HB_OS_WIN_32)
{
auto PHB_ITEM iP = hb_itemParam( 1 );
auto USHORT uiType = hb_itemType( iP );
auto PHB_ITEM iP = hb_itemParam( 1 );
auto HB_TYPE uiType = hb_itemType( iP );
auto PHB_ITEM iR = NULL;
auto PHB_ITEM iR = NULL;
auto USHORT uiLen, n;
auto char * pDescend;

View File

@@ -357,7 +357,7 @@ static void disp_update(int offset)
line += 1;
offset += 2;
}
hb_gtRest( sline, scol, eline, ecol, vseg );
hb_gtRest( ( SHORT ) sline, ( SHORT ) scol, ( SHORT ) eline, ( SHORT ) ecol, vseg );
}
@@ -557,7 +557,7 @@ HB_FUNC( _FT_DFINIT )
hb_gtRectSize( sline, scol, eline, ecol, &ulSize );
vseg = (char * ) hb_xalloc( ulSize );
if (vseg != NULL)
hb_gtSave( sline, scol, eline, ecol, vseg );
hb_gtSave( ( SHORT ) sline, ( SHORT ) scol, ( SHORT ) eline, ( SHORT ) ecol, vseg );
maxlin = hb_parni(12);
buffsize = hb_parni(13); /* yes - load value */
@@ -643,7 +643,7 @@ HB_FUNC( _FT_DFINIT )
for (i = 1; i < j; i++)
linedown();
hb_gtRest( sline, scol, eline, ecol, vseg );
hb_gtRest( ( SHORT ) sline, ( SHORT ) scol, ( SHORT ) eline, ( SHORT ) ecol, vseg );
}
@@ -740,7 +740,7 @@ HB_FUNC( FT_DISPFILE )
for (i = 0; i < height; i++)
chattr(0, i, width, norm);
hb_gtRest( sline, scol, eline, ecol, vseg );
hb_gtRest( ( SHORT ) sline, ( SHORT ) scol, ( SHORT ) eline, ( SHORT ) ecol, vseg );
/* main processing loop -- terminated by user key press */
@@ -749,16 +749,16 @@ HB_FUNC( FT_DISPFILE )
if ( refresh == YES ) /* redraw window contents? */
disp_update(wintop);
hb_gtRest( sline, scol, eline, ecol, vseg );
hb_gtRest( ( SHORT ) sline, ( SHORT ) scol, ( SHORT ) eline, ( SHORT ) ecol, vseg );
/* if not browse, highlight the current line */
if ( brows == NO )
chattr(0, winrow - sline, width, hlight);
hb_gtRest( sline, scol, eline, ecol, vseg );
hb_gtRest( ( SHORT ) sline, ( SHORT ) scol, ( SHORT ) eline, ( SHORT ) ecol, vseg );
hb_gtSetPos( winrow, scol );
hb_gtSetPos( ( SHORT ) winrow, ( SHORT ) scol );
ch = keyin(); /* get user key press */
@@ -767,7 +767,7 @@ HB_FUNC( FT_DISPFILE )
if ( brows == NO )
chattr(0, winrow - sline, width, norm);
hb_gtRest( sline, scol, eline, ecol, vseg );
hb_gtRest( ( SHORT ) sline, ( SHORT ) scol, ( SHORT ) eline, ( SHORT ) ecol, vseg );
/* figure out what the user wants to do */

View File

@@ -173,12 +173,12 @@ End
HB_FUNC( FT_SAVEATT )
{
USHORT uiTop = hb_parni( 1 ); /* Defaults to zero on bad type */
USHORT uiLeft = hb_parni( 2 ); /* Defaults to zero on bad type */
USHORT uiTop = ( USHORT ) hb_parni( 1 ); /* Defaults to zero on bad type */
USHORT uiLeft = ( USHORT ) hb_parni( 2 ); /* Defaults to zero on bad type */
USHORT uiMaxRow = hb_gtMaxRow();
USHORT uiMaxCol = hb_gtMaxCol();
USHORT uiBottom = ISNUM( 3 ) ? hb_parni( 3 ) : uiMaxRow;
USHORT uiRight = ISNUM( 4 ) ? hb_parni( 4 ) : uiMaxRow;
USHORT uiBottom = ISNUM( 3 ) ? ( USHORT ) hb_parni( 3 ) : uiMaxRow;
USHORT uiRight = ISNUM( 4 ) ? ( USHORT ) hb_parni( 4 ) : uiMaxRow;
ULONG ulSize;
char * pBuffer;
@@ -386,12 +386,12 @@ HB_FUNC( FT_RESTATT )
ULONG ulLen = hb_parclen( 5 );
if( ulLen )
{
USHORT uiTop = hb_parni( 1 ); /* Defaults to zero on bad type */
USHORT uiLeft = hb_parni( 2 ); /* Defaults to zero on bad type */
USHORT uiTop = ( USHORT ) hb_parni( 1 ); /* Defaults to zero on bad type */
USHORT uiLeft = ( USHORT ) hb_parni( 2 ); /* Defaults to zero on bad type */
USHORT uiMaxRow = hb_gtMaxRow();
USHORT uiMaxCol = hb_gtMaxCol();
USHORT uiBottom = ISNUM( 3 ) ? hb_parni( 3 ) : hb_gtMaxRow();
USHORT uiRight = ISNUM( 4 ) ? hb_parni( 4 ) : hb_gtMaxCol();
USHORT uiBottom = ISNUM( 3 ) ? ( USHORT ) hb_parni( 3 ) : hb_gtMaxRow();
USHORT uiRight = ISNUM( 4 ) ? ( USHORT ) hb_parni( 4 ) : hb_gtMaxCol();
char * pAttrib = hb_parc( 5 );
if( uiBottom > uiMaxRow )

View File

@@ -63,6 +63,9 @@ HB_FUNC( FT_SHADOW )
HB_FUNC( FT_SETATTR )
{
hb_gtSetAttribute( hb_parni( 1 ), hb_parni( 2 ),
hb_parni( 3 ), hb_parni( 4 ), hb_parni( 5 ) );
hb_gtSetAttribute( ( SHORT ) hb_parni( 1 ),
( SHORT ) hb_parni( 2 ),
( SHORT ) hb_parni( 3 ),
( SHORT ) hb_parni( 4 ),
( BYTE ) hb_parni( 5 ) );
}

View File

@@ -195,16 +195,16 @@ static int _writeLine( BYTE * theData, int iDataLen );
static BOOL _writeeol( HB_FHANDLE fhnd );
/* arrays used by the text workareas */
static int area = 0;
static long recno[ TEXT_WORKAREAS];
static long offset[ TEXT_WORKAREAS];
static int handles[ TEXT_WORKAREAS];
static long last_rec[TEXT_WORKAREAS];
static long last_off[TEXT_WORKAREAS];
static long lastbyte[TEXT_WORKAREAS];
static int isBof[ TEXT_WORKAREAS];
static int isEof[ TEXT_WORKAREAS];
static int error[ TEXT_WORKAREAS];
static int area = 0;
static long recno[ TEXT_WORKAREAS];
static long offset[ TEXT_WORKAREAS];
static HB_FHANDLE handles[ TEXT_WORKAREAS];
static long last_rec[TEXT_WORKAREAS];
static long last_off[TEXT_WORKAREAS];
static long lastbyte[TEXT_WORKAREAS];
static int isBof[ TEXT_WORKAREAS];
static int isEof[ TEXT_WORKAREAS];
static int error[ TEXT_WORKAREAS];
/* for debugging purposes */
static int doInt = 0;
@@ -304,7 +304,7 @@ HB_FUNC( FT_FUSE )
if ( ISCHAR(1) )
{
handles[area] = hb_fsOpen( ( BYTE * ) hb_parc(1), attr ) ;
handles[area] = hb_fsOpen( ( BYTE * ) hb_parc(1), ( USHORT ) attr ) ;
if( handles[area] <= 0 )
error[area] = hb_fsError();
offset[area] = 0 ;
@@ -954,12 +954,12 @@ static long _ft_skip( long iRecs )
HB_FUNC( FT_FREADLN )
{
USHORT iByteCount;
USHORT iBytesRead;
int iByteCount;
int iBytesRead;
BYTE * cPtr = ( BYTE * ) hb_xgrab( BUFFSIZE );
hb_fsSeek( handles[area], offset[area], FS_SET );
iBytesRead = (int) hb_fsRead( handles[area], cPtr, BUFFSIZE );
iBytesRead = (int) hb_fsReadLarge( handles[area], cPtr, BUFFSIZE );
error[area] = 0;
@@ -1044,7 +1044,7 @@ HB_FUNC( FT_FDELETE )
iBytesRead = hb_fsRead( handles[area], Buff , BUFFSIZE ); /* now read in a big glob */
srcPtr += iBytesRead;
hb_fsSeek( handles[area], destPtr, FS_SET );
destPtr += hb_fsWrite( handles[area], Buff, iBytesRead );
destPtr += hb_fsWriteLarge( handles[area], Buff, iBytesRead );
} while( iBytesRead > 0 );
@@ -1383,7 +1383,7 @@ HB_FUNC( FT_FWRITEL )
_del_buff( iLineLen - iDataLen - 2 );
/* write the new record's contents */
hb_fsWrite( handles[area], theData, iDataLen );
hb_fsWriteLarge( handles[area], theData, iDataLen );
}
else
{
@@ -1391,7 +1391,7 @@ HB_FUNC( FT_FWRITEL )
_ins_buff( iDataLen - iLineLen + 2 );
/* write the new record's contents */
hb_fsWrite( handles[area], theData, iDataLen );
hb_fsWriteLarge( handles[area], theData, iDataLen );
}
error[area] = hb_fsError();
err = (error[area]) ? 0 : 1;
@@ -1799,7 +1799,7 @@ _fbolerr:
*/
} /* end _findbol() */
/*ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ*/
/*--------------------------------------------------------------------------*/
/* inserts xxx bytes into the current file, beginning at the current record */
/* the contents of the inserted bytes are indeterminate, i.e. you'll have to
write to them before they mean anything */
@@ -1844,7 +1844,7 @@ static int _ins_buff( int iLen )
break;
}
SaveLen = hb_fsWrite( handles[area], WriteBuff, WriteLen );
SaveLen = hb_fsWriteLarge( handles[area], WriteBuff, WriteLen );
if( !SaveLen )
{
@@ -1896,7 +1896,7 @@ static int _ins_buff( int iLen )
/*ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ*/
/*--------------------------------------------------------------------------*/
/* deletes xxx bytes from the current file, beginning at the current record */
static int _del_buff( int iLen )
{
@@ -1920,7 +1920,7 @@ static int _del_buff( int iLen )
{
/* position to beginning of write area */
hb_fsSeek( handles[area], fpWrite, FS_SET );
SaveLen = hb_fsWrite( handles[area], WriteBuff, WriteLen );
SaveLen = hb_fsWriteLarge( handles[area], WriteBuff, WriteLen );
/* move write pointer */
fpWrite += SaveLen;
@@ -1954,13 +1954,13 @@ static int _del_buff( int iLen )
/* _del_buff */
/*ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ*/
/*--------------------------------------------------------------------------*/
/* writes a line of data to the file, including the terminating CRLF */
static int _writeLine( BYTE * theData, int iDataLen )
{
int err = 0;
if( !( hb_fsWrite( handles[area], theData, iDataLen ) == iDataLen ) )
if( !( hb_fsWriteLarge( handles[area], theData, iDataLen ) == iDataLen ) )
{
err = 1;
error[area] = hb_fsError();
@@ -1979,7 +1979,7 @@ static BOOL _writeeol( HB_FHANDLE fhnd )
char * crlf = hb_conNewLine();
int len = strlen( crlf );
return hb_fsWrite( fhnd, ( BYTE * ) crlf, len ) == len;
return hb_fsWriteLarge( fhnd, ( BYTE * ) crlf, len ) == len;
}
/* fttext.c eof */

View File

@@ -198,11 +198,11 @@ HB_FUNC( SQLCONNECT ) /* HB_SQLCONNECT( hDbc, cDSN, cUseName, cPassword ) --> nR
HB_TCHAR_FREE( lpPassword );
#else
ret = SQLConnect( ( HDBC ) hb_parptr( 1 ),
(unsigned char*) hb_parcx( 2 ),
( unsigned char * ) hb_parcx( 2 ),
( SQLSMALLINT ) hb_parclen( 2 ),
(unsigned char*) hb_parcx( 3 ),
( unsigned char * ) hb_parcx( 3 ),
( SQLSMALLINT ) hb_parclen( 3 ),
(unsigned char*) hb_parcx( 4 ),
( unsigned char * ) hb_parcx( 4 ),
( SQLSMALLINT ) hb_parclen( 4 ) );
#endif
hb_retni( ret );
@@ -233,7 +233,7 @@ HB_FUNC( SQLALLOCST ) /* HB_SQLALLOCSTMT( hDbc, @hStmt ) --> nRetCode */
HB_FUNC( SQLFREESTM ) /* HB_SQLFREESTMT( hStmt, nType ) --> nRetCode */
{
hb_retni( SQLFreeStmt( ( HSTMT ) hb_parptr( 1 ), hb_parni( 2 ) ) );
hb_retni( SQLFreeStmt( ( HSTMT ) hb_parptr( 1 ), ( SQLUSMALLINT ) hb_parni( 2 ) ) );
}
HB_FUNC( SQLEXECDIR ) /* HB_SQLEXECDIRECT( hStmt, cStatement ) --> nRetCode */
@@ -243,7 +243,7 @@ HB_FUNC( SQLEXECDIR ) /* HB_SQLEXECDIRECT( hStmt, cStatement ) --> nRetCode */
hb_retni( SQLExecDirect( ( HSTMT ) hb_parptr( 1 ), lpStr, hb_parclen( 2 ) ) );
HB_TCHAR_FREE( lpStr );
#else
hb_retni( SQLExecDirect( ( HSTMT ) hb_parptr( 1 ), (unsigned char*) hb_parcx( 2 ), hb_parclen( 2 ) ) );
hb_retni( SQLExecDirect( ( HSTMT ) hb_parptr( 1 ), ( unsigned char * ) hb_parcx( 2 ), hb_parclen( 2 ) ) );
#endif
}
@@ -259,7 +259,7 @@ HB_FUNC( SQLGETDATA ) /* HB_SQLGETDATA( hStmt, nField, nType, nLen, @cBuffer ) -
WORD wType, wResult;
int iReallocs = 0;
wType = hb_parni( 3 );
wType = ( WORD ) hb_parni( 3 );
if( !wType )
wType = ( WORD ) SQL_BINARY;
lLen = ( SQLLEN ) hb_parnl( 4 );
@@ -273,7 +273,7 @@ HB_FUNC( SQLGETDATA ) /* HB_SQLGETDATA( hStmt, nField, nType, nLen, @cBuffer ) -
wResult = ! SQL_NO_DATA;
while( wResult != SQL_NO_DATA )
{
wResult = SQLGetData( ( HSTMT ) hb_parptr( 1 ), hb_parni( 2 ), wType, ( PTR ) bBuffer, lLen, &lLen );
wResult = SQLGetData( ( HSTMT ) hb_parptr( 1 ), ( SQLUSMALLINT ) hb_parni( 2 ), wType, ( PTR ) bBuffer, lLen, &lLen );
if( wResult == SQL_SUCCESS && iReallocs == 0 )
{
hb_storclen( ( LPSTR ) bBuffer, ( ULONG ) ( lLen < 0 ? 0 : ( lLen < hb_parnl( 4 ) ? lLen : hb_parnl( 4 ) ) ), 5 );
@@ -334,11 +334,11 @@ HB_FUNC( SQLNUMRES )
HB_FUNC( SQLDESCRIB )
{
SDWORD lLen = ( SDWORD ) hb_parnl( 4 );
SQLSMALLINT wBufLen = hb_parni( 5 );
SQLSMALLINT wDataType = hb_parni( 6 );
SQLSMALLINT wBufLen = ( SQLUSMALLINT ) hb_parni( 5 );
SQLSMALLINT wDataType = ( SQLUSMALLINT ) hb_parni( 6 );
SQLULEN wColSize = hb_parni( 7 );
SQLSMALLINT wDecimals = hb_parni( 8 );
SQLSMALLINT wNullable = hb_parni( 9 );
SQLSMALLINT wDecimals = ( SQLUSMALLINT ) hb_parni( 8 );
SQLSMALLINT wNullable = ( SQLUSMALLINT ) hb_parni( 9 );
#if defined( HB_OS_WIN_32 ) && defined( UNICODE )
LPTSTR buffer = ( LPTSTR ) hb_xgrab( lLen * sizeof( TCHAR ) );
#else
@@ -347,7 +347,7 @@ HB_FUNC( SQLDESCRIB )
WORD wResult;
wResult = SQLDescribeCol( ( HSTMT ) hb_parptr( 1 ),
hb_parni( 2 ),
( SQLUSMALLINT ) hb_parni( 2 ),
buffer,
( SQLSMALLINT ) lLen,
&wBufLen,
@@ -384,17 +384,17 @@ HB_FUNC( SQLCOLATTRIBUTE )
{
SDWORD lLen = ( SDWORD ) hb_parnl( 5 );
PTR bBuffer = hb_xgrab( lLen );
SQLSMALLINT wBufLen = hb_parni( 6 );
SQLSMALLINT wBufLen = ( SQLUSMALLINT ) hb_parni( 6 );
#if defined(__DMC__)
SQLINTEGER wNumPtr = hb_parni( 7 );
#else
SQLLEN wNumPtr = hb_parni( 7 );
#endif
WORD wResult = SQLColAttribute( ( HSTMT ) hb_parptr( 1 ),
hb_parni( 2 ),
hb_parni( 3 ),
(unsigned char*) bBuffer,
hb_parni( 5 ),
( SQLUSMALLINT ) hb_parni( 2 ),
( SQLUSMALLINT ) hb_parni( 3 ),
( unsigned char * ) bBuffer,
( SQLUSMALLINT ) hb_parni( 5 ),
&wBufLen,
&wNumPtr );
@@ -418,7 +418,7 @@ HB_FUNC( SQLEXTENDE )
#else
SQLULEN uiRowCountPtr = hb_parni( 4 );
#endif
SQLUSMALLINT siRowStatus = hb_parni( 5 );
SQLUSMALLINT siRowStatus = ( SQLUSMALLINT ) hb_parni( 5 );
WORD wResult = SQLExtendedFetch( ( HSTMT ) hb_parptr( 1 ),
( USHORT ) hb_parnl( 2 ),
( USHORT ) hb_parnl( 3 ),
@@ -466,7 +466,7 @@ HB_FUNC( SQLERROR ) /* hEnv, hDbc, hStmt, @ cErrorClass, @ nType, @ cErrorMsg */
hb_storc( szStr, 4 );
HB_TCHAR_FREE( szStr );
#else
hb_storc( (char *) buffer, 4 );
hb_storc( ( char * ) buffer, 4 );
#endif
}
hb_stornl( ( LONG ) lError, 5 );
@@ -477,7 +477,7 @@ HB_FUNC( SQLERROR ) /* hEnv, hDbc, hStmt, @ cErrorClass, @ nType, @ cErrorMsg */
hb_storc( szStr, 6 );
HB_TCHAR_FREE( szStr );
#else
hb_storc( (char *) szErrorMsg, 6 );
hb_storc( ( char * ) szErrorMsg, 6 );
#endif
}
}
@@ -602,7 +602,7 @@ HB_FUNC( SQLPREPARE ) /* HB_SQLPREPARE( hStmt, cStatement ) --> nRetCode */
hb_retni( SQLPrepare( ( HSTMT ) hb_parptr( 1 ), lpStr, SQL_NTS ) );
HB_TCHAR_FREE( lpStr );
#else
hb_retni( SQLPrepare( ( HSTMT ) hb_parptr( 1 ), (unsigned char*) hb_parcx( 2 ), SQL_NTS ) );
hb_retni( SQLPrepare( ( HSTMT ) hb_parptr( 1 ), ( unsigned char * ) hb_parcx( 2 ), SQL_NTS ) );
#endif
}
@@ -627,7 +627,7 @@ HB_FUNC( SQLEXECUTESCALAR )
wResult = SQLExecDirect( ( HSTMT ) hStmt, lpStr, SQL_NTS );
HB_TCHAR_FREE( lpStr );
#else
wResult = SQLExecDirect( ( HSTMT ) hStmt, (unsigned char*) hb_parcx( 1 ), SQL_NTS );
wResult = SQLExecDirect( ( HSTMT ) hStmt, ( unsigned char * ) hb_parcx( 1 ), SQL_NTS );
#endif
if( wResult == SQL_SUCCESS || wResult == SQL_SUCCESS_WITH_INFO )
{
@@ -635,7 +635,7 @@ HB_FUNC( SQLEXECUTESCALAR )
if( wResult != SQL_NO_DATA )
{
wResult = SQLGetData( ( HSTMT ) hStmt, 1, SQL_C_CHAR, bBuffer, sizeof( bBuffer ), &lLen );
hb_storc( (char *)bBuffer, 3 );
hb_storc( ( char * ) bBuffer, 3 );
}
}
}
@@ -649,7 +649,7 @@ HB_FUNC( SQLSTOD )
{
if( hb_parclen( 1 ) >= 10 )
{
char *szSqlDate = hb_parc( 1 ); /* YYYY-MM-DD */
char * szSqlDate = hb_parc( 1 ); /* YYYY-MM-DD */
char szHrbDate[9]; /* YYYYMMDD */
szHrbDate[ 0 ] = szSqlDate[ 0 ];

View File

@@ -114,7 +114,7 @@ static LPSTR DblToDate( double nDate, char * cDate )
static LPWSTR AnsiToWide( LPCSTR cAnsi )
{
unsigned short wLen;
unsigned int wLen;
LPWSTR cString;
wLen = MultiByteToWideChar( CP_ACP, MB_PRECOMPOSED, cAnsi, -1, 0, 0 );
@@ -126,7 +126,7 @@ static LPWSTR AnsiToWide( LPCSTR cAnsi )
static LPSTR WideToAnsi( LPWSTR cWide )
{
unsigned short wLen;
unsigned int wLen;
LPSTR cString;
wLen = WideCharToMultiByte( CP_ACP, 0, ( LPWSTR ) cWide, -1,
@@ -191,10 +191,10 @@ static void GetParams( DISPPARAMS * dParams )
case HB_IT_LOGICAL:
#if !defined(__BORLANDC__) && !defined(__XCC__) && !defined(NONAMELESSUNION)
pArgs[ n ].vt = VT_BOOL;
pArgs[ n ].boolVal = hb_parl( nArg );
pArgs[ n ].boolVal = hb_parl( nArg ) ? VARIANT_TRUE : VARIANT_FALSE;
#else
pArgs[ n ].n1.n2.vt = VT_BOOL;
pArgs[ n ].n1.n2.n3.boolVal = hb_parl( nArg );
pArgs[ n ].n1.n2.n3.boolVal = hb_parl( nArg ) ? VARIANT_TRUE : VARIANT_FALSE;
#endif
break;
@@ -289,7 +289,7 @@ static void RetValue( void )
break;
case VT_BOOL:
hb_retl( s_RetVal.boolVal );
hb_retl( s_RetVal.boolVal == VARIANT_TRUE );
break;
case VT_DISPATCH:
@@ -329,7 +329,7 @@ static void RetValue( void )
break;
case VT_BOOL:
hb_retl( s_RetVal.n1.n2.n3.boolVal );
hb_retl( s_RetVal.n1.n2.n3.boolVal == VARIANT_TRUE );
break;
case VT_DISPATCH:

View File

@@ -231,7 +231,7 @@ typedef struct DYNAPARM
SHORT usArg; /* 2-byte argument */
DWORD dwArg; /* 4-byte argument */
double dArg; /* double argument */
};
} numargs;
void * pArg; /* Pointer to argument */
} DYNAPARM;
@@ -299,7 +299,7 @@ RESULT DynaCall( int iFlags, LPVOID lpFunction, int nArgs,
else
{
/* Arg has the real arg */
dwVal = *( (DWORD *)( (BYTE *) ( &( Parm[nInd].dwArg ) ) + ( nLoops * 4 ) ) );
dwVal = *( (DWORD *)( (BYTE *) ( &( Parm[nInd].numargs.dwArg ) ) + ( nLoops * 4 ) ) );
}
/* Do push dwVal */
@@ -502,17 +502,17 @@ static void DllExec( int iFlags, int iRtype, LPVOID lpFunction, PXPP_DLLEXEC xec
case HB_IT_NIL:
Parm[ iCnt ].nWidth = sizeof( void * );
/* TOFIX: Store NULL pointer in pointer variable. */
Parm[ iCnt ].dwArg = 0;
Parm[ iCnt ].numargs.dwArg = 0;
break;
case HB_IT_POINTER:
Parm[ iCnt ].nWidth = sizeof( void * );
/* TOFIX: Store pointer in pointer variable. */
Parm[ iCnt ].dwArg = ( DWORD ) hb_itemGetPtr( pParam );
Parm[ iCnt ].numargs.dwArg = ( DWORD ) hb_itemGetPtr( pParam );
if( hb_parinfo( i ) & HB_IT_BYREF )
{
Parm[ iCnt ].pArg = &( Parm[ iCnt ].dwArg );
Parm[ iCnt ].pArg = &( Parm[ iCnt ].numargs.dwArg );
Parm[ iCnt ].dwFlags = DC_FLAG_ARGPTR; /* use the pointer */
}
break;
@@ -522,23 +522,23 @@ static void DllExec( int iFlags, int iRtype, LPVOID lpFunction, PXPP_DLLEXEC xec
case HB_IT_DATE:
case HB_IT_LOGICAL:
Parm[ iCnt ].nWidth = sizeof( DWORD );
Parm[ iCnt ].dwArg = ( DWORD ) hb_itemGetNL( pParam );
Parm[ iCnt ].numargs.dwArg = ( DWORD ) hb_itemGetNL( pParam );
if( hb_parinfo( i ) & HB_IT_BYREF )
{
Parm[ iCnt ].pArg = &( Parm[ iCnt ].dwArg );
Parm[ iCnt ].pArg = &( Parm[ iCnt ].numargs.dwArg );
Parm[ iCnt ].dwFlags = DC_FLAG_ARGPTR; /* use the pointer */
}
break;
case HB_IT_DOUBLE:
Parm[ iCnt ].nWidth = sizeof( double );
Parm[ iCnt ].dArg = hb_itemGetND( pParam );
Parm[ iCnt ].numargs.dArg = hb_itemGetND( pParam );
if( hb_parinfo( i ) & HB_IT_BYREF )
{
Parm[ iCnt ].nWidth = sizeof( void * );
Parm[ iCnt ].pArg = &( Parm[ iCnt ].dArg );
Parm[ iCnt ].pArg = &( Parm[ iCnt ].numargs.dArg );
Parm[ iCnt ].dwFlags = DC_FLAG_ARGPTR; /* use the pointer */
}
@@ -569,7 +569,7 @@ static void DllExec( int iFlags, int iRtype, LPVOID lpFunction, PXPP_DLLEXEC xec
if( strncmp( hb_objGetClsName( hb_param( i, HB_IT_ANY ) ), "C Structure", 11 ) == 0 )
{
Parm[ iCnt ].nWidth = sizeof( void * );
Parm[ iCnt ].dwArg = ( DWORD ) hb_parcstruct( i );
Parm[ iCnt ].numargs.dwArg = ( DWORD ) hb_parcstruct( i );
break;
}
#endif
@@ -598,22 +598,22 @@ static void DllExec( int iFlags, int iRtype, LPVOID lpFunction, PXPP_DLLEXEC xec
switch( HB_ITEM_TYPE( hb_param( i, HB_IT_ANY ) ) )
{
case HB_IT_NIL:
hb_stornl( Parm[ iCnt ].dwArg, i );
hb_stornl( Parm[ iCnt ].numargs.dwArg, i );
break;
case HB_IT_POINTER:
hb_storptr( ( void * ) Parm[ iCnt ].dwArg, i );
hb_storptr( ( void * ) Parm[ iCnt ].numargs.dwArg, i );
break;
case HB_IT_INTEGER:
case HB_IT_LONG:
case HB_IT_DATE:
case HB_IT_LOGICAL:
hb_stornl( Parm[ iCnt ].dwArg, i );
hb_stornl( Parm[ iCnt ].numargs.dwArg, i );
break;
case HB_IT_DOUBLE:
hb_stornd( Parm[ iCnt ].dArg, i );
hb_stornd( Parm[ iCnt ].numargs.dArg, i );
break;
case HB_IT_STRING:

View File

@@ -326,7 +326,8 @@ LONG hb_PrintFileRaw( UCHAR * cPrinterName, UCHAR * cFileName, UCHAR * cDocName
UCHAR printBuffer[BIG_PRINT_BUFFER];
HANDLE hPrinter, hFile;
DOC_INFO_1 DocInfo;
DWORD nRead, nWritten, Result;
DWORD nRead, nWritten;
LONG Result;
LPTSTR lpPrinterName = HB_TCHAR_CONVTO( ( char * ) cPrinterName );
if( OpenPrinter( lpPrinterName, &hPrinter, NULL ) != 0 )
@@ -388,7 +389,7 @@ LONG hb_PrintFileRaw( UCHAR * cPrinterName, UCHAR * cFileName, UCHAR * cDocName
HB_FUNC( PRINTFILERAW )
{
UCHAR *cPrinterName, *cFileName, *cDocName;
DWORD Result = -1;
LONG Result = -1;
if( ISCHAR( 1 ) && ISCHAR( 2 ) )
{

View File

@@ -3645,7 +3645,7 @@ static ERRCODE adsOrderDestroy( ADSAREAP pArea, LPDBORDERINFO pOrderInfo )
static ERRCODE adsOrderInfo( ADSAREAP pArea, USHORT uiIndex, LPDBORDERINFO pOrderInfo )
{
ADSHANDLE hIndex;
ADSHANDLE hIndex = 0;
UNSIGNED8 aucBuffer[ MAX_STR_LEN + 1 ];
UNSIGNED16 u16len = MAX_STR_LEN;
UNSIGNED16 u16 = 0;

View File

@@ -243,7 +243,7 @@ static unsigned int SizeOfCStructure( PHB_ITEM aDef, unsigned int uiAlign )
{
uiPad = ( ( uiMemberSize < uiAlign ) ? uiMemberSize : uiAlign );
if( ( cShift = ( uiSize % uiPad ) ) > 0 )
if( ( cShift = ( BYTE ) ( uiSize % uiPad ) ) > 0 )
{
uiSize += ( uiPad - cShift );
}
@@ -255,7 +255,7 @@ static unsigned int SizeOfCStructure( PHB_ITEM aDef, unsigned int uiAlign )
}
if( ( cShift = ( uiSize % uiAlign ) ) > 0 )
if( ( cShift = ( BYTE ) ( uiSize % uiAlign ) ) > 0 )
{
uiSize += ( uiAlign - cShift );
}
@@ -484,7 +484,7 @@ static BYTE * ArrayToStructure( PHB_ITEM aVar, PHB_ITEM aDef, unsigned int uiAli
{
unsigned int uiPad = ( ( uiMemberSize < uiAlign ) ? uiMemberSize : uiAlign );
if( ( cShift = ( uiOffset % uiPad ) ) > 0 )
if( ( cShift = ( BYTE ) ( uiOffset % uiPad ) ) > 0 )
{
uiOffset += ( uiPad - cShift );
}
@@ -1168,7 +1168,7 @@ static PHB_ITEM StructureToArray( BYTE* Buffer, unsigned long ulBufferLen, PHB_I
{
unsigned int uiPad = ( ( uiMemberSize < uiAlign ) ? uiMemberSize : uiAlign );
if( ( cShift = ( uiOffset % uiPad ) ) > 0 )
if( ( cShift = ( BYTE ) ( uiOffset % uiPad ) ) > 0 )
{
uiOffset += ( uiPad - cShift );
}

View File

@@ -239,7 +239,7 @@ static MXML_STATUS mxml_attribute_read( MXML_REFIL *ref, PHB_ITEM pDoc, PHB_ITEM
default:
if ( isalpha( chr ) )
{
if ( mxml_sgs_append_char( buf_name, chr ) != MXML_STATUS_OK )
if ( mxml_sgs_append_char( buf_name, ( char ) chr ) != MXML_STATUS_OK )
{
hbxml_set_doc_status( ref, pDoc, pNode,
MXML_STATUS_MALFORMED, MXML_ERROR_NAMETOOLONG );
@@ -258,7 +258,7 @@ static MXML_STATUS mxml_attribute_read( MXML_REFIL *ref, PHB_ITEM pDoc, PHB_ITEM
case 1:
if ( isalnum( chr ) || chr == '_' || chr == '-' || chr == ':' )
{
if ( mxml_sgs_append_char( buf_name, chr ) != MXML_STATUS_OK )
if ( mxml_sgs_append_char( buf_name, ( char ) chr ) != MXML_STATUS_OK )
{
hbxml_set_doc_status( ref, pDoc, pNode,
MXML_STATUS_MALFORMED, MXML_ERROR_NAMETOOLONG );
@@ -335,12 +335,12 @@ static MXML_STATUS mxml_attribute_read( MXML_REFIL *ref, PHB_ITEM pDoc, PHB_ITEM
{
iStatus = 5;
iPosAmper = buf_attrib->length;
mxml_sgs_append_char( buf_attrib, chr ); /* we'll need it */
mxml_sgs_append_char( buf_attrib, ( char ) chr ); /* we'll need it */
}
else if( chr == MXML_LINE_TERMINATOR )
{
hbxml_doc_new_line( pDoc );
if ( mxml_sgs_append_char( buf_attrib, chr ) != MXML_STATUS_OK )
if ( mxml_sgs_append_char( buf_attrib, ( char ) chr ) != MXML_STATUS_OK )
{
hbxml_set_doc_status( ref, pDoc, pNode,
MXML_STATUS_MALFORMED, MXML_ERROR_ATTRIBTOOLONG );
@@ -350,7 +350,7 @@ static MXML_STATUS mxml_attribute_read( MXML_REFIL *ref, PHB_ITEM pDoc, PHB_ITEM
/* We repeat line terminator here for portability */
else
{
if ( mxml_sgs_append_char( buf_attrib, chr) != MXML_STATUS_OK )
if ( mxml_sgs_append_char( buf_attrib, ( char ) chr ) != MXML_STATUS_OK )
{
hbxml_set_doc_status( ref, pDoc, pNode, MXML_STATUS_MALFORMED, MXML_ERROR_ATTRIBTOOLONG );
return MXML_STATUS_MALFORMED;
@@ -382,7 +382,7 @@ static MXML_STATUS mxml_attribute_read( MXML_REFIL *ref, PHB_ITEM pDoc, PHB_ITEM
else if ( strncmp( bp, "apos", iAmpLen ) == 0 ) chr = '\'';
/** Reducing an SGS length is legal */
buf_attrib->length = iPosAmper;
mxml_sgs_append_char( buf_attrib, chr );
mxml_sgs_append_char( buf_attrib, ( char ) chr );
}
else if ( ! isalpha( chr ) )
{
@@ -392,7 +392,7 @@ static MXML_STATUS mxml_attribute_read( MXML_REFIL *ref, PHB_ITEM pDoc, PHB_ITEM
}
else
{
if ( mxml_sgs_append_char( buf_attrib, chr ) != MXML_STATUS_OK )
if ( mxml_sgs_append_char( buf_attrib, ( char ) chr ) != MXML_STATUS_OK )
{
hbxml_set_doc_status( ref, pDoc, pNode, MXML_STATUS_MALFORMED, MXML_ERROR_ATTRIBTOOLONG );
return MXML_STATUS_MALFORMED;
@@ -818,7 +818,7 @@ static void mxml_node_read_data( MXML_REFIL *ref, PHB_ITEM pNode, PHB_ITEM doc,
hbxml_doc_new_line( doc );
}
buf[ iPos++ ] = chr;
buf[ iPos++ ] = ( char ) chr;
if ( iPos >= iAllocated ) {
iAllocated += MXML_ALLOC_BLOCK;
@@ -894,7 +894,7 @@ static MXML_STATUS mxml_node_read_name( MXML_REFIL *ref, PHB_ITEM pNode, PHB_ITE
case 0:
if ( isalpha( chr ) ) {
/* can't cause reallocations */
buf[ iPos++ ] = chr;
buf[ iPos++ ] = ( char ) chr;
iStatus = 1;
}
else
@@ -909,7 +909,7 @@ static MXML_STATUS mxml_node_read_name( MXML_REFIL *ref, PHB_ITEM pNode, PHB_ITE
if ( isalnum( chr ) || chr == '_' || chr == '-' || chr == ':' )
{
/* can't cause reallocations */
buf[ iPos++ ] = chr;
buf[ iPos++ ] = ( char ) chr;
}
else if ( chr == '>' || chr == ' ' || chr == '/' || chr == '\r'
|| chr == '\t' || chr == '\n' )
@@ -1003,7 +1003,7 @@ static void mxml_node_read_directive( MXML_REFIL *ref, PHB_ITEM pNode, PHB_ITEM
chr = mxml_refil_getc( ref );
while ( chr != MXML_EOF && chr != '>') {
if ( iPos > 0 || ( chr != ' ' && chr != '\t' && chr != '\r' && chr != '\n' ) )
buf[ iPos++ ] = chr;
buf[ iPos++ ] = ( char ) chr;
if ( iPos >= iAllocated ) {
iAllocated += MXML_ALLOC_BLOCK;
@@ -1070,13 +1070,13 @@ static void mxml_node_read_pi( MXML_REFIL *ref, PHB_ITEM pNode, PHB_ITEM doc )
if ( chr == MXML_LINE_TERMINATOR )
{
hbxml_doc_new_line( doc );
buf[ iPos ++ ] = chr;
buf[ iPos ++ ] = ( char ) chr;
}
else if ( chr == '?' )
iStatus = 1;
else {
if ( iPos > 0 || ( chr != ' ' && chr != '\n' ) )
buf[ iPos++ ] = chr;
buf[ iPos++ ] = ( char ) chr;
}
break;
@@ -1136,7 +1136,7 @@ static void mxml_node_read_tag( MXML_REFIL *ref, PHB_ITEM pNode, PHB_ITEM doc,
/* if the list of attributes terminates with a '/', the last '>' is
left unread. This means the current node is complete. */
chr = mxml_refil_getc( ref );
chr = ( char ) mxml_refil_getc( ref );
if ( ref->status == MXML_STATUS_OK && chr != '>' )
{
mxml_refil_ungetc( ref, chr );
@@ -1180,12 +1180,12 @@ static void mxml_node_read_comment( MXML_REFIL *ref, PHB_ITEM pNode, PHB_ITEM do
if ( chr == MXML_LINE_TERMINATOR )
{
hbxml_doc_new_line( doc );
buf[ iPos ++ ] = chr;
buf[ iPos ++ ] = ( char ) chr;
}
else if ( chr == '-' )
iStatus = 1;
else
buf[ iPos++ ] = chr;
buf[ iPos++ ] = ( char ) chr;
break;
case 1:
@@ -1353,12 +1353,12 @@ static void mxml_node_read_cdata( MXML_REFIL *ref, PHB_ITEM pNode, PHB_ITEM pDoc
if ( chr == MXML_LINE_TERMINATOR )
{
hbxml_doc_new_line( pDoc );
buf[ iPos ++ ] = chr;
buf[ iPos ++ ] = ( char ) chr;
}
else if ( chr == ']' )
iStatus = 1;
else
buf[ iPos++ ] = chr;
buf[ iPos++ ] = ( char ) chr;
break;
case 1:
@@ -1421,7 +1421,7 @@ static int mxml_node_read_closing( MXML_REFIL *ref, PHB_ITEM pNode, PHB_ITEM doc
chr = mxml_refil_getc( ref );
while ( chr != MXML_EOF && chr != '>' && iPos < iLen) {
buf[ iPos++ ] = chr;
buf[ iPos++ ] = ( char ) chr;
chr = mxml_refil_getc( ref );
}
@@ -1966,7 +1966,7 @@ static void mxml_output_func_to_handle( MXML_OUTPUT *out, char *s, int len )
HB_FHANDLE fh = out->u.hFile;
int olen;
olen = hb_fsWrite( fh, (BYTE *) s, len );
olen = hb_fsWriteLarge( fh, (BYTE *) s, len );
if ( olen < len )
{
@@ -2121,7 +2121,7 @@ static void mxml_refill_from_handle_func( MXML_REFIL *ref )
HB_FHANDLE fh = ( HB_FHANDLE ) ref->u.hFile;
int len;
len = hb_fsRead( fh, (BYTE *) ref->buffer, ref->bufsize );
len = hb_fsReadLarge( fh, (BYTE *) ref->buffer, ref->bufsize );
if ( len == -1 )
{

View File

@@ -151,7 +151,7 @@ HB_FUNC( XHB_INDEX )
if( HB_IS_VALID_INDEX( ulIndex, ulLen ) )
{
char cValue = HB_IS_STRING( pValue ) ? hb_itemGetCPtr( pValue )[0] :
hb_itemGetNI( pValue );
( char ) hb_itemGetNI( pValue );
if( ulLen == 1 )
hb_itemPutCL( pSelf, &cValue, 1 );
else
@@ -221,7 +221,7 @@ HB_FUNC( XHB_PLUS )
pValue && HB_IS_NUMERIC( pValue ) )
{
UCHAR uc = ( UCHAR ) hb_itemGetCPtr( pSelf )[0];
uc += hb_itemGetNI( pValue );
uc += ( UCHAR ) hb_itemGetNI( pValue );
hb_retclen( ( char * ) &uc, 1 );
}
else if( HB_IS_HASH( pSelf ) && HB_IS_HASH( pValue ) )
@@ -254,7 +254,7 @@ HB_FUNC( XHB_MINUS )
pValue && HB_IS_NUMERIC( pValue ) )
{
UCHAR uc = ( UCHAR ) hb_itemGetCPtr( pSelf )[0];
uc -= hb_itemGetNI( pValue );
uc -= ( UCHAR ) hb_itemGetNI( pValue );
hb_retclen( ( char * ) &uc, 1 );
}
else if( HB_IS_HASH( pSelf ) && HB_IS_HASH( pValue ) )

View File

@@ -145,7 +145,8 @@ Core
work, but it lets build the rest of Harbour (like hbrun.exe).
- PCRE lib upgraded to 7.8 RC1 (from 7.7)
- Fixed dbInfo( DBI_POSITIONED ) returned value.
- Fixed potential internal error in dirty index reading.
- Fixed internal error in dirty index reading.
- Fixed return value of HB_INETGETSNDBUFSIZE().
Contrib
=============================
@@ -193,6 +194,7 @@ Contrib
implementation, this new one is completely portable and
fixes some potential leaks and GPFs. This code could use
some more testing, be aware.
- hbbmcdx fixed internal error in dirty index reading.
Known build issues
=============================

View File

@@ -70,11 +70,11 @@
static void hb_gaugeUpdate( PHB_ITEM pArray, float fPercent )
{
int iCenter = ( ( hb_arrayGetNL( pArray, B_RIGHT ) - hb_arrayGetNL( pArray, B_LEFT ) ) / 2 ) + 1;
int iRatio = hb_arrayGetNL( pArray, B_RIGHT ) - hb_arrayGetNL( pArray, B_LEFT ) - 1;
int iRow;
int iCols;
int iMax;
SHORT iCenter = ( SHORT ) ( ( ( hb_arrayGetNI( pArray, B_RIGHT ) - hb_arrayGetNI( pArray, B_LEFT ) ) / 2 ) + 1 );
SHORT iRatio = ( SHORT ) ( hb_arrayGetNI( pArray, B_RIGHT ) - hb_arrayGetNI( pArray, B_LEFT ) - 1 );
SHORT iRow;
SHORT iCols;
SHORT iMax;
char szOldColor[ HB_CLRSTR_LEN ];
char * szStr = " ";
char szPct[ 5 ];
@@ -83,25 +83,29 @@ static void hb_gaugeUpdate( PHB_ITEM pArray, float fPercent )
hb_gtSetColorStr( hb_arrayGetCPtr( pArray, B_BARCOLOR ) );
fPercent = ( fPercent < 0 ? 0 : ( fPercent > 1 ? 1 : fPercent ) );
iCols = (int) (fPercent * iRatio);
iCols = ( SHORT ) ( fPercent * iRatio );
if( hb_arrayGetL( pArray, B_DISPLAYNUM ) )
{
snprintf( szPct, sizeof( szPct ), "%3.0f%%", fPercent * 100 );
hb_gtWriteAt( (USHORT) hb_arrayGetNL( pArray, B_TOP ),
(USHORT) iCenter + 2, (BYTE *) szPct, 4 );
hb_gtWriteAt( ( SHORT ) hb_arrayGetNI( pArray, B_TOP ),
iCenter + 2,
( BYTE * ) szPct, 4 );
}
hb_gtBox( hb_arrayGetNI( pArray, B_TOP ) + 1, hb_arrayGetNI( pArray, B_LEFT ) + 1,
hb_arrayGetNI( pArray, B_BOTTOM ) - 1, hb_arrayGetNI( pArray, B_RIGHT ) - 1,
hb_gtBox( ( SHORT ) hb_arrayGetNI( pArray, B_TOP ) + 1,
( SHORT ) hb_arrayGetNI( pArray, B_LEFT ) + 1,
( SHORT ) hb_arrayGetNI( pArray, B_BOTTOM ) - 1,
( SHORT ) hb_arrayGetNI( pArray, B_RIGHT ) - 1,
( BYTE * ) szStr );
iMax = hb_arrayGetNL( pArray, B_BOTTOM ) - hb_arrayGetNL( pArray, B_TOP ) - 1;
iMax = ( SHORT ) ( hb_arrayGetNI( pArray, B_BOTTOM ) - hb_arrayGetNI( pArray, B_TOP ) - 1 );
for( iRow = 1; iRow <= iMax; iRow++ )
{
hb_gtRepChar( (USHORT) (iRow + hb_arrayGetNL( pArray, B_TOP )),
(USHORT) (hb_arrayGetNL( pArray, B_LEFT ) + 1),
( BYTE ) * hb_arrayGetCPtr( pArray, B_BARCHAR ), iCols );
hb_gtRepChar( ( SHORT ) ( hb_arrayGetNI( pArray, B_TOP ) + iRow ),
( SHORT ) ( hb_arrayGetNI( pArray, B_LEFT ) + 1 ),
( BYTE ) * hb_arrayGetCPtr( pArray, B_BARCHAR ),
iCols );
}
hb_gtSetColorStr( szOldColor );
@@ -146,28 +150,29 @@ HB_FUNC( GAUGEDISPLAY )
if( pArray )
{
int iCenter = ( ( hb_arrayGetNL( pArray, B_RIGHT ) - hb_arrayGetNL( pArray, B_LEFT ) ) / 2 ) + 1;
SHORT iCenter = ( SHORT ) ( ( ( hb_arrayGetNI( pArray, B_RIGHT ) - hb_arrayGetNI( pArray, B_LEFT ) ) / 2 ) + 1 );
char szOldColor[ HB_CLRSTR_LEN ];
char * szStr = " ";
hb_gtGetColorStr( szOldColor );
hb_gtSetColorStr( hb_arrayGetCPtr( pArray, B_BACKCOLOR ) );
hb_gtBox( (SHORT) hb_arrayGetNL( pArray, B_TOP ),
(SHORT) hb_arrayGetNL( pArray, B_LEFT ),
(SHORT) hb_arrayGetNL( pArray, B_BOTTOM ),
(SHORT) hb_arrayGetNL( pArray, B_RIGHT ),
(BYTE *) szStr );
hb_gtBox( ( SHORT) hb_arrayGetNI( pArray, B_TOP ),
( SHORT) hb_arrayGetNI( pArray, B_LEFT ),
( SHORT) hb_arrayGetNI( pArray, B_BOTTOM ),
( SHORT) hb_arrayGetNI( pArray, B_RIGHT ),
( BYTE * ) szStr );
hb_gtBox( (SHORT) hb_arrayGetNL( pArray, B_TOP ),
(SHORT) hb_arrayGetNL( pArray, B_LEFT ),
(SHORT) hb_arrayGetNL( pArray, B_BOTTOM ),
(SHORT) hb_arrayGetNL( pArray, B_RIGHT ),
(BYTE *) B_BOXLINES );
hb_gtBox( ( SHORT ) hb_arrayGetNI( pArray, B_TOP ),
( SHORT ) hb_arrayGetNI( pArray, B_LEFT ),
( SHORT ) hb_arrayGetNI( pArray, B_BOTTOM ),
( SHORT ) hb_arrayGetNI( pArray, B_RIGHT ),
( BYTE * ) B_BOXLINES );
if( hb_arrayGetL( pArray, B_DISPLAYNUM ) )
hb_gtWriteAt( (USHORT) hb_arrayGetNL( pArray, B_TOP ),
iCenter, ( BYTE * ) "[ ]", 8 );
hb_gtWriteAt( ( SHORT ) hb_arrayGetNI( pArray, B_TOP ),
iCenter,
( BYTE * ) "[ ]", 8 );
hb_gtSetColorStr( szOldColor );