diff --git a/dubu_pack/src/dubu_pack/packer/Packer.cpp b/dubu_pack/src/dubu_pack/packer/Packer.cpp index 71a16c6..69f9bc5 100644 --- a/dubu_pack/src/dubu_pack/packer/Packer.cpp +++ b/dubu_pack/src/dubu_pack/packer/Packer.cpp @@ -80,12 +80,14 @@ void Packer::Pack() { fileHeader.originalFileSize); uLongf sourceLength = bufferBound; - int result = compress((Bytef*)mCompressionBuffer.data(), - &sourceLength, - (Bytef*)sourceFile.data(), - (uLong)sourceFile.size()); - - if (result == Z_OK && sourceLength < fileHeader.originalFileSize) { + int result = compress( + reinterpret_cast(mCompressionBuffer.data()), + &sourceLength, + reinterpret_cast(sourceFile.data()), + static_cast(sourceFile.size())); + + if (result == Z_OK && + sourceLength < fileHeader.originalFileSize) { fileHeader.compressedFileSize = static_cast(sourceLength); temporaryFileBuffer.Write(mCompressionBuffer.data(), diff --git a/dubu_pack/src/dubu_pack/packer/Unpacker.cpp b/dubu_pack/src/dubu_pack/packer/Unpacker.cpp index 6e5f563..d9fe763 100644 --- a/dubu_pack/src/dubu_pack/packer/Unpacker.cpp +++ b/dubu_pack/src/dubu_pack/packer/Unpacker.cpp @@ -46,10 +46,11 @@ std::optional Unpacker::ReadFile(std::filesystem::path filePath) { } mFileBuffer.Read(&mCompressionBuffer[0], it->second.compressedFileSize); - int result = uncompress((Bytef*)&data[0], - &destinationLength, - (Bytef*)mCompressionBuffer.data(), - sourceLength); + int result = + uncompress(reinterpret_cast(&data[0]), + &destinationLength, + reinterpret_cast(mCompressionBuffer.data()), + sourceLength); if (result != Z_OK) { return std::nullopt;