From 3b1a1a97c5fdef371cdeb8fa395b823af061edbe Mon Sep 17 00:00:00 2001 From: "taemin.yeom" Date: Fri, 12 Mar 2021 10:36:14 +0900 Subject: [PATCH] Improve variable naming style Change-Id: I7e8166f40624a53ff4add751b9a2d06800b5f285 Signed-off-by: taemin.yeom --- src/auto-test/haptic.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/auto-test/haptic.c b/src/auto-test/haptic.c index 866ce6e..944f622 100644 --- a/src/auto-test/haptic.c +++ b/src/auto-test/haptic.c @@ -27,42 +27,42 @@ #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; } -- 2.7.4