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:
@@ -105,34 +105,34 @@ bool CImageASC::Load(const QString& fileName, CFloatImage& image)
|
||||
|
||||
// ncols = grid width
|
||||
validData = validData && (azstricmp(token, "ncols") == 0);
|
||||
token = azstrtok(NULL, 0, seps, &nextToken);
|
||||
token = azstrtok(nullptr, 0, seps, &nextToken);
|
||||
width = atoi(token);
|
||||
|
||||
// nrows = grid height
|
||||
token = azstrtok(NULL, 0, seps, &nextToken);
|
||||
token = azstrtok(nullptr, 0, seps, &nextToken);
|
||||
validData = validData && (azstricmp(token, "nrows") == 0);
|
||||
token = azstrtok(NULL, 0, seps, &nextToken);
|
||||
token = azstrtok(nullptr, 0, seps, &nextToken);
|
||||
height = atoi(token);
|
||||
|
||||
// xllcorner = leftmost coordinate. (Skip, we don't care about it)
|
||||
token = azstrtok(NULL, 0, seps, &nextToken);
|
||||
token = azstrtok(nullptr, 0, seps, &nextToken);
|
||||
validData = validData && (azstricmp(token, "xllcorner") == 0);
|
||||
token = azstrtok(NULL, 0, seps, &nextToken);
|
||||
token = azstrtok(nullptr, 0, seps, &nextToken);
|
||||
|
||||
// yllcorner = bottommost coordinate. (Skip, we don't care about it)
|
||||
token = azstrtok(NULL, 0, seps, &nextToken);
|
||||
token = azstrtok(nullptr, 0, seps, &nextToken);
|
||||
validData = validData && (azstricmp(token, "yllcorner") == 0);
|
||||
token = azstrtok(NULL, 0, seps, &nextToken);
|
||||
token = azstrtok(nullptr, 0, seps, &nextToken);
|
||||
|
||||
// cellsize = size of each grid cell. (Skip, we don't care about it)
|
||||
token = azstrtok(NULL, 0, seps, &nextToken);
|
||||
token = azstrtok(nullptr, 0, seps, &nextToken);
|
||||
validData = validData && (azstricmp(token, "cellsize") == 0);
|
||||
token = azstrtok(NULL, 0, seps, &nextToken);
|
||||
token = azstrtok(nullptr, 0, seps, &nextToken);
|
||||
|
||||
// nodata_value = the value used for missing data. We'll replace these with 0 height.
|
||||
token = azstrtok(NULL, 0, seps, &nextToken);
|
||||
token = azstrtok(nullptr, 0, seps, &nextToken);
|
||||
validData = validData && (azstricmp(token, "nodata_value") == 0);
|
||||
token = azstrtok(NULL, 0, seps, &nextToken);
|
||||
token = azstrtok(nullptr, 0, seps, &nextToken);
|
||||
nodataValue = atof(token);
|
||||
|
||||
if (!validData)
|
||||
@@ -152,10 +152,10 @@ bool CImageASC::Load(const QString& fileName, CFloatImage& image)
|
||||
int i = 0;
|
||||
float pixelValue;
|
||||
float maxPixel = 0.0f;
|
||||
while (token != NULL && i < size)
|
||||
while (token != nullptr && i < size)
|
||||
{
|
||||
token = azstrtok(NULL, 0, seps, &nextToken);
|
||||
if (token != NULL)
|
||||
token = azstrtok(nullptr, 0, seps, &nextToken);
|
||||
if (token != nullptr)
|
||||
{
|
||||
// Negative heights aren't supported, clamp to 0.
|
||||
pixelValue = max(0.0, atof(token));
|
||||
|
||||
Reference in New Issue
Block a user