Trivial improving code quality 16/242816/1
authorInkyun Kil <inkyun.kil@samsung.com>
Tue, 1 Sep 2020 05:37:12 +0000 (14:37 +0900)
committerInkyun Kil <inkyun.kil@samsung.com>
Tue, 1 Sep 2020 05:37:12 +0000 (14:37 +0900)
- change global variable to static

Change-Id: Idff8f2940be87b37fc2f5a43684e7d50dd154706
Signed-off-by: Inkyun Kil <inkyun.kil@samsung.com>
lib/alarm-lib.c
server/alarm-manager-timer.c
server/alarm-manager.c
server/plugin/platform/src/alarm-server-plugin.c
session-agent/agent.c

index 7bf104767b1cd2785987df9dbdc6c8801260d79b..ed12a12cc780929e87e77b640170f5713362138c 100644 (file)
@@ -74,7 +74,7 @@ struct alarm_async_param_t {
 
 static alarm_cb_info_t *alarmcb_head;
 
-guint registration_id;
+static guint registration_id;
 
 static GDBusNodeInfo *introspection_data;
 
index d98640bf1b449a4d01c671a8546ade7bdb5c28ba..ff6a304c70c57487ca58e2dffecd073d7a119b27 100644 (file)
@@ -128,7 +128,7 @@ static gboolean __timer_glib_prepare(GSource *src, gint *timeout)
        return FALSE;
 }
 
-GSourceFuncs funcs = {
+static GSourceFuncs funcs = {
        .prepare = __timer_glib_prepare,
        .check = __timer_glib_check,
        .dispatch = __timer_glib_dispatch,
index 06c8fd4944b75d9e37a0a41ed2bb59a607560c14..3e06f06b3ac1bee3ae9ea8dec47325504992b2f5 100644 (file)
@@ -80,7 +80,7 @@ extern bool g_dummy_timer_is_set;
 GSList *g_scheduled_alarm_list;
 GSList *g_expired_alarm_list;
 GSList *g_disabled_alarm_list;
-GHashTable *caller_appid_cache_table;
+static GHashTable *caller_appid_cache_table;
 
 bool is_time_changed = false; /* for calculating next duetime */
 static time_t periodic_alarm_standard_time = 0;
index 8b78767c591ba087161e7408e072d5f82985e35e..3f065a9909bcc0a32607a0114770502671afbdff 100644 (file)
@@ -26,8 +26,8 @@
 #include "plugin.h"
 
 static const char default_rtc[] = "/dev/rtc";
-int gfd = -1;
-int is_psm = -1;
+static int gfd = -1;
+static int is_psm = -1;
 
 EXPORT int CLEAR_WAKEUP_RTC(void)
 {
index 370c397a7132febc1e989bb81ab22b81b191556e..a88af1cf8d61e1de419bf28cb7bebec1eedbe340 100755 (executable)
@@ -35,7 +35,7 @@
 
 #define POLLFD_MAX 1
 
-GMainLoop *mainloop;
+static GMainLoop *__mainloop;
 
 static int _sock_create(const char *path)
 {
@@ -246,7 +246,7 @@ static gboolean _alarm_agent_main(gint fd, GIOCondition condition,
 
 gboolean _timeout_handler(gpointer user_data)
 {
-       g_main_loop_quit(mainloop);
+       g_main_loop_quit(__mainloop);
        return G_SOURCE_REMOVE;
 }
 
@@ -264,13 +264,13 @@ int main(int argc, char *argv[])
                exit(0);
        }
 
-       mainloop = g_main_loop_new(NULL, FALSE);
+       __mainloop = g_main_loop_new(NULL, FALSE);
        g_unix_fd_add(sock_fd, G_IO_IN, _alarm_agent_main, NULL);
        g_timeout_add_seconds(100, _timeout_handler, NULL);
 
-       g_main_loop_run(mainloop);
+       g_main_loop_run(__mainloop);
 
-       g_main_loop_unref(mainloop);
+       g_main_loop_unref(__mainloop);
        close(sock_fd);
 
        return 0;