summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClaudio Takahasi <claudio.takahasi@openbossa.org>2006-08-16 18:43:50 +0000
committerClaudio Takahasi <claudio.takahasi@openbossa.org>2006-08-16 18:43:50 +0000
commit58887f9452b222cfb28bf8c5c11d13bd5de95efb (patch)
tree9c66cd441aad2ece4f7678b09280a3f889455c08
parent2ed4044afd72c32e9e689d1f3ca953d4baff815e (diff)
code cleanup:using libc free
-rw-r--r--hcid/dbus-adapter.c2
-rw-r--r--hcid/dbus.c40
-rw-r--r--hcid/dbus.h1
3 files changed, 9 insertions, 34 deletions
diff --git a/hcid/dbus-adapter.c b/hcid/dbus-adapter.c
index 02cc85c9..4b1b0a63 100644
--- a/hcid/dbus-adapter.c
+++ b/hcid/dbus-adapter.c
@@ -2241,7 +2241,7 @@ static DBusHandlerResult handle_dev_cancel_discovery_req(DBusConnection *conn, D
return error_failed(conn, msg, bt_error(status));
}
- slist_foreach(dbus_data->disc_devices, disc_device_info_free, NULL);
+ slist_foreach(dbus_data->disc_devices, (slist_func_t)free, NULL);
slist_free(dbus_data->disc_devices);
dbus_data->disc_devices = NULL;
diff --git a/hcid/dbus.c b/hcid/dbus.c
index e60ef44f..9ef99428 100644
--- a/hcid/dbus.c
+++ b/hcid/dbus.c
@@ -72,14 +72,6 @@ int hcid_dbus_use_experimental(void)
return experimental;
}
-void disc_device_info_free(void *data, void *user_data)
-{
- struct discovered_dev_info *dev = data;
-
- if (dev)
- free(dev);
-}
-
void bonding_request_free(struct bonding_request_info *dev )
{
if (dev) {
@@ -91,22 +83,6 @@ void bonding_request_free(struct bonding_request_info *dev )
}
}
-static void pending_bonding_free(void *p1, void *p2)
-{
- bdaddr_t *peer1 = p1;
-
- if (peer1)
- free(peer1);
-}
-
-static void active_conn_info_free(void *data, void *user_data)
-{
- struct active_conn_info *dev = data;
-
- if (dev)
- free(dev);
-}
-
static int disc_device_find(const struct discovered_dev_info *d1, const struct discovered_dev_info *d2)
{
int ret;
@@ -422,7 +398,7 @@ static int unregister_dbus_path(const char *path)
free(pdata->requestor_name);
if (pdata->disc_devices) {
- slist_foreach(pdata->disc_devices, disc_device_info_free, NULL);
+ slist_foreach(pdata->disc_devices, (slist_func_t)free, NULL);
slist_free(pdata->disc_devices);
pdata->disc_devices = NULL;
}
@@ -433,13 +409,13 @@ static int unregister_dbus_path(const char *path)
}
if (pdata->pending_bondings) {
- slist_foreach(pdata->pending_bondings, pending_bonding_free, NULL);
+ slist_foreach(pdata->pending_bondings, (slist_func_t)free, NULL);
slist_free(pdata->pending_bondings);
pdata->pending_bondings = NULL;
}
if (pdata->active_conn) {
- slist_foreach(pdata->active_conn, active_conn_info_free, NULL);
+ slist_foreach(pdata->active_conn, (slist_func_t)free, NULL);
slist_free(pdata->active_conn);
pdata->active_conn = NULL;
}
@@ -665,7 +641,7 @@ int hcid_dbus_stop_device(uint16_t id)
}
if (pdata->disc_devices) {
- slist_foreach(pdata->disc_devices, disc_device_info_free, NULL);
+ slist_foreach(pdata->disc_devices, (slist_func_t)free, NULL);
slist_free(pdata->disc_devices);
pdata->disc_devices = NULL;
}
@@ -676,13 +652,13 @@ int hcid_dbus_stop_device(uint16_t id)
}
if (pdata->pending_bondings) {
- slist_foreach(pdata->pending_bondings, pending_bonding_free, NULL);
+ slist_foreach(pdata->pending_bondings, (slist_func_t)free, NULL);
slist_free(pdata->pending_bondings);
pdata->pending_bondings = NULL;
}
if (pdata->active_conn) {
- slist_foreach(pdata->active_conn, active_conn_info_free, NULL);
+ slist_foreach(pdata->active_conn, (slist_func_t)free, NULL);
slist_free(pdata->active_conn);
pdata->active_conn = NULL;
}
@@ -1053,7 +1029,7 @@ void hcid_dbus_inquiry_complete(bdaddr_t *local)
pdata->discover_state = STATE_IDLE;
/* free discovered devices list */
- slist_foreach(pdata->disc_devices, disc_device_info_free, NULL);
+ slist_foreach(pdata->disc_devices, (slist_func_t)free, NULL);
slist_free(pdata->disc_devices);
pdata->disc_devices = NULL;
@@ -1233,7 +1209,7 @@ void hcid_dbus_remote_name(bdaddr_t *local, bdaddr_t *peer, uint8_t status, char
goto failed; /* skip if a new request has been sent */
/* free discovered devices list */
- slist_foreach(pdata->disc_devices, disc_device_info_free, NULL);
+ slist_foreach(pdata->disc_devices, (slist_func_t)free, NULL);
slist_free(pdata->disc_devices);
pdata->disc_devices = NULL;
diff --git a/hcid/dbus.h b/hcid/dbus.h
index 4052b9c8..c8ac1d3f 100644
--- a/hcid/dbus.h
+++ b/hcid/dbus.h
@@ -195,7 +195,6 @@ static inline DBusHandlerResult send_reply_and_unref(DBusConnection *conn, DBusM
int active_conn_find_by_bdaddr(const void *data, const void *user_data);
void bonding_request_free(struct bonding_request_info *dev);
-void disc_device_info_free(void *data, void *user_data);
int disc_device_append(struct slist **list, bdaddr_t *bdaddr, name_status_t name_status, int discover_type);
int disc_device_req_name(struct hci_dbus_data *dbus_data);