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 7bf1047..ed12a12 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 d98640b..ff6a304 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 06c8fd4..3e06f06 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 8b78767..3f065a9 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 370c397..a88af1c 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;