Fix defects detected by static analysis tool 43/229743/3
authorJi-hoon Lee <dalton.lee@samsung.com>
Fri, 3 Apr 2020 06:51:55 +0000 (15:51 +0900)
committerJi-hoon Lee <dalton.lee@samsung.com>
Wed, 8 Apr 2020 10:44:46 +0000 (19:44 +0900)
Fixes the problem that local variable names are
same with parameter names.

Change-Id: Id60bc907d2e8142f739c01502d7202f4c6435cdd

plugins/wakeup-manager/dependency-default/src/dependency_default_button.cpp
plugins/wakeup-manager/src/assistant_config_manager.cpp
src/service_main.cpp

index f11ee97..140ac41 100644 (file)
@@ -61,14 +61,14 @@ static Eina_Bool _key_up_cb(void* data, int type, void* event)
                        auto diff = current_time_point - g_last_key_pressed;
                        long long int milliseconds = chrono::duration_cast<chrono::milliseconds>(diff).count();
                        LOGD("milliseconds : %lld", milliseconds);
-                       mas_plugin_event_e event;
+                       mas_plugin_event_e plugin_event;
                        if (milliseconds < g_voice_key_tap_duration) {
-                               event = MAS_PLUGIN_EVENT_VOICE_KEY_RELEASED_AFTER_TAP;
+                               plugin_event = MAS_PLUGIN_EVENT_VOICE_KEY_RELEASED_AFTER_TAP;
                        } else {
-                               event = MAS_PLUGIN_EVENT_VOICE_KEY_RELEASED_AFTER_PUSH;
+                               plugin_event = MAS_PLUGIN_EVENT_VOICE_KEY_RELEASED_AFTER_PUSH;
                        }
                        if (g_proxy_interface.process_event) {
-                               g_proxy_interface.process_event(event, NULL, 0);
+                               g_proxy_interface.process_event(plugin_event, NULL, 0);
                        }
                }
        }
index e15b411..bdc7461 100644 (file)
@@ -64,10 +64,10 @@ void CAssistantConfigManager::foreach_assistant_language(foreach_assistant_langu
        closure.user_data = user_data;
 
        preference_foreach_item(
-               [](const char *key, void *user_data) {
+               [](const char *key, void *data) {
                        string prefix = string{LANGUAGE_PREFIX};
                        foreach_assistant_language_cb_closure* closure =
-                               static_cast<foreach_assistant_language_cb_closure*>(user_data);
+                               static_cast<foreach_assistant_language_cb_closure*>(data);
                        if (key && strlen(key) > prefix.length() &&
                                0 == prefix.compare(0, prefix.length(), key, prefix.length())) {
                                char* value = nullptr;
index 86b4001..b023aa4 100644 (file)
@@ -306,9 +306,9 @@ int CServiceMain::mas_client_send_preprocessing_result(int pid, bool result)
        }
 
        if (current_maclient_appid) {
-               int pid = mClientManager.find_client_pid_by_appid(
+               int pid_by_appid = mClientManager.find_client_pid_by_appid(
                        std::string{current_maclient_appid});
-               mServiceIpc.send_preprocessing_result(pid, result);
+               mServiceIpc.send_preprocessing_result(pid_by_appid, result);
        }
 
        return 0;