From: Jim Meyering Date: Tue, 4 Oct 2016 16:11:08 +0000 (-0700) Subject: folly/io/Compression.cpp: avoid shadowing warnings for "rc" X-Git-Tag: v2016.10.10.00~20 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=e7256a8a282c258dee2e62055ac227761df5e22d;p=folly.git folly/io/Compression.cpp: avoid shadowing warnings for "rc" Summary: gcc's -Wshadow (and the under-review -Wshadow-local) would evoke this: ``` folly/io/Compression.cpp:650:9: error: declaration of 'rc' shadows a previous local [-Werror=shadow-compatible-local] folly/io/Compression.cpp:637:7: error: shadowed declaration is here [-Werror=shadow-compatible-local] folly/io/Compression.cpp:566:9: error: declaration of 'rc' shadows a previous local [-Werror=shadow-compatible-local] folly/io/Compression.cpp:548:7: error: shadowed declaration is here [-Werror=shadow-compatible-local] ``` In each case, I removed the "int" from the latter declaration. Reviewed By: philippv Differential Revision: D3966308 fbshipit-source-id: 584cb9ffe8ba0e56914223c440efabe9e0de6b17 --- diff --git a/folly/io/Compression.cpp b/folly/io/Compression.cpp index 0b725703..e1c65ef0 100644 --- a/folly/io/Compression.cpp +++ b/folly/io/Compression.cpp @@ -563,7 +563,7 @@ std::unique_ptr ZlibCodec::doCompress(const IOBuf* data) { bool success = false; SCOPE_EXIT { - int rc = deflateEnd(&stream); + rc = deflateEnd(&stream); // If we're here because of an exception, it's okay if some data // got dropped. CHECK(rc == Z_OK || (!success && rc == Z_DATA_ERROR)) @@ -647,7 +647,7 @@ std::unique_ptr ZlibCodec::doUncompress(const IOBuf* data, bool success = false; SCOPE_EXIT { - int rc = inflateEnd(&stream); + rc = inflateEnd(&stream); // If we're here because of an exception, it's okay if some data // got dropped. CHECK(rc == Z_OK || (!success && rc == Z_DATA_ERROR))