2009-10-23 09:46 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)

* harbour/contrib/hbpgsql/postgres.c
  * harbour/contrib/hbgd/gdwrp.c
    * updated code which was using hb_gcAlloc() to work with new GC API.
This commit is contained in:
Przemyslaw Czerpak
2009-10-23 07:46:42 +00:00
parent a70ce60954
commit 434812c2fc
3 changed files with 38 additions and 13 deletions

View File

@@ -17,6 +17,11 @@
past entries belonging to author(s): Viktor Szakats.
*/
2009-10-23 09:46 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/contrib/hbpgsql/postgres.c
* harbour/contrib/hbgd/gdwrp.c
* updated code which was using hb_gcAlloc() to work with new GC API.
2009-10-23 09:24 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/src/rdd/dbfnsx/dbfnsx1.c
! fixed bug reported by Jaroslav Janik (many thanks) - if index FOR

View File

@@ -121,6 +121,13 @@ static HB_GARBAGE_FUNC( hb_gdImage_Destructor )
}
}
static const HB_GC_FUNCS s_gcGDimageFuncs =
{
hb_gdImage_Destructor,
hb_gcDummyMark
};
/* ---------------------------------------------------------------------------*/
/* function returns gdImage pointer or NULL when wrong variable is
@@ -129,7 +136,7 @@ static HB_GARBAGE_FUNC( hb_gdImage_Destructor )
static gdImagePtr hb_parGdImage( int iParam )
{
gdImagePtr * imPtr =
( gdImagePtr * ) hb_parptrGC( hb_gdImage_Destructor, iParam );
( gdImagePtr * ) hb_parptrGC( &s_gcGDimageFuncs, iParam );
if( imPtr )
return * imPtr;
@@ -145,8 +152,8 @@ static void hb_retGdImage( gdImagePtr im )
{
gdImagePtr * imPtr;
imPtr = ( gdImagePtr * ) hb_gcAlloc( sizeof( gdImagePtr ),
hb_gdImage_Destructor );
imPtr = ( gdImagePtr * ) hb_gcAllocate( sizeof( gdImagePtr ),
&s_gcGDimageFuncs );
* imPtr = im;
hb_retptrGC( ( void * ) imPtr );
}
@@ -160,8 +167,8 @@ static PHB_ITEM hb_gdImageItemNew( gdImagePtr im )
{
gdImagePtr * imPtr;
imPtr = ( gdImagePtr * ) hb_gcAlloc( sizeof( gdImagePtr ),
hb_gdImage_Destructor );
imPtr = ( gdImagePtr * ) hb_gcAllocate( sizeof( gdImagePtr ),
&s_gcGDimageFuncs );
* imPtr = im;
return hb_itemPutPtrGC( NULL, ( void * ) imPtr );
}
@@ -193,6 +200,12 @@ static HB_GARBAGE_FUNC( hb_gdFont_Destructor )
}
}
static const HB_GC_FUNCS s_gcGDfontFuncs =
{
hb_gdFont_Destructor,
hb_gcDummyMark
};
/* ---------------------------------------------------------------------------*/
/* function returns gdFont pointer or NULL when wrong variable is
@@ -201,7 +214,7 @@ static HB_GARBAGE_FUNC( hb_gdFont_Destructor )
static gdFontPtr hb_parGdFont( int iParam )
{
gdFontPtr * fontPtr =
( gdFontPtr * ) hb_parptrGC( hb_gdFont_Destructor, iParam );
( gdFontPtr * ) hb_parptrGC( &s_gcGDfontFuncs, iParam );
if( fontPtr )
return * fontPtr;
@@ -217,8 +230,8 @@ static void hb_retGdFont( gdFontPtr font )
{
gdFontPtr * fontPtr;
fontPtr = ( gdFontPtr * ) hb_gcAlloc( sizeof( gdFontPtr ),
hb_gdFont_Destructor );
fontPtr = ( gdFontPtr * ) hb_gcAllocate( sizeof( gdFontPtr ),
&s_gcGDfontFuncs );
* fontPtr = font;
hb_retptrGC( ( void * ) fontPtr );
}
@@ -232,8 +245,8 @@ static PHB_ITEM hb_gdFontItemNew( gdFontPtr font )
{
gdFontPtr * fontPtr;
fontPtr = ( gdFontPtr * ) hb_gcAlloc( sizeof( gdFontPtr ),
hb_gdFont_Destructor );
fontPtr = ( gdFontPtr * ) hb_gcAllocate( sizeof( gdFontPtr ),
&s_gcGDfontFuncs );
* fontPtr = font;
return hb_itemPutPtrGC( NULL, ( void * ) fontPtr );
}

View File

@@ -108,9 +108,16 @@ static HB_GARBAGE_FUNC( PGconn_release )
}
}
static const HB_GC_FUNCS s_gcPGconnFuncs =
{
PGconn_release,
hb_gcDummyMark
};
static void PGconn_ret( PGconn * p )
{
void ** ph = ( void ** ) hb_gcAlloc( sizeof( PGconn * ), PGconn_release );
void ** ph = ( void ** ) hb_gcAllocate( sizeof( PGconn * ), &s_gcPGconnFuncs );
* ph = p;
@@ -120,7 +127,7 @@ static void PGconn_ret( PGconn * p )
static PGconn * PGconn_par( int iParam )
{
void ** ph = ( void ** ) hb_parptrGC( PGconn_release, iParam );
void ** ph = ( void ** ) hb_parptrGC( &s_gcPGconnFuncs, iParam );
return ph ? ( PGconn * ) * ph : NULL;
}
@@ -160,7 +167,7 @@ HB_FUNC( PQSETDBLOGIN )
HB_FUNC( PQCLOSE )
{
void ** ph = ( void ** ) hb_parptrGC( PGconn_release, 1 );
void ** ph = ( void ** ) hb_parptrGC( &s_gcPGconnFuncs, 1 );
/* Check if pointer is not NULL to avoid multiple freeing */
if( ph && * ph )