summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2008-06-07 19:53:51 +0000
committerMarcel Holtmann <marcel@holtmann.org>2008-06-07 19:53:51 +0000
commita1a65a6821bddc4d3e076b8600e4bd497a64d162 (patch)
treea6245a3609e4216a737925c5d42312fbb7365e18
parent012cac6d32c56eac1d4f8dbc6051b2450e809efc (diff)
Don't abstract functions that are only used once
-rw-r--r--gdbus/gdbus.h3
-rw-r--r--gdbus/object.c25
-rw-r--r--hcid/dbus-hci.c27
3 files changed, 26 insertions, 29 deletions
diff --git a/gdbus/gdbus.h b/gdbus/gdbus.h
index 84e7e1ae..ffa5cf19 100644
--- a/gdbus/gdbus.h
+++ b/gdbus/gdbus.h
@@ -42,9 +42,6 @@ gboolean g_dbus_set_disconnect_function(DBusConnection *connection,
void dbus_message_iter_append_dict_entry(DBusMessageIter *dict,
const char *key, int type, void *val);
-void dbus_message_iter_append_dict_valist(DBusMessageIter *iter,
- const char *first_key,
- va_list var_args);
dbus_bool_t dbus_connection_emit_property_changed(DBusConnection *conn,
const char *path,
diff --git a/gdbus/object.c b/gdbus/object.c
index 61b46a26..8e362be5 100644
--- a/gdbus/object.c
+++ b/gdbus/object.c
@@ -448,31 +448,6 @@ void dbus_message_iter_append_dict_entry(DBusMessageIter *dict,
dbus_message_iter_close_container(dict, &entry);
}
-void dbus_message_iter_append_dict_valist(DBusMessageIter *iter,
- const char *first_key,
- va_list var_args)
-{
- DBusMessageIter dict;
- const char *key;
- int type;
- void *val;
-
- dbus_message_iter_open_container(iter, DBUS_TYPE_ARRAY,
- DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING
- DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_VARIANT_AS_STRING
- DBUS_DICT_ENTRY_END_CHAR_AS_STRING, &dict);
-
- key = first_key;
- while (key) {
- type = va_arg(var_args, int);
- val = va_arg(var_args, void *);
- dbus_message_iter_append_dict_entry(&dict, key, type, val);
- key = va_arg(var_args, char *);
- }
-
- dbus_message_iter_close_container(iter, &dict);
-}
-
static gboolean check_signal(DBusConnection *conn, const char *path,
const char *interface, const char *name,
const char **args)
diff --git a/hcid/dbus-hci.c b/hcid/dbus-hci.c
index ec22bbce..c0af3124 100644
--- a/hcid/dbus-hci.c
+++ b/hcid/dbus-hci.c
@@ -1658,6 +1658,31 @@ static char *extract_eir_name(uint8_t *data, uint8_t *type)
return NULL;
}
+static void append_dict_valist(DBusMessageIter *iter,
+ const char *first_key,
+ va_list var_args)
+{
+ DBusMessageIter dict;
+ const char *key;
+ int type;
+ void *val;
+
+ dbus_message_iter_open_container(iter, DBUS_TYPE_ARRAY,
+ DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING
+ DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_VARIANT_AS_STRING
+ DBUS_DICT_ENTRY_END_CHAR_AS_STRING, &dict);
+
+ key = first_key;
+ while (key) {
+ type = va_arg(var_args, int);
+ val = va_arg(var_args, void *);
+ dbus_message_iter_append_dict_entry(&dict, key, type, val);
+ key = va_arg(var_args, char *);
+ }
+
+ dbus_message_iter_close_container(iter, &dict);
+}
+
static void emit_device_found(const char *path, const char *address,
const char *first_key, ...)
{
@@ -1676,7 +1701,7 @@ static void emit_device_found(const char *path, const char *address,
dbus_message_iter_append_basic(&iter, DBUS_TYPE_STRING, &address);
va_start(var_args, first_key);
- dbus_message_iter_append_dict_valist(&iter, first_key, var_args);
+ append_dict_valist(&iter, first_key, var_args);
va_end(var_args);
dbus_connection_send(connection, signal, NULL);