From e8b6efe7dce4940bf662aa7bac4437b51ec76ac8 Mon Sep 17 00:00:00 2001 From: Hwankyu Jhun Date: Fri, 11 Sep 2020 09:27:10 +0900 Subject: [PATCH] Adjust scope of global variables This patch adds "static" keyword to global variables. And, the name that is "white" is changed to "allowed". Change-Id: Ibd803143327d9cf9892475d5f9781109f53cd8b3 Signed-off-by: Hwankyu Jhun --- src/service.c | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/src/service.c b/src/service.c index ace56f2..6fb38f3 100755 --- a/src/service.c +++ b/src/service.c @@ -79,8 +79,8 @@ typedef struct _aul_svc_transient_cb_info_t { void *data; } aul_svc_transient_cb_info_t; -pthread_mutex_t iniparser_lock = PTHREAD_MUTEX_INITIALIZER; -GSList *tmp_list; +static pthread_mutex_t iniparser_lock = PTHREAD_MUTEX_INITIALIZER; +static GSList *tmp_list; static aul_svc_cb_info_t *__create_rescb(int request_code, aul_svc_res_fn cbfunc, aul_svc_err_cb err_cb, void *data); @@ -93,43 +93,40 @@ static int __run_svc_with_pkgname(char *pkgname, bundle *b, int request_code, static int __get_resolve_info(bundle *b, aul_svc_resolve_info_t *info); static int __free_resolve_info_data(aul_svc_resolve_info_t *info); -static char *white_list[] = { - APP_SELECTOR, - SHARE_PANEL, - NULL -}; - static bool __is_special_app(const char *appid) { - const char *id; - int i = 0; + static char *allowed_apps[] = { + APP_SELECTOR, + SHARE_PANEL, + NULL + }; + int i; if (appid == NULL) return false; - while ((id = white_list[i]) != NULL) { - if (strcmp(id, appid) == 0) + for (i = 0; allowed_apps[i]; ++i) { + if (!strcmp(allowed_apps[i], appid)) return true; - i++; } return false; } static bool __is_special_operation(bundle *b) { - const char *operation; - const char *white_operations[] = { + static const char *allowed_operations[] = { "http://tizen.org/appcontrol/operation/guide_privacy_setting", NULL }; + const char *operation; int i; operation = aul_svc_get_operation(b); if (!operation) return false; - for (i = 0; white_operations[i]; ++i) { - if (!strcmp(operation, white_operations[i])) + for (i = 0; allowed_operations[i]; ++i) { + if (!strcmp(allowed_operations[i], operation)) return true; } -- 2.7.4