From cf643adb4e35725d013eb267a6dafb4ba1e830af Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 24 May 2018 15:46:53 +0200 Subject: [PATCH] health: Fix compiler warning from casting functions Change-Id: I927c2f443c275912f6c63b96389284df8dc56700 Signed-off-by: Amit Purwar --- profiles/health/hdp.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/profiles/health/hdp.c b/profiles/health/hdp.c index bc3b38a..a6de97f 100755 --- a/profiles/health/hdp.c +++ b/profiles/health/hdp.c @@ -59,7 +59,6 @@ static uint8_t next_app_id = HDP_MDEP_INITIAL; static GSList *adapters; -static gboolean update_adapter(struct hdp_adapter *adapter); static struct hdp_device *create_health_device(struct btd_device *device); static void free_echo_data(struct hdp_echo_data *edata); @@ -313,12 +312,14 @@ static void free_health_device(struct hdp_device *device) g_free(device); } +static void update_adapter_cb(void *data, void *user_data); + static void remove_application(struct hdp_application *app) { DBG("Application %s deleted", app->path); hdp_application_unref(app); - g_slist_foreach(adapters, (GFunc) update_adapter, NULL); + g_slist_foreach(adapters, update_adapter_cb, NULL); } static void client_disconnected(DBusConnection *conn, void *user_data) @@ -369,7 +370,7 @@ static DBusMessage *manager_create_application(DBusConnection *conn, app->dbus_watcher = g_dbus_add_disconnect_watch(btd_get_dbus_connection(), name, client_disconnected, app, NULL); - g_slist_foreach(adapters, (GFunc) update_adapter, NULL); + g_slist_foreach(adapters, update_adapter_cb, NULL); DBG("Health application created with id %s", app->path); @@ -404,14 +405,19 @@ static DBusMessage *manager_destroy_application(DBusConnection *conn, return g_dbus_create_reply(msg, DBUS_TYPE_INVALID); } +static void application_unref(void *data, void *user_data) +{ + hdp_application_unref(data); +} + static void manager_path_unregister(gpointer data) { - g_slist_foreach(applications, (GFunc) hdp_application_unref, NULL); + g_slist_foreach(applications, application_unref, NULL); g_slist_free(applications); applications = NULL; - g_slist_foreach(adapters, (GFunc) update_adapter, NULL); + g_slist_foreach(adapters, update_adapter_cb, NULL); } static const GDBusMethodTable health_manager_methods[] = { @@ -1384,6 +1390,11 @@ fail: return FALSE; } +static void update_adapter_cb(void *data, void *user_data) +{ + update_adapter(data); +} + int hdp_adapter_register(struct btd_adapter *adapter) { struct hdp_adapter *hdp_adapter; -- 2.7.4