change global variables to static 58/250358/1
authordyamy-lee <dyamy.lee@samsung.com>
Tue, 1 Dec 2020 05:58:31 +0000 (14:58 +0900)
committerdyamy-lee <dyamy.lee@samsung.com>
Thu, 24 Dec 2020 02:53:27 +0000 (11:53 +0900)
Change-Id: I93cbffc279e7fd7232be3b086936debf6ffe7fb1

12 files changed:
base/base_gui_direct.c
base/base_main.c
base/fota_png.c
base/gui_log.h
base/gui_util.c
base/tdm-if.h
fota_gui_wearable/fota_gr_direct_ro_wearable.c
fota_gui_wearable/fota_gui_ro_wearable_main.c
rw-update-ani-wearable/rw-update-ani_new.c
rw-update-ani-wearable/rw-update_new_cairo_w_360_360.c
rw-update-ani-wearable/rw-update_new_common_display.h
rw-update-ani-wearable/rw-update_new_fb_cairo.c

index 2aca45b9ec8da860b2b1d0093920a572d1a06fcc..5acee0aa8ad16547db37ec0fb3914b7217e94364 100644 (file)
 /*****************************************************************************
 ** global variables
 *****************************************************************************/
-const int x_offset_main_bg_text_pos = 518;
-const int y_offset_main_bg_text_pos = 300;
-const int x_offset_prog_bar_img_pos = 240;
-const int y_offset_prog_bar_img_pos = 355;
-int rotate_step = 0;
-int rollback_step = 0;
-int img_buf_width = 0;
-int img_buf_height = 0;
-
-FbInfo s_fbi;
-tdm_if_disp s_disp;
-
-int s_percent_to_draw = 0;
-int s_saved_percent = -1;
+static const int x_offset_main_bg_text_pos = 518;
+static const int y_offset_main_bg_text_pos = 300;
+static const int x_offset_prog_bar_img_pos = 240;
+static const int y_offset_prog_bar_img_pos = 355;
+static int rotate_step = 0;
+static int rollback_step = 0;
+static int img_buf_width = 0;
+static int img_buf_height = 0;
+
+static FbInfo s_fbi;
+static tdm_if_disp s_disp;
+
+static int s_percent_to_draw = 0;
+static int s_saved_percent = -1;
 
 /*-----------------------------------------------------------------------------
   fb_open()
index cb7f6dd2041a80a74fdd2f8395d5e47f79d9f51a..129d1d21f6aff7d5a0cf67e7edcbc093f0369a8d 100644 (file)
 #include "gui_general.h"
 #include "gui_util.h"
 #include "base_gui.h"
-
+/*
 unsigned int __log_level__ =
        (LOG_DEBUG | LOG_FLASH | LOG_FILE | LOG_FUNCS | LOG_GUI | LOG_SSENGINE | LOG_INFO);
+       */
 FILE *__log_out_file__;
 
-int s_prog_percent = 0;
-int s_last_prog_percent = 0;
+static int s_prog_percent = 0;
+static int s_last_prog_percent = 0;
 
-int s_pid = -1;
+static int s_pid = -1;
 
 static int wait_main(void)
 {
index 65cc5cc937ce998fba804ba23255219c93f0c8f8..18c59838b4454b6ef3a2cf8155a47e49b37bab8b 100644 (file)
 #include "gui_general.h"
 #include "fota_png.h"
 
-int png_img_width;
-int png_img_height;
+static int png_img_width;
+static int png_img_height;
 /* clear screen based on img size */
 //int png_img_width_batt_normal;
 //int png_img_height_batt_normal;
 
-png_byte png_color_type;
-png_byte png_bit_depth;
+static png_byte png_color_type;
+static png_byte png_bit_depth;
 
-png_structp png_ptr;
-png_infop info_ptr;
-int number_of_passes;
-png_bytep *row_pointers;
+static png_structp png_ptr;
+static png_infop info_ptr;
+static int number_of_passes;
+static png_bytep *row_pointers;
 
 /*-----------------------------------------------------------------------------
   read_png_file()
index f7ee22827f6da9a4ff248fc14cf498bf3505e3be..18cac9ccc0e3370f11f8b9822ea519f3fccc724a 100644 (file)
@@ -21,7 +21,7 @@
 
 #include <stdio.h>
 
-extern unsigned int __log_level__;
+//extern unsigned int __log_level__;
 extern FILE *__log_out_file__;
 
 #define LOG_INFO       (1<<8)
@@ -36,18 +36,24 @@ extern FILE *__log_out_file__;
 #define LOG_PRFIX      "FOTA_GUI"
 #endif
 
+#define LOG_LEVEL      (LOG_DEBUG | LOG_FLASH | LOG_FILE | LOG_FUNCS | LOG_GUI | LOG_SSENGINE | LOG_INFO)
+
+#define LOGL(mask, s, args...) do { if ((mask) & LOG_LEVEL) \
+       printf(LOG_PRFIX "/(%s): " s, __func__, ##args); } while (0)
+#define LOG(s, args...) LOGL(LOG_DEBUG, s, ##args)
+
 #define DEBUG_STDOUT
 //#define DEBUG_FILE
 
 #ifdef DEBUG_STDOUT
 #define LOGE(s, args...) printf(LOG_PRFIX "/ERROR(%s)  " s, __func__, ##args) // Error log
-#define LOGL(mask, s, args...) do { if ((mask) & __log_level__) \
+#define LOGL(mask, s, args...) do { if ((mask) & LOG_LEVEL) \
        printf(LOG_PRFIX "/(%s): " s, __func__, ##args); } while (0)
 #define LOG(s, args...) LOGL(LOG_DEBUG, s, ##args)
 
 #elif defined(DEBUG_FILE)
 #define LOGE(s, args...) fprintf(__log_out_file__, LOG_PRFIX "/ERROR(%s)  " s, __func__, ##args)
-#define LOGL(mask, s, args...) do { if ((mask) & __log_level__) \
+#define LOGL(mask, s, args...) do { if ((mask) & LOG_LEVEL) \
        fprintf(__log_out_file__, LOG_PRFIX "/(%s): " s , __func__, ##args); } while (0)
 #define LOG(s, args...) LOGL(LOG_DEBUG, s, ##args)
 
@@ -57,7 +63,7 @@ extern FILE *__log_out_file__;
                                                fprintf(__log_out_file__, LOG_PRFIX "/ERROR(%s)  " s, __func__, ##args);\
                                        } while (0)
 #define LOGL(mask, s, args...) do { \
-                                               if ((mask) & __log_level__) { \
+                                               if ((mask) & LOG_LEVEL) { \
                                                        printf(LOG_PRFIX "/(%s): " s , __func__, ##args);\
                                                    fprintf(__log_out_file__, LOG_PRFIX "/(%s): " s, __func__, ##args);\
                                                } \
index f0ef7f62a6ff4926ce6bbb122bec0be4aec0f520..9ed6c7b4ae78d54fad4f7b8152fe886ed0c2cb2c 100644 (file)
@@ -28,9 +28,9 @@
 
 #include "gui_log.h"
 
-int s_fd_stdin = -1;
-int s_fd_stdout = -1;
-int s_fd_stderr = -1;
+static int s_fd_stdin = -1;
+static int s_fd_stdout = -1;
+static int s_fd_stderr = -1;
 
 /*-----------------------------------------------------------------------------
   set_default_stdio
index dc67910047be723f4fa33fa49982b222d003bb5a..22f91db9edf7ee06150d3cdd222f6ee45a8ebe63 100644 (file)
@@ -63,7 +63,7 @@ typedef enum {
        BACK_BUFFER
 } BUFFER_TYPE;
 
-extern tdm_if_disp s_disp;
+//extern tdm_if_disp s_disp;
 
 int tdm_if_display_init(tdm_if_disp *st_disp);
 void tdm_if_display_deinit(tdm_if_disp *st_disp);
index 11fd10824e7421be3328e4f92ee113b8cb6f0953..eeb4d901fa115616ab59de008cf47a2261a232cc 100644 (file)
 /*****************************************************************************
 ** global variables
 *****************************************************************************/
-FbInfo s_fbi;
-tdm_if_disp s_disp;
+static FbInfo s_fbi;
+static tdm_if_disp s_disp;
 
-int s_percent_to_draw = 0;
-int s_saved_percent = -1;
+static int s_percent_to_draw = 0;
+static int s_saved_percent = -1;
 
 /*-----------------------------------------------------------------------------
   fb_open()
index e8472c416a33fb9894ea56f08938f051d16d7283..7e8d461a463e90366efeb673a295925aa78be133 100644 (file)
 
 //#define WAIT
 //#undef WAIT
-
+/*
 unsigned int __log_level__ =
        (LOG_DEBUG | LOG_FLASH | LOG_FILE | LOG_FUNCS | LOG_GUI | LOG_SSENGINE | LOG_INFO);
+*/
 FILE *__log_out_file__;
 
-int s_prog_percent = 0;
-int s_last_prog_percent = 0;
+static int s_prog_percent = 0;
+static int s_last_prog_percent = 0;
 
-int s_pid = -1;
+static int s_pid = -1;
 
 static int wait_main_fota_ro(void)
 {
index 8651862e2ceadc0fe78404b80be1f151e96ce4b7..94e6e4dc3dabbf087d195c7dcdd9734f284c2c95 100644 (file)
@@ -50,7 +50,8 @@
 #define FILE_IO_BUF_SIZE               128
 #define CHG_ENV_BATT_STATUS "/sys/class/power_supply/battery/status"
 
-FbInfo fbi;
+static FbInfo fbi;
+static common_disp s_disp;
 
 static pthread_t keyevent_thread;
 
index b4c93dfbb94ef3dd9775331d0819f4deb03bf05d..52c2c79419105533d501e5c32c4e059c9df16dcc 100644 (file)
@@ -37,7 +37,7 @@
 
 #include <libintl.h>           // dgettext
 
-CairoInfo cairoinfo;
+static CairoInfo cairoinfo;
 
 #define DEFAULT_FONT   "SamsungOneUI"
 #define TEXT_COLOR     1, 1, 1 /* #12b4ff */
@@ -66,24 +66,24 @@ CairoInfo cairoinfo;
 #define TEXT_FONT_SIZE_MAX             32
 #define TEXT_FONT_SIZE_MIN             16
 
-cairo_surface_t *img_surf_main = NULL;
-cairo_surface_t *img_surf_popup = NULL;
-cairo_surface_t *img_surf_main_txt = NULL;
-cairo_surface_t *img_surf_prog[PROGRESS_IMG_CNT] = {NULL,};
-cairo_surface_t *img_surf_num[PROGRESS_NUM_CNT] = {NULL,};
-cairo_surface_t *img_surf_slash = NULL;
+static cairo_surface_t *img_surf_main = NULL;
+static cairo_surface_t *img_surf_popup = NULL;
+static cairo_surface_t *img_surf_main_txt = NULL;
+static cairo_surface_t *img_surf_prog[PROGRESS_IMG_CNT] = {NULL,};
+static cairo_surface_t *img_surf_num[PROGRESS_NUM_CNT] = {NULL,};
+static cairo_surface_t *img_surf_slash = NULL;
 
-int main_img_x = 0;
-int main_img_y = 0;
-int main_img_w = 0;
-int main_img_h = 0;
+static int main_img_x = 0;
+static int main_img_y = 0;
+static int main_img_w = 0;
+static int main_img_h = 0;
 
 #define BG_COLOR       0.0, 0.0, 0.0
 
 #define MAX_BUF_LEN    512
-char s_rw_process_msg1[MAX_BUF_LEN];
-char s_rw_process_msg2[MAX_BUF_LEN];
-int s_bnewline = 0;
+static char s_rw_process_msg1[MAX_BUF_LEN];
+static char s_rw_process_msg2[MAX_BUF_LEN];
+static int s_bnewline = 0;
 
 static double s_text_x1 = 0.0;
 static double s_text_x2 = 0.0;
@@ -92,7 +92,7 @@ static double s_text_y2 = 0.0;
 
 static int s_font_sz = 0.0;
 
-int s_font_initialized = 0;
+static int s_font_initialized = 0;
 
 /*-----------------------------------------------------------------------------
   cairo_update_screen()
index 5f6c0898d665eb060c5b476e3c1ef9982ad8896a..cdd059b5e5095283619fceac2c0011148d6a70c3 100644 (file)
@@ -72,7 +72,7 @@ enum {
        CHG_DEGREE_270 = 3,
 };
 
-extern common_disp s_disp;
+//extern common_disp s_disp;
 
 int chg_common_display_init(common_disp *st_disp);
 void chg_common_display_deinit(common_disp *st_disp);
index 28ed9924d5c00566560e58ced0dffa8639e436e4..c4a5ec6b536a682824a962d93f4e5a35d3286902 100644 (file)
@@ -29,7 +29,7 @@
 #endif
 #include "rw-update_new_common_display.h"
 
-common_disp s_disp;
+static common_disp s_disp;
 
 /*-----------------------------------------------------------------------------
   fb_open()