Change global variables to static 33/222333/1
authorhj kim <backto.kim@samsung.com>
Mon, 13 Jan 2020 06:59:32 +0000 (15:59 +0900)
committerhj kim <backto.kim@samsung.com>
Mon, 13 Jan 2020 22:48:45 +0000 (22:48 +0000)
Change-Id: I6a995e9e9476de4896d96fe3d2d9a5d809b74261
(cherry picked from commit ee796ea757fe314bf5dcd1516b72c92e000d461a)

lib/media-util-db.c
lib/media-util-noti-internal.c
lib/media-util-register.c
src/common/media-common-system.c
src/mediadb-update.c
src/scanner-v2/media-scanner-common-v2.c
src/scanner-v2/media-scanner-extract-v2.c
src/scanner-v2/media-scanner-scan-v2.c
src/scanner/media-scanner-scan.c
src/server/media-server-scanner.c

index 568ab2d..3a1707e 100755 (executable)
 #define BATCH_END "COMMIT"
 #define PATH_PLUGIN_LIBICU                             PATH_LIBDIR"/libicui18n.so"
 
-UCollator *(*icu_ucol_open)(const char *, UErrorCode *);
-void (*icu_ucol_close)(UCollator *);
-void (*icu_ucol_setStrength)(UCollator *, UCollationStrength);
-UCollationResult (*icu_ucol_strcollIter)(const UCollator *, UCharIterator *, UCharIterator *, UErrorCode *);
-void (*icu_uiter_setUTF8)(UCharIterator *, const char *, int32_t);
-void (*icu_uloc_setDefault)(const char* localeID, UErrorCode* status);
-const char* (*icu_uloc_getDefault)(void);
+static UCollator *(*icu_ucol_open)(const char *, UErrorCode *);
+static void (*icu_ucol_close)(UCollator *);
+static void (*icu_ucol_setStrength)(UCollator *, UCollationStrength);
+static UCollationResult (*icu_ucol_strcollIter)(const UCollator *, UCharIterator *, UCharIterator *, UErrorCode *);
+static void (*icu_uiter_setUTF8)(UCharIterator *, const char *, int32_t);
+static void (*icu_uloc_setDefault)(const char* localeID, UErrorCode* status);
+static const char* (*icu_uloc_getDefault)(void);
 
 static void *funcHandle = NULL;
 
index 4683f3a..a651bff 100755 (executable)
@@ -36,7 +36,7 @@
 #include "media-util.h"
 #include "private.h"
 
-GArray *handle_list_internal;
+static GArray *handle_list_internal;
 static GMutex mutex_internal;
 
 #define MS_MEDIA_DBUS_NAME_INTERNAL "ms_db_updated_internal"
index cb53993..e76798f 100755 (executable)
@@ -44,7 +44,7 @@ typedef struct media_scan_data {
        char *req_path;
 } media_scan_data;
 
-GArray *req_list;
+static GArray *req_list;
 
 static int _check_dir_path(const char *dir_path, uid_t uid)
 {
index 446e2b3..994f9eb 100644 (file)
@@ -58,7 +58,7 @@ typedef struct block_cb_data {
        void *usr_data;
 } block_cb_data;
 
-block_cb_data *g_stg_cb_data = NULL;
+static block_cb_data *g_stg_cb_data = NULL;
 
 static void __ms_block_changed(GDBusConnection* connection,
                                        const gchar* sender_name,
@@ -456,7 +456,7 @@ typedef struct pwoff_cb_data {
 static GDBusConnection *g_pwr_bus;
 static int g_pwr_handler;
 
-pwoff_cb_data *g_pwr_cb_data = NULL;
+static pwoff_cb_data *g_pwr_cb_data = NULL;
 
 static void __poweroff_signal_cb(GDBusConnection *connection,
                                                                        const gchar *sender_name,
index c1e5111..87519a1 100755 (executable)
 
 #define PATH_PLUGIN_LIB                                PATH_LIBDIR"/libmedia-content-plugin.so"
 
-GMainLoop * mainloop = NULL;
-struct timeval start_time, end_time;
+static GMainLoop * mainloop = NULL;
+static struct timeval start_time;
 
-int (*svc_check_db)                    (sqlite3 * handle, uid_t uid);
-int (*svc_get_storage_id)              (sqlite3 * handle, const char *path, char *storage_id, uid_t uid);
+static int (*svc_check_db)                     (sqlite3 * handle, uid_t uid);
+static int (*svc_get_storage_id)               (sqlite3 * handle, const char *path, char *storage_id, uid_t uid);
 
-void callback(media_request_result_s * result, void *user_data)
+static void callback(media_request_result_s * result, void *user_data)
 {
        long long ms_time = 0;
+       struct timeval end_time;
 
        if (result->result != MEDIA_REQUEST_SCAN_PARTIAL) {
                gettimeofday(&end_time, NULL);
index 1961c0a..92802d1 100755 (executable)
@@ -24,8 +24,8 @@
 #include "media-scanner-common-v2.h"
 
 bool power_off2;
-bool disc_stg_scan_status;
-bool disc_dir_scan_status;
+static bool disc_stg_scan_status;
+static bool disc_dir_scan_status;
 
 void msc_set_power_status(bool status)
 {
index 074c44a..6a411a9 100644 (file)
 extern bool power_off2;
 GAsyncQueue *storage_extract_queue;
 GAsyncQueue *folder_extract_queue;
-GMutex extract_req_mutex;
-GMutex extract_blocked_mutex;
-char *g_extract_cancel_path;
-char *g_extract_blocked_path;
+static GMutex extract_req_mutex;
+static GMutex extract_blocked_mutex;
+static char *g_extract_cancel_path;
+static char *g_extract_blocked_path;
 bool g_directory_extract_processing;
-int stg_extract_status;
+static int stg_extract_status;
 
-GMutex extract_item_mutex;
-GMutex decode_mutex;
+static GMutex extract_item_mutex;
+static GMutex decode_mutex;
 
-s_extract_item* cancel_extract_item = NULL;
-s_extract_item* cur_extract_item = NULL;
+static s_extract_item* cancel_extract_item = NULL;
+static s_extract_item* cur_extract_item = NULL;
 
-GCond extract_data_cond;
-GMutex extract_data_mutex;
+static GCond extract_data_cond;
+static GMutex extract_data_mutex;
 #define VCONFKEY_PRIVATE_EXTRACTSTATUS "db/private/extractstatus"
 #define LAST_EVENT 1
 #define NORMAL_EVENT 0
index fdc885c..2dd1d60 100644 (file)
@@ -57,27 +57,26 @@ GAsyncQueue *storage_queue2;
 GAsyncQueue *scan_queue2;
 GAsyncQueue *reg_queue2;
 GMutex scan_req_mutex2;
-GMutex blocked_mutex2;
-GMutex storage_scan_mutex2;
-GMutex dir_scan_mutex2;
-GCond data_cond2;      /* Must be initialized somewhere */
-GMutex data_mutex2;    /* Must be initialized somewhere */
-gpointer current_data2 = NULL;
-GMutex scan_item_mutex;
+static GMutex blocked_mutex2;
+static GMutex storage_scan_mutex2;
+static GMutex dir_scan_mutex2;
+static GCond data_cond2;       /* Must be initialized somewhere */
+static GMutex data_mutex2;     /* Must be initialized somewhere */
+static GMutex scan_item_mutex;
 
-char *g_blocked_path2;
+static char *g_blocked_path2;
 
-s_scan_item* cancel_scan_item = NULL;
-s_scan_item* cur_scan_item = NULL;
+static s_scan_item* cancel_scan_item = NULL;
+static s_scan_item* cur_scan_item = NULL;
 
 int g_directory_scan_processing2 = DIR_SCAN_NON_SCAN;
-char *g_storage_scan_path;
-char* g_dir_scan_path;
-unsigned int io_err_folder;
-unsigned int io_err_storage;
+static char *g_storage_scan_path;
+static char* g_dir_scan_path;
+static unsigned int io_err_folder;
+static unsigned int io_err_storage;
 
 typedef int (*DIR_SCAN_CB)();
-DIR_SCAN_CB g_dir_scan_cb;
+static DIR_SCAN_CB g_dir_scan_cb;
 
 struct linux_dirent {
        ino64_t                 d_ino;   /* 64-bit inode number */
index 2b79bf5..923e281 100644 (file)
@@ -31,9 +31,9 @@
 #include "media-scanner-scan.h"
 
 bool power_off;
-GAsyncQueue * storage_queue;
+static GAsyncQueue * storage_queue;
 GAsyncQueue *scan_queue;
-GAsyncQueue *reg_queue;
+static GAsyncQueue *reg_queue;
 GMutex scan_req_mutex;
 
 static bool __msc_is_stop_needed(void)
index a67ea4b..a0fc314 100755 (executable)
@@ -52,7 +52,7 @@ static int receive_id;
 
 static bool scanner_cleaned;
 
-int fifo_fd;
+static int fifo_fd;
 
 static int __ms_get_remained_task(void)
 {