Improve variable naming style 77/255077/2 accepted/tizen/unified/20210317.120012 submit/tizen/20210315.085912
authortaemin.yeom <taemin.yeom@samsung.com>
Fri, 12 Mar 2021 01:36:14 +0000 (10:36 +0900)
committertaemin.yeom <taemin.yeom@samsung.com>
Mon, 15 Mar 2021 06:16:47 +0000 (15:16 +0900)
Change-Id: I7e8166f40624a53ff4add751b9a2d06800b5f285
Signed-off-by: taemin.yeom <taemin.yeom@samsung.com>
src/auto-test/haptic.c

index 866ce6e..944f622 100644 (file)
 #define METHOD_HAPTIC_SHOWHANDLELIST   "ShowHandleList"
 #define METHOD_HAPTIC_ISSUPPORTED      "IsSupported"
 
-static bool request_haptic_method(const char *method, GVariant *param, int *return_val)
+static bool request_haptic_method(const char *method, GVariant *param, int *out_val)
 {
-       GVariant *msg;
-       int val, err;
+       GVariant *reply;
+       int reply_val, ret_dbus;
        bool ret = FALSE;
 
-       err = dbus_handle_method_sync_with_reply_var(VIBRATOR_BUS_NAME,
+       ret_dbus = dbus_handle_method_sync_with_reply_var(VIBRATOR_BUS_NAME,
                VIBRATOR_PATH_HAPTIC,
                VIBRATOR_INTERFACE_HAPTIC,
-               method, param, &msg);
+               method, param, &reply);
 
-       if (err < 0) {
+       if (ret_dbus < 0) {
                _E("Failed to call %s: no reply", method);
                return ret;
        }
 
-       if (!g_variant_get_safe(msg, "(i)", &val))
+       if (!g_variant_get_safe(reply, "(i)", &reply_val))
                _E("Failed to call %s: no message", method);
        else {
-               if ((val == -ENOTSUP) || (val == -ENOSYS)) {
-                       _I("Not supported feature(%s): %d", method, val);
+               if ((reply_val == -ENOTSUP) || (reply_val == -ENOSYS)) {
+                       _I("Not supported feature(%s): %d", method, reply_val);
                        ret = TRUE;
-               } else if (val == -ENODEV) {
-                       _E("Failed to call %s. Device open fail: %d", method, val);
-               } else if (val < 0) {
-                       _E("Failed to call %s. Returned fail: %d", method, val);
+               } else if (reply_val == -ENODEV) {
+                       _E("Failed to call %s. Device open fail: %d", method, reply_val);
+               } else if (reply_val < 0) {
+                       _E("Failed to call %s. Returned fail: %d", method, reply_val);
                } else {
-                       _I("Success. %s: %d", method, val);
+                       _I("Success. %s: %d", method, reply_val);
                        ret = TRUE;
                }
        }
 
-       g_variant_unref(msg);
+       g_variant_unref(reply);
 
-       if (return_val)
-               *return_val = val;
+       if (out_val)
+               *out_val = reply_val;
 
        return ret;
 }