Re: [gtk-list] Re: How to use a gpointer?



This looks kinda dangerous to me:

Lars Hallberg wrote:
> > GTK_SIGNAL_FUNC(handle_value),(gpointer)???);
>   GTK_SIGNAL_FUNC(handle_value),(gpointer) value);
> >
> > the_value=??????data;
>   the_value= (int) data;

Correct me if I'm wrong, but doesn't this make the assumption that
sizeof(int)==sizeof(void *)? And wouldn't this cause problems on systems
which the assumption is false, e.g. 64 bit systems? I feel the safer way
to do it is to pass the reference, as in (gpointer)&value.

I seem to remember reading something about this being why people are
having problems with mozilla to work correctly on Linux/alpha. 

-- 
Email: <troth@netmagic.net>  Web site: <http://www.netmagic.net/~troth>
------------------------------------------------------------------------
"When a man's best friend is his dog, that dog has a problem."
                                          --- Edward Abbey



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