From a6d2b43e413e27915f87153813ddbda255565660 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 23 May 2018 16:33:49 +0200 Subject: [PATCH] core: Fix compiler warning from casting functions --- src/advertising.c | 8 ++++++-- src/gatt-client.c | 8 ++++++-- src/shared/gatt-client.c | 8 ++++++-- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/advertising.c b/src/advertising.c index b087b48b7..ddc713357 100644 --- a/src/advertising.c +++ b/src/advertising.c @@ -1231,11 +1231,15 @@ void btd_adv_manager_destroy(struct btd_adv_manager *manager) manager_destroy(manager); } +static void manager_refresh(void *data, void *user_data) +{ + refresh_adv(data, user_data); +} + void btd_adv_manager_refresh(struct btd_adv_manager *manager) { if (!manager) return; - queue_foreach(manager->clients, (queue_foreach_func_t)refresh_adv, - NULL); + queue_foreach(manager->clients, manager_refresh, NULL); } diff --git a/src/gatt-client.c b/src/gatt-client.c index d3b699d6a..234f46ed7 100644 --- a/src/gatt-client.c +++ b/src/gatt-client.c @@ -2208,6 +2208,11 @@ static void clear_notify_id(void *data, void *user_data) client->notify_id = 0; } +static void client_shutdown(void *data) +{ + io_shutdown(data); +} + void btd_gatt_client_disconnected(struct btd_gatt_client *client) { if (!client || !client->gatt) @@ -2215,8 +2220,7 @@ void btd_gatt_client_disconnected(struct btd_gatt_client *client) DBG("Device disconnected. Cleaning up."); - queue_remove_all(client->ios, NULL, NULL, - (queue_destroy_func_t) io_shutdown); + queue_remove_all(client->ios, NULL, NULL, client_shutdown); /* * TODO: Once GATT over BR/EDR is properly supported, we should pass the diff --git a/src/shared/gatt-client.c b/src/shared/gatt-client.c index 6b97ee70e..2e153db5c 100644 --- a/src/shared/gatt-client.c +++ b/src/shared/gatt-client.c @@ -2183,13 +2183,17 @@ bool bt_gatt_client_cancel(struct bt_gatt_client *client, unsigned int id) return cancel_request(req); } +static void cancel_pending(void *data) +{ + cancel_request(data); +} + bool bt_gatt_client_cancel_all(struct bt_gatt_client *client) { if (!client || !client->att) return false; - queue_remove_all(client->pending_requests, NULL, NULL, - (queue_destroy_func_t) cancel_request); + queue_remove_all(client->pending_requests, NULL, NULL, cancel_pending); if (client->discovery_req) { bt_gatt_request_cancel(client->discovery_req); -- 2.47.3