From 6996495c1b0b6b362d4dbca8436a1d641fa36a1f Mon Sep 17 00:00:00 2001 From: Jay Zhuang Date: Wed, 16 Mar 2022 21:16:12 -0700 Subject: [PATCH] Minor fix for Windows build with zlib (#9699) Summary: ``` conversion from 'size_t' to 'uLong', possible loss of data ``` Fix https://github.com/facebook/rocksdb/issues/9688 Pull Request resolved: https://github.com/facebook/rocksdb/pull/9699 Reviewed By: riversand963 Differential Revision: D34901116 Pulled By: jay-zhuang fbshipit-source-id: 969148a7a8c023449bd85055a1f0eec71d0a9b3f --- util/compression.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/util/compression.h b/util/compression.h index 1effb8605..fbe9edbb9 100644 --- a/util/compression.h +++ b/util/compression.h @@ -778,7 +778,8 @@ inline bool Zlib_Compress(const CompressionInfo& info, } // Get an upper bound on the compressed size. - size_t upper_bound = deflateBound(&_stream, length); + size_t upper_bound = + deflateBound(&_stream, static_cast(length)); output->resize(output_header_len + upper_bound); // Compress the input, and put compressed data in output.