Re: passing #define'd value to callback



on 10/11/00 11:31 PM, Peter Wurmsdobler at peter wurmsdobler ctm-france com
wrote:

This was my first attempt before posting the question,
but the result was a segmentation fault, maybe because
GINT_TO_POINTER() is nothing but (gpointer) which is
again (void *). Using this for 0 results in (void *)0
which is NULL. However I would like 0 and 1 because
I can directly use the values rather than strings.

The technique definitely works; I have done it many times and seen it many
places throughout the Gtk code too. It seems you have some other bug if you
got a segmentation fault. The fact that GINT_TO_POINTER(0) is the same as
NULL is irrelevant. Nothing tries to dereference the pointer.

    -- Darin





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]