Cosmetic change for DBus message error checking macros
authorEduardo Lima (Etrunko) <eduardo.lima@intel.com>
Wed, 25 Sep 2013 20:19:39 +0000 (17:19 -0300)
committerEduardo Lima (Etrunko) <eduardo.lima@intel.com>
Thu, 26 Sep 2013 20:33:18 +0000 (17:33 -0300)
Signed-off-by: Eduardo Lima (Etrunko) <eduardo.lima@intel.com>
src/wkb-ibus-config.c
src/wkb-ibus-panel.c
src/wkb-ibus.c

index 5ed7535461a476e4696216486e3ad49bdf1e65a3..9c7ea8bc03e38e3121be4e52916c611f443a713f 100644 (file)
@@ -18,6 +18,7 @@
 #include <stdlib.h>
 #include <string.h>
 
+#include <Eina.h>
 #include <Eldbus.h>
 
 #include "wkb-ibus.h"
@@ -26,7 +27,7 @@
 
 static struct wkb_ibus_config_eet *_conf_eet = NULL;
 
-#define CONFIG_CHECK_MESSAGE_ERRORS(_msg) \
+#define _config_check_message_errors(_msg) \
    do \
      { \
         const char *error, *error_msg; \
@@ -36,7 +37,7 @@ static struct wkb_ibus_config_eet *_conf_eet = NULL;
              return NULL; \
           } \
         DBG("Message '%s' with signature '%s'", eldbus_message_member_get(_msg), eldbus_message_signature_get(_msg)); \
-     } while (0);
+     } while (0)
 
 static Eldbus_Message *
 _config_set_value(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg)
@@ -44,7 +45,7 @@ _config_set_value(const Eldbus_Service_Interface *iface, const Eldbus_Message *m
    const char *section, *name;
    Eldbus_Message_Iter *value;
 
-   CONFIG_CHECK_MESSAGE_ERRORS(msg)
+   _config_check_message_errors(msg);
 
    if (!eldbus_message_arguments_get(msg, "ssv", &section, &name, &value))
      {
@@ -62,7 +63,7 @@ _config_get_value(const Eldbus_Service_Interface *iface, const Eldbus_Message *m
 {
    const char *section, *name;
 
-   CONFIG_CHECK_MESSAGE_ERRORS(msg)
+   _config_check_message_errors(msg);
 
    if (!eldbus_message_arguments_get(msg, "ss", &section, &name))
      {
@@ -80,7 +81,7 @@ _config_get_values(const Eldbus_Service_Interface *iface, const Eldbus_Message *
 {
    const char *section;
 
-   CONFIG_CHECK_MESSAGE_ERRORS(msg)
+   _config_check_message_errors(msg);
 
    if (!eldbus_message_arguments_get(msg, "s", &section))
      {
@@ -98,7 +99,7 @@ _config_unset_value(const Eldbus_Service_Interface *iface, const Eldbus_Message
 {
    const char *section, *name;
 
-   CONFIG_CHECK_MESSAGE_ERRORS(msg)
+   _config_check_message_errors(msg);
 
    if (!eldbus_message_arguments_get(msg, "ss", &section, &name))
      {
index 9832c065d989e4d58e5b797b103bea0755e4ad63..dfa77e9082ede6ac09439a9bea82f3ee33898262 100644 (file)
 #include <stdlib.h>
 #include <string.h>
 
+#include <Eina.h>
 #include <Eldbus.h>
 
 #include "wkb-ibus.h"
 #include "wkb-ibus-defs.h"
 
-#define PANEL_CHECK_MESSAGE_ERRORS(_msg) \
+#define _panel_check_message_errors(_msg) \
    do \
      { \
         const char *error, *error_msg; \
@@ -33,7 +34,7 @@
              return NULL; \
           } \
         DBG("Message '%s' with signature '%s'", eldbus_message_member_get(_msg), eldbus_message_signature_get(_msg)); \
-     } while (0);
+     } while (0)
 
 static Eina_Array *_get_properties_from_message_iter(Eldbus_Message_Iter *iter);
 
@@ -427,7 +428,7 @@ _panel_update_preedit_text(const Eldbus_Service_Interface *iface, const Eldbus_M
    Eina_Bool visible = 0;
    struct _ibus_text *ibus_text;
 
-   PANEL_CHECK_MESSAGE_ERRORS(msg)
+   _panel_check_message_errors(msg);
 
    if (!eldbus_message_arguments_get(msg, "vub", &text, &cursor_pos, &visible))
      {
@@ -447,7 +448,7 @@ _panel_update_preedit_text(const Eldbus_Service_Interface *iface, const Eldbus_M
 static Eldbus_Message *
 _panel_show_preedit_text(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg)
 {
-   PANEL_CHECK_MESSAGE_ERRORS(msg)
+   _panel_check_message_errors(msg);
 
    return NULL;
 }
@@ -455,7 +456,7 @@ _panel_show_preedit_text(const Eldbus_Service_Interface *iface, const Eldbus_Mes
 static Eldbus_Message *
 _panel_hide_preedit_text(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg)
 {
-   PANEL_CHECK_MESSAGE_ERRORS(msg)
+   _panel_check_message_errors(msg);
 
    return NULL;
 }
@@ -467,7 +468,7 @@ _panel_update_auxiliary_text(const Eldbus_Service_Interface *iface, const Eldbus
    Eina_Bool visible = 0;
    struct _ibus_text *ibus_text;
 
-   PANEL_CHECK_MESSAGE_ERRORS(msg)
+   _panel_check_message_errors(msg);
 
    if (!eldbus_message_arguments_get(msg, "vb", &text, &visible))
      {
@@ -487,7 +488,7 @@ _panel_update_auxiliary_text(const Eldbus_Service_Interface *iface, const Eldbus
 static Eldbus_Message *
 _panel_show_auxiliary_text(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg)
 {
-   PANEL_CHECK_MESSAGE_ERRORS(msg)
+   _panel_check_message_errors(msg);
 
    return NULL;
 }
@@ -495,7 +496,7 @@ _panel_show_auxiliary_text(const Eldbus_Service_Interface *iface, const Eldbus_M
 static Eldbus_Message *
 _panel_hide_auxiliary_text(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg)
 {
-   PANEL_CHECK_MESSAGE_ERRORS(msg)
+   _panel_check_message_errors(msg);
 
    return NULL;
 }
@@ -507,7 +508,7 @@ _panel_update_lookup_table(const Eldbus_Service_Interface *iface, const Eldbus_M
    Eina_Bool visible =  0;
    struct _ibus_lookup_table *ibus_lookup_table;
 
-   PANEL_CHECK_MESSAGE_ERRORS(msg)
+   _panel_check_message_errors(msg);
 
    if (!eldbus_message_arguments_get(msg, "vb", &table, &visible))
      {
@@ -526,7 +527,7 @@ _panel_update_lookup_table(const Eldbus_Service_Interface *iface, const Eldbus_M
 static Eldbus_Message *
 _panel_show_lookup_table(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg)
 {
-   PANEL_CHECK_MESSAGE_ERRORS(msg)
+   _panel_check_message_errors(msg);
 
    return NULL;
 }
@@ -534,9 +535,7 @@ _panel_show_lookup_table(const Eldbus_Service_Interface *iface, const Eldbus_Mes
 static Eldbus_Message *
 _panel_hide_lookup_table(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg)
 {
-   PANEL_CHECK_MESSAGE_ERRORS(msg)
-
-   DBG("here");
+   _panel_check_message_errors(msg);
 
    return NULL;
 }
@@ -544,9 +543,7 @@ _panel_hide_lookup_table(const Eldbus_Service_Interface *iface, const Eldbus_Mes
 static Eldbus_Message *
 _panel_cursor_up_lookup_table(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg)
 {
-   PANEL_CHECK_MESSAGE_ERRORS(msg)
-
-   DBG("here");
+   _panel_check_message_errors(msg);
 
    return NULL;
 }
@@ -554,7 +551,7 @@ _panel_cursor_up_lookup_table(const Eldbus_Service_Interface *iface, const Eldbu
 static Eldbus_Message *
 _panel_cursor_down_lookup_table(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg)
 {
-   PANEL_CHECK_MESSAGE_ERRORS(msg)
+   _panel_check_message_errors(msg);
 
    return NULL;
 }
@@ -562,7 +559,7 @@ _panel_cursor_down_lookup_table(const Eldbus_Service_Interface *iface, const Eld
 static Eldbus_Message *
 _panel_page_up_lookup_table(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg)
 {
-   PANEL_CHECK_MESSAGE_ERRORS(msg)
+   _panel_check_message_errors(msg);
 
    return NULL;
 }
@@ -570,7 +567,7 @@ _panel_page_up_lookup_table(const Eldbus_Service_Interface *iface, const Eldbus_
 static Eldbus_Message *
 _panel_page_down_lookup_table(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg)
 {
-   PANEL_CHECK_MESSAGE_ERRORS(msg)
+   _panel_check_message_errors(msg);
 
    return NULL;
 }
@@ -581,7 +578,7 @@ _panel_register_properties(const Eldbus_Service_Interface *iface, const Eldbus_M
    Eldbus_Message_Iter *props = NULL;
    Eina_Array *properties = NULL;
 
-   PANEL_CHECK_MESSAGE_ERRORS(msg)
+   _panel_check_message_errors(msg);
 
    if (!eldbus_message_arguments_get(msg, "v", &props))
      {
@@ -602,7 +599,7 @@ _panel_update_property(const Eldbus_Service_Interface *iface, const Eldbus_Messa
 {
    Eldbus_Message_Iter *prop = NULL;
 
-   PANEL_CHECK_MESSAGE_ERRORS(msg)
+   _panel_check_message_errors(msg);
 
    if (!eldbus_message_arguments_get(msg, "v", &prop))
      {
@@ -619,7 +616,7 @@ _panel_update_property(const Eldbus_Service_Interface *iface, const Eldbus_Messa
 static Eldbus_Message *
 _panel_focus_in(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg)
 {
-   PANEL_CHECK_MESSAGE_ERRORS(msg)
+   _panel_check_message_errors(msg);
 
    return NULL;
 }
@@ -627,7 +624,7 @@ _panel_focus_in(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg
 static Eldbus_Message *
 _panel_focus_out(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg)
 {
-   PANEL_CHECK_MESSAGE_ERRORS(msg)
+   _panel_check_message_errors(msg);
 
    return NULL;
 }
@@ -637,7 +634,7 @@ _panel_set_cursor_location(const Eldbus_Service_Interface *iface, const Eldbus_M
 {
    int x = 0, y = 0, w = 0, h = 0;
 
-   PANEL_CHECK_MESSAGE_ERRORS(msg)
+   _panel_check_message_errors(msg);
 
    if (!eldbus_message_arguments_get(msg, "iiii", &x, &y, &w, &h))
      {
@@ -653,7 +650,7 @@ _panel_set_cursor_location(const Eldbus_Service_Interface *iface, const Eldbus_M
 static Eldbus_Message *
 _panel_reset(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg)
 {
-   PANEL_CHECK_MESSAGE_ERRORS(msg)
+   _panel_check_message_errors(msg);
 
    return NULL;
 }
@@ -661,7 +658,7 @@ _panel_reset(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg)
 static Eldbus_Message *
 _panel_start_setup(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg)
 {
-   PANEL_CHECK_MESSAGE_ERRORS(msg)
+   _panel_check_message_errors(msg);
 
    return NULL;
 }
@@ -669,7 +666,7 @@ _panel_start_setup(const Eldbus_Service_Interface *iface, const Eldbus_Message *
 static Eldbus_Message *
 _panel_state_changed(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg)
 {
-   PANEL_CHECK_MESSAGE_ERRORS(msg)
+   _panel_check_message_errors(msg);
 
    return NULL;
 }
@@ -677,7 +674,7 @@ _panel_state_changed(const Eldbus_Service_Interface *iface, const Eldbus_Message
 static Eldbus_Message *
 _panel_hide_language_bar(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg)
 {
-   PANEL_CHECK_MESSAGE_ERRORS(msg)
+   _panel_check_message_errors(msg);
 
    return NULL;
 }
@@ -685,7 +682,7 @@ _panel_hide_language_bar(const Eldbus_Service_Interface *iface, const Eldbus_Mes
 static Eldbus_Message *
 _panel_show_language_bar(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg)
 {
-   PANEL_CHECK_MESSAGE_ERRORS(msg)
+   _panel_check_message_errors(msg);
 
    return NULL;
 }
index 882a9dd86f05c86907384a2dbae53be78c6d7fc1..55e4e26784f496f1d5fa2db77714bb507a0b35a5 100644 (file)
@@ -27,7 +27,7 @@
 
 int _wkb_ibus_log_dom = -1;
 
-#define CHECK_MESSAGE_ERRORS(_msg) \
+#define _check_message_errors(_msg) \
    do \
      { \
         const char *error, *error_msg; \
@@ -37,7 +37,7 @@ int _wkb_ibus_log_dom = -1;
              return; \
           } \
         DBG("Message '%s' with signature '%s'", eldbus_message_member_get(_msg), eldbus_message_signature_get(_msg)); \
-     } while (0);
+     } while (0)
 
 struct _wkb_ibus_service
 {
@@ -70,7 +70,7 @@ _wkb_config_value_changed_cb(void *data, const Eldbus_Message *msg)
    const char *section, name;
    Eldbus_Message_Iter *value;
 
-   CHECK_MESSAGE_ERRORS(msg)
+   _check_message_errors(msg);
 
    if (!eldbus_message_arguments_get(msg, "ssv", &section, &name, &value))
      {
@@ -123,7 +123,7 @@ _wkb_name_acquired_cb(void *data, const Eldbus_Message *msg)
 
    DBG("NameAcquired");
 
-   CHECK_MESSAGE_ERRORS(msg)
+   _check_message_errors(msg);
 
    if (!eldbus_message_arguments_get(msg, "s", &name))
      {
@@ -170,7 +170,7 @@ _wkb_name_lost_cb(void *data, const Eldbus_Message *msg)
 
    DBG("NameLost");
 
-   CHECK_MESSAGE_ERRORS(msg)
+   _check_message_errors(msg);
 
    if (!eldbus_message_arguments_get(msg, "s", &name))
      {
@@ -226,7 +226,7 @@ _wkb_name_release_cb(void *data, const Eldbus_Message *msg, Eldbus_Pending *pend
 {
    unsigned int reply;
 
-   CHECK_MESSAGE_ERRORS(msg)
+   _check_message_errors(msg);
 
    if (!eldbus_message_arguments_get(msg, "u", &reply))
      {