From 9da2f8434a60312d1b18cf3fb306cf368ab3b18c Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 7 Mar 2010 14:32:48 -0800 Subject: Make interface callback tables const --- gdbus/gdbus.h | 6 +++--- gdbus/object.c | 26 +++++++++++++------------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/gdbus/gdbus.h b/gdbus/gdbus.h index 77b8aee1..47e18cfb 100644 --- a/gdbus/gdbus.h +++ b/gdbus/gdbus.h @@ -91,9 +91,9 @@ typedef struct { gboolean g_dbus_register_interface(DBusConnection *connection, const char *path, const char *name, - GDBusMethodTable *methods, - GDBusSignalTable *signals, - GDBusPropertyTable *properties, + const GDBusMethodTable *methods, + const GDBusSignalTable *signals, + const GDBusPropertyTable *properties, void *user_data, GDBusDestroyFunction destroy); gboolean g_dbus_unregister_interface(DBusConnection *connection, diff --git a/gdbus/object.c b/gdbus/object.c index 9dc3835b..8da2dabf 100644 --- a/gdbus/object.c +++ b/gdbus/object.c @@ -45,9 +45,9 @@ struct generic_data { struct interface_data { char *name; - GDBusMethodTable *methods; - GDBusSignalTable *signals; - GDBusPropertyTable *properties; + const GDBusMethodTable *methods; + const GDBusSignalTable *signals; + const GDBusPropertyTable *properties; void *user_data; GDBusDestroyFunction destroy; }; @@ -114,8 +114,8 @@ static void print_arguments(GString *gstr, const char *sig, static void generate_interface_xml(GString *gstr, struct interface_data *iface) { - GDBusMethodTable *method; - GDBusSignalTable *signal; + const GDBusMethodTable *method; + const GDBusSignalTable *signal; for (method = iface->methods; method && method->name; method++) { if (!strlen(method->signature) && !strlen(method->reply)) @@ -238,7 +238,7 @@ static DBusHandlerResult generic_message(DBusConnection *connection, { struct generic_data *data = user_data; struct interface_data *iface; - GDBusMethodTable *method; + const GDBusMethodTable *method; const char *interface; interface = dbus_message_get_interface(message); @@ -327,9 +327,9 @@ static GDBusMethodTable introspect_methods[] = { }; static void add_interface(struct generic_data *data, const char *name, - GDBusMethodTable *methods, - GDBusSignalTable *signals, - GDBusPropertyTable *properties, + const GDBusMethodTable *methods, + const GDBusSignalTable *signals, + const GDBusPropertyTable *properties, void *user_data, GDBusDestroyFunction destroy) { @@ -428,7 +428,7 @@ static gboolean check_signal(DBusConnection *conn, const char *path, { struct generic_data *data = NULL; struct interface_data *iface; - GDBusSignalTable *signal; + const GDBusSignalTable *signal; *args = NULL; if (!dbus_connection_get_object_path_data(conn, path, @@ -502,9 +502,9 @@ fail: gboolean g_dbus_register_interface(DBusConnection *connection, const char *path, const char *name, - GDBusMethodTable *methods, - GDBusSignalTable *signals, - GDBusPropertyTable *properties, + const GDBusMethodTable *methods, + const GDBusSignalTable *signals, + const GDBusPropertyTable *properties, void *user_data, GDBusDestroyFunction destroy) { -- cgit v1.2.3