folly/io/Compression.cpp: avoid shadowing warnings for "rc"
authorJim Meyering <meyering@fb.com>
Tue, 4 Oct 2016 16:11:08 +0000 (09:11 -0700)
committerFacebook Github Bot <facebook-github-bot-bot@fb.com>
Tue, 4 Oct 2016 16:23:36 +0000 (09:23 -0700)
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

folly/io/Compression.cpp

index 0b7257037cf27a645b1b8489f7ed24197fabdd85..e1c65ef0ff2cd73776dd46faa3aeb61433ecf339 100644 (file)
@@ -563,7 +563,7 @@ std::unique_ptr<IOBuf> 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<IOBuf> 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))