c++ warning in generated bindings

Ryan Gammon rgammon at real.com
Fri Jul 8 06:07:48 EST 2005


Ross Burton wrote:

>static inline gboolean
>BookFactory_get_book_async (DBusGProxy *proxy, const char * IN_source, BookFactory_get_book_reply callback, gpointer userdata)
>{
>  DBusGAsyncData *stuff;
>  stuff = g_new (DBusGAsyncData, 1);
>  stuff->cb = callback;
>  stuff->userdata = userdata;
>  dbus_g_proxy_begin_call (proxy, "getBook", BookFactory_get_book_async_callback, stuff, g_free, G_TYPE_STRING, IN_source, G_TYPE_INVALID);
>  return TRUE;
>}
>  
>

Hi guys, on the topic of the binding tool,
stuff->cb = callback;
... is problematic for c++

warning: invalid
   conversion from `void (*)(char*, GError*, void*)' to `void*'

Would it be reasonable here to explicitly cast the callback to a 
(gpointer) here?

stuff->cb = (gpointer) callback;

That seems to fix the warning here.

-- 
Ryan Gammon
rgammon at real.com
Developer for Helix Player
https://player.helixcommunity.org


More information about the dbus mailing list