From: Marcel Holtmann Date: Sun, 7 Mar 2010 22:32:48 +0000 (-0800) Subject: Make interface callback tables const X-Git-Tag: 0.51~23 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9da2f8434a60312d1b18cf3fb306cf368ab3b18c;p=platform%2Fupstream%2Fconnman.git Make interface callback tables const --- diff --git a/gdbus/gdbus.h b/gdbus/gdbus.h index 77b8aee..47e18cf 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 9dc3835..8da2dab 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) {