There are some warning message.
To clean codes, fix the build warning.
Change-Id: I0c7f79e12636dd4d8724ac169248448e0ff99cd0
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
#include "fota_common.h"
#include "sha1.h"
-void hex_digest(char * sha1, char *buffer, int size)
+void hex_digest(unsigned char *sha1, unsigned char *buffer, int size)
{
for (int i = 0; i < size; i++) {
- snprintf(&buffer[i * 2], (size * 2) - (i * 2) + 1, "%02x", sha1[i]);
+ snprintf((char *)&buffer[i * 2], (size * 2) - (i * 2) + 1, "%02x", sha1[i]);
}
}
void SS_unicode_to_char(const char *src, char *dest, int size);
-void hex_digest(char * sha1, char *buffer, int size);
+void hex_digest(unsigned char *sha1, unsigned char *buffer, int size);
// source_filename, (long)patch_data_size, (long)free_space, enough_space);
//LOGL(LOG_SSENGINE,"Generate Target Space availabitiy [%d]\n", enough_space);
- SinkFn sink = NULL;
- void *token = NULL;
output = -1;
outname = NULL;
}
}
}
- sink = ss_fileSink;
- token = &output;
}
result = apply_patch_brotli((char *)source_filename, outname, tar_file, -1);
if (output >= 0) {
LOGE("cannot open %s to verify SHA1\n", outname);
return E_SS_FAILURE;
}
- char buff[4096];
+ unsigned char buff[4096];
for (;;) {
int res = read(fd, buff, 4096);
if (res == -1) {
free(brotli_file);
brotli_file = NULL;
}
+
+ return 0;
}
ssize_t brotli_write(__attribute__((unused)) int fd,
static char delta_folder[MAX_FOLDER_PATH];
static char delta_path[MAX_FILE_PATH];
static char result_folder[MAX_FOLDER_PATH];
+#ifndef DEBUG_STDOUT
static char log_path[MAX_FILE_PATH];
+#endif
static char mnt_point[MAX_FILE_PATH];
static ua_part_info_t s_part_info;
enum archive_kind {
KIND_RAW,
KIND_BROTLI_PATCH,
- KIND_LZMA_PATCH
};
struct parse_result {
if (kind == -1)
return (struct parse_result) { .result = PARSE_MISSING_ARGUMENT };
- if (patch_orig == NULL && (kind == KIND_BROTLI_PATCH || kind == KIND_LZMA_PATCH))
+ if (patch_orig == NULL && kind == KIND_BROTLI_PATCH)
return (struct parse_result) { .result = PARSE_PATCH_MISTAKE };
if (patch_orig != NULL && kind == KIND_RAW)
return (struct parse_result) { .result = PARSE_PATCH_MISTAKE };
return PF_ERROR_OPEN_FILE;
}
} else if (target_size != data->dest.len) {
- fprintf(stderr, "Declared target size differs from that read from the patch (%ld [patch] != %ld [declared])\n", target_size, data->dest.len);
+ fprintf(stderr, "Declared target size differs from that read from the patch (%zu [patch] != %zu [declared])\n", target_size, data->dest.len);
return PF_ERROR_INVALID_PATCH_FILE;
}
}
void SHA1(
- char *hash_out,
- const char *str,
+ unsigned char *hash_out,
+ const unsigned char *str,
int len)
{
SHA1_CTX ctx;
);
void SHA1(
- char *hash_out,
- const char *str,
+ unsigned char *hash_out,
+ const unsigned char *str,
int len);
#endif /* SHA1_H */