Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 21, 2015, 7:05:53 PM (8 years ago)
Author:
muemart
Message:

Run clang-modernize -loop-convert

  • Again, not all possible loops were converted
  • It can do pretty cool transformations, but I had to fix a few compile errors, so there might be some runtime errors lurking around too
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/cpp11_v2/src/libraries/tools/DebugDrawer.cc

    r10768 r10821  
    392392            manualObject->estimateVertexCount(lineVertices.size());
    393393            manualObject->estimateIndexCount(lineIndices.size());
    394             for (std::list<VertexPair>::iterator i = lineVertices.begin(); i != lineVertices.end(); i++)
     394            for (auto & elem : lineVertices)
    395395            {
    396                 manualObject->position(i->first);
    397                 manualObject->colour(i->second);
     396                manualObject->position(elem.first);
     397                manualObject->colour(elem.second);
    398398            }
    399             for (std::list<int>::iterator i = lineIndices.begin(); i != lineIndices.end(); i++)
    400                 manualObject->index(*i);
     399            for (auto & elem : lineIndices)
     400                manualObject->index(elem);
    401401        }
    402402        else
     
    409409            manualObject->estimateVertexCount(triangleVertices.size());
    410410            manualObject->estimateIndexCount(triangleIndices.size());
    411             for (std::list<VertexPair>::iterator i = triangleVertices.begin(); i != triangleVertices.end(); i++)
     411            for (auto & elem : triangleVertices)
    412412            {
    413                 manualObject->position(i->first);
    414                 manualObject->colour(i->second.r, i->second.g, i->second.b, fillAlpha);
     413                manualObject->position(elem.first);
     414                manualObject->colour(elem.second.r, elem.second.g, elem.second.b, fillAlpha);
    415415            }
    416             for (std::list<int>::iterator i = triangleIndices.begin(); i != triangleIndices.end(); i++)
    417                 manualObject->index(*i);
     416            for (auto & elem : triangleIndices)
     417                manualObject->index(elem);
    418418        }
    419419        else
Note: See TracChangeset for help on using the changeset viewer.