explicit cast zlib functions
This commit is contained in:
@@ -10,14 +10,14 @@ namespace utils {
|
||||
|
||||
std::uint64_t Inflate(const std::string& source, std::string& dest) {
|
||||
std::size_t size;
|
||||
uncompress(reinterpret_cast<Bytef*>(dest.data()), &size, reinterpret_cast<const Bytef*>(source.c_str()), source.length());
|
||||
uncompress(reinterpret_cast<Bytef*>(dest.data()), reinterpret_cast<uLongf*>(&size), reinterpret_cast<const Bytef*>(source.c_str()), source.length());
|
||||
return size;
|
||||
}
|
||||
|
||||
std::uint64_t Deflate(const std::string& source, std::string& dest) {
|
||||
std::size_t size;
|
||||
dest.resize(source.size()); // Resize for the compressed data to fit into
|
||||
compress(reinterpret_cast<Bytef*>(dest.data()), &size, reinterpret_cast<const Bytef*>(source.c_str()), source.length());
|
||||
compress(reinterpret_cast<Bytef*>(dest.data()), reinterpret_cast<uLongf*>(&size), reinterpret_cast<const Bytef*>(source.c_str()), source.length());
|
||||
dest.resize(size); // Resize to cut useless data
|
||||
return size;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user