diff options
author | Lasse Collin <lasse.collin@tukaani.org> | 2019-06-24 00:40:45 +0300 |
---|---|---|
committer | Lasse Collin <lasse.collin@tukaani.org> | 2019-06-24 00:40:45 +0300 |
commit | 1d4a904d8fb634bd5a04f7fbdd17d3739f3d8866 (patch) | |
tree | 31c82e33184d7bf0e4febf2f191abac8460d6797 /src/xz/list.c | |
parent | xz: list.c: Fix some warnings from -Wsign-conversion. (diff) | |
download | xz-1d4a904d8fb634bd5a04f7fbdd17d3739f3d8866.tar.xz |
xz: Change io_seek_src and io_pread arguments from off_t to uint64_t.
This helps fixing warnings from -Wsign-conversion and makes the
code look better too.
Diffstat (limited to 'src/xz/list.c')
-rw-r--r-- | src/xz/list.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/xz/list.c b/src/xz/list.c index 364e2c14..70b4a9bb 100644 --- a/src/xz/list.c +++ b/src/xz/list.c @@ -382,12 +382,11 @@ parse_indexes(xz_file_info *xfi, file_pair *pair) break; case LZMA_SEEK_NEEDED: - // The cast is safe because liblzma won't ask us to - // seek past the known size of the input file which - // did fit into off_t. + // liblzma won't ask us to seek past the known size + // of the input file. assert(strm.seek_pos <= (uint64_t)(pair->src_st.st_size)); - if (io_seek_src(pair, (off_t)(strm.seek_pos))) + if (io_seek_src(pair, strm.seek_pos)) goto error; // avail_in must be zero so that we will read new @@ -589,7 +588,7 @@ parse_check_value(file_pair *pair, const lzma_index_iter *iter) // Locate and read the Check field. const uint32_t size = lzma_check_size(iter->stream.flags->check); - const off_t offset = iter->block.compressed_file_offset + const uint64_t offset = iter->block.compressed_file_offset + iter->block.total_size - size; io_buf buf; if (io_pread(pair, &buf, size, offset)) |