[glibmm] DBusConnection: Use gobj() instead of reinterpret_cast<> for *VTable.



commit 02cb6c80ee5e53f6f8dca175ef5c5c31b88b1e50
Author: José Alburquerque <jaalburqu svn gnome org>
Date:   Fri Jan 7 12:10:57 2011 -0500

    DBusConnection: Use gobj() instead of reinterpret_cast<> for *VTable.
    
    	* gio/src/dbusconnection.ccg: Use the gobj() of the
    	DBusInterfaceVTable instead of casting it to a GDBusInterfaceVTable in
    	the callbacks and in the register_object() method.

 ChangeLog                  |    8 ++++++++
 gio/src/dbusconnection.ccg |    9 +++------
 2 files changed, 11 insertions(+), 6 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index f70baac..9e2050d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2011-01-07  José Alburquerque  <jaalburqu svn gnome org>
+
+	DBusConnection: Use gobj() instead of reinterpret_cast<> for *VTable.
+
+	* gio/src/dbusconnection.ccg: Use the gobj() of the
+	DBusInterfaceVTable instead of casting it to a GDBusInterfaceVTable in
+	the callbacks and in the register_object() method.
+
 2011-01-07  Murray Cumming  <murrayc murrayc com>
 
 	DBusConnection: Use const guint instead of guint const.
diff --git a/gio/src/dbusconnection.ccg b/gio/src/dbusconnection.ccg
index ac6bbc6..20933dc 100644
--- a/gio/src/dbusconnection.ccg
+++ b/gio/src/dbusconnection.ccg
@@ -249,8 +249,7 @@ static const GDBusInterfaceVTable* DBusSubtreeVTable_Dispatch_giomm_callback(
 
     *out_user_data = const_cast<Gio::DBusInterfaceVTable*>(vtable);
 
-    return reinterpret_cast<GDBusInterfaceVTable*>(
-      const_cast<Gio::DBusInterfaceVTable*>(vtable));
+    return vtable->gobj();
   }
   catch(...)
   {
@@ -980,8 +979,7 @@ guint DBusConnection::register_object(const Glib::ustring& object_path,
 
   const guint result = g_dbus_connection_register_object(gobj(),
     object_path.c_str(), Glib::unwrap(interface_info),
-    reinterpret_cast<GDBusInterfaceVTable*>(const_cast<DBusInterfaceVTable*>(vtable)),
-    const_cast<DBusInterfaceVTable*>(vtable), 0, &gerror);
+    vtable->gobj(), const_cast<DBusInterfaceVTable*>(vtable), 0, &gerror);
 
   if(gerror)
     ::Glib::Error::throw_exception(gerror);
@@ -996,8 +994,7 @@ guint DBusConnection::register_subtree(const Glib::ustring& object_path,
 
   const guint result = g_dbus_connection_register_subtree(gobj(),
     object_path.c_str(), 
-    reinterpret_cast<GDBusSubtreeVTable*>(const_cast<DBusSubtreeVTable*>(vtable)),
-    static_cast<GDBusSubtreeFlags>(flags),
+    vtable->gobj(), static_cast<GDBusSubtreeFlags>(flags),
     const_cast<DBusSubtreeVTable*>(vtable), 0, &gerror);
 
   if(gerror)



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