Fix some shadow warning (#6242)

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
main
sdong 5 years ago committed by Facebook Github Bot
parent cfd9732f65
commit 39410bcb3d
  1. 9
      env/composite_env_wrapper.h
  2. 20
      utilities/blob_db/blob_compaction_filter.h

@ -627,8 +627,9 @@ class CompositeEnvWrapper : public Env {
class LegacySequentialFileWrapper : public FSSequentialFile {
public:
explicit LegacySequentialFileWrapper(std::unique_ptr<SequentialFile>&& target)
: target_(std::move(target)) {}
explicit LegacySequentialFileWrapper(
std::unique_ptr<SequentialFile>&& _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<WritableFile>&& target)
: target_(std::move(target)) {}
explicit LegacyWritableFileWrapper(std::unique_ptr<WritableFile>&& _target)
: target_(std::move(_target)) {}
IOStatus Append(const Slice& data, const IOOptions& /*options*/,
IODebugContext* /*dbg*/) override {

@ -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";

Loading…
Cancel
Save