diff options
author | kientzle <kientzle@FreeBSD.org> | 2007-04-02 00:41:37 +0000 |
---|---|---|
committer | kientzle <kientzle@FreeBSD.org> | 2007-04-02 00:41:37 +0000 |
commit | 65a30c481ba0f8b44f073c893e9d5dbc5747a5d1 (patch) | |
tree | 2e53fb72851f8d5e7549fb268e4e38904afc5a76 | |
parent | 014a4b1cfe1e47eb7196ba04ae3f7987e39dde2c (diff) | |
download | FreeBSD-src-65a30c481ba0f8b44f073c893e9d5dbc5747a5d1.zip FreeBSD-src-65a30c481ba0f8b44f073c893e9d5dbc5747a5d1.tar.gz |
Fix type-punned pointer, minor style fixes.
Thanks to: Joerg Sonnenberger
-rw-r--r-- | lib/libarchive/archive_read.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/libarchive/archive_read.c b/lib/libarchive/archive_read.c index 06a4e8c..19d72e4 100644 --- a/lib/libarchive/archive_read.c +++ b/lib/libarchive/archive_read.c @@ -182,12 +182,12 @@ archive_read_open2(struct archive *_a, void *client_data, a->client_data = client_data; /* Select a decompression routine. */ - high_bidder = choose_decompressor(a, buffer, bytes_read); + high_bidder = choose_decompressor(a, buffer, (size_t)bytes_read); if (high_bidder < 0) return (ARCHIVE_FATAL); /* Initialize decompression routine with the first block of data. */ - e = (a->decompressors[high_bidder].init)(a, buffer, bytes_read); + e = (a->decompressors[high_bidder].init)(a, buffer, (size_t)bytes_read); if (e == ARCHIVE_OK) a->archive.state = ARCHIVE_STATE_HEADER; @@ -439,6 +439,7 @@ archive_read_data(struct archive *_a, void *buff, size_t s) { struct archive_read *a = (struct archive_read *)_a; char *dest; + const void *read_buf; size_t bytes_read; size_t len; int r; @@ -448,10 +449,10 @@ archive_read_data(struct archive *_a, void *buff, size_t s) while (s > 0) { if (a->read_data_remaining <= 0) { - r = archive_read_data_block(&a->archive, - (const void **)&a->read_data_block, - &a->read_data_remaining, - &a->read_data_offset); + read_buf = a->read_data_block; + r = archive_read_data_block(&a->archive, &read_buf, + &a->read_data_remaining, &a->read_data_offset); + a->read_data_block = read_buf; if (r == ARCHIVE_EOF) return (bytes_read); /* |