From: dyamy-lee Date: Tue, 1 Dec 2020 05:58:31 +0000 (+0900) Subject: change global variables to static X-Git-Tag: submit/tizen/20201202.104648~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F38%2F248638%2F1;p=profile%2Fcommon%2Fapps%2Fnative%2Ffirmware-update-system-ui.git change global variables to static Change-Id: I93cbffc279e7fd7232be3b086936debf6ffe7fb1 --- diff --git a/base/base_gui_direct.c b/base/base_gui_direct.c index 2aca45b..5acee0a 100644 --- a/base/base_gui_direct.c +++ b/base/base_gui_direct.c @@ -44,20 +44,20 @@ /***************************************************************************** ** 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() diff --git a/base/base_main.c b/base/base_main.c index cb7f6dd..129d1d2 100644 --- a/base/base_main.c +++ b/base/base_main.c @@ -31,15 +31,16 @@ #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) { diff --git a/base/fota_png.c b/base/fota_png.c index 65cc5cc..18c5983 100644 --- a/base/fota_png.c +++ b/base/fota_png.c @@ -21,19 +21,19 @@ #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() diff --git a/base/gui_log.h b/base/gui_log.h index f7ee228..18cac9c 100644 --- a/base/gui_log.h +++ b/base/gui_log.h @@ -21,7 +21,7 @@ #include -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);\ } \ diff --git a/base/gui_util.c b/base/gui_util.c index f0ef7f6..9ed6c7b 100644 --- a/base/gui_util.c +++ b/base/gui_util.c @@ -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 diff --git a/base/tdm-if.h b/base/tdm-if.h index dc67910..22f91db 100644 --- a/base/tdm-if.h +++ b/base/tdm-if.h @@ -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); diff --git a/fota_gui_wearable/fota_gr_direct_ro_wearable.c b/fota_gui_wearable/fota_gr_direct_ro_wearable.c index 11fd108..eeb4d90 100644 --- a/fota_gui_wearable/fota_gr_direct_ro_wearable.c +++ b/fota_gui_wearable/fota_gr_direct_ro_wearable.c @@ -50,11 +50,11 @@ /***************************************************************************** ** 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() diff --git a/fota_gui_wearable/fota_gui_ro_wearable_main.c b/fota_gui_wearable/fota_gui_ro_wearable_main.c index e8472c4..7e8d461 100644 --- a/fota_gui_wearable/fota_gui_ro_wearable_main.c +++ b/fota_gui_wearable/fota_gui_ro_wearable_main.c @@ -34,15 +34,16 @@ //#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) { diff --git a/rw-update-ani-wearable/rw-update-ani_new.c b/rw-update-ani-wearable/rw-update-ani_new.c index 8651862..94e6e4d 100644 --- a/rw-update-ani-wearable/rw-update-ani_new.c +++ b/rw-update-ani-wearable/rw-update-ani_new.c @@ -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; diff --git a/rw-update-ani-wearable/rw-update_new_cairo_w_360_360.c b/rw-update-ani-wearable/rw-update_new_cairo_w_360_360.c index b4c93df..52c2c79 100644 --- a/rw-update-ani-wearable/rw-update_new_cairo_w_360_360.c +++ b/rw-update-ani-wearable/rw-update_new_cairo_w_360_360.c @@ -37,7 +37,7 @@ #include // 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() diff --git a/rw-update-ani-wearable/rw-update_new_common_display.h b/rw-update-ani-wearable/rw-update_new_common_display.h index 5f6c089..cdd059b 100644 --- a/rw-update-ani-wearable/rw-update_new_common_display.h +++ b/rw-update-ani-wearable/rw-update_new_common_display.h @@ -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); diff --git a/rw-update-ani-wearable/rw-update_new_fb_cairo.c b/rw-update-ani-wearable/rw-update_new_fb_cairo.c index 28ed992..c4a5ec6 100644 --- a/rw-update-ani-wearable/rw-update_new_fb_cairo.c +++ b/rw-update-ani-wearable/rw-update_new_fb_cairo.c @@ -29,7 +29,7 @@ #endif #include "rw-update_new_common_display.h" -common_disp s_disp; +static common_disp s_disp; /*----------------------------------------------------------------------------- fb_open()