aboutsummaryrefslogtreecommitdiff
path: root/src/test/allocator_tests.cpp
diff options
context:
space:
mode:
authorBen Woosley <ben.woosley@gmail.com>2018-07-31 14:02:34 -0400
committerBen Woosley <ben.woosley@gmail.com>2019-01-13 03:25:14 -0800
commit3a0e76fc12b91b2846d756981e15f09b767a9c37 (patch)
tree73d30057afc14c8cf0f3e882d9f885336a970d86 /src/test/allocator_tests.cpp
parent9096276e0b2d5b7e19af9a5f3c144ef108ee55e0 (diff)
Replace remaining 0 with nullptr in Qt code
Also used type-appropriate enum values such as Qt::NoItemFlags in some cases. All cases identified via -Wzero-as-null-pointer-constant
Diffstat (limited to 'src/test/allocator_tests.cpp')
-rw-r--r--src/test/allocator_tests.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/test/allocator_tests.cpp b/src/test/allocator_tests.cpp
index 5a108dcdad..80328458c4 100644
--- a/src/test/allocator_tests.cpp
+++ b/src/test/allocator_tests.cpp
@@ -105,13 +105,13 @@ BOOST_AUTO_TEST_CASE(arena_tests)
// Go entirely wild: free and alloc interleaved,
// generate targets and sizes using pseudo-randomness.
for (int x=0; x<2048; ++x)
- addr.push_back(0);
+ addr.push_back(nullptr);
uint32_t s = 0x12345678;
for (int x=0; x<5000; ++x) {
int idx = s & (addr.size()-1);
if (s & 0x80000000) {
b.free(addr[idx]);
- addr[idx] = 0;
+ addr[idx] = nullptr;
} else if(!addr[idx]) {
addr[idx] = b.alloc((s >> 16) & 2047);
}
@@ -146,7 +146,7 @@ public:
return reinterpret_cast<void*>(0x08000000 + (count<<24)); // Fake address, do not actually use this memory
}
- return 0;
+ return nullptr;
}
void FreeLocked(void* addr, size_t len) override
{