Commit dc0c74b4 authored by Sean McBride's avatar Sean McBride

Made “infinite” while loop more clear

Fixes cppcheck warning about condition always being true.
parent 21de87ca
Pipeline #251 passed with stage
......@@ -97,7 +97,6 @@ int vtkPolyDataReader::RequestData(
int numPts=0;
char line[256];
int npts, size = 0, ncells, i;
int done=0;
vtkPolyData *output = vtkPolyData::SafeDownCast(
outInfo->Get(vtkDataObject::DATA_OBJECT()));
int *tempArray;
......@@ -140,7 +139,7 @@ int vtkPolyDataReader::RequestData(
//
// Might find points, vertices, lines, polygons, or triangle strips
//
while (!done)
while (true)
{
if (!this->ReadString(line))
{
......
......@@ -151,7 +151,6 @@ int vtkRectilinearGridReader::RequestData(
int numPts=0, npts, ncoords, numCells=0, ncells;
char line[256];
int dimsRead=0;
int done=0;
vtkRectilinearGrid *output = vtkRectilinearGrid::SafeDownCast(
outInfo->Get(vtkDataObject::DATA_OBJECT()));
......@@ -199,7 +198,7 @@ int vtkRectilinearGridReader::RequestData(
// Read keyword and number of points
//
while (!done)
while (true)
{
if (!this->ReadString(line))
{
......
......@@ -73,7 +73,6 @@ int vtkStructuredGridReader::RequestInformation(
int vtkStructuredGridReader::ReadMetaData(vtkInformation *outInfo)
{
char line[256];
int done=0;
if (!this->OpenVTKFile() || !this->ReadHeader())
{
......@@ -109,7 +108,7 @@ int vtkStructuredGridReader::ReadMetaData(vtkInformation *outInfo)
// Read keyword and dimensions
//
while (!done)
while (true)
{
if (!this->ReadString(line))
{
......@@ -164,7 +163,6 @@ int vtkStructuredGridReader::RequestData(
int numPts=0, npts=0, numCells=0, ncells;
char line[256];
int dimsRead=0;
int done=0;
vtkStructuredGrid *output = vtkStructuredGrid::SafeDownCast(
outInfo->Get(vtkDataObject::DATA_OBJECT()));
......@@ -204,7 +202,7 @@ int vtkStructuredGridReader::RequestData(
// Read keyword and number of points
//
while (!done)
while (true)
{
if (!this->ReadString(line))
{
......
......@@ -77,7 +77,6 @@ int vtkStructuredPointsReader::ReadMetaData(vtkInformation *outInfo)
char line[256];
int dimsRead=0, arRead=0, originRead=0;
int done=0;
if (!this->OpenVTKFile() || !this->ReadHeader())
{
......@@ -113,7 +112,7 @@ int vtkStructuredPointsReader::ReadMetaData(vtkInformation *outInfo)
}
// Read keyword and number of points
while (!done)
while (true)
{
if (!this->ReadString(line))
{
......@@ -311,7 +310,6 @@ int vtkStructuredPointsReader::RequestData(
char line[256];
int npts, ncells;
int dimsRead=0, arRead=0, originRead=0;
int done=0;
vtkStructuredPoints *output = vtkStructuredPoints::SafeDownCast(
outInfo->Get(vtkDataObject::DATA_OBJECT()));
......@@ -358,7 +356,7 @@ int vtkStructuredPointsReader::RequestData(
// Read keyword and number of points
//
numPts = output->GetNumberOfPoints(); // get default
while (!done)
while (true)
{
if (!this->ReadString(line))
{
......
......@@ -98,7 +98,6 @@ int vtkUnstructuredGridReader::RequestData(
int piece, numPieces, skip1, read2, skip3, tmp;
vtkCellArray *cells=NULL;
int *types=NULL;
int done=0;
vtkUnstructuredGrid *output = vtkUnstructuredGrid::SafeDownCast(
outInfo->Get(vtkDataObject::DATA_OBJECT()));
int *tempArray;
......@@ -146,7 +145,7 @@ int vtkUnstructuredGridReader::RequestData(
// Might find points, cells, and cell types
//
while (!done)
while (true)
{
if (!this->ReadString(line))
{
......
......@@ -245,7 +245,6 @@ void vtkImageQuantizeRGBToIndexExecute(vtkImageQuantizeRGBToIndex *self,
vtkTimerLog *timer;
int totalCount;
double weight;
int done=0;
timer = vtkTimerLog::New();
timer->StartTimer();
......@@ -352,7 +351,7 @@ void vtkImageQuantizeRGBToIndexExecute(vtkImageQuantizeRGBToIndex *self,
rgbPtr++;
}
tmp = root;
while( !done )
while( true )
{
if ( tmp->GetIndex() != -1 )
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment