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
This commit is contained in:
Peter Dillinger 2021-09-27 11:42:10 -07:00 committed by Facebook GitHub Bot
parent b59b7570cf
commit 0774d640c0
3 changed files with 7 additions and 13 deletions

View File

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

View File

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

View File

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