Codemod NULL to nullptr

Summary:
scripted NULL to nullptr in
* include/leveldb/
* db/
* table/
* util/

Test Plan: make all check

Reviewers: dhruba, emayanke

Reviewed By: emayanke

CC: leveldb

Differential Revision: https://reviews.facebook.net/D9003
This commit is contained in:
Abhishek Kona
2013-02-28 18:04:58 -08:00
parent e45c7a8444
commit c41f1e995c
45 changed files with 452 additions and 445 deletions

View File

@@ -7,14 +7,14 @@
namespace leveldb {
Iterator::Iterator() {
cleanup_.function = NULL;
cleanup_.next = NULL;
cleanup_.function = nullptr;
cleanup_.next = nullptr;
}
Iterator::~Iterator() {
if (cleanup_.function != NULL) {
if (cleanup_.function != nullptr) {
(*cleanup_.function)(cleanup_.arg1, cleanup_.arg2);
for (Cleanup* c = cleanup_.next; c != NULL; ) {
for (Cleanup* c = cleanup_.next; c != nullptr; ) {
(*c->function)(c->arg1, c->arg2);
Cleanup* next = c->next;
delete c;
@@ -24,9 +24,9 @@ Iterator::~Iterator() {
}
void Iterator::RegisterCleanup(CleanupFunction func, void* arg1, void* arg2) {
assert(func != NULL);
assert(func != nullptr);
Cleanup* c;
if (cleanup_.function == NULL) {
if (cleanup_.function == nullptr) {
c = &cleanup_;
} else {
c = new Cleanup;
@@ -41,7 +41,7 @@ void Iterator::RegisterCleanup(CleanupFunction func, void* arg1, void* arg2) {
namespace {
class EmptyIterator : public Iterator {
public:
EmptyIterator(const Status& s) : status_(s) { }
explicit EmptyIterator(const Status& s) : status_(s) { }
virtual bool Valid() const { return false; }
virtual void Seek(const Slice& target) { }
virtual void SeekToFirst() { }