Remove unused enum definition 13/290313/2
authorSuyeon Hwang <stom.hwang@samsung.com>
Mon, 20 Mar 2023 10:45:32 +0000 (19:45 +0900)
committerSuyeon Hwang <stom.hwang@samsung.com>
Wed, 19 Apr 2023 08:43:43 +0000 (08:43 +0000)
- Issue:
The enum value is unvaluable in server logic.

- Solution:
Enum values in sttd_result_state_e are not valuable, because there is no
logic to handle those value. So, this patch removes this enum definition
from the code.

Change-Id: I2d2b57d11fd5c0508346783c1a4c70d76d1ca1c2
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
server/sttd_main.h
server/sttd_server.c

index b14edc1..e044025 100644 (file)
@@ -59,11 +59,6 @@ typedef enum {
        STTD_ERROR_SERVICE_RESET                = TIZEN_ERROR_STT | 0x11        /**< Service reset */
 } sttd_error_e;
 
-typedef enum {
-       STTD_RESULT_STATE_DONE          = 0,                    /**< Sync state change */
-       STTD_RESULT_STATE_NOT_DONE      = 1                     /**< Async state change */
-} sttd_result_state_e;
-
 typedef struct {
        char* engine_id;
        char* engine_name;
index b096694..3464518 100644 (file)
@@ -1079,7 +1079,7 @@ Eina_Bool __stop_by_recording_timeout(void *data)
        if (STT_INVALID_UID != uid) {
                /* cancel engine recognition */
                int ret = sttd_server_stop(uid);
-               if (0 != ret) {
+               if (STTD_ERROR_NONE != ret) {
                        SLOG(LOG_ERROR, TAG_STTD, "[Server ERROR] Fail to stop : result(%d)", ret);
                }
        }
@@ -1318,12 +1318,11 @@ int sttd_server_start(unsigned int uid, const char* lang, const char* recognitio
                }
 
                SLOG(LOG_INFO, TAG_STTD, "[Server SUCCESS] Start recognition");
-               return STTD_RESULT_STATE_DONE;
+       } else {
+               SLOG(LOG_INFO, TAG_STTD, "[Server] Wait sound finish");
        }
 
-       SLOG(LOG_INFO, TAG_STTD, "[Server] Wait sound finish");
-
-       return STTD_RESULT_STATE_NOT_DONE;
+       return STTD_ERROR_NONE;
 }
 
 Eina_Bool __time_out_for_processing(void *data)
@@ -1476,8 +1475,6 @@ int sttd_server_stop(unsigned int uid)
 
                SLOG(LOG_INFO, TAG_STTD, "[INFO] Add g_processing_timer");
                g_processing_timer = ecore_timer_add(g_processing_timeout, __time_out_for_processing, NULL);
-
-               return STTD_RESULT_STATE_NOT_DONE;
        } else {
                SLOG(LOG_INFO, TAG_STTD, "[Server] No sound play");
 
@@ -1506,8 +1503,6 @@ int sttd_server_stop(unsigned int uid)
 
                SLOG(LOG_INFO, TAG_STTD, "[INFO] Add g_processing_timer");
                g_processing_timer = ecore_timer_add(g_processing_timeout, __time_out_for_processing, NULL);
-
-               return STTD_RESULT_STATE_DONE;
        }
 
        return STTD_ERROR_NONE;