diff options
author | Noel Grandin <noel@peralex.com> | 2015-05-27 16:33:44 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-05-28 12:49:54 +0200 |
commit | d5129a9dd68978f9eccdd4597b5b6834557c422a (patch) | |
tree | df43250172f784f3048ce42ce1c3410d1d449c1e /basegfx | |
parent | f3331f7694e74f349375c223ce7ed84838e92d89 (diff) |
new clang plugin: loopvartoosmall
Idea from bubli - look for loops where the index variable is of such
size that it cannot cover the range revealed by examining the length
part of the condition.
So far, I have only run the plugin up till the VCL module.
Also the plugin deliberately excludes anything more complicated than a
straightforward incrementing for loop.
Change-Id: Ifced18b01c03ea537c64168465ce0b8287a42015
Diffstat (limited to 'basegfx')
-rw-r--r-- | basegfx/source/polygon/b2dpolygoncutandtouch.cxx | 2 | ||||
-rw-r--r-- | basegfx/source/polygon/b2dpolypolygon.cxx | 4 | ||||
-rw-r--r-- | basegfx/source/polygon/b2dpolypolygoncutter.cxx | 4 | ||||
-rw-r--r-- | basegfx/source/polygon/b2dtrapezoid.cxx | 2 | ||||
-rw-r--r-- | basegfx/source/polygon/b3dpolypolygon.cxx | 12 |
5 files changed, 12 insertions, 12 deletions
diff --git a/basegfx/source/polygon/b2dpolygoncutandtouch.cxx b/basegfx/source/polygon/b2dpolygoncutandtouch.cxx index 3eae85f5c500..5bb23ad2f10a 100644 --- a/basegfx/source/polygon/b2dpolygoncutandtouch.cxx +++ b/basegfx/source/polygon/b2dpolygoncutandtouch.cxx @@ -411,7 +411,7 @@ namespace basegfx } // append remapped tempVector entries for edge to tempPoints for edge - for(sal_uInt32 a(0L); a < aTempPointVectorEdge.size(); a++) + for(size_t a(0L); a < aTempPointVectorEdge.size(); a++) { const temporaryPoint& rTempPoint = aTempPointVectorEdge[a]; rTempPointsB.push_back(temporaryPoint(rTempPoint.getPoint(), nIndB, rTempPoint.getCut())); diff --git a/basegfx/source/polygon/b2dpolypolygon.cxx b/basegfx/source/polygon/b2dpolypolygon.cxx index 92b74e7e3e52..a77652d74ac6 100644 --- a/basegfx/source/polygon/b2dpolypolygon.cxx +++ b/basegfx/source/polygon/b2dpolypolygon.cxx @@ -105,7 +105,7 @@ public: void setClosed(bool bNew) { - for(sal_uInt32 a(0L); a < maPolygons.size(); a++) + for(size_t a(0L); a < maPolygons.size(); a++) { maPolygons[a].setClosed(bNew); } @@ -127,7 +127,7 @@ public: void transform(const basegfx::B2DHomMatrix& rMatrix) { - for(sal_uInt32 a(0L); a < maPolygons.size(); a++) + for(size_t a(0L); a < maPolygons.size(); a++) { maPolygons[a].transform(rMatrix); } diff --git a/basegfx/source/polygon/b2dpolypolygoncutter.cxx b/basegfx/source/polygon/b2dpolypolygoncutter.cxx index 5f1385245fc5..c0d080be18c0 100644 --- a/basegfx/source/polygon/b2dpolypolygoncutter.cxx +++ b/basegfx/source/polygon/b2dpolypolygoncutter.cxx @@ -1038,7 +1038,7 @@ namespace basegfx B2DPolyPolygonVector aResult; aResult.reserve(aInput.size()); - for(sal_uInt32 a(0); a < aInput.size(); a++) + for(size_t a(0); a < aInput.size(); a++) { const basegfx::B2DPolyPolygon aCandidate(prepareForPolygonOperation(aInput[a])); @@ -1080,7 +1080,7 @@ namespace basegfx B2DPolyPolygonVector aResult; aResult.reserve((aInput.size() / 2) + 1); - for(sal_uInt32 a(0); a < aInput.size(); a += 2) + for(size_t a(0); a < aInput.size(); a += 2) { if(a + 1 < aInput.size()) { diff --git a/basegfx/source/polygon/b2dtrapezoid.cxx b/basegfx/source/polygon/b2dtrapezoid.cxx index 935287e3a53a..222bfa3863ac 100644 --- a/basegfx/source/polygon/b2dtrapezoid.cxx +++ b/basegfx/source/polygon/b2dtrapezoid.cxx @@ -423,7 +423,7 @@ namespace basegfx // there were horizontal edges. These can be excluded, but // cuts with other edges need to be solved and added before // ignoring them - for(sal_uInt32 a = 0; a < rTrDeSimpleEdges.size(); a++) + for(size_t a = 0; a < rTrDeSimpleEdges.size(); a++) { // get horizontal edge as candidate; prepare its range and fixed Y const TrDeSimpleEdge& rHorEdge = rTrDeSimpleEdges[a]; diff --git a/basegfx/source/polygon/b3dpolypolygon.cxx b/basegfx/source/polygon/b3dpolypolygon.cxx index a96d4dac7355..9cfc8f8f9753 100644 --- a/basegfx/source/polygon/b3dpolypolygon.cxx +++ b/basegfx/source/polygon/b3dpolypolygon.cxx @@ -121,7 +121,7 @@ public: void transform(const ::basegfx::B3DHomMatrix& rMatrix) { - for(sal_uInt32 a(0L); a < maPolygons.size(); a++) + for(size_t a(0L); a < maPolygons.size(); a++) { maPolygons[a].transform(rMatrix); } @@ -129,7 +129,7 @@ public: void clearBColors() { - for(sal_uInt32 a(0L); a < maPolygons.size(); a++) + for(size_t a(0L); a < maPolygons.size(); a++) { maPolygons[a].clearBColors(); } @@ -137,7 +137,7 @@ public: void transformNormals(const ::basegfx::B3DHomMatrix& rMatrix) { - for(sal_uInt32 a(0L); a < maPolygons.size(); a++) + for(size_t a(0L); a < maPolygons.size(); a++) { maPolygons[a].transformNormals(rMatrix); } @@ -145,7 +145,7 @@ public: void clearNormals() { - for(sal_uInt32 a(0L); a < maPolygons.size(); a++) + for(size_t a(0L); a < maPolygons.size(); a++) { maPolygons[a].clearNormals(); } @@ -153,7 +153,7 @@ public: void transformTextureCoordiantes(const ::basegfx::B2DHomMatrix& rMatrix) { - for(sal_uInt32 a(0L); a < maPolygons.size(); a++) + for(size_t a(0L); a < maPolygons.size(); a++) { maPolygons[a].transformTextureCoordiantes(rMatrix); } @@ -161,7 +161,7 @@ public: void clearTextureCoordinates() { - for(sal_uInt32 a(0L); a < maPolygons.size(); a++) + for(size_t a(0L); a < maPolygons.size(); a++) { maPolygons[a].clearTextureCoordinates(); } |