Re: What is GINT_TO_POINTER(6) intended for?



Le Wed, Jul 03, 2002, à 10:00:20AM -0300, Dolores Alia de Saravia a écrit:
It was quite easy for me to write a new object by imitating 
UML/object.c    y chronogram/chronoline.c 

This is great news ! (wow -- imitating chronoline.c -- not for the faint of
                      heart)


But I would like to understand a bit more;  I use 
GINT_TO_POINTER (2), or  INT_TO_POINTER (6) or INT_TO_POINTER (10)
and there are no visible differences ...

GINT_TO_POINTER(x) is GLibese for ((void *)(x))

I guess I could be more helpful if you could point me at some context... (I
suspect it's related to the possibility to have the same underlying type
appear several times on a sheet with different defaults, eg: in the GRAFCET
sheet, Step and Initial Step are the same object, but with different
initialisation parameters. IIRC, the "variant" value is passed as a "void
*", so as we need to pass an int, we cast it using GINT_TO_POINTER (and
GPOINTER_TO_INT)).

        -- Cyrille

-- 
Grumpf.




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