diff options
author | atdt <atdt@google.com> | 2021-04-19 00:59:10 +0000 |
---|---|---|
committer | Victor Costan <costan@google.com> | 2021-04-22 04:27:48 +0000 |
commit | 9c1be17938429574cdec8fbf820f2d9d5ea66c5c (patch) | |
tree | e9da9efbf85f24302baa26fda76f01f2790349ad | |
parent | 78650d126afc55f834d15d018b430985f0c8c87c (diff) | |
download | snappy-git-9c1be17938429574cdec8fbf820f2d9d5ea66c5c.tar.gz |
'size' remains unused if none of ZLIB, LZO and LZ4 are available.
While we're here, take care of a couple of lint warnings by converting CHECK(a != b) to CHECK_NE(a, b).
PiperOrigin-RevId: 369132446
-rw-r--r-- | snappy_test_tool.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/snappy_test_tool.cc b/snappy_test_tool.cc index c6ca5fa..24ac1ee 100644 --- a/snappy_test_tool.cc +++ b/snappy_test_tool.cc @@ -204,7 +204,7 @@ bool Compress(const char* input, size_t input_size, CompressorType comp, int destlen = compressed->size(); destlen = LZ4_compress_default(input, string_as_array(compressed), input_size, destlen); - CHECK(destlen != 0); + CHECK_NE(destlen, 0); if (!compressed_is_preallocated) { compressed->resize(destlen); } @@ -233,6 +233,8 @@ bool Compress(const char* input, size_t input_size, CompressorType comp, bool Uncompress(const std::string& compressed, CompressorType comp, int size, std::string* output) { + // TODO: Switch to [[maybe_unused]] when we can assume C++17. + (void)size; switch (comp) { #ifdef ZLIB_VERSION case ZLIB: { @@ -272,7 +274,7 @@ bool Uncompress(const std::string& compressed, CompressorType comp, int size, int destlen = output->size(); destlen = LZ4_decompress_safe(compressed.data(), string_as_array(output), compressed.size(), destlen); - CHECK(destlen != 0); + CHECK_NE(destlen, 0); CHECK_EQ(size, destlen); break; } |