summaryrefslogtreecommitdiff
path: root/src/mongo/base
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/base')
-rw-r--r--src/mongo/base/clonable_ptr.h2
-rw-r--r--src/mongo/base/owned_pointer_vector.h2
-rw-r--r--src/mongo/base/owned_pointer_vector_test.cpp2
-rw-r--r--src/mongo/base/status.h2
-rw-r--r--src/mongo/base/string_data.h2
-rw-r--r--src/mongo/base/string_data_test.cpp6
6 files changed, 8 insertions, 8 deletions
diff --git a/src/mongo/base/clonable_ptr.h b/src/mongo/base/clonable_ptr.h
index 135fd272fa0..42b0c63c1db 100644
--- a/src/mongo/base/clonable_ptr.h
+++ b/src/mongo/base/clonable_ptr.h
@@ -63,7 +63,7 @@ struct detect_clone_factory_type_member_impl {
template <typename U>
static Yes& test(U*);
- static constexpr bool value = sizeof(test<Derived>(0)) == sizeof(Yes);
+ static constexpr bool value = sizeof(test<Derived>(nullptr)) == sizeof(Yes);
using type = typename std::integral_constant<bool, value>::type;
};
diff --git a/src/mongo/base/owned_pointer_vector.h b/src/mongo/base/owned_pointer_vector.h
index 199e172e4c3..929606ec520 100644
--- a/src/mongo/base/owned_pointer_vector.h
+++ b/src/mongo/base/owned_pointer_vector.h
@@ -157,7 +157,7 @@ public:
*/
T* releaseAt(size_t i) {
T* out = _vector[i];
- _vector[i] = NULL;
+ _vector[i] = nullptr;
return out;
}
diff --git a/src/mongo/base/owned_pointer_vector_test.cpp b/src/mongo/base/owned_pointer_vector_test.cpp
index 5838785725e..c11bda6fb6f 100644
--- a/src/mongo/base/owned_pointer_vector_test.cpp
+++ b/src/mongo/base/owned_pointer_vector_test.cpp
@@ -290,7 +290,7 @@ TEST(OwnedPointerVectorTest, ReleaseAt) {
holder.reset(owned.releaseAt(1));
ASSERT_EQUALS(0U, DestructionLogger::destroyedNames().size());
ASSERT_EQUALS(3U, owned.size());
- ASSERT_EQUALS(static_cast<DestructionLogger*>(NULL), owned[1]);
+ ASSERT_EQUALS(static_cast<DestructionLogger*>(nullptr), owned[1]);
// owned destroyed
}
diff --git a/src/mongo/base/status.h b/src/mongo/base/status.h
index 52a46d0adb0..d3faa8fd0ec 100644
--- a/src/mongo/base/status.h
+++ b/src/mongo/base/status.h
@@ -312,7 +312,7 @@ inline unsigned Status::refCount() const {
return _error ? _error->refs.load() : 0;
}
-inline Status::Status() : _error(NULL) {}
+inline Status::Status() : _error(nullptr) {}
inline void Status::ref(ErrorInfo* error) {
if (error)
diff --git a/src/mongo/base/string_data.h b/src/mongo/base/string_data.h
index 4192ccd60f6..3a943348680 100644
--- a/src/mongo/base/string_data.h
+++ b/src/mongo/base/string_data.h
@@ -279,7 +279,7 @@ inline size_t StringData::find(char c, size_t fromPos) const {
return std::string::npos;
const void* x = memchr(_data + fromPos, c, _size - fromPos);
- if (x == 0)
+ if (x == nullptr)
return std::string::npos;
return static_cast<size_t>(static_cast<const char*>(x) - _data);
}
diff --git a/src/mongo/base/string_data_test.cpp b/src/mongo/base/string_data_test.cpp
index a1d9d7d7773..b0cfac8467a 100644
--- a/src/mongo/base/string_data_test.cpp
+++ b/src/mongo/base/string_data_test.cpp
@@ -42,7 +42,7 @@ using std::string;
TEST(Construction, Empty) {
StringData strData;
ASSERT_EQUALS(strData.size(), 0U);
- ASSERT_TRUE(strData.rawData() == NULL);
+ ASSERT_TRUE(strData.rawData() == nullptr);
}
TEST(Construction, FromStdString) {
@@ -60,10 +60,10 @@ TEST(Construction, FromCString) {
}
TEST(Construction, FromNullCString) {
- char* c = NULL;
+ char* c = nullptr;
StringData strData(c);
ASSERT_EQUALS(strData.size(), 0U);
- ASSERT_TRUE(strData.rawData() == NULL);
+ ASSERT_TRUE(strData.rawData() == nullptr);
}
TEST(Construction, FromUserDefinedLiteral) {