summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2009-10-28 14:28:51 -0500
committerDenis Kenzior <denkenz@gmail.com>2009-10-28 14:28:51 -0500
commit3ad86847ec144cc8d4374997e1b3ced59a16b2b7 (patch)
treec2d1b6f193d832f4d58ad46cf2b9a631c4dcc083 /src
parent32f013f386ece78b183ae0d5b8a5f44cfda8b8f7 (diff)
downloadofono-3ad86847ec144cc8d4374997e1b3ced59a16b2b7.tar.bz2
Refactor: Avoid unnecessary forward declarations
Diffstat (limited to 'src')
-rw-r--r--src/voicecall.c89
1 files changed, 44 insertions, 45 deletions
diff --git a/src/voicecall.c b/src/voicecall.c
index 81b56201..ca78aaad 100644
--- a/src/voicecall.c
+++ b/src/voicecall.c
@@ -75,7 +75,6 @@ static const char *default_en_list_no_sim[] = { "119", "118", "999", "110",
static void generic_callback(const struct ofono_error *error, void *data);
static void multirelease_callback(const struct ofono_error *err, void *data);
-static void private_chat_callback(const struct ofono_error *error, void *data);
static gint call_compare_by_id(gconstpointer a, gconstpointer b)
{
@@ -1139,6 +1138,50 @@ static void multiparty_callback_common(struct ofono_voicecall *vc,
dbus_message_iter_close_container(&iter, &array_iter);
}
+static void private_chat_callback(const struct ofono_error *error, void *data)
+{
+ struct ofono_voicecall *vc = data;
+ DBusMessage *reply;
+ const char *callpath;
+ const char *c;
+ int id;
+ GSList *l;
+
+ if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
+ ofono_debug("command failed with error: %s",
+ telephony_error_to_str(error));
+ __ofono_dbus_pending_reply(&vc->pending,
+ __ofono_error_failed(vc->pending));
+ return;
+ }
+
+ dbus_message_get_args(vc->pending, NULL,
+ DBUS_TYPE_OBJECT_PATH, &callpath,
+ DBUS_TYPE_INVALID);
+
+ c = strrchr(callpath, '/');
+ sscanf(c, "/voicecall%2u", &id);
+
+ l = g_slist_find_custom(vc->multiparty_list, GINT_TO_POINTER(id),
+ call_compare_by_id);
+
+ if (l) {
+ vc->multiparty_list =
+ g_slist_remove(vc->multiparty_list, l->data);
+
+ if (g_slist_length(vc->multiparty_list) < 2) {
+ g_slist_free(vc->multiparty_list);
+ vc->multiparty_list = 0;
+ }
+ }
+
+ reply = dbus_message_new_method_return(vc->pending);
+ multiparty_callback_common(vc, reply);
+ __ofono_dbus_pending_reply(&vc->pending, reply);
+
+ emit_multiparty_call_list_changed(vc);
+}
+
static DBusMessage *multiparty_private_chat(DBusConnection *conn,
DBusMessage *msg, void *data)
{
@@ -1558,50 +1601,6 @@ static void multirelease_callback(const struct ofono_error *error, void *data)
__ofono_dbus_pending_reply(&vc->pending, reply);
}
-static void private_chat_callback(const struct ofono_error *error, void *data)
-{
- struct ofono_voicecall *vc = data;
- DBusMessage *reply;
- const char *callpath;
- const char *c;
- int id;
- GSList *l;
-
- if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
- ofono_debug("command failed with error: %s",
- telephony_error_to_str(error));
- __ofono_dbus_pending_reply(&vc->pending,
- __ofono_error_failed(vc->pending));
- return;
- }
-
- dbus_message_get_args(vc->pending, NULL,
- DBUS_TYPE_OBJECT_PATH, &callpath,
- DBUS_TYPE_INVALID);
-
- c = strrchr(callpath, '/');
- sscanf(c, "/voicecall%2u", &id);
-
- l = g_slist_find_custom(vc->multiparty_list, GINT_TO_POINTER(id),
- call_compare_by_id);
-
- if (l) {
- vc->multiparty_list =
- g_slist_remove(vc->multiparty_list, l->data);
-
- if (g_slist_length(vc->multiparty_list) < 2) {
- g_slist_free(vc->multiparty_list);
- vc->multiparty_list = 0;
- }
- }
-
- reply = dbus_message_new_method_return(vc->pending);
- multiparty_callback_common(vc, reply);
- __ofono_dbus_pending_reply(&vc->pending, reply);
-
- emit_multiparty_call_list_changed(vc);
-}
-
static void emit_en_list_changed(struct ofono_voicecall *vc)
{
DBusConnection *conn = ofono_dbus_get_connection();