Fix build warnings 05/149205/4
authorSunmin Lee <sunm.lee@samsung.com>
Tue, 12 Sep 2017 01:48:26 +0000 (10:48 +0900)
committerSunmin Lee <sunm.lee@samsung.com>
Wed, 13 Sep 2017 01:20:55 +0000 (10:20 +0900)
Change-Id: I6d8c2fe644ac565a75d34d86f8808058c7f31c81
Signed-off-by: Sunmin Lee <sunm.lee@samsung.com>
fota_gui/fota_gr_direct_wc1.c
fota_gui/tdm-if.c
packaging/tota-ua.spec
src/tw1/ua.c

index 10b0e21815162fa3211525fdec773cf38e8ec3c6..011e3e2bb036d5eb25f9db4120b6d936380fa408 100755 (executable)
@@ -155,7 +155,7 @@ static void _gr_direct_draw_text(FbInfo *fbi, int percent)
        }
 
        if (percent == 100) {
-               sprintf(img_name, "%s%s%d.png", IMG_BASE, PROGRESS_NUM_PREFIX, 1);
+               snprintf(img_name, MAX_PATH, "%s%s%d.png", IMG_BASE, PROGRESS_NUM_PREFIX, 1);
                if (read_png_file(img_name) < 0) {
                        return;
                }
@@ -170,7 +170,7 @@ static void _gr_direct_draw_text(FbInfo *fbi, int percent)
                if (num == 10)
                        num = 0;
 
-               sprintf(img_name, "%s%s%d.png", IMG_BASE, PROGRESS_NUM_PREFIX, num);
+               snprintf(img_name, MAX_PATH, "%s%s%d.png", IMG_BASE, PROGRESS_NUM_PREFIX, num);
                if (read_png_file(img_name) < 0) {
                        return;
                }
@@ -182,7 +182,7 @@ static void _gr_direct_draw_text(FbInfo *fbi, int percent)
        img_x += 18;
        num = percent % 10;
 
-       sprintf(img_name, "%s%s%d.png", IMG_BASE, PROGRESS_NUM_PREFIX, num);
+       snprintf(img_name, MAX_PATH, "%s%s%d.png", IMG_BASE, PROGRESS_NUM_PREFIX, num);
        if (read_png_file(img_name) < 0) {
                return;
        }
@@ -192,7 +192,7 @@ static void _gr_direct_draw_text(FbInfo *fbi, int percent)
 
        img_x += 17;
 
-       sprintf(img_name, "%s%s", IMG_BASE, PERCENT_IMG_NAME);
+       snprintf(img_name, MAX_PATH, "%s%s", IMG_BASE, PERCENT_IMG_NAME);
        if (read_png_file(img_name) < 0) {
                return;
        }
@@ -254,6 +254,7 @@ static void _gr_direct_draw_main_img(FbInfo *fbi)
 
 }
 
+/*
 static void _gr_direct_draw_text_img(FbInfo *fbi)
 {
        int img_x = 0;
@@ -270,6 +271,7 @@ static void _gr_direct_draw_text_img(FbInfo *fbi)
        release_png_res();
 
 }
+*/
 
 static void _gr_direct_draw_last_buffer_text_img(FbInfo *fbi)
 {
@@ -326,7 +328,7 @@ static void _gr_direct_final_circle_progress_bar(FbInfo *fbi, int progress)
        char img_name[MAX_PATH];
 
        // draw current progress image
-       sprintf(img_name, "%s%sfinal.png", IMG_BASE, PROGRESS_BAR_IMG_PREFIX);
+       snprintf(img_name, MAX_PATH, "%s%sfinal.png", IMG_BASE, PROGRESS_BAR_IMG_PREFIX);
        if (read_png_file(img_name) < 0) {
                LOG("ERROR \n");
                return;
@@ -344,7 +346,7 @@ static void _gr_direct_circular_progress(FbInfo *fbi)
 
        // delete previous progress image
        if (prev_prog_cnt >= 0) {
-               sprintf(img_name, "%s%s%02d.png", IMG_BASE, PROGRESS_IMG_PREFIX, prev_prog_cnt+1);
+               snprintf(img_name, MAX_PATH, "%s%s%02d.png", IMG_BASE, PROGRESS_IMG_PREFIX, prev_prog_cnt+1);
                if (read_png_file(img_name) < 0) {
                        return;
                }
@@ -354,7 +356,7 @@ static void _gr_direct_circular_progress(FbInfo *fbi)
        }
 
        // draw current progress image
-       sprintf(img_name, "%s%s%02d.png", IMG_BASE, PROGRESS_IMG_PREFIX, prog_cnt+1);
+       snprintf(img_name, MAX_PATH, "%s%s%02d.png", IMG_BASE, PROGRESS_IMG_PREFIX, prog_cnt+1);
        if (read_png_file(img_name) < 0) {
                return;
        }
@@ -398,7 +400,7 @@ static void _gr_direct_circle_progress_bar(FbInfo *fbi, int progress)
                LOG("prog_pre/prog_cnt : %d, %d \n", prog_pre , prog_cnt);
 
                // draw current progress image
-               sprintf(img_name, "%s%s%03d.png", IMG_BASE, PROGRESS_BAR_IMG_PREFIX, prog_pre);
+               snprintf(img_name, MAX_PATH, "%s%s%03d.png", IMG_BASE, PROGRESS_BAR_IMG_PREFIX, prog_pre);
                if (read_png_file(img_name) < 0) {
                        LOG("ERROR \n");
                        return;
index 6aa03ce75c974994e77a9aea38f54b49ab22742e..fde07013e0631bfd49eca684ac9203c2ac06e004 100755 (executable)
@@ -292,7 +292,8 @@ void tdm_if_display_update(void)
        tdm_if_disp *st_disp = &s_st_disp;
 
        buf_cnt = st_disp->current_buf_id;
-       st_disp->current_buf_id = (++st_disp->current_buf_id)%MAX_BUF;
+       ++st_disp->current_buf_id;
+       st_disp->current_buf_id %= MAX_BUF;
 
        tdm_layer_set_buffer(st_disp->layer, st_disp->surf[buf_cnt]);
 
index 8a96107811e1317515ae182a71b08ed77f9268c7..1b0d6738038ec70d60d9d5ad07fec2bb38e5e80c 100755 (executable)
@@ -1,8 +1,8 @@
 Name:          tota-ua
 Summary:       fota update agent
 ExclusiveArch:         %{arm}
-Version:       0.1.5
-Release:       6
+Version:       0.1.6
+Release:       7
 Group:         System
 License:       Apache-2.0
 Source0:       %{name}-%{version}.tar.gz
index 8ae71ceed23cb1d89b3e094d560034329740b111..2f70d1b783bd968c7c23ca87c1040a23618c0d13 100755 (executable)
@@ -36,6 +36,7 @@
 #include "fota_cfg.h"
 #include "fota_tar.h"
 #include "fota_util.h"
+#include "SS_UPI.h"
 
 #define MAX_CFG_LEN    4096
 
@@ -220,7 +221,7 @@ static int write_data_to_blkdev(char* dev_name, int blk_start, int blk_cnt, char
 /*-----------------------------------------------------------------------------
   write_full_image
  ----------------------------------------------------------------------------*/
-static int write_full_image(ua_data_t* ua_data, int part_idx)
+static int write_full_image(ua_dataSS_t* ua_data, int part_idx)
 {
        int ret = SUCCESS;
        int blk_start = 0;
@@ -304,9 +305,9 @@ static int write_full_image(ua_data_t* ua_data, int part_idx)
  ----------------------------------------------------------------------------*/
 int verify_Full_Image(int part_idx)
 {
-int ret = SUCCESS;
-ua_dataSS_t ua_dataSS;
-int last_update_status = UP_START_NONE;
+       int ret = SUCCESS;
+       ua_dataSS_t ua_dataSS;
+       //int last_update_status = UP_START_NONE;
        ua_part_info_t *ua_part_info = &s_part_info[part_idx];
        ua_update_cfg_t *ua_update_cfg = &s_update_cfg[part_idx];
        ua_update_data_t *ua_update_data = &s_update_data[part_idx];
@@ -317,13 +318,13 @@ int last_update_status = UP_START_NONE;
        ua_dataSS.update_delta=ua_delta_info;
        ua_dataSS.ua_operation = UI_OP_SCOUT;
        ua_dataSS.ui_progress = fota_gui_progress;
-       last_update_status = get_last_update_status();
+       //last_update_status = get_last_update_status();
 
-                       if (ua_update_data->ua_delta_path != NULL){
-                               ret = SUCCESS;//SS_IMGVerfiyPartition(&ua_dataSS);
-                               fota_gui_progress(&ua_dataSS, 100);
-               }
-return ret;
+       if (ua_update_data->ua_delta_path != NULL){
+               ret = SUCCESS;//SS_IMGVerfiyPartition(&ua_dataSS);
+               fota_gui_progress(&ua_dataSS, 100);
+       }
+       return ret;
 }
 
 /*-----------------------------------------------------------------------------
@@ -366,7 +367,7 @@ int update_Full_Image(int part_idx)
 int verify_Delta_FS(int part_idx)
 {
        int ret = SUCCESS;
-       int last_update_status = UP_START_NONE;
+       //int last_update_status = UP_START_NONE;
        ua_dataSS_t ua_dataSS;
        ua_part_info_t *ua_part_info = &s_part_info[part_idx];
        ua_update_cfg_t *ua_update_cfg = &s_update_cfg[part_idx];
@@ -378,13 +379,13 @@ int verify_Delta_FS(int part_idx)
        ua_dataSS.update_delta=ua_delta_info;
        ua_dataSS.ua_operation = UI_OP_SCOUT;
        ua_dataSS.ui_progress = fota_gui_progress;
-       last_update_status = get_last_update_status();
+       //last_update_status = get_last_update_status();
        //if(last_update_status <= part_idx) // Should build nodes again, unless this partition already updated.
 
-               if (ua_update_data->ua_delta_path != NULL) {
+       if (ua_update_data->ua_delta_path != NULL) {
                LOG("Verifying %s \n", ua_dataSS.parti_info->ua_parti_name);
                ret = SS_FSVerifyPartition(&ua_dataSS, part_idx);
-               }
+       }
 
        return ret;
 }
@@ -421,7 +422,7 @@ int verify_Delta_IMG(int part_idx)
 {
        int ret = SUCCESS;
        ua_dataSS_t ua_dataSS;
-       int last_update_status = UP_START_NONE;
+       //int last_update_status = UP_START_NONE;
        ua_part_info_t *ua_part_info = &s_part_info[part_idx];
        ua_update_cfg_t *ua_update_cfg = &s_update_cfg[part_idx];
        ua_update_data_t *ua_update_data = &s_update_data[part_idx];
@@ -438,14 +439,14 @@ int verify_Delta_IMG(int part_idx)
        ua_dataSS.update_delta=ua_delta_info;
        ua_dataSS.ua_operation = UI_OP_SCOUT;
        ua_dataSS.ui_progress = fota_gui_progress;
-       last_update_status = get_last_update_status();
+       //last_update_status = get_last_update_status();
 
-                       if (ua_update_data->ua_delta_path != NULL){
-                       ret = SS_IMGVerfiyPartition(&ua_dataSS);
-                       }
+       if (ua_update_data->ua_delta_path != NULL) {
+               ret = SS_IMGVerfiyPartition(&ua_dataSS);
+       }
 
        return ret;
-       }
+}
 
 /*-----------------------------------------------------------------------------
   update_Delta_IMG
@@ -1368,7 +1369,7 @@ if(!part_name)
  ----------------------------------------------------------------------------*/
 int main(int argc, char **argv)
 {
-       char ver_str[MAX_PATH];
+       //char ver_str[MAX_PATH];
        int ret = FAIL;
 
        _init_stdio();