diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2015-05-23 17:30:16 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2015-08-02 10:39:47 +0200 |
commit | c0e05dbd43bf6b6752ff69b1c27071f88a123923 (patch) | |
tree | 8e685f1b2a66e68b30220b36fff7a6d8e0049977 | |
parent | f67cc379563928ec09e859301d89d7408befcd1c (diff) |
cli,voice: minor coding style fixes
-rw-r--r-- | cli/mmcli-call.c | 62 | ||||
-rw-r--r-- | cli/mmcli-common.c | 45 | ||||
-rw-r--r-- | cli/mmcli-common.h | 20 | ||||
-rw-r--r-- | cli/mmcli-modem-voice.c | 32 |
4 files changed, 80 insertions, 79 deletions
diff --git a/cli/mmcli-call.c b/cli/mmcli-call.c index 871d37ee..410290d7 100644 --- a/cli/mmcli-call.c +++ b/cli/mmcli-call.c @@ -97,7 +97,7 @@ mmcli_call_options_enabled (void) return !!n_actions; n_actions = (start_flag + - accept_flag + + accept_flag + hangup_flag + !!tone_request); @@ -153,14 +153,14 @@ print_call_info (MMCall *call) g_print ("CALL '%s'\n", mm_call_get_path (call)); g_print (" -------------------------------\n" " Global | number: '%s'\n", VALIDATE (mm_call_get_number (call))); - g_print (" | direction: '%s'\n", mm_call_direction_get_string( mm_call_get_direction (call) ) ); + g_print (" | direction: '%s'\n", mm_call_direction_get_string (mm_call_get_direction (call)) ); g_print (" -------------------------------\n" " Properties | state: '%s'\n", mm_call_state_get_string (mm_call_get_state (call))); if (mm_call_get_state_reason(call) != MM_CALL_STATE_REASON_UNKNOWN) g_print (" | state reason: '%s'\n", - mm_call_state_reason_get_string(mm_call_get_state_reason(call))); + mm_call_state_reason_get_string(mm_call_get_state_reason (call))); } static void @@ -277,8 +277,8 @@ get_call_ready (GObject *source, gpointer none) { ctx->call = mmcli_get_call_finish (result, - &ctx->manager, - &ctx->object); + &ctx->manager, + &ctx->object); /* Setup operation timeout */ mmcli_force_operation_timeout (G_DBUS_PROXY (ctx->call)); @@ -287,38 +287,38 @@ get_call_ready (GObject *source, /* Requesting to start the call? */ if (start_flag) { - mm_call_start(ctx->call, - ctx->cancellable, - (GAsyncReadyCallback)start_ready, - NULL); + mm_call_start (ctx->call, + ctx->cancellable, + (GAsyncReadyCallback)start_ready, + NULL); return; } /* Requesting to accept the call? */ if (accept_flag) { - mm_call_accept(ctx->call, - ctx->cancellable, - (GAsyncReadyCallback)accept_ready, - NULL); + mm_call_accept (ctx->call, + ctx->cancellable, + (GAsyncReadyCallback)accept_ready, + NULL); return; } /* Requesting to hangup the call? */ if (hangup_flag) { - mm_call_hangup(ctx->call, - ctx->cancellable, - (GAsyncReadyCallback)hangup_ready, - NULL); + mm_call_hangup (ctx->call, + ctx->cancellable, + (GAsyncReadyCallback)hangup_ready, + NULL); return; } /* Requesting to send tone the call? */ if (tone_request) { - mm_call_send_tone(ctx->call, - tone_request, - ctx->cancellable, - (GAsyncReadyCallback)send_tone_ready, - NULL); + mm_call_send_tone (ctx->call, + tone_request, + ctx->cancellable, + (GAsyncReadyCallback)send_tone_ready, + NULL); return; } @@ -329,7 +329,7 @@ get_call_ready (GObject *source, void mmcli_call_run_asynchronous (GDBusConnection *connection, - GCancellable *cancellable) + GCancellable *cancellable) { /* Initialize context */ ctx = g_new0 (Context, 1); @@ -338,10 +338,10 @@ mmcli_call_run_asynchronous (GDBusConnection *connection, /* Get proper call */ mmcli_get_call (connection, - mmcli_get_common_call_string (), - cancellable, - (GAsyncReadyCallback)get_call_ready, - NULL); + mmcli_get_common_call_string (), + cancellable, + (GAsyncReadyCallback)get_call_ready, + NULL); } void @@ -352,9 +352,9 @@ mmcli_call_run_synchronous (GDBusConnection *connection) /* Initialize context */ ctx = g_new0 (Context, 1); ctx->call = mmcli_get_call_sync (connection, - mmcli_get_common_call_string (), - &ctx->manager, - &ctx->object); + mmcli_get_common_call_string (), + &ctx->manager, + &ctx->object); /* Setup operation timeout: 2 minutes */ g_dbus_proxy_set_default_timeout (G_DBUS_PROXY (ctx->call), 2 * 60 * 1000); @@ -398,7 +398,7 @@ mmcli_call_run_synchronous (GDBusConnection *connection) hangup_process_reply (operation_result, error); return; } - + /* Requesting to send a tone? */ if (tone_request) { gboolean operation_result; diff --git a/cli/mmcli-common.c b/cli/mmcli-common.c index 0b1df167..10c7fde5 100644 --- a/cli/mmcli-common.c +++ b/cli/mmcli-common.c @@ -1110,7 +1110,7 @@ static void look_for_call_in_modem (GetVoiceContext *ctx); static MMCall * find_call_in_list (GList *list, - const gchar *call_path) + const gchar *call_path) { GList *l; @@ -1128,8 +1128,8 @@ find_call_in_list (GList *list, static void list_call_ready (MMModemVoice *modem, - GAsyncResult *res, - GetVoiceContext *ctx) + GAsyncResult *res, + GetVoiceContext *ctx) { GList *call_list; GError *error = NULL; @@ -1180,9 +1180,9 @@ look_for_call_in_modem (GetVoiceContext *ctx) ctx->call_path, mm_object_get_path (ctx->current)); mm_modem_voice_list_call (modem, - ctx->cancellable, - (GAsyncReadyCallback)list_call_ready, - ctx); + ctx->cancellable, + (GAsyncReadyCallback)list_call_ready, + ctx); g_object_unref (modem); return; } @@ -1193,8 +1193,8 @@ look_for_call_in_modem (GetVoiceContext *ctx) static void get_voice_manager_ready (GDBusConnection *connection, - GAsyncResult *res, - GetVoiceContext *ctx) + GAsyncResult *res, + GetVoiceContext *ctx) { ctx->manager = mmcli_get_manager_finish (res); ctx->modems = g_dbus_object_manager_get_objects (G_DBUS_OBJECT_MANAGER (ctx->manager)); @@ -1237,8 +1237,8 @@ get_call_path (const gchar *path_or_index) MMCall * mmcli_get_call_finish (GAsyncResult *res, - MMManager **o_manager, - MMObject **o_object) + MMManager **o_manager, + MMObject **o_object) { GetVoiceContext *ctx; @@ -1250,12 +1250,13 @@ mmcli_get_call_finish (GAsyncResult *res, return g_object_ref (ctx->call); } -void mmcli_get_call (GDBusConnection *connection, - const gchar *path_or_index, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data) { - +void +mmcli_get_call (GDBusConnection *connection, + const gchar *path_or_index, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ GetVoiceContext *ctx; ctx = g_new0 (GetVoiceContext, 1); @@ -1272,11 +1273,12 @@ void mmcli_get_call (GDBusConnection *connection, ctx); } -MMCall *mmcli_get_call_sync (GDBusConnection *connection, - const gchar *path_or_index, - MMManager **o_manager, - MMObject **o_object) { - +MMCall * +mmcli_get_call_sync (GDBusConnection *connection, + const gchar *path_or_index, + MMManager **o_manager, + MMObject **o_object) +{ MMManager *manager; GList *modems; GList *l; @@ -1340,7 +1342,6 @@ MMCall *mmcli_get_call_sync (GDBusConnection *connection, return found; } - /* Common options */ static gchar *modem_str; static gchar *bearer_str; diff --git a/cli/mmcli-common.h b/cli/mmcli-common.h index 2b807b04..1707dab5 100644 --- a/cli/mmcli-common.h +++ b/cli/mmcli-common.h @@ -79,18 +79,18 @@ MMSms *mmcli_get_sms_sync (GDBusConnection *connection, MMManager **manager, MMObject **object); -void mmcli_get_call (GDBusConnection *connection, - const gchar *path_or_index, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data); +void mmcli_get_call (GDBusConnection *connection, + const gchar *path_or_index, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); MMCall *mmcli_get_call_finish (GAsyncResult *res, - MMManager **manager, - MMObject **object); + MMManager **manager, + MMObject **object); MMCall *mmcli_get_call_sync (GDBusConnection *connection, - const gchar *path_or_index, - MMManager **manager, - MMObject **object); + const gchar *path_or_index, + MMManager **manager, + MMObject **object); const gchar *mmcli_get_state_reason_string (MMModemStateChangeReason reason); diff --git a/cli/mmcli-modem-voice.c b/cli/mmcli-modem-voice.c index 8622a1f9..06bebae9 100644 --- a/cli/mmcli-modem-voice.c +++ b/cli/mmcli-modem-voice.c @@ -253,8 +253,8 @@ delete_process_reply (gboolean result, static void delete_ready (MMModemVoice *modem, - GAsyncResult *result, - gpointer nothing) + GAsyncResult *result, + gpointer nothing) { gboolean operation_result; GError *error = NULL; @@ -267,7 +267,7 @@ delete_ready (MMModemVoice *modem, static void get_call_to_delete_ready (GDBusConnection *connection, - GAsyncResult *res) + GAsyncResult *res) { MMCall *call; MMObject *obj = NULL; @@ -281,10 +281,10 @@ get_call_to_delete_ready (GDBusConnection *connection, } mm_modem_voice_delete_call (ctx->modem_voice, - mm_call_get_path (call), - ctx->cancellable, - (GAsyncReadyCallback)delete_ready, - NULL); + mm_call_get_path (call), + ctx->cancellable, + (GAsyncReadyCallback)delete_ready, + NULL); g_object_unref (call); g_object_unref (obj); } @@ -331,10 +331,10 @@ get_modem_ready (GObject *source, /* Request to delete a given call? */ if (delete_str) { mmcli_get_call (ctx->connection, - delete_str, - ctx->cancellable, - (GAsyncReadyCallback)get_call_to_delete_ready, - NULL); + delete_str, + ctx->cancellable, + (GAsyncReadyCallback)get_call_to_delete_ready, + NULL); return; } @@ -343,7 +343,7 @@ get_modem_ready (GObject *source, void mmcli_modem_voice_run_asynchronous (GDBusConnection *connection, - GCancellable *cancellable) + GCancellable *cancellable) { /* Initialize context */ ctx = g_new0 (Context, 1); @@ -394,7 +394,7 @@ mmcli_modem_voice_run_synchronous (GDBusConnection *connection) MMCallProperties *properties; properties = build_call_properties_from_input (create_str); - + g_debug ("Synchronously creating new call in modem..."); call = mm_modem_voice_create_call_sync (ctx->modem_voice, properties, @@ -413,9 +413,9 @@ mmcli_modem_voice_run_synchronous (GDBusConnection *connection) MMObject *obj = NULL; call = mmcli_get_call_sync (connection, - delete_str, - NULL, - &obj); + delete_str, + NULL, + &obj); if (!g_str_equal (mm_object_get_path (obj), mm_modem_voice_get_path (ctx->modem_voice))) { g_printerr ("error: call '%s' not owned by modem '%s'", mm_call_get_path (call), |