From f07a470cd8958b3d9cdf74e0328772b2a957b38d Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 4 Jan 2013 12:20:10 -0800 Subject: [PATCH] core: Remove the total silly usage of gchar and replace it with just char --- src/adapter.c | 10 +++++----- src/adapter.h | 4 ++-- src/agent.c | 12 ++++++------ src/device.c | 38 +++++++++++++++++++------------------- src/device.h | 4 ++-- src/glib-helper.c | 2 +- src/glib-helper.h | 2 +- src/sdp-xml.c | 6 +++--- src/storage.c | 2 +- src/storage.h | 2 +- 10 files changed, 41 insertions(+), 41 deletions(-) diff --git a/src/adapter.c b/src/adapter.c index e969c4877..5a1816ce5 100644 --- a/src/adapter.c +++ b/src/adapter.c @@ -891,7 +891,7 @@ void adapter_remove_device(struct btd_adapter *adapter, } struct btd_device *adapter_get_device(struct btd_adapter *adapter, - const gchar *address, uint8_t addr_type) + const char *address, uint8_t addr_type) { struct btd_device *device; @@ -1317,9 +1317,9 @@ static gboolean adapter_property_get_modalias( return TRUE; } -static gint device_path_cmp(struct btd_device *device, const gchar *path) +static gint device_path_cmp(struct btd_device *device, const char *path) { - const gchar *dev_path = device_get_path(device); + const char *dev_path = device_get_path(device); return strcasecmp(dev_path, path); } @@ -3038,7 +3038,7 @@ uint16_t adapter_get_dev_id(struct btd_adapter *adapter) return adapter->dev_id; } -const gchar *adapter_get_path(struct btd_adapter *adapter) +const char *adapter_get_path(struct btd_adapter *adapter) { if (!adapter) return NULL; @@ -3360,7 +3360,7 @@ static gboolean process_auth_queue(gpointer user_data) while (!g_queue_is_empty(adapter->auths)) { struct service_auth *auth = adapter->auths->head->data; struct btd_device *device = auth->device; - const gchar *dev_path; + const char *dev_path; if (device_is_trusted(device) == TRUE) { auth->cb(NULL, auth->user_data); diff --git a/src/adapter.h b/src/adapter.h index 2462e3130..e8a60f8cf 100644 --- a/src/adapter.h +++ b/src/adapter.h @@ -85,7 +85,7 @@ bool btd_adapter_get_pairable(struct btd_adapter *adapter); uint32_t btd_adapter_get_class(struct btd_adapter *adapter); const char *btd_adapter_get_name(struct btd_adapter *adapter); struct btd_device *adapter_get_device(struct btd_adapter *adapter, - const gchar *address, uint8_t addr_type); + const char *address, uint8_t addr_type); sdp_list_t *btd_adapter_get_services(struct btd_adapter *adapter); struct btd_device *adapter_find_device(struct btd_adapter *adapter, const char *dest); @@ -97,7 +97,7 @@ void adapter_remove_device(struct btd_adapter *adapter, void adapter_set_discovering(struct btd_adapter *adapter, gboolean discovering); uint16_t adapter_get_dev_id(struct btd_adapter *adapter); -const gchar *adapter_get_path(struct btd_adapter *adapter); +const char *adapter_get_path(struct btd_adapter *adapter); const bdaddr_t *adapter_get_address(struct btd_adapter *adapter); void adapter_update_found_devices(struct btd_adapter *adapter, const bdaddr_t *bdaddr, diff --git a/src/agent.c b/src/agent.c index 5fe5492bf..0fde3ef3f 100644 --- a/src/agent.c +++ b/src/agent.c @@ -490,7 +490,7 @@ int agent_request_pincode(struct agent *agent, struct btd_device *device, void *user_data, GDestroyNotify destroy) { struct agent_request *req; - const gchar *dev_path = device_get_path(device); + const char *dev_path = device_get_path(device); int err; if (agent->request) @@ -584,7 +584,7 @@ int agent_request_passkey(struct agent *agent, struct btd_device *device, GDestroyNotify destroy) { struct agent_request *req; - const gchar *dev_path = device_get_path(device); + const char *dev_path = device_get_path(device); int err; if (agent->request) @@ -643,7 +643,7 @@ int agent_request_confirmation(struct agent *agent, struct btd_device *device, void *user_data, GDestroyNotify destroy) { struct agent_request *req; - const gchar *dev_path = device_get_path(device); + const char *dev_path = device_get_path(device); int err; if (agent->request) @@ -700,7 +700,7 @@ int agent_request_authorization(struct agent *agent, struct btd_device *device, GDestroyNotify destroy) { struct agent_request *req; - const gchar *dev_path = device_get_path(device); + const char *dev_path = device_get_path(device); int err; if (agent->request) @@ -729,7 +729,7 @@ int agent_display_passkey(struct agent *agent, struct btd_device *device, uint32_t passkey, uint16_t entered) { DBusMessage *message; - const gchar *dev_path = device_get_path(device); + const char *dev_path = device_get_path(device); message = dbus_message_new_method_call(agent->owner, agent->path, AGENT_INTERFACE, "DisplayPasskey"); @@ -835,7 +835,7 @@ int agent_display_pincode(struct agent *agent, struct btd_device *device, void *user_data, GDestroyNotify destroy) { struct agent_request *req; - const gchar *dev_path = device_get_path(device); + const char *dev_path = device_get_path(device); int err; if (agent->request) diff --git a/src/device.c b/src/device.c index 20099e6b8..61c25f4d7 100644 --- a/src/device.c +++ b/src/device.c @@ -139,7 +139,7 @@ struct att_callbacks { struct btd_device { bdaddr_t bdaddr; uint8_t bdaddr_type; - gchar *path; + char *path; bool svc_resolved; GSList *eir_uuids; char name[MAX_NAME_LENGTH + 1]; @@ -214,7 +214,7 @@ static gboolean store_device_info_cb(gpointer user_data) char device_addr[18]; char *str; char class[9]; - gchar **uuids = NULL; + char **uuids = NULL; gsize length = 0; device->store_id = 0; @@ -289,11 +289,11 @@ static gboolean store_device_info_cb(gpointer user_data) GSList *l; int i; - uuids = g_new0(gchar *, g_slist_length(device->uuids) + 1); + uuids = g_new0(char *, g_slist_length(device->uuids) + 1); for (i = 0, l = device->uuids; l; l = g_slist_next(l), i++) uuids[i] = l->data; g_key_file_set_string_list(key_file, "General", "Services", - (const gchar **)uuids, i); + (const char **)uuids, i); } else { g_key_file_remove_key(key_file, "General", "Services", NULL); } @@ -1642,7 +1642,7 @@ void device_remove_disconnect_watch(struct btd_device *device, guint id) } static char *load_cached_name(struct btd_device *device, const char *local, - const gchar *peer) + const char *peer) { char filename[PATH_MAX + 1]; GKeyFile *key_file; @@ -1670,13 +1670,13 @@ failed: return str; } -static void load_info(struct btd_device *device, const gchar *local, - const gchar *peer, GKeyFile *key_file) +static void load_info(struct btd_device *device, const char *local, + const char *peer, GKeyFile *key_file) { char *str; gboolean store_needed = FALSE; gboolean blocked; - gchar **uuids; + char **uuids; int source, vendor, product, version; char **techno, **t; gboolean bredr = FALSE; @@ -1767,7 +1767,7 @@ next: uuids = g_key_file_get_string_list(key_file, "General", "Services", NULL, NULL); if (uuids) { - gchar **uuid; + char **uuid; for (uuid = uuids; *uuid; uuid++) { GSList *match; @@ -1803,8 +1803,8 @@ next: store_device_info(device); } -static void load_att_info(struct btd_device *device, const gchar *local, - const gchar *peer) +static void load_att_info(struct btd_device *device, const char *local, + const char *peer) { char filename[PATH_MAX + 1]; GKeyFile *key_file; @@ -1893,11 +1893,11 @@ static void load_att_info(struct btd_device *device, const gchar *local, } static struct btd_device *device_new(struct btd_adapter *adapter, - const gchar *address) + const char *address) { - gchar *address_up; + char *address_up; struct btd_device *device; - const gchar *adapter_path = adapter_get_path(adapter); + const char *adapter_path = adapter_get_path(adapter); device = g_try_malloc0(sizeof(struct btd_device)); if (device == NULL) @@ -1946,7 +1946,7 @@ struct btd_device *device_create_from_storage(struct btd_adapter *adapter, } struct btd_device *device_create(struct btd_adapter *adapter, - const gchar *address, uint8_t bdaddr_type) + const char *address, uint8_t bdaddr_type) { struct btd_device *device; const bdaddr_t *src; @@ -2174,7 +2174,7 @@ void device_remove(struct btd_device *device, gboolean remove_stored) btd_device_unref(device); } -gint device_address_cmp(struct btd_device *device, const gchar *address) +gint device_address_cmp(struct btd_device *device, const char *address) { char addr[18]; @@ -2499,7 +2499,7 @@ static void update_bredr_services(struct browse_req *req, sdp_list_t *recs) for (seq = recs; seq; seq = seq->next) { sdp_record_t *rec = (sdp_record_t *) seq->data; sdp_list_t *svcclass = NULL; - gchar *profile_uuid; + char *profile_uuid; GSList *l; if (!rec) @@ -3332,7 +3332,7 @@ const bdaddr_t *device_get_address(struct btd_device *device) return &device->bdaddr; } -const gchar *device_get_path(struct btd_device *device) +const char *device_get_path(struct btd_device *device) { if (!device) return NULL; @@ -3969,7 +3969,7 @@ struct btd_device *btd_device_ref(struct btd_device *device) void btd_device_unref(struct btd_device *device) { - gchar *path; + char *path; device->ref--; diff --git a/src/device.h b/src/device.h index ae70690cd..96e81f080 100644 --- a/src/device.h +++ b/src/device.h @@ -42,7 +42,7 @@ uint16_t btd_device_get_vendor_src(struct btd_device *device); uint16_t btd_device_get_product(struct btd_device *device); uint16_t btd_device_get_version(struct btd_device *device); void device_remove(struct btd_device *device, gboolean remove_stored); -gint device_address_cmp(struct btd_device *device, const gchar *address); +gint device_address_cmp(struct btd_device *device, const char *address); gint device_bdaddr_cmp(struct btd_device *device, bdaddr_t *bdaddr); GSList *device_get_uuids(struct btd_device *device); void device_probe_profiles(struct btd_device *device, GSList *profiles); @@ -59,7 +59,7 @@ void device_probe_profile(gpointer a, gpointer b); void device_remove_profile(gpointer a, gpointer b); struct btd_adapter *device_get_adapter(struct btd_device *device); const bdaddr_t *device_get_address(struct btd_device *device); -const gchar *device_get_path(struct btd_device *device); +const char *device_get_path(struct btd_device *device); gboolean device_is_bredr(struct btd_device *device); gboolean device_is_le(struct btd_device *device); gboolean device_is_temporary(struct btd_device *device); diff --git a/src/glib-helper.c b/src/glib-helper.c index 9d482fb34..a9a9a6e3c 100644 --- a/src/glib-helper.c +++ b/src/glib-helper.c @@ -53,7 +53,7 @@ char *bt_modalias(uint16_t source, uint16_t vendor, char *bt_uuid2string(uuid_t *uuid) { - gchar *str; + char *str; uuid_t uuid128; unsigned int data0; unsigned short data1; diff --git a/src/glib-helper.h b/src/glib-helper.h index f414e0c9d..c0d7f9eec 100644 --- a/src/glib-helper.h +++ b/src/glib-helper.h @@ -23,6 +23,6 @@ char *bt_modalias(uint16_t source, uint16_t vendor, uint16_t product, uint16_t version); -gchar *bt_uuid2string(uuid_t *uuid); +char *bt_uuid2string(uuid_t *uuid); char *bt_name2string(const char *string); int bt_string2uuid(uuid_t *uuid, const char *string); diff --git a/src/sdp-xml.c b/src/sdp-xml.c index 80f180e07..8cb1e2dab 100644 --- a/src/sdp-xml.c +++ b/src/sdp-xml.c @@ -438,8 +438,8 @@ static sdp_data_t *sdp_xml_parse_datatype(const char *el, return NULL; } static void element_start(GMarkupParseContext *context, - const gchar *element_name, const gchar **attribute_names, - const gchar **attribute_values, gpointer user_data, GError **err) + const char *element_name, const char **attribute_names, + const char **attribute_values, gpointer user_data, GError **err) { struct context_data *ctx_data = user_data; @@ -516,7 +516,7 @@ static void sdp_xml_data_free(struct sdp_xml_data *elem) } static void element_end(GMarkupParseContext *context, - const gchar *element_name, gpointer user_data, GError **err) + const char *element_name, gpointer user_data, GError **err) { struct context_data *ctx_data = user_data; struct sdp_xml_data *elem; diff --git a/src/storage.c b/src/storage.c index be3bbf25c..28abeb355 100644 --- a/src/storage.c +++ b/src/storage.c @@ -144,7 +144,7 @@ int read_local_name(const bdaddr_t *bdaddr, char *name) return 0; } -sdp_record_t *record_from_string(const gchar *str) +sdp_record_t *record_from_string(const char *str) { sdp_record_t *rec; int size, i, len; diff --git a/src/storage.h b/src/storage.h index 8d171b06b..53e9834f4 100644 --- a/src/storage.h +++ b/src/storage.h @@ -27,6 +27,6 @@ int read_discoverable_timeout(const char *src, int *timeout); int read_pairable_timeout(const char *src, int *timeout); int read_on_mode(const char *src, char *mode, int length); int read_local_name(const bdaddr_t *bdaddr, char *name); -sdp_record_t *record_from_string(const gchar *str); +sdp_record_t *record_from_string(const char *str); sdp_record_t *find_record_in_list(sdp_list_t *recs, const char *uuid); int read_device_pairable(const bdaddr_t *local, gboolean *mode); -- 2.47.3