Port towards C++11 nullptr

This commit is contained in:
Luís Pereira
2019-04-10 18:13:08 +01:00
committed by Alf Gaida
parent 1e634114a3
commit b8906f6b0c
27 changed files with 91 additions and 91 deletions
+7 -7
View File
@@ -41,9 +41,9 @@ BlockArray::BlockArray()
: size(0),
current(size_t(-1)),
index(size_t(-1)),
lastmap(0),
lastmap(nullptr),
lastmap_index(size_t(-1)),
lastblock(0), ion(-1),
lastblock(nullptr), ion(-1),
length(0)
{
// lastmap_index = index = current = size_t(-1);
@@ -138,7 +138,7 @@ const Block * BlockArray::at(size_t i)
if (i > index) {
qDebug() << "BlockArray::at() i > index\n";
return 0;
return nullptr;
}
// if (index - i >= length) {
@@ -151,11 +151,11 @@ const Block * BlockArray::at(size_t i)
Q_ASSERT(j < size);
unmap();
Block * block = (Block *)mmap(0, blocksize, PROT_READ, MAP_PRIVATE, ion, j * blocksize);
Block * block = (Block *)mmap(nullptr, blocksize, PROT_READ, MAP_PRIVATE, ion, j * blocksize);
if (block == (Block *)-1) {
perror("mmap");
return 0;
return nullptr;
}
lastmap = block;
@@ -172,7 +172,7 @@ void BlockArray::unmap()
perror("munmap");
}
}
lastmap = 0;
lastmap = nullptr;
lastmap_index = size_t(-1);
}
@@ -193,7 +193,7 @@ bool BlockArray::setHistorySize(size_t newsize)
if (!newsize) {
delete lastblock;
lastblock = 0;
lastblock = nullptr;
if (ion >= 0) {
close(ion);
}