[vtk-developers] Incorrect indentation by vtk_reindent_code.py

Bill Lorensen bill.lorensen at gmail.com
Sat Jul 2 12:53:49 EDT 2016


David,

vtk_reindent_code.py has trouble with for loops after if blocks that
do not have braces.

See the attached file, around lines 3269 and 3290.

For example, Original:
int vtkReebGraph::Implementation::GetNumberOfNodes()
{
  if(!this->NodeNumber)
    for(vtkIdType nodeId = 1; nodeId < this->MainNodeTable.Size; nodeId++)
      {
      // check if node is cleared
      if(!(this->GetNode(nodeId)->ArcUpId == ((int)-2)))
        this->NodeNumber++;
      }

  return this->NodeNumber;
}

after vtk_reindent_code.py
int vtkReebGraph::Implementation::GetNumberOfNodes()
{
  if(!this->NodeNumber)
    for(vtkIdType nodeId = 1; nodeId < this->MainNodeTable.Size; nodeId++)
  {
      // check if node is cleared
      if(!(this->GetNode(nodeId)->ArcUpId == ((int)-2)))
        this->NodeNumber++;
  }

  return this->NodeNumber;
}


There are there are other files that exhibit the same behavior.

Bill

-- 
Unpaid intern in BillsBasement at noware dot com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vtkReebGraph.cxx
Type: text/x-c++src
Size: 104419 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20160702/793513b7/attachment-0001.cxx>


More information about the vtk-developers mailing list