diff options
author | 2023-05-04 02:41:16 +1000 | |
---|---|---|
committer | 2023-05-04 02:41:16 +1000 | |
commit | a504bde3a7462b54fafd5cfc2f52e58d0f3218e1 (patch) | |
tree | 8b3108d572b1a0873a6cdbb4e8af1f17179545c3 /src/lib/util/chdcodec.cpp | |
parent | befb9bf4a8cfdb2b693a32e32535b5eac522c5d8 (diff) |
3rdparty/lzma: Updated to LZMA SDK version 22.01
Diffstat (limited to 'src/lib/util/chdcodec.cpp')
-rw-r--r-- | src/lib/util/chdcodec.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/lib/util/chdcodec.cpp b/src/lib/util/chdcodec.cpp index 7d3f3185212..be48cd55ec9 100644 --- a/src/lib/util/chdcodec.cpp +++ b/src/lib/util/chdcodec.cpp @@ -114,11 +114,11 @@ public: private: // internal helpers - static void *fast_alloc(void *p, size_t size); - static void fast_free(void *p, void *address); + static void *fast_alloc(ISzAllocPtr p, size_t size); + static void fast_free(ISzAllocPtr p, void *address); static constexpr int MAX_LZMA_ALLOCS = 64; - uint32_t * m_allocptr[MAX_LZMA_ALLOCS]; + uint32_t *m_allocptr[MAX_LZMA_ALLOCS]; }; @@ -1020,9 +1020,9 @@ chd_lzma_allocator::~chd_lzma_allocator() // allocates and frees memory frequently //------------------------------------------------- -void *chd_lzma_allocator::fast_alloc(void *p, size_t size) +void *chd_lzma_allocator::fast_alloc(ISzAllocPtr p, size_t size) { - auto *codec = reinterpret_cast<chd_lzma_allocator *>(p); + auto *const codec = static_cast<chd_lzma_allocator *>(const_cast<ISzAlloc *>(p)); // compute the size, rounding to the nearest 1k size = (size + 0x3ff) & ~0x3ff; @@ -1059,12 +1059,12 @@ void *chd_lzma_allocator::fast_alloc(void *p, size_t size) // allocates and frees memory frequently //------------------------------------------------- -void chd_lzma_allocator::fast_free(void *p, void *address) +void chd_lzma_allocator::fast_free(ISzAllocPtr p, void *address) { if (address == nullptr) return; - auto *codec = reinterpret_cast<chd_lzma_allocator *>(p); + auto *const codec = static_cast<chd_lzma_allocator *>(const_cast<ISzAlloc *>(p)); // find the hunk uint32_t *ptr = reinterpret_cast<uint32_t *>(address) - 1; @@ -1149,7 +1149,7 @@ uint32_t chd_lzma_compressor::compress(const uint8_t *src, uint32_t srclen, uint void chd_lzma_compressor::configure_properties(CLzmaEncProps &props, uint32_t hunkbytes) { LzmaEncProps_Init(&props); - props.level = 9; + props.level = 8; props.reduceSize = hunkbytes; LzmaEncProps_Normalize(&props); } |