From 45d2b4efca2b93a2b4425db833eb3ac00e8c241c Mon Sep 17 00:00:00 2001 From: Peter Dillinger Date: Mon, 20 Apr 2020 11:37:36 -0700 Subject: [PATCH] Fix tabs and lint-ignores (#6734) Summary: Pull Request resolved: https://github.com/facebook/rocksdb/pull/6734 Reviewed By: cheng-chang Differential Revision: D21134556 Pulled By: pdillinger fbshipit-source-id: 3636cc1d1333137b70031f8277458781c21631fb --- db/log_reader.h | 2 -- java/rocksjni/jnicallback.cc | 5 ++--- java/rocksjni/jnicallback.h | 1 - java/rocksjni/rocks_callback_object.cc | 3 +-- java/rocksjni/statisticsjni.cc | 3 +-- java/rocksjni/statisticsjni.h | 3 +-- table/cuckoo/cuckoo_table_builder_test.cc | 7 +++---- util/crc32c.cc | 16 ++++++++-------- utilities/merge_operators/bytesxor.cc | 2 +- utilities/simulator_cache/sim_cache.cc | 3 +-- utilities/simulator_cache/sim_cache_test.cc | 7 +++---- utilities/ttl/ttl_test.cc | 3 +-- 12 files changed, 22 insertions(+), 33 deletions(-) diff --git a/db/log_reader.h b/db/log_reader.h index 293ae957c..45cfbb5a2 100644 --- a/db/log_reader.h +++ b/db/log_reader.h @@ -49,7 +49,6 @@ class Reader { // // If "checksum" is true, verify checksums if available. Reader(std::shared_ptr info_log, - // @lint-ignore TXT2 T25377293 Grandfathered in std::unique_ptr&& file, Reporter* reporter, bool checksum, uint64_t log_num); // No copying allowed @@ -159,7 +158,6 @@ class Reader { class FragmentBufferedReader : public Reader { public: FragmentBufferedReader(std::shared_ptr info_log, - // @lint-ignore TXT2 T25377293 Grandfathered in std::unique_ptr&& _file, Reporter* reporter, bool checksum, uint64_t log_num) : Reader(info_log, std::move(_file), reporter, checksum, log_num), diff --git a/java/rocksjni/jnicallback.cc b/java/rocksjni/jnicallback.cc index 40fb4514d..28d84f277 100644 --- a/java/rocksjni/jnicallback.cc +++ b/java/rocksjni/jnicallback.cc @@ -43,11 +43,10 @@ JniCallback::~JniCallback() { JNIEnv* env = getJniEnv(&attached_thread); assert(env != nullptr); - if(m_jcallback_obj != nullptr) { + if (m_jcallback_obj != nullptr) { env->DeleteGlobalRef(m_jcallback_obj); } releaseJniEnv(attached_thread); } -// @lint-ignore TXT4 T25377293 Grandfathered in -} // namespace ROCKSDB_NAMESPACE \ No newline at end of file +} // namespace ROCKSDB_NAMESPACE diff --git a/java/rocksjni/jnicallback.h b/java/rocksjni/jnicallback.h index 54264eade..b11ef2ef2 100644 --- a/java/rocksjni/jnicallback.h +++ b/java/rocksjni/jnicallback.h @@ -27,5 +27,4 @@ class JniCallback { }; } // namespace ROCKSDB_NAMESPACE -// @lint-ignore TXT4 T25377293 Grandfathered in #endif // JAVA_ROCKSJNI_JNICALLBACK_H_ diff --git a/java/rocksjni/rocks_callback_object.cc b/java/rocksjni/rocks_callback_object.cc index 73aa86137..35513e151 100644 --- a/java/rocksjni/rocks_callback_object.cc +++ b/java/rocksjni/rocks_callback_object.cc @@ -27,5 +27,4 @@ void Java_org_rocksdb_RocksCallbackObject_disposeInternal(JNIEnv* /*env*/, // I think this is okay, as Comparator and JniCallback both have virtual // destructors... delete reinterpret_cast(handle); - // @lint-ignore TXT4 T25377293 Grandfathered in -} \ No newline at end of file +} diff --git a/java/rocksjni/statisticsjni.cc b/java/rocksjni/statisticsjni.cc index afb9d6cff..f46337893 100644 --- a/java/rocksjni/statisticsjni.cc +++ b/java/rocksjni/statisticsjni.cc @@ -28,5 +28,4 @@ bool StatisticsJni::HistEnabledForType(uint32_t type) const { return true; } -// @lint-ignore TXT4 T25377293 Grandfathered in -}; // namespace ROCKSDB_NAMESPACE \ No newline at end of file +} // namespace ROCKSDB_NAMESPACE diff --git a/java/rocksjni/statisticsjni.h b/java/rocksjni/statisticsjni.h index 51e279143..db3985582 100644 --- a/java/rocksjni/statisticsjni.h +++ b/java/rocksjni/statisticsjni.h @@ -30,5 +30,4 @@ class StatisticsJni : public StatisticsImpl { } // namespace ROCKSDB_NAMESPACE -// @lint-ignore TXT4 T25377293 Grandfathered in -#endif // JAVA_ROCKSJNI_STATISTICSJNI_H_ \ No newline at end of file +#endif // JAVA_ROCKSJNI_STATISTICSJNI_H_ diff --git a/table/cuckoo/cuckoo_table_builder_test.cc b/table/cuckoo/cuckoo_table_builder_test.cc index bcbff5c5b..80181f067 100644 --- a/table/cuckoo/cuckoo_table_builder_test.cc +++ b/table/cuckoo/cuckoo_table_builder_test.cc @@ -57,10 +57,9 @@ class CuckooBuilderTest : public testing::Test { uint64_t read_file_size; ASSERT_OK(env_->GetFileSize(fname, &read_file_size)); - // @lint-ignore TXT2 T25377293 Grandfathered in - Options options; - options.allow_mmap_reads = true; - ImmutableCFOptions ioptions(options); + Options options; + options.allow_mmap_reads = true; + ImmutableCFOptions ioptions(options); // Assert Table Properties. TableProperties* props = nullptr; diff --git a/util/crc32c.cc b/util/crc32c.cc index fa70d23ff..6f729d58c 100644 --- a/util/crc32c.cc +++ b/util/crc32c.cc @@ -725,29 +725,29 @@ uint32_t crc32c_3way(uint32_t crc, const char* buf, size_t len) { do { // jumps here for a full block of len 128 CRCtriplet(crc, next, -128); - FALLTHROUGH_INTENDED; + FALLTHROUGH_INTENDED; case 127: // jumps here or below for the first block smaller CRCtriplet(crc, next, -127); - FALLTHROUGH_INTENDED; + FALLTHROUGH_INTENDED; case 126: CRCtriplet(crc, next, -126); // than 128 - FALLTHROUGH_INTENDED; + FALLTHROUGH_INTENDED; case 125: CRCtriplet(crc, next, -125); - FALLTHROUGH_INTENDED; + FALLTHROUGH_INTENDED; case 124: CRCtriplet(crc, next, -124); - FALLTHROUGH_INTENDED; + FALLTHROUGH_INTENDED; case 123: CRCtriplet(crc, next, -123); - FALLTHROUGH_INTENDED; + FALLTHROUGH_INTENDED; case 122: CRCtriplet(crc, next, -122); - FALLTHROUGH_INTENDED; + FALLTHROUGH_INTENDED; case 121: CRCtriplet(crc, next, -121); - FALLTHROUGH_INTENDED; + FALLTHROUGH_INTENDED; case 120: CRCtriplet(crc, next, -120); FALLTHROUGH_INTENDED; diff --git a/utilities/merge_operators/bytesxor.cc b/utilities/merge_operators/bytesxor.cc index 859affb5e..9324a3665 100644 --- a/utilities/merge_operators/bytesxor.cc +++ b/utilities/merge_operators/bytesxor.cc @@ -49,7 +49,7 @@ void BytesXOROperator::XOR(const Slice* existing_value, new_value->push_back(existing_value_data[i]); } } else { - assert(value.size() == max_size); + assert(value.size() == max_size); for (size_t i = min_size; i < max_size; i++) { new_value->push_back(value_data[i]); } diff --git a/utilities/simulator_cache/sim_cache.cc b/utilities/simulator_cache/sim_cache.cc index ec411cf9a..70eeae141 100644 --- a/utilities/simulator_cache/sim_cache.cc +++ b/utilities/simulator_cache/sim_cache.cc @@ -92,8 +92,7 @@ class CacheActivityLogger { log_line += key.ToString(true); log_line += " - "; AppendNumberTo(&log_line, size); - // @lint-ignore TXT2 T25377293 Grandfathered in - log_line += "\n"; + log_line += "\n"; // line format: "ADD - - " MutexLock l(&mutex_); diff --git a/utilities/simulator_cache/sim_cache_test.cc b/utilities/simulator_cache/sim_cache_test.cc index 6cb495813..996ea90f6 100644 --- a/utilities/simulator_cache/sim_cache_test.cc +++ b/utilities/simulator_cache/sim_cache_test.cc @@ -199,8 +199,7 @@ TEST_F(SimCacheTest, SimCacheLogging) { ASSERT_EQ(add_num, num_block_entries); // Log things again but stop logging automatically after reaching 512 bytes - // @lint-ignore TXT2 T25377293 Grandfathered in - int max_size = 512; + int max_size = 512; ASSERT_OK(sim_cache->StartActivityLogging(log_file, env_, max_size)); for (int it = 0; it < 10; it++) { for (int i = 0; i < num_block_entries; i++) { @@ -211,9 +210,9 @@ TEST_F(SimCacheTest, SimCacheLogging) { uint64_t fsize = 0; ASSERT_OK(env_->GetFileSize(log_file, &fsize)); - // error margin of 100 bytes + // error margin of 100 bytes ASSERT_LT(fsize, max_size + 100); - ASSERT_GT(fsize, max_size - 100); + ASSERT_GT(fsize, max_size - 100); } } // namespace ROCKSDB_NAMESPACE diff --git a/utilities/ttl/ttl_test.cc b/utilities/ttl/ttl_test.cc index 3960bc625..015f67cc4 100644 --- a/utilities/ttl/ttl_test.cc +++ b/utilities/ttl/ttl_test.cc @@ -668,8 +668,7 @@ TEST_F(TtlTest, ChangeTtlOnOpenDb) { OpenTtl(1); // T=0:Open the db with ttl = 2 SetTtl(3); - // @lint-ignore TXT2 T25377293 Grandfathered in - PutValues(0, kSampleSize_); // T=0:Insert Set1. Delete at t=2 + PutValues(0, kSampleSize_); // T=0:Insert Set1. Delete at t=2 SleepCompactCheck(2, 0, kSampleSize_, true); // T=2:Set1 should be there CloseTtl(); }