diff options
author | A. Jesse Jiryu Davis <jesse@mongodb.com> | 2019-06-14 16:42:10 -0400 |
---|---|---|
committer | A. Jesse Jiryu Davis <jesse@mongodb.com> | 2019-06-14 19:23:18 -0400 |
commit | 47b380f03e8898f4706ff01fa2be64dfb72e0dba (patch) | |
tree | fb3508758c9abd0e297afee43ac847bf5aebcbbb /src/mongo/db/storage/mobile | |
parent | b3c26131f6ab3f919beca658341e737de5d45683 (diff) | |
download | mongo-47b380f03e8898f4706ff01fa2be64dfb72e0dba.tar.gz |
SERVER-41071 Replace NULL and 0 with nullptr
Diffstat (limited to 'src/mongo/db/storage/mobile')
-rw-r--r-- | src/mongo/db/storage/mobile/mobile_record_store.h | 2 | ||||
-rw-r--r-- | src/mongo/db/storage/mobile/mobile_recovery_unit.cpp | 2 | ||||
-rw-r--r-- | src/mongo/db/storage/mobile/mobile_sqlite_statement.cpp | 10 | ||||
-rw-r--r-- | src/mongo/db/storage/mobile/mobile_util.cpp | 2 | ||||
-rw-r--r-- | src/mongo/db/storage/mobile/mobile_util.h | 7 |
5 files changed, 13 insertions, 10 deletions
diff --git a/src/mongo/db/storage/mobile/mobile_record_store.h b/src/mongo/db/storage/mobile/mobile_record_store.h index ac2d7e4e229..9379a7760f7 100644 --- a/src/mongo/db/storage/mobile/mobile_record_store.h +++ b/src/mongo/db/storage/mobile/mobile_record_store.h @@ -113,7 +113,7 @@ public: Status touch(OperationContext* opCtx, BSONObjBuilder* output) const override; int64_t storageSize(OperationContext* opCtx, - BSONObjBuilder* extraInfo = NULL, + BSONObjBuilder* extraInfo = nullptr, int infoLevel = 0) const override; long long dataSize(OperationContext* opCtx) const override; diff --git a/src/mongo/db/storage/mobile/mobile_recovery_unit.cpp b/src/mongo/db/storage/mobile/mobile_recovery_unit.cpp index d8ff95a9e50..60181ac0b02 100644 --- a/src/mongo/db/storage/mobile/mobile_recovery_unit.cpp +++ b/src/mongo/db/storage/mobile/mobile_recovery_unit.cpp @@ -146,7 +146,7 @@ bool MobileRecoveryUnit::waitUntilDurable() { Lock::GlobalLock lk(opCtx, MODE_X); // Use FULL mode to guarantee durability ret = sqlite3_wal_checkpoint_v2(_session.get()->getSession(), - NULL, + nullptr, SQLITE_CHECKPOINT_FULL, &framesInWAL, &checkpointedFrames); diff --git a/src/mongo/db/storage/mobile/mobile_sqlite_statement.cpp b/src/mongo/db/storage/mobile/mobile_sqlite_statement.cpp index 151ad0d68d7..7760dff5788 100644 --- a/src/mongo/db/storage/mobile/mobile_sqlite_statement.cpp +++ b/src/mongo/db/storage/mobile/mobile_sqlite_statement.cpp @@ -59,14 +59,14 @@ void SqliteStatement::finalize() { int status = sqlite3_finalize(_stmt); fassert(37053, status == _exceptionStatus); - _stmt = NULL; + _stmt = nullptr; } void SqliteStatement::prepare(const MobileSession& session) { SQLITE_STMT_TRACE() << "Preparing: " << _sqlQuery.data(); - int status = - sqlite3_prepare_v2(session.getSession(), _sqlQuery.data(), _sqlQuery.size(), &_stmt, NULL); + int status = sqlite3_prepare_v2( + session.getSession(), _sqlQuery.data(), _sqlQuery.size(), &_stmt, nullptr); if (status == SQLITE_BUSY) { SQLITE_STMT_TRACE() << "Throwing writeConflictException, " << "SQLITE_BUSY while preparing: " << _sqlQuery.data(); @@ -150,8 +150,8 @@ const char* SqliteStatement::getColText(int colIndex) { void SqliteStatement::_execQuery(sqlite3* session, const char* query) { LOG(MOBILE_TRACE_LEVEL) << "MobileSE: SQLite sqlite3_exec: " << query; - char* errMsg = NULL; - int status = sqlite3_exec(session, query, NULL, NULL, &errMsg); + char* errMsg = nullptr; + int status = sqlite3_exec(session, query, nullptr, nullptr, &errMsg); if (status == SQLITE_BUSY || status == SQLITE_LOCKED) { LOG(MOBILE_TRACE_LEVEL) << "MobileSE: " << (status == SQLITE_BUSY ? "Busy" : "Locked") diff --git a/src/mongo/db/storage/mobile/mobile_util.cpp b/src/mongo/db/storage/mobile/mobile_util.cpp index 141cff1a070..3159dd169f8 100644 --- a/src/mongo/db/storage/mobile/mobile_util.cpp +++ b/src/mongo/db/storage/mobile/mobile_util.cpp @@ -91,7 +91,7 @@ Status sqliteRCToStatus(int retCode, const char* prefix) { } const char* sqliteStatusToStr(int retStatus) { - const char* msg = NULL; + const char* msg = nullptr; switch (retStatus) { case SQLITE_OK: diff --git a/src/mongo/db/storage/mobile/mobile_util.h b/src/mongo/db/storage/mobile/mobile_util.h index 93ca3fdd51d..9cdb8bf0e15 100644 --- a/src/mongo/db/storage/mobile/mobile_util.h +++ b/src/mongo/db/storage/mobile/mobile_util.h @@ -44,7 +44,7 @@ namespace embedded { /** * Converts SQLite return codes to MongoDB statuses. */ -Status sqliteRCToStatus(int retCode, const char* prefix = NULL); +Status sqliteRCToStatus(int retCode, const char* prefix = nullptr); /** * Converts SQLite return codes to string equivalents. @@ -54,7 +54,10 @@ const char* sqliteStatusToStr(int retStatus); /** * Checks if retStatus == desiredStatus; else calls fassert. */ -void checkStatus(int retStatus, int desiredStatus, const char* fnName, const char* errMsg = NULL); +void checkStatus(int retStatus, + int desiredStatus, + const char* fnName, + const char* errMsg = nullptr); /** * Validate helper function to log an error and append the error to the results. |