diff options
author | Michihiro NAKAJIMA <ggcueroad@gmail.com> | 2012-11-07 15:25:47 +0900 |
---|---|---|
committer | Michihiro NAKAJIMA <ggcueroad@gmail.com> | 2012-11-07 15:25:47 +0900 |
commit | 4f54591d05a9b4d593cda12a48cf13cab43bb5db (patch) | |
tree | 71bf381322d7f506a4fa3bf9944fdf471d72a142 /libarchive/archive_read_support_format_lha.c | |
parent | 6f00b2a18cddba6030583ea1338465f31f83f746 (diff) | |
download | libarchive-4f54591d05a9b4d593cda12a48cf13cab43bb5db.tar.gz |
Fix build failure on Win64.
Diffstat (limited to 'libarchive/archive_read_support_format_lha.c')
-rw-r--r-- | libarchive/archive_read_support_format_lha.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/libarchive/archive_read_support_format_lha.c b/libarchive/archive_read_support_format_lha.c index a7c071e1..f702949f 100644 --- a/libarchive/archive_read_support_format_lha.c +++ b/libarchive/archive_read_support_format_lha.c @@ -272,7 +272,7 @@ static int lha_skip_sfx(struct archive_read *); static time_t lha_dos_time(const unsigned char *); static time_t lha_win_time(uint64_t, long *); static unsigned char lha_calcsum(unsigned char, const void *, - int, int); + int, size_t); static int lha_parse_linkname(struct archive_string *, struct archive_string *); static int lha_read_data_none(struct archive_read *, const void **, @@ -1635,7 +1635,7 @@ lha_parse_linkname(struct archive_string *linkname, struct archive_string *pathname) { char * linkptr; - int symlen; + size_t symlen; linkptr = strchr(pathname->s, '|'); if (linkptr != NULL) { @@ -1690,12 +1690,12 @@ lha_win_time(uint64_t wintime, long *ns) } static unsigned char -lha_calcsum(unsigned char sum, const void *pp, int offset, int size) +lha_calcsum(unsigned char sum, const void *pp, int offset, size_t size) { unsigned char const *p = (unsigned char const *)pp; p += offset; - while (--size >= 0) + for (;size > 0; --size) sum += *p++; return (sum); } @@ -2020,7 +2020,7 @@ lzh_copy_from_window(struct lzh_stream *strm, struct lzh_dec *ds) copy_bytes = (size_t)strm->avail_out; memcpy(strm->next_out, ds->w_buff + ds->copy_pos, copy_bytes); - ds->copy_pos += copy_bytes; + ds->copy_pos += (int)copy_bytes; } else { if (ds->w_remaining <= strm->avail_out) copy_bytes = ds->w_remaining; @@ -2028,7 +2028,7 @@ lzh_copy_from_window(struct lzh_stream *strm, struct lzh_dec *ds) copy_bytes = (size_t)strm->avail_out; memcpy(strm->next_out, ds->w_buff + ds->w_size - ds->w_remaining, copy_bytes); - ds->w_remaining -= copy_bytes; + ds->w_remaining -= (int)copy_bytes; } strm->next_out += copy_bytes; strm->avail_out -= copy_bytes; @@ -2482,7 +2482,7 @@ lzh_huffman_init(struct huffman *hf, size_t len_size, int tbl_bits) bits = tbl_bits; else bits = HTBL_BITS; - hf->tbl = malloc((1 << bits) * sizeof(hf->tbl[0])); + hf->tbl = malloc(((size_t)1 << bits) * sizeof(hf->tbl[0])); if (hf->tbl == NULL) return (ARCHIVE_FATAL); } @@ -2492,7 +2492,7 @@ lzh_huffman_init(struct huffman *hf, size_t len_size, int tbl_bits) if (hf->tree == NULL) return (ARCHIVE_FATAL); } - hf->len_size = len_size; + hf->len_size = (int)len_size; hf->tbl_bits = tbl_bits; return (ARCHIVE_OK); } |