summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Sen Jiang <senj@google.com> 2018-05-11 18:58:58 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2018-05-11 18:58:58 +0000
commitb12c46f8382ca939f55abc0c20fb48fb17b2c1be (patch)
tree8c4f7ccdf29d5ad7f2064405a19c61bec4ae709f
parentbf37ad2589025e9fa122bceebea00ec7ad353803 (diff)
parentf9e11ac336888238c9573eb081324c101bf39f49 (diff)
Merge "Match LZMA SDK 18.05 API."
-rw-r--r--compiler/debug/elf_gnu_debugdata_writer.h13
1 files changed, 6 insertions, 7 deletions
diff --git a/compiler/debug/elf_gnu_debugdata_writer.h b/compiler/debug/elf_gnu_debugdata_writer.h
index a88c5cb213..fd132f4ac4 100644
--- a/compiler/debug/elf_gnu_debugdata_writer.h
+++ b/compiler/debug/elf_gnu_debugdata_writer.h
@@ -41,23 +41,23 @@ static void XzCompress(const std::vector<uint8_t>* src, std::vector<uint8_t>* ds
Lzma2EncProps_Normalize(&lzma2Props);
CXzProps props;
XzProps_Init(&props);
- props.lzma2Props = &lzma2Props;
+ props.lzma2Props = lzma2Props;
// Implement the required interface for communication (written in C so no virtual methods).
struct XzCallbacks : public ISeqInStream, public ISeqOutStream, public ICompressProgress {
- static SRes ReadImpl(void* p, void* buf, size_t* size) {
- auto* ctx = static_cast<XzCallbacks*>(reinterpret_cast<ISeqInStream*>(p));
+ static SRes ReadImpl(const ISeqInStream* p, void* buf, size_t* size) {
+ auto* ctx = static_cast<XzCallbacks*>(const_cast<ISeqInStream*>(p));
*size = std::min(*size, ctx->src_->size() - ctx->src_pos_);
memcpy(buf, ctx->src_->data() + ctx->src_pos_, *size);
ctx->src_pos_ += *size;
return SZ_OK;
}
- static size_t WriteImpl(void* p, const void* buf, size_t size) {
- auto* ctx = static_cast<XzCallbacks*>(reinterpret_cast<ISeqOutStream*>(p));
+ static size_t WriteImpl(const ISeqOutStream* p, const void* buf, size_t size) {
+ auto* ctx = static_cast<const XzCallbacks*>(p);
const uint8_t* buffer = reinterpret_cast<const uint8_t*>(buf);
ctx->dst_->insert(ctx->dst_->end(), buffer, buffer + size);
return size;
}
- static SRes ProgressImpl(void* , UInt64, UInt64) {
+ static SRes ProgressImpl(const ICompressProgress* , UInt64, UInt64) {
return SZ_OK;
}
size_t src_pos_;
@@ -113,4 +113,3 @@ static std::vector<uint8_t> MakeMiniDebugInfoInternal(
} // namespace art
#endif // ART_COMPILER_DEBUG_ELF_GNU_DEBUGDATA_WRITER_H_
-