aboutsummaryrefslogtreecommitdiff
path: root/src/liblzma/common/stream_encoder_multi.c
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2008-01-22 00:15:11 +0200
committerLasse Collin <lasse.collin@tukaani.org>2008-01-22 00:15:11 +0200
commit0ed6f1adcea540fb9593ca115d36de537f7f0dc6 (patch)
treee6accc3efc9437823e77569145c537ab50159058 /src/liblzma/common/stream_encoder_multi.c
parentUpdated debug/sync_flush.c. (diff)
downloadxz-0ed6f1adcea540fb9593ca115d36de537f7f0dc6.tar.xz
Made lzma_extra pointers const in lzma_options_stream.
Diffstat (limited to 'src/liblzma/common/stream_encoder_multi.c')
-rw-r--r--src/liblzma/common/stream_encoder_multi.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/liblzma/common/stream_encoder_multi.c b/src/liblzma/common/stream_encoder_multi.c
index 16c98423..5a517ff4 100644
--- a/src/liblzma/common/stream_encoder_multi.c
+++ b/src/liblzma/common/stream_encoder_multi.c
@@ -220,7 +220,11 @@ stream_encode(lzma_coder *coder, lzma_allocator *allocator,
.uncompressed_size = coder->stream_options
->uncompressed_size,
.index = NULL,
- .extra = coder->stream_options->header,
+ // Metadata encoder doesn't modify this, but since
+ // the lzma_extra structure is used also when decoding
+ // Metadata, the pointer is not const, and we need
+ // to cast the constness away in the encoder.
+ .extra = (lzma_extra *)(coder->stream_options->header),
};
return_if_error(metadata_encoder_init(coder, allocator,
@@ -238,7 +242,7 @@ stream_encode(lzma_coder *coder, lzma_allocator *allocator,
.total_size = LZMA_VLI_VALUE_UNKNOWN,
.uncompressed_size = LZMA_VLI_VALUE_UNKNOWN,
.index = lzma_info_index_get(coder->info, false),
- .extra = coder->stream_options->footer,
+ .extra = (lzma_extra *)(coder->stream_options->footer),
};
return_if_error(metadata_encoder_init(coder, allocator,