diff --git a/tools/ldb.cc b/tools/ldb.cc index 56e3d9670..d26a491e0 100644 --- a/tools/ldb.cc +++ b/tools/ldb.cc @@ -67,7 +67,7 @@ public: } LDBCommand* cmdObj = LDBCommand::InitFromCmdLineArgs(argc, argv); - if (cmdObj == NULL) { + if (cmdObj == nullptr) { fprintf(stderr, "Unknown command\n"); PrintHelp(argv[0]); exit(1); diff --git a/tools/reduce_levels_test.cc b/tools/reduce_levels_test.cc index 1e48e296e..8f2a4ce17 100644 --- a/tools/reduce_levels_test.cc +++ b/tools/reduce_levels_test.cc @@ -18,7 +18,7 @@ public: ReduceLevelTest() { dbname_ = test::TmpDir() + "/db_reduce_levels_test"; DestroyDB(dbname_, Options()); - db_ = NULL; + db_ = nullptr; } Status OpenDB(bool create_if_missing, int levels, @@ -41,7 +41,7 @@ public: } Status CompactMemTable() { - if (db_ == NULL) { + if (db_ == nullptr) { return Status::InvalidArgument("DB not opened."); } DBImpl* db_impl = reinterpret_cast(db_); @@ -49,9 +49,9 @@ public: } void CloseDB() { - if (db_ != NULL) { + if (db_ != nullptr) { delete db_; - db_ = NULL; + db_ = nullptr; } } diff --git a/tools/sst_dump.cc b/tools/sst_dump.cc index 7297571b2..f24e148d2 100644 --- a/tools/sst_dump.cc +++ b/tools/sst_dump.cc @@ -22,7 +22,7 @@ namespace leveldb { class SstFileReader { public: - SstFileReader(std::string file_name, + explicit SstFileReader(std::string file_name, bool verify_checksum = false, bool output_hex = false); Status ReadSequential(bool print_kv, uint64_t read_num = -1); @@ -95,7 +95,7 @@ static void print_help() { int main(int argc, char** argv) { - const char* dir_or_file = NULL; + const char* dir_or_file = nullptr; uint64_t read_num = -1; std::string command; @@ -121,7 +121,7 @@ int main(int argc, char** argv) { } } - if(dir_or_file == NULL) { + if(dir_or_file == nullptr) { print_help(); exit(1); }