From 844786189632d888c3250e069e61efa03933edaa Mon Sep 17 00:00:00 2001 From: Yueh-Hsuan Chiang Date: Fri, 7 Nov 2014 14:57:51 -0800 Subject: [PATCH] Fixed -WShadow errors in db/db_test.cc and include/rocksdb/metadata.h Summary: Fixed -WShadow errors in db/db_test.cc and include/rocksdb/metadata.h Test Plan: make --- db/db_test.cc | 16 ++++++++-------- include/rocksdb/metadata.h | 36 ++++++++++++++++++------------------ 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/db/db_test.cc b/db/db_test.cc index 8b018715c..4ae34ff9c 100644 --- a/db/db_test.cc +++ b/db/db_test.cc @@ -8333,9 +8333,9 @@ namespace { } // namespace TEST(DBTest, CompactFilesOnLevelCompaction) { - const int kKeySize = 16; - const int kValueSize = 984; - const int kEntrySize = kKeySize + kValueSize; + const int kTestKeySize = 16; + const int kTestValueSize = 984; + const int kEntrySize = kTestKeySize + kTestValueSize; const int kEntriesPerBuffer = 100; Options options; options.create_if_missing = true; @@ -8351,7 +8351,7 @@ TEST(DBTest, CompactFilesOnLevelCompaction) { Random rnd(301); for (int key = 64 * kEntriesPerBuffer; key >= 0; --key) { - ASSERT_OK(Put(1, std::to_string(key), RandomString(&rnd, kValueSize))); + ASSERT_OK(Put(1, std::to_string(key), RandomString(&rnd, kTestValueSize))); } dbfull()->TEST_WaitForFlushMemTable(handles_[1]); dbfull()->TEST_WaitForCompact(); @@ -8388,9 +8388,9 @@ TEST(DBTest, CompactFilesOnLevelCompaction) { } TEST(DBTest, CompactFilesOnUniversalCompaction) { - const int kKeySize = 16; - const int kValueSize = 984; - const int kEntrySize = kKeySize + kValueSize; + const int kTestKeySize = 16; + const int kTestValueSize = 984; + const int kEntrySize = kTestKeySize + kTestValueSize; const int kEntriesPerBuffer = 10; ChangeCompactOptions(); @@ -8405,7 +8405,7 @@ TEST(DBTest, CompactFilesOnUniversalCompaction) { ASSERT_EQ(options.compaction_style, kCompactionStyleUniversal); Random rnd(301); for (int key = 1024 * kEntriesPerBuffer; key >= 0; --key) { - ASSERT_OK(Put(1, std::to_string(key), RandomString(&rnd, kValueSize))); + ASSERT_OK(Put(1, std::to_string(key), RandomString(&rnd, kTestValueSize))); } dbfull()->TEST_WaitForFlushMemTable(handles_[1]); dbfull()->TEST_WaitForCompact(); diff --git a/include/rocksdb/metadata.h b/include/rocksdb/metadata.h index 96f70ed85..e026fa96e 100644 --- a/include/rocksdb/metadata.h +++ b/include/rocksdb/metadata.h @@ -19,9 +19,9 @@ struct SstFileMetaData; // The metadata that describes a column family. struct ColumnFamilyMetaData { ColumnFamilyMetaData() : size(0), name("") {} - ColumnFamilyMetaData(const std::string& name, uint64_t size, - const std::vector&& levels) : - size(size), name(name), levels(levels) {} + ColumnFamilyMetaData(const std::string& _name, uint64_t _size, + const std::vector&& _levels) : + size(_size), name(_name), levels(_levels) {} // The size of this column family in bytes, which is equal to the sum of // the file size of its "levels". @@ -36,10 +36,10 @@ struct ColumnFamilyMetaData { // The metadata that describes a level. struct LevelMetaData { - LevelMetaData(int level, uint64_t size, - const std::vector&& files) : - level(level), size(size), - files(files) {} + LevelMetaData(int _level, uint64_t _size, + const std::vector&& _files) : + level(_level), size(_size), + files(_files) {} // The level which this meta data describes. const int level; @@ -53,17 +53,17 @@ struct LevelMetaData { // The metadata that describes a SST file. struct SstFileMetaData { SstFileMetaData() {} - SstFileMetaData(const std::string& file_name, - const std::string& path, uint64_t size, - SequenceNumber smallest_seqno, - SequenceNumber largest_seqno, - const std::string& smallestkey, - const std::string& largestkey, - bool being_compacted) : - size(size), name(file_name), - db_path(path), smallest_seqno(smallest_seqno), largest_seqno(largest_seqno), - smallestkey(smallestkey), largestkey(largestkey), - being_compacted(being_compacted) {} + SstFileMetaData(const std::string& _file_name, + const std::string& _path, uint64_t _size, + SequenceNumber _smallest_seqno, + SequenceNumber _largest_seqno, + const std::string& _smallestkey, + const std::string& _largestkey, + bool _being_compacted) : + size(_size), name(_file_name), + db_path(_path), smallest_seqno(_smallest_seqno), largest_seqno(_largest_seqno), + smallestkey(_smallestkey), largestkey(_largestkey), + being_compacted(_being_compacted) {} // File size in bytes. uint64_t size;