Hi Przemek,

The ides of hb_itemGetPtrGC() is to _NOT_ make such things and return
_ONLY_ pointers which are exactly the requested type.

... Ok, I can assume so.

       return ( HANDLE ) ( ph ? *ph : NULL );

But this assumes that it's always GC.
Perhaps we need an API function .-

BOOL hb_itemIsGC( PHB_ITEM pItem )
{
   return (pItem && HB_IS_POINTER( pItem ) && pItem->item.asPointer.collect);
}

... will probably cause GPF or other bad side effects.

IMHO this is always difficult against misuse or indirection of pointers.
Maybe another kind of runtime type identification could help.
I don't know now.

Best regards,
Xavi
_______________________________________________
Harbour mailing list (attachment size limit: 40KB)
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to