2010-02-15 15:12 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)

* harbour/contrib/hbfbird/firebird.c
    ! use native type for GC pointer item holder instead of casting
      to 'void *'. Such casting may strip significant data when handler
      is wider type then pointer.

  * harbour/contrib/hbnf/fttext.c
    ! fixed unnecessary casting
This commit is contained in:
Przemyslaw Czerpak
2010-02-15 14:12:56 +00:00
parent 80500fce7f
commit a2f9a20abc
3 changed files with 18 additions and 8 deletions

View File

@@ -17,6 +17,15 @@
past entries belonging to author(s): Viktor Szakats.
*/
2010-02-15 15:12 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/contrib/hbfbird/firebird.c
! use native type for GC pointer item holder instead of casting
to 'void *'. Such casting may strip significant data when handler
is wider type then pointer.
* harbour/contrib/hbnf/fttext.c
! fixed unnecessary casting
2010-02-15 12:33 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/src/vm/hvm.c
* minor cleanup

View File

@@ -75,7 +75,7 @@
static HB_GARBAGE_FUNC( FB_db_handle_release )
{
void ** ph = ( void ** ) Cargo;
isc_db_handle * ph = ( isc_db_handle * ) Cargo;
/* Check if pointer is not NULL to avoid multiple freeing */
if( ph && * ph )
@@ -83,10 +83,10 @@ static HB_GARBAGE_FUNC( FB_db_handle_release )
ISC_STATUS_ARRAY status;
/* Destroy the object */
isc_detach_database( status, ( isc_db_handle * ) ph );
isc_detach_database( status, ph );
/* set pointer to NULL to avoid multiple freeing */
* ph = NULL;
* ph = 0;
}
}
@@ -100,9 +100,10 @@ static void hb_FB_db_handle_ret( isc_db_handle p )
{
if( p )
{
void ** ph = ( void ** ) hb_gcAllocate( sizeof( isc_db_handle ), &s_gcFB_db_handleFuncs );
isc_db_handle * ph = ( isc_db_handle * )
hb_gcAllocate( sizeof( isc_db_handle ), &s_gcFB_db_handleFuncs );
* ph = ( void * ) p;
* ph = p;
hb_retptrGC( ph );
}
@@ -112,9 +113,9 @@ static void hb_FB_db_handle_ret( isc_db_handle p )
static isc_db_handle hb_FB_db_handle_par( int iParam )
{
void ** ph = ( void ** ) hb_parptrGC( &s_gcFB_db_handleFuncs, iParam );
isc_db_handle * ph = ( isc_db_handle * ) hb_parptrGC( &s_gcFB_db_handleFuncs, iParam );
return ( isc_db_handle ) ( HB_PTRDIFF ) ( ph ? * ph : 0 );
return ph ? * ph : 0;
}
/* API wrappers */

View File

@@ -1839,7 +1839,7 @@ static int _ins_buff( int iLen )
while( WriteLen > 0 )
{
/* position to beginning of write area */
if( hb_fsSeekLarge( handles[area], fpWrite, FS_SET ) != (unsigned long) fpWrite )
if( hb_fsSeekLarge( handles[area], fpWrite, FS_SET ) != fpWrite )
{
error[area] = hb_fsError();
break;