2009-06-25 12:47 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)

* contrib/hbct/ascpos.c
  * contrib/hbct/ctwfunc.c
  * contrib/hbct/ctcrypt.c
  * contrib/xhb/filestat.c
  * contrib/hbsqlit3/hbsqlit3.c
  * contrib/hbnf/fttext.c
  * contrib/hbpgsql/postgres.c
  * contrib/hbfimage/fi_wrp.c
  * contrib/hbgd/gdwrp.c
  * source/rtl/mouse53.c
    * 'const' cleanup.
    ; NOTE: I rather didn't commit BYTE to char in CTWIN.
    ; TOFIX: Some of these will result in warnings when passing values
             to external API calls. I'd like to ask developers to review
             what the intent was. Sometimes external API declarations
             are missing 'const', so it's safe to pass them these buffers,
             but it should be checked in documentation.
      ---
      ../../fi_wrp.c: In function 'HB_FUN_FI_LOADFROMMEM':
      ../../fi_wrp.c:372: warning: passing argument 1 of 'FreeImage_OpenMemory' discards qualifiers from pointer target type
      C:\devl\FreeImage-3.12.0\Dist/FreeImage.h:771: note: expected 'BYTE *' but argument is of type 'const BYTE *'
      ../../fi_wrp.c: In function 'HB_FUN_FI_GETFILETYPEFROMMEM':
      ../../fi_wrp.c:887: warning: passing argument 1 of 'FreeImage_OpenMemory' discards qualifiers from pointer target type
      C:\devl\FreeImage-3.12.0\Dist/FreeImage.h:771: note: expected 'BYTE *' but argument is of type 'const BYTE *'

      ../../gdwrp.c: In function 'HB_FUN_GDIMAGESTRINGFTEX':
      ../../gdwrp.c:2718: warning: passing argument 4 of 'gdImageStringFTEx' discards qualifiers from pointer target type
      C:\devl\gd-2.0.34\include/gd.h:459: note: expected 'char *' but argument is of type 'const char *'
      ../../gdwrp.c:2718: warning: passing argument 9 of 'gdImageStringFTEx' discards qualifiers from pointer target type
      C:\devl\gd-2.0.34\include/gd.h:459: note: expected 'char *' but argument is of type 'const char *'
      ../../gdwrp.c: In function 'HB_FUN_GDIMAGESTRINGFTCIRCLE':
      ../../gdwrp.c:2809: warning: passing argument 7 of 'gdImageStringFTCircle' discards qualifiers from pointer target type
      C:\devl\gd-2.0.34\include/gdfx.h:41: note: expected 'char *' but argument is of type 'const char *'
      ../../gdwrp.c:2809: warning: passing argument 9 of 'gdImageStringFTCircle' discards qualifiers from pointer target type
      C:\devl\gd-2.0.34\include/gdfx.h:41: note: expected 'char *' but argument is of type 'const char *'
      ../../gdwrp.c:2809: warning: passing argument 10 of 'gdImageStringFTCircle' discards qualifiers from pointer target type
      C:\devl\gd-2.0.34\include/gdfx.h:41: note: expected 'char *' but argument is of type 'const char *'
      ---
This commit is contained in:
Viktor Szakats
2009-06-26 10:51:04 +00:00
parent 9c9bd626a0
commit bd923f154d
11 changed files with 79 additions and 39 deletions

View File

@@ -17,6 +17,46 @@
past entries belonging to author(s): Viktor Szakats.
*/
2009-06-25 12:47 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* contrib/hbct/ascpos.c
* contrib/hbct/ctwfunc.c
* contrib/hbct/ctcrypt.c
* contrib/xhb/filestat.c
* contrib/hbsqlit3/hbsqlit3.c
* contrib/hbnf/fttext.c
* contrib/hbpgsql/postgres.c
* contrib/hbfimage/fi_wrp.c
* contrib/hbgd/gdwrp.c
* source/rtl/mouse53.c
* 'const' cleanup.
; NOTE: I rather didn't commit BYTE to char in CTWIN.
; TOFIX: Some of these will result in warnings when passing values
to external API calls. I'd like to ask developers to review
what the intent was. Sometimes external API declarations
are missing 'const', so it's safe to pass them these buffers,
but it should be checked in documentation.
---
../../fi_wrp.c: In function 'HB_FUN_FI_LOADFROMMEM':
../../fi_wrp.c:372: warning: passing argument 1 of 'FreeImage_OpenMemory' discards qualifiers from pointer target type
C:\devl\FreeImage-3.12.0\Dist/FreeImage.h:771: note: expected 'BYTE *' but argument is of type 'const BYTE *'
../../fi_wrp.c: In function 'HB_FUN_FI_GETFILETYPEFROMMEM':
../../fi_wrp.c:887: warning: passing argument 1 of 'FreeImage_OpenMemory' discards qualifiers from pointer target type
C:\devl\FreeImage-3.12.0\Dist/FreeImage.h:771: note: expected 'BYTE *' but argument is of type 'const BYTE *'
../../gdwrp.c: In function 'HB_FUN_GDIMAGESTRINGFTEX':
../../gdwrp.c:2718: warning: passing argument 4 of 'gdImageStringFTEx' discards qualifiers from pointer target type
C:\devl\gd-2.0.34\include/gd.h:459: note: expected 'char *' but argument is of type 'const char *'
../../gdwrp.c:2718: warning: passing argument 9 of 'gdImageStringFTEx' discards qualifiers from pointer target type
C:\devl\gd-2.0.34\include/gd.h:459: note: expected 'char *' but argument is of type 'const char *'
../../gdwrp.c: In function 'HB_FUN_GDIMAGESTRINGFTCIRCLE':
../../gdwrp.c:2809: warning: passing argument 7 of 'gdImageStringFTCircle' discards qualifiers from pointer target type
C:\devl\gd-2.0.34\include/gdfx.h:41: note: expected 'char *' but argument is of type 'const char *'
../../gdwrp.c:2809: warning: passing argument 9 of 'gdImageStringFTCircle' discards qualifiers from pointer target type
C:\devl\gd-2.0.34\include/gdfx.h:41: note: expected 'char *' but argument is of type 'const char *'
../../gdwrp.c:2809: warning: passing argument 10 of 'gdImageStringFTCircle' discards qualifiers from pointer target type
C:\devl\gd-2.0.34\include/gdfx.h:41: note: expected 'char *' but argument is of type 'const char *'
---
2009-06-26 12:27 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/contrib/Makefile
* harbour/contrib/hbbmcdx/bmdbfcdx.c

View File

@@ -68,7 +68,7 @@ static void do_ascpos( int iSwitch )
if( HB_ISCHAR( 1 ) )
{
size_t sStrSize = hb_parclen( 1 );
BYTE *pcString = ( BYTE * ) hb_parc( 1 );
const BYTE *pcString = ( const BYTE * ) hb_parc( 1 );
size_t sPos;
if( HB_ISNUM( 2 ) )

View File

@@ -58,10 +58,10 @@ HB_FUNC( CRYPT )
if( ulCryptLen >= 2 )
{
BYTE *pbyCrypt = ( BYTE * ) hb_parc( 2 );
const BYTE *pbyCrypt = ( const BYTE * ) hb_parc( 2 );
ULONG ulCryptPos = 0;
BYTE *pbyString = ( BYTE * ) hb_parc( 1 );
const BYTE *pbyString = ( const BYTE * ) hb_parc( 1 );
ULONG ulStringLen = hb_parclen( 1 );
ULONG ulStringPos;

View File

@@ -207,12 +207,13 @@ HB_FUNC( WBOX )
"ÞÛÝÝÝÛÞÞ", /* 14 WB_FULL_HALF */
"ÛÛÛÛÛÛÛÛ" }; /* 15 WB_FULL */
BYTE * szBox, szBoxBuf[ 10 ];
const BYTE * szBox;
BYTE szBoxBuf[ 10 ];
int iColor;
if( HB_ISCHAR( 1 ) )
{
szBox = ( BYTE * ) hb_parc( 1 );
szBox = ( const BYTE * ) hb_parc( 1 );
}
else
{
@@ -336,7 +337,7 @@ HB_FUNC( CTWLASTKEY )
hb_retni( hb_ctwLastKey() );
}
/* NOTE: These two functions are emulating the MaxRow()/MaxCol() core functions
/* NOTE: These two functions are emulating the MaxRow()/MaxCol() core functions
"overloaded" by the CT3 library. */
HB_FUNC( HBCT_MAXROW ) /* Return the maximum screen/window row number (zero origin) */

View File

@@ -360,12 +360,12 @@ HB_FUNC( FI_LOADFROMMEM )
FIBITMAP *dib;
FREE_IMAGE_FORMAT fif;
FIMEMORY *stream;
BYTE *szImage;
const BYTE *szImage;
int flags;
/* Retrieve parameters */
fif = (FREE_IMAGE_FORMAT) hb_parni( 1 );
szImage = ( BYTE * ) hb_parcx( 2 );
szImage = ( const BYTE * ) hb_parcx( 2 );
flags = hb_parni( 3 );
/* run function */
@@ -878,12 +878,12 @@ HB_FUNC( FI_GETFILETYPEFROMMEM )
hb_parinfo( 1 ) & HB_IT_STRING
)
{
BYTE * szImage;
const BYTE * szImage;
FIMEMORY *stream;
int size;
/* Retrieve parameters */
szImage = ( BYTE * ) hb_parcx( 1 );
szImage = ( const BYTE * ) hb_parcx( 1 );
stream = FreeImage_OpenMemory( szImage, hb_parclen(1) );
size = ( hb_parinfo( 2 ) & HB_IT_NUMERIC ? hb_parni( 1 ) : 0 );

View File

@@ -2628,10 +2628,10 @@ HB_FUNC( GDIMAGESTRINGFTEX )
gdImagePtr im;
gdFTStringExtra extra;
int fg;
char *fontname;
const char *fontname;
double ptsize, angle;
int x, y, i;
char *string;
const char *string;
PHB_ITEM pRect;
int aRect[8];
char *err;
@@ -2768,10 +2768,10 @@ HB_FUNC( GDIMAGESTRINGFTCIRCLE ) /* char *gdImageStringFTCircle(gdImagePtr im, i
gdImagePtr im;
int cx, cy;
double radius, textRadius, fillPortion, points;
char *top;
const char *top;
const char *bottom;
int fgcolor;
char *font;
const char *font;
char *err;
/* Retrieve image pointer */

View File

@@ -191,7 +191,7 @@ static int _findbol( BYTE * buf, int buf_len );
static int _ins_buff( int bytes );
static int _del_buff( int bytes );
static long _ft_skip( long recs );
static int _writeLine( BYTE * theData, ULONG iDataLen );
static int _writeLine( const BYTE * theData, ULONG iDataLen );
static BOOL _writeeol( HB_FHANDLE fhnd );
/* arrays used by the text workareas */
@@ -1330,7 +1330,7 @@ HB_FUNC( FT_FAPPEND )
HB_FUNC( FT_FWRITEL )
{
BYTE * theData = ( BYTE * ) hb_parc( 1 );
const BYTE * theData = ( const BYTE * ) hb_parc( 1 );
int iDataLen = hb_parclen( 1 );
int lInsert = ( HB_ISLOG( 2 ) ? hb_parl( 2 ) : 0 );
int err;
@@ -1720,16 +1720,16 @@ static int _findbol( BYTE * buf, int buf_len )
{
p--;
tmp--;
if( tmp == 0 )
return buf_len;
}
if( b == FT_CHR_LF )
{
p--;
tmp--;
if( tmp == 0 )
return buf_len;
@@ -1737,12 +1737,12 @@ static int _findbol( BYTE * buf, int buf_len )
{
p--;
tmp--;
if( tmp == 0 )
return buf_len;
}
}
for( ; tmp > 0; tmp--, p-- )
{
if( *p == FT_CHR_LF && *( p - 1 ) == FT_CHR_CR )
@@ -1956,7 +1956,7 @@ static int _del_buff( int iLen )
/*--------------------------------------------------------------------------*/
/* writes a line of data to the file, including the terminating CRLF */
static int _writeLine( BYTE * theData, ULONG iDataLen )
static int _writeLine( const BYTE * theData, ULONG iDataLen )
{
int err = 0;

View File

@@ -564,11 +564,9 @@ HB_FUNC( PQESCAPESTRING )
HB_FUNC( PQESCAPEBYTEA ) /* deprecated */
{
unsigned const char * from = ( BYTE * ) hb_parc( 1 );
size_t from_length = hb_parclen( 1 );
size_t to_length = from_length * 5 + 1;
unsigned char * to = PQescapeBytea( from, from_length, &to_length );
unsigned char * to = PQescapeBytea( ( const unsigned char * ) hb_parcx( 1 ), from_length, &to_length );
hb_retc( ( char * ) to ); /* TOFIX: ? hb_retc( ( char * ) to, to_length ); */
PQfreemem( to );
}
@@ -577,7 +575,7 @@ HB_FUNC( PQESCAPEBYTEA ) /* deprecated */
HB_FUNC( PQUNESCAPEBYTEA )
{
size_t to_length;
unsigned char * from = PQunescapeBytea( ( BYTE * ) hb_parcx( 1 ), &to_length );
unsigned char * from = PQunescapeBytea( ( const unsigned char * ) hb_parcx( 1 ), &to_length );
hb_retclen( ( char * ) from, to_length );
PQfreemem( from );
}

View File

@@ -547,7 +547,7 @@ HB_FUNC( SQLITE3_TEMP_DIRECTORY )
#ifdef SQLITE3_LIB
{
BOOL fFree;
BYTE *pszDirName = hb_fsNameConv( ( BYTE * ) hb_parcx(1), &fFree );
BYTE *pszDirName = hb_fsNameConv( hb_parcx(1), &fFree );
if( hb_fsIsDirectory(pszDirName) )
{
@@ -956,7 +956,7 @@ HB_FUNC( SQLITE3_BIND_BLOB )
if( pStmt )
{
hb_retni( sqlite3_bind_blob(pStmt, hb_parni(2), ( const char * ) hb_parcx(3), hb_parcsiz(3) - 1, SQLITE_TRANSIENT) );
hb_retni( sqlite3_bind_blob(pStmt, hb_parni(2), hb_parcx(3), hb_parcsiz(3) - 1, SQLITE_TRANSIENT) );
}
else
{
@@ -1027,7 +1027,7 @@ HB_FUNC( SQLITE3_BIND_TEXT )
if( pStmt )
{
hb_retni( sqlite3_bind_text(pStmt, hb_parni(2), ( const char * ) hb_parc(3), hb_parclen(3), SQLITE_TRANSIENT) );
hb_retni( sqlite3_bind_text(pStmt, hb_parni(2), hb_parc(3), hb_parclen(3), SQLITE_TRANSIENT) );
}
else
{
@@ -1467,9 +1467,9 @@ HB_FUNC( SQLITE3_TABLE_COLUMN_METADATA )
sqlite3_table_column_metadata
(
pHbSqlite3->db,
( const char * ) hb_parc(2) /* zDbName */,
( const char * ) hb_parc(3) /* zTableName */,
( const char * ) hb_parc(4) /* zColumnName */,
hb_parc(2) /* zDbName */,
hb_parc(3) /* zTableName */,
hb_parc(4) /* zColumnName */,
&pzDataType /* pzDataDtype */,
&pzCollSeq /* pzCollSeq */,
&iNotNull,
@@ -1572,9 +1572,9 @@ HB_FUNC( SQLITE3_BLOB_OPEN )
sqlite3_blob_open
(
pHbSqlite3->db,
( const char * ) hb_parc(2) /* zDb */,
( const char * ) hb_parc(3) /* zTable */,
( const char * ) hb_parc(4) /* zColumn */,
hb_parc(2) /* zDb */,
hb_parc(3) /* zTable */,
hb_parc(4) /* zColumn */,
(sqlite3_int64) hb_parnint(5) /* iRow */,
hb_parni(6) /* flags */,
&ppBlob

View File

@@ -71,7 +71,7 @@
#endif
static BOOL hb_fsFileStats(
BYTE *pszFileName,
const char *pszFileName,
BYTE *pszAttr,
HB_FOFFSET *llSize,
LONG *lcDate,
@@ -85,7 +85,7 @@ static BOOL hb_fsFileStats(
struct stat statbuf;
if( stat( ( char * ) pszFileName, &statbuf ) == 0 )
if( stat( pszFileName, &statbuf ) == 0 )
{
// determine if we can read/write/execute the file
USHORT usAttr, ushbAttr = 0;
@@ -265,7 +265,8 @@ static BOOL hb_fsFileStats(
HB_FUNC( FILESTATS )
{
BYTE szAttr[21], *szFile = ( BYTE * ) hb_parc( 1 );
BYTE szAttr[ 21 ];
const char * szFile = hb_parc( 1 );
HB_FOFFSET lSize = 0;
LONG lcDate = 0, lcTime = 0, lmDate = 0, lmTime = 0;

View File

@@ -154,7 +154,7 @@ HB_FUNC( MRESTSTATE )
{
if( HB_ISCHAR( 1 ) && hb_parclen( 1 ) == ( ULONG ) hb_mouseStorageSize() )
{
hb_mouseRestoreState( ( BYTE * ) hb_parc( 1 ) );
hb_mouseRestoreState( ( const BYTE * ) hb_parc( 1 ) );
}
}