Re: passing arg 2 of `g_timeout_add' from incompatible pointer type
- From: Tristan Van Berkom <tvb gnome org>
- To: Yiannis <odysseus lost gmail com>
- Cc: gtk-list gnome org
- Subject: Re: passing arg 2 of `g_timeout_add' from incompatible pointer type
- Date: Tue, 03 Oct 2006 15:12:30 -0400
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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]