From f9e11ac336888238c9573eb081324c101bf39f49 Mon Sep 17 00:00:00 2001 From: Sen Jiang Date: Fri, 4 May 2018 13:08:48 -0700 Subject: Match LZMA SDK 18.05 API. The signature of ISeqInStream::Read and ISeqOutStream::Write changed. CXzProps::lzma2Props is not a pointer now. Test: mma Change-Id: Ia6936bd2ff1ea9a09e2d81496867078bf9116d6a --- compiler/debug/elf_gnu_debugdata_writer.h | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'compiler') 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* src, std::vector* 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(reinterpret_cast(p)); + static SRes ReadImpl(const ISeqInStream* p, void* buf, size_t* size) { + auto* ctx = static_cast(const_cast(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(reinterpret_cast(p)); + static size_t WriteImpl(const ISeqOutStream* p, const void* buf, size_t size) { + auto* ctx = static_cast(p); const uint8_t* buffer = reinterpret_cast(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 MakeMiniDebugInfoInternal( } // namespace art #endif // ART_COMPILER_DEBUG_ELF_GNU_DEBUGDATA_WRITER_H_ - -- cgit v1.2.3-59-g8ed1b