From 82cefe8b93062e77755f7ecc031a066dcba16385 Mon Sep 17 00:00:00 2001 From: Jihoon Jung Date: Tue, 3 Jul 2018 15:30:07 +0900 Subject: [PATCH] Apply coding rule Change-Id: I128899b0591188f63a8169d3a019a53a3173f431 Signed-off-by: Jihoon Jung --- src/mdg_dbus.c | 3 +-- src/mdg_private.h | 2 +- src/mdg_util.c | 3 +-- test/mdg-manager.c | 2 +- test/menu.h | 9 ++++++--- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/mdg_dbus.c b/src/mdg_dbus.c index 20201fe..6038c3d 100755 --- a/src/mdg_dbus.c +++ b/src/mdg_dbus.c @@ -124,9 +124,8 @@ static void __event_cb(Group *object, channel = tmp_channel; } - if (channel != NULL) { + if (channel != NULL) channel->cb(0, device_id, channel_id, data, data_len, channel->user_data); - } } else { _ERR("Unknown Event"); diff --git a/src/mdg_private.h b/src/mdg_private.h index 78a667d..35f6beb 100755 --- a/src/mdg_private.h +++ b/src/mdg_private.h @@ -153,7 +153,7 @@ typedef struct _mdg_manager_s { } mdg_manager_s; #define CHECK_HANDLE_IS_VALID(handle) { \ - if (g_slist_find (handle_list, handle) == NULL) \ + if (g_slist_find(handle_list, handle) == NULL) \ return MDG_ERROR_UNKNOWN; \ } diff --git a/src/mdg_util.c b/src/mdg_util.c index abea395..9282b3a 100755 --- a/src/mdg_util.c +++ b/src/mdg_util.c @@ -174,9 +174,8 @@ void mdg_get_data_from_variant(GVariant *va, char **device_id, char **channel_id *data = (unsigned char *)g_try_malloc0(*data_len + 1); g_variant_get(data_va, "a(y)", &data_iter); - while (g_variant_iter_loop(data_iter, "(y)", &byte_data)) { + while (g_variant_iter_loop(data_iter, "(y)", &byte_data)) (*data)[i++] = byte_data; - } g_variant_iter_free(iter); } diff --git a/test/mdg-manager.c b/test/mdg-manager.c index 96141e2..0d21f01 100755 --- a/test/mdg-manager.c +++ b/test/mdg-manager.c @@ -55,7 +55,7 @@ static const char* __device_type_to_string(mdg_device_type_e type) return "Local"; case MDG_DEVICE_TYPE_REMOTE: return "Remote"; - default : + default: return "Unknown"; } } diff --git a/test/menu.h b/test/menu.h index 728d36c..fcfcfc8 100755 --- a/test/menu.h +++ b/test/menu.h @@ -62,16 +62,19 @@ __BEGIN_DECLS 3 + ((n) * 2), ##args); fflush(stdout); } while (0) #define pmsg(fmt, args...) do { \ - if (is_pid_show()) { fprintf(stdout, "(%5d) ", get_tid()); } \ + if (is_pid_show()) \ + fprintf(stdout, "(%5d) ", get_tid()); \ fprintf(stdout, fmt "\n", ##args); fflush(stdout); } while (0) #define pmsgb(fmt, args...) do { \ - if (is_pid_show()) { fprintf(stdout, "(%5d) ", get_tid()); } \ + if (is_pid_show()) \ + fprintf(stdout, "(%5d) ", get_tid()); \ fprintf(stdout, ANSI_COLOR_LIGHTGREEN fmt \ ANSI_COLOR_NORMAL "\n", ##args); fflush(stdout); } while (0) #define pmsgt(n, fmt, args...) do { \ - if (is_pid_show()) { fprintf(stdout, "(%5d) ", get_tid()); } \ + if (is_pid_show()) \ + fprintf(stdout, "(%5d) ", get_tid()); \ fprintf(stdout, "\e[%dC" fmt "\n", \ 3 + ((n) * 2), ##args); fflush(stdout); } while (0) -- 2.7.4