From 39410bcb3d138e6aabe285291090cdbccc0afbf0 Mon Sep 17 00:00:00 2001 From: sdong Date: Wed, 8 Jan 2020 18:18:42 -0800 Subject: [PATCH] Fix some shadow warning (#6242) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: Some shadow warning shows up when using gcc 4.8. An example: ./utilities/blob_db/blob_compaction_filter.h: In constructor ‘rocksdb::blob_db::BlobIndexCompactionFilterFactoryBase::BlobIndexCompactionFilterFactoryBase(rocksdb::blob_db::lobDBImpl*, rocksdb::Env*, rocksdb::Statistics*)’: ./utilities/blob_db/blob_compaction_filter.h:121:7: error: declaration of ‘blob_db_impl’ shadows a member of 'this' [-Werror=shadow] : blob_db_impl_(blob_db_impl), env_(_env), statistics_(_statistics) {} ^ Fix them. Pull Request resolved: https://github.com/facebook/rocksdb/pull/6242 Test Plan: Build and see the warnings go away. Differential Revision: D19217789 fbshipit-source-id: 8ef631941f23dab47a388e060adec24b72efd65e --- env/composite_env_wrapper.h | 9 +++++---- utilities/blob_db/blob_compaction_filter.h | 20 +++++++++++--------- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/env/composite_env_wrapper.h b/env/composite_env_wrapper.h index 51f892f348..bbe58a4882 100644 --- a/env/composite_env_wrapper.h +++ b/env/composite_env_wrapper.h @@ -627,8 +627,9 @@ class CompositeEnvWrapper : public Env { class LegacySequentialFileWrapper : public FSSequentialFile { public: - explicit LegacySequentialFileWrapper(std::unique_ptr&& target) - : target_(std::move(target)) {} + explicit LegacySequentialFileWrapper( + std::unique_ptr&& _target) + : target_(std::move(_target)) {} IOStatus Read(size_t n, const IOOptions& /*options*/, Slice* result, char* scratch, IODebugContext* /*dbg*/) override { @@ -716,8 +717,8 @@ class LegacyRandomAccessFileWrapper : public FSRandomAccessFile { class LegacyWritableFileWrapper : public FSWritableFile { public: - explicit LegacyWritableFileWrapper(std::unique_ptr&& target) - : target_(std::move(target)) {} + explicit LegacyWritableFileWrapper(std::unique_ptr&& _target) + : target_(std::move(_target)) {} IOStatus Append(const Slice& data, const IOOptions& /*options*/, IODebugContext* /*dbg*/) override { diff --git a/utilities/blob_db/blob_compaction_filter.h b/utilities/blob_db/blob_compaction_filter.h index 32f44e5169..5bfcccf198 100644 --- a/utilities/blob_db/blob_compaction_filter.h +++ b/utilities/blob_db/blob_compaction_filter.h @@ -116,9 +116,9 @@ class BlobIndexCompactionFilterGC : public BlobIndexCompactionFilterBase { // that creates non-GC filters. class BlobIndexCompactionFilterFactoryBase : public CompactionFilterFactory { public: - BlobIndexCompactionFilterFactoryBase(BlobDBImpl* blob_db_impl, Env* env, - Statistics* statistics) - : blob_db_impl_(blob_db_impl), env_(env), statistics_(statistics) {} + BlobIndexCompactionFilterFactoryBase(BlobDBImpl* _blob_db_impl, Env* _env, + Statistics* _statistics) + : blob_db_impl_(_blob_db_impl), env_(_env), statistics_(_statistics) {} protected: BlobDBImpl* blob_db_impl() const { return blob_db_impl_; } @@ -134,9 +134,10 @@ class BlobIndexCompactionFilterFactoryBase : public CompactionFilterFactory { class BlobIndexCompactionFilterFactory : public BlobIndexCompactionFilterFactoryBase { public: - BlobIndexCompactionFilterFactory(BlobDBImpl* blob_db_impl, Env* env, - Statistics* statistics) - : BlobIndexCompactionFilterFactoryBase(blob_db_impl, env, statistics) {} + BlobIndexCompactionFilterFactory(BlobDBImpl* _blob_db_impl, Env* _env, + Statistics* _statistics) + : BlobIndexCompactionFilterFactoryBase(_blob_db_impl, _env, _statistics) { + } const char* Name() const override { return "BlobIndexCompactionFilterFactory"; @@ -149,9 +150,10 @@ class BlobIndexCompactionFilterFactory class BlobIndexCompactionFilterFactoryGC : public BlobIndexCompactionFilterFactoryBase { public: - BlobIndexCompactionFilterFactoryGC(BlobDBImpl* blob_db_impl, Env* env, - Statistics* statistics) - : BlobIndexCompactionFilterFactoryBase(blob_db_impl, env, statistics) {} + BlobIndexCompactionFilterFactoryGC(BlobDBImpl* _blob_db_impl, Env* _env, + Statistics* _statistics) + : BlobIndexCompactionFilterFactoryBase(_blob_db_impl, _env, _statistics) { + } const char* Name() const override { return "BlobIndexCompactionFilterFactoryGC";