Editor code: tidy up BOOLs,NULLs and overrides pt4.

A few 'typedefs' replaced by 'using's
This shouldn't have any functional changes at all, just c++17 modernization
It's a part 4 of a split #2847

Signed-off-by: Nemerle <nemerle5+git@gmail.com>
This commit is contained in:
Nemerle
2021-08-05 16:49:02 +02:00
parent 7404622b48
commit 1a80d313e5
36 changed files with 204 additions and 204 deletions
+19 -19
View File
@@ -149,13 +149,13 @@ bool CImageUtil::LoadPGM(const QString& fileName, CImageEx& image)
char* nextToken = nullptr;
token = azstrtok(str, 0, seps, &nextToken);
while (token != NULL && token[0] == '#')
while (token != nullptr && token[0] == '#')
{
if (token != NULL && token[0] == '#')
if (token != nullptr && token[0] == '#')
{
azstrtok(NULL, 0, "\n", &nextToken);
azstrtok(nullptr, 0, "\n", &nextToken);
}
token = azstrtok(NULL, 0, seps, &nextToken);
token = azstrtok(nullptr, 0, seps, &nextToken);
}
if (azstricmp(token, "P2") != 0)
{
@@ -167,32 +167,32 @@ bool CImageUtil::LoadPGM(const QString& fileName, CImageEx& image)
do
{
token = azstrtok(NULL, 0, seps, &nextToken);
if (token != NULL && token[0] == '#')
token = azstrtok(nullptr, 0, seps, &nextToken);
if (token != nullptr && token[0] == '#')
{
azstrtok(NULL, 0, "\n", &nextToken);
azstrtok(nullptr, 0, "\n", &nextToken);
}
} while (token != NULL && token[0] == '#');
} while (token != nullptr && token[0] == '#');
width = atoi(token);
do
{
token = azstrtok(NULL, 0, seps, &nextToken);
if (token != NULL && token[0] == '#')
token = azstrtok(nullptr, 0, seps, &nextToken);
if (token != nullptr && token[0] == '#')
{
azstrtok(NULL, 0, "\n", &nextToken);
azstrtok(nullptr, 0, "\n", &nextToken);
}
} while (token != NULL && token[0] == '#');
} while (token != nullptr && token[0] == '#');
height = atoi(token);
do
{
token = azstrtok(NULL, 0, seps, &nextToken);
if (token != NULL && token[0] == '#')
token = azstrtok(nullptr, 0, seps, &nextToken);
if (token != nullptr && token[0] == '#')
{
azstrtok(NULL, 0, "\n", &nextToken);
azstrtok(nullptr, 0, "\n", &nextToken);
}
} while (token != NULL && token[0] == '#');
} while (token != nullptr && token[0] == '#');
numColors = atoi(token);
image.Allocate(width, height);
@@ -200,12 +200,12 @@ bool CImageUtil::LoadPGM(const QString& fileName, CImageEx& image)
uint32* p = image.GetData();
int size = width * height;
int i = 0;
while (token != NULL && i < size)
while (token != nullptr && i < size)
{
do
{
token = azstrtok(NULL, 0, seps, &nextToken);
} while (token != NULL && token[0] == '#');
token = azstrtok(nullptr, 0, seps, &nextToken);
} while (token != nullptr && token[0] == '#');
*p++ = atoi(token);
i++;
}