Re: passing arg 2 of `g_timeout_add' from incompatible pointer type

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

 



Yiannis wrote:
> OK, I always get the following warning and I never understood why.
> passing arg 2 of `g_timeout_add' from incompatible pointer type
> 
> A typical example of my code would be:
> 
> gboolean
> foo(void)
> {
> return TRUE;
> }
> 
> g_timeout_add(500, foo, NULL);
> 
> Any clues?
> Thanks!

It should be "gboolean foo (gpointer user_data)", the GFunc will
be called with the third arg of g_timeout_add() as user_data.

You can also safely ignore the user_data as you did - just cast
foo like this:
     g_timeout_add(500, (GFunc)foo, NULL);

Cheers,
                     -Tristan
_______________________________________________
gtk-list mailing list
gtk-list@xxxxxxxxx
http://mail.gnome.org/mailman/listinfo/gtk-list

[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux