Fix some lint warnings reported on 6.25 (#8945)

Summary:
Fix some lint warnings

Pull Request resolved: https://github.com/facebook/rocksdb/pull/8945

Test Plan: existing tests, linters

Reviewed By: zhichao-cao

Differential Revision: D31103824

Pulled By: pdillinger

fbshipit-source-id: 4dd9b0c30fa50e588107ac6ed392b2dfb507a5d4
main
Peter Dillinger 3 years ago committed by Facebook GitHub Bot
parent b59b7570cf
commit 0774d640c0
  1. 2
      db/arena_wrapped_db_iter.h
  2. 6
      db/kv_checksum.h
  3. 12
      db/listener_test.cc

@ -34,7 +34,7 @@ class Version;
// the same as the inner DBIter. // the same as the inner DBIter.
class ArenaWrappedDBIter : public Iterator { class ArenaWrappedDBIter : public Iterator {
public: public:
virtual ~ArenaWrappedDBIter() { ~ArenaWrappedDBIter() override {
if (db_iter_ != nullptr) { if (db_iter_ != nullptr) {
db_iter_->~DBIter(); db_iter_->~DBIter();
} else { } else {

@ -117,7 +117,7 @@ class ProtectionInfoKVO {
friend class ProtectionInfoKVOS<T>; friend class ProtectionInfoKVOS<T>;
friend class ProtectionInfoKVOC<T>; friend class ProtectionInfoKVOC<T>;
ProtectionInfoKVO<T>(T val) : info_(val) { explicit ProtectionInfoKVO<T>(T val) : info_(val) {
static_assert(sizeof(ProtectionInfoKVO<T>) == sizeof(T), ""); static_assert(sizeof(ProtectionInfoKVO<T>) == sizeof(T), "");
} }
@ -155,7 +155,7 @@ class ProtectionInfoKVOC {
private: private:
friend class ProtectionInfoKVO<T>; friend class ProtectionInfoKVO<T>;
ProtectionInfoKVOC<T>(T val) : kvo_(val) { explicit ProtectionInfoKVOC<T>(T val) : kvo_(val) {
static_assert(sizeof(ProtectionInfoKVOC<T>) == sizeof(T), ""); static_assert(sizeof(ProtectionInfoKVOC<T>) == sizeof(T), "");
} }
@ -193,7 +193,7 @@ class ProtectionInfoKVOS {
private: private:
friend class ProtectionInfoKVO<T>; friend class ProtectionInfoKVO<T>;
ProtectionInfoKVOS<T>(T val) : kvo_(val) { explicit ProtectionInfoKVOS<T>(T val) : kvo_(val) {
static_assert(sizeof(ProtectionInfoKVOS<T>) == sizeof(T), ""); static_assert(sizeof(ProtectionInfoKVOS<T>) == sizeof(T), "");
} }

@ -1427,12 +1427,6 @@ TEST_F(EventListenerTest, BlobDBCompactFiles) {
class BlobDBFileLevelEventListener : public EventListener { class BlobDBFileLevelEventListener : public EventListener {
public: public:
BlobDBFileLevelEventListener() {
files_started_.store(0);
files_created_.store(0);
files_deleted_.store(0);
}
void OnBlobFileCreationStarted( void OnBlobFileCreationStarted(
const BlobFileCreationBriefInfo& info) override { const BlobFileCreationBriefInfo& info) override {
files_started_++; files_started_++;
@ -1471,9 +1465,9 @@ class BlobDBFileLevelEventListener : public EventListener {
} }
private: private:
std::atomic<uint32_t> files_started_; std::atomic<uint32_t> files_started_{};
std::atomic<uint32_t> files_created_; std::atomic<uint32_t> files_created_{};
std::atomic<uint32_t> files_deleted_; std::atomic<uint32_t> files_deleted_{};
}; };
TEST_F(EventListenerTest, BlobDBFileTest) { TEST_F(EventListenerTest, BlobDBFileTest) {

Loading…
Cancel
Save