[geos-commits] [SCM] GEOS branch master updated. 434a1adf6a9b445d06b434e3d3ef0a1d4ab7f742

git at osgeo.org git at osgeo.org
Tue Aug 28 11:51:25 PDT 2018


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GEOS".

The branch, master has been updated
       via  434a1adf6a9b445d06b434e3d3ef0a1d4ab7f742 (commit)
       via  7d577f9368666310f372b066c81ae44e780bcb2f (commit)
      from  1be02b3644672ac97842bfa2ad4cb2810696dc75 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 434a1adf6a9b445d06b434e3d3ef0a1d4ab7f742
Merge: 1be02b3 7d577f9
Author: cvvergara <vicky at georepublic.de>
Date:   Tue Aug 28 11:51:24 2018 -0700

    Merge branch 'rm-static-1' of cvvergara/geos into master


commit 7d577f9368666310f372b066c81ae44e780bcb2f
Author: cvvergara <vicky at georepublic.de>
Date:   Sat Jul 14 19:24:18 2018 -0500

    Closes #897 Unifying with size_t type
    
    This is a combination of 23 commits.

diff --git a/include/geos/algorithm/LineIntersector.h b/include/geos/algorithm/LineIntersector.h
index 2b8ae84..293a1ef 100644
--- a/include/geos/algorithm/LineIntersector.h
+++ b/include/geos/algorithm/LineIntersector.h
@@ -160,7 +160,7 @@ public:
 	//
 	/// This will be either 0, 1 or 2.
 	///
-	int getIntersectionNum() const { return result; }
+	size_t getIntersectionNum() const { return result; }
 
 
 	/// Returns the intIndex'th intersection point
@@ -169,7 +169,7 @@ public:
 	///
 	/// @return the intIndex'th intersection point
 	///
-	const geom::Coordinate& getIntersection(int intIndex) const {
+	const geom::Coordinate& getIntersection(size_t intIndex) const {
 		return intPt[intIndex];
 	}
 
@@ -241,7 +241,7 @@ public:
 	 *
 	 * @return the edge distance of the intersection point
 	 */
-	double getEdgeDistance(int geomIndex,int intIndex) const;
+	double getEdgeDistance(size_t geomIndex, size_t intIndex) const;
 
 private:
 
@@ -257,7 +257,7 @@ private:
 	 */
 	const geom::PrecisionModel *precisionModel;
 
-	int result;
+	size_t result;
 
 	const geom::Coordinate *inputLines[2][2];
 
diff --git a/include/geos/algorithm/distance/PointPairDistance.h b/include/geos/algorithm/distance/PointPairDistance.h
index 10e51b7..e266faa 100644
--- a/include/geos/algorithm/distance/PointPairDistance.h
+++ b/include/geos/algorithm/distance/PointPairDistance.h
@@ -70,7 +70,7 @@ public:
 		return pt;
 	}
 
-	const geom::Coordinate& getCoordinate(unsigned int i) const
+	const geom::Coordinate& getCoordinate(size_t i) const
 	{
 		assert(i<pt.size());
 		return pt[i];
diff --git a/include/geos/geom/CoordinateList.h b/include/geos/geom/CoordinateList.h
index 902c007..b478afb 100644
--- a/include/geos/geom/CoordinateList.h
+++ b/include/geos/geom/CoordinateList.h
@@ -58,7 +58,6 @@ public:
 
 	typedef std::list<Coordinate>::iterator iterator;
 	typedef std::list<Coordinate>::const_iterator const_iterator;
-	typedef std::list<Coordinate>::size_type size_type;
 
 	friend std::ostream& operator<< (std::ostream& os,
 		const CoordinateList& cl);
@@ -84,7 +83,7 @@ public:
 	{
 	}
 
-	size_type size() const
+	size_t size() const
 	{
 		return coords.size();
 	}
diff --git a/include/geos/geom/CoordinateSequence.h b/include/geos/geom/CoordinateSequence.h
index 008f891..c6e3e30 100644
--- a/include/geos/geom/CoordinateSequence.h
+++ b/include/geos/geom/CoordinateSequence.h
@@ -262,7 +262,7 @@ public:
 	/// FIXME: return std::size_t, using numeric_limits<std::size_t>::max
 	/// as 'not found' value.
 	///
-	static int indexOf(const Coordinate *coordinate,
+	static size_t indexOf(const Coordinate *coordinate,
 			const CoordinateSequence *cl);
 
 	/**
diff --git a/include/geos/geom/IntersectionMatrix.h b/include/geos/geom/IntersectionMatrix.h
index e7c0ec9..e225f4b 100644
--- a/include/geos/geom/IntersectionMatrix.h
+++ b/include/geos/geom/IntersectionMatrix.h
@@ -167,7 +167,7 @@ public:
 	 *        to compare the element.  The order of dimension values
 	 *        from least to greatest is {DONTCARE, TRUE, FALSE, 0, 1, 2}.
 	 */
-	void setAtLeast(int row, int column, int minimumDimensionValue);
+	void setAtLeast(size_t row, size_t column, int minimumDimensionValue);
 
 	/** \brief
 	 * If row >= 0 and column >= 0, changes the specified element
diff --git a/include/geos/geom/LineString.h b/include/geos/geom/LineString.h
index 30e0e64..81c6c38 100644
--- a/include/geos/geom/LineString.h
+++ b/include/geos/geom/LineString.h
@@ -92,7 +92,7 @@ public:
 	/// Returns a read-only pointer to internal CoordinateSequence
 	const CoordinateSequence* getCoordinatesRO() const;
 
-	virtual const Coordinate& getCoordinateN(int n) const;
+	virtual const Coordinate& getCoordinateN(size_t n) const;
 
 	/// Returns line dimension (1)
 	Dimension::DimensionType getDimension() const override;
diff --git a/include/geos/geom/MultiPoint.h b/include/geos/geom/MultiPoint.h
index 4fc0676..ec1b718 100644
--- a/include/geos/geom/MultiPoint.h
+++ b/include/geos/geom/MultiPoint.h
@@ -112,7 +112,7 @@ protected:
 
 	MultiPoint(const MultiPoint &mp): Geometry(mp), GeometryCollection(mp) {}
 
-	const Coordinate* getCoordinateN(int n) const;
+	const Coordinate* getCoordinateN(size_t n) const;
 };
 
 #ifdef _MSC_VER
diff --git a/include/geos/geomgraph/Edge.h b/include/geos/geomgraph/Edge.h
index 1583e2a..6067c7e 100644
--- a/include/geos/geomgraph/Edge.h
+++ b/include/geos/geomgraph/Edge.h
@@ -109,8 +109,8 @@ public:
 
 	~Edge() override;
 
-	virtual int getNumPoints() const {
-		return static_cast<int>(pts->getSize());
+	virtual size_t getNumPoints() const {
+		return pts->getSize();
 	}
 
 	virtual void setName(const std::string &newName) {
@@ -122,7 +122,7 @@ public:
 		return pts;
 	}
 
-	virtual const geom::Coordinate& getCoordinate(int i) const {
+	virtual const geom::Coordinate& getCoordinate(size_t i) const {
 		testInvariant();
 		return pts->getAt(i);
 	}
@@ -153,7 +153,7 @@ public:
 		testInvariant();
 	}
 
-	virtual int getMaximumSegmentIndex() const {
+	virtual size_t getMaximumSegmentIndex() const {
 		testInvariant();
 		return getNumPoints()-1;
 	}
@@ -196,16 +196,16 @@ public:
 	 * Adds EdgeIntersections for one or both
 	 * intersections found for a segment of an edge to the edge intersection list.
 	 */
-	virtual void addIntersections(algorithm::LineIntersector *li, int segmentIndex,
-		int geomIndex);
+	virtual void addIntersections(algorithm::LineIntersector *li, size_t segmentIndex,
+		size_t geomIndex);
 
 	/// Add an EdgeIntersection for intersection intIndex.
 	//
 	/// An intersection that falls exactly on a vertex of the edge is normalized
 	/// to use the higher of the two possible segmentIndexes
 	///
-	virtual void addIntersection(algorithm::LineIntersector *li, int segmentIndex,
-		int geomIndex, int intIndex);
+	virtual void addIntersection(algorithm::LineIntersector *li, size_t segmentIndex,
+		size_t geomIndex, size_t intIndex);
 
 	/// Update the IM with the contribution for this component.
 	//
diff --git a/include/geos/geomgraph/EdgeIntersection.h b/include/geos/geomgraph/EdgeIntersection.h
index 4a4bffc..cc522f1 100644
--- a/include/geos/geomgraph/EdgeIntersection.h
+++ b/include/geos/geomgraph/EdgeIntersection.h
@@ -52,17 +52,17 @@ public:
 	double dist;
 
 	// the index of the containing line segment in the parent edge
-	int segmentIndex;
+	size_t segmentIndex;
 
 	EdgeIntersection(const geom::Coordinate& newCoord,
-	                 int newSegmentIndex, double newDist)
+	                 size_t newSegmentIndex, double newDist)
 	  :
 	  coord(newCoord),
 	  dist(newDist),
 	  segmentIndex(newSegmentIndex)
 	{}
 
-	bool isEndPoint(int maxSegmentIndex) const {
+	bool isEndPoint(size_t maxSegmentIndex) const {
 	  if (segmentIndex==0 && dist==0.0) return true;
 	  if (segmentIndex==maxSegmentIndex) return true;
 	  return false;
@@ -72,7 +72,7 @@ public:
 		return coord;
 	}
 
-	int getSegmentIndex() const { return segmentIndex; }
+	size_t getSegmentIndex() const { return segmentIndex; }
 
 	double getDistance() const { return dist; }
 
diff --git a/include/geos/geomgraph/EdgeIntersectionList.h b/include/geos/geomgraph/EdgeIntersectionList.h
index 83201c9..212f8ad 100644
--- a/include/geos/geomgraph/EdgeIntersectionList.h
+++ b/include/geos/geomgraph/EdgeIntersectionList.h
@@ -77,7 +77,7 @@ public:
 	 * @return the EdgeIntersection found or added
 	 */
 	EdgeIntersection* add(const geom::Coordinate& coord,
-		int segmentIndex, double dist);
+		size_t segmentIndex, double dist);
 
 	iterator begin() { return nodeMap.begin(); }
 	iterator end() { return nodeMap.end(); }
diff --git a/include/geos/geomgraph/index/MonotoneChain.h b/include/geos/geomgraph/index/MonotoneChain.h
index f19c463..3a546ec 100644
--- a/include/geos/geomgraph/index/MonotoneChain.h
+++ b/include/geos/geomgraph/index/MonotoneChain.h
@@ -44,11 +44,11 @@ namespace index { // geos::geomgraph::index
 class GEOS_DLL MonotoneChain: public SweepLineEventOBJ {
 private:
 	MonotoneChainEdge *mce;
-	int chainIndex;
+	size_t chainIndex;
 
 public:
 
-	MonotoneChain(MonotoneChainEdge *newMce, int newChainIndex):
+	MonotoneChain(MonotoneChainEdge *newMce, size_t newChainIndex):
 		mce(newMce),
 		chainIndex(newChainIndex)
 	{}
diff --git a/include/geos/geomgraph/index/MonotoneChainEdge.h b/include/geos/geomgraph/index/MonotoneChainEdge.h
index 9c77a11..68c6341 100644
--- a/include/geos/geomgraph/index/MonotoneChainEdge.h
+++ b/include/geos/geomgraph/index/MonotoneChainEdge.h
@@ -47,15 +47,15 @@ public:
 	~MonotoneChainEdge();
 	MonotoneChainEdge(Edge *newE);
 	const geom::CoordinateSequence* getCoordinates();
-	std::vector<int>& getStartIndexes();
-	double getMinX(int chainIndex);
-	double getMaxX(int chainIndex);
+	std::vector<size_t>& getStartIndexes();
+	double getMinX(size_t chainIndex);
+	double getMaxX(size_t chainIndex);
 
 	void computeIntersects(const MonotoneChainEdge &mce,
 		SegmentIntersector &si);
 
-	void computeIntersectsForChain(int chainIndex0,
-		const MonotoneChainEdge &mce, int chainIndex1,
+	void computeIntersectsForChain(size_t chainIndex0,
+		const MonotoneChainEdge &mce, size_t chainIndex1,
 		SegmentIntersector &si);
 
 protected:
@@ -63,14 +63,14 @@ protected:
 	const geom::CoordinateSequence* pts; // cache a reference to the coord array, for efficiency
 	// the lists of start/end indexes of the monotone chains.
 	// Includes the end point of the edge as a sentinel
-	std::vector<int> startIndex;
+	std::vector<size_t> startIndex;
 	// these envelopes are created once and reused
 	geom::Envelope env1;
 	geom::Envelope env2;
 private:
-	void computeIntersectsForChain(int start0, int end0,
+	void computeIntersectsForChain(size_t start0, size_t end0,
 		const MonotoneChainEdge &mce,
-		int start1, int end1,
+		size_t start1, size_t end1,
 		SegmentIntersector &ei);
 };
 
diff --git a/include/geos/geomgraph/index/MonotoneChainIndexer.h b/include/geos/geomgraph/index/MonotoneChainIndexer.h
index db72dae..1b282ee 100644
--- a/include/geos/geomgraph/index/MonotoneChainIndexer.h
+++ b/include/geos/geomgraph/index/MonotoneChainIndexer.h
@@ -16,8 +16,8 @@
 #ifndef GEOS_GEOMGRAPH_INDEX_MONOTONECHAININDEXER_H
 #define GEOS_GEOMGRAPH_INDEX_MONOTONECHAININDEXER_H
 
-#include <geos/export.h>
 #include <vector>
+#include <geos/export.h>
 
 // Forward declarations
 namespace geos {
@@ -37,11 +37,11 @@ public:
 
 	MonotoneChainIndexer(){}
 
-	void getChainStartIndices(const geom::CoordinateSequence*, std::vector<int>&);
+	void getChainStartIndices(const geom::CoordinateSequence*, std::vector<std::size_t>&);
 
 private:
 
-	int findChainEnd(const geom::CoordinateSequence* pts, int start);
+	std::size_t findChainEnd(const geom::CoordinateSequence* pts, std::size_t start);
 
 };
 
diff --git a/include/geos/geomgraph/index/SegmentIntersector.h b/include/geos/geomgraph/index/SegmentIntersector.h
index e979e52..ec3bf62 100644
--- a/include/geos/geomgraph/index/SegmentIntersector.h
+++ b/include/geos/geomgraph/index/SegmentIntersector.h
@@ -78,7 +78,7 @@ private:
 	/// Elements are externally owned
 	std::vector<std::vector<Node*>*> bdyNodes;
 
-	bool isTrivialIntersection(Edge *e0,int segIndex0,Edge *e1, int segIndex1);
+	bool isTrivialIntersection(Edge *e0, size_t segIndex0,Edge *e1, size_t segIndex1);
 
 	bool isBoundaryPoint(algorithm::LineIntersector *li,
 			std::vector<std::vector<Node*>*>& tstBdyNodes);
@@ -88,7 +88,7 @@ private:
 
 public:
 
-	static bool isAdjacentSegments(int i1,int i2);
+	static bool isAdjacentSegments(size_t i1, size_t i2);
 
 	// testing only
 	int numTests;
@@ -127,7 +127,7 @@ public:
 
 	bool hasProperInteriorIntersection();
 
-	void addIntersections(Edge *e0, int segIndex0, Edge *e1, int segIndex1);
+	void addIntersections(Edge *e0, size_t segIndex0, Edge *e1, size_t segIndex1);
 
 	void setIsDoneIfProperInt(bool isDoneWhenProperInt);
 
diff --git a/include/geos/geomgraph/index/SimpleMCSweepLineIntersector.h b/include/geos/geomgraph/index/SimpleMCSweepLineIntersector.h
index d88bdc3..4ebf526 100644
--- a/include/geos/geomgraph/index/SimpleMCSweepLineIntersector.h
+++ b/include/geos/geomgraph/index/SimpleMCSweepLineIntersector.h
@@ -84,7 +84,7 @@ private:
 
 	void computeIntersections(SegmentIntersector *si);
 
-	void processOverlaps(int start, int end,
+	void processOverlaps(size_t start, size_t end,
 			SweepLineEvent *ev0,
 			SegmentIntersector *si);
 };
diff --git a/include/geos/geomgraph/index/SimpleSweepLineIntersector.h b/include/geos/geomgraph/index/SimpleSweepLineIntersector.h
index cd8c84d..2e17652 100644
--- a/include/geos/geomgraph/index/SimpleSweepLineIntersector.h
+++ b/include/geos/geomgraph/index/SimpleSweepLineIntersector.h
@@ -81,7 +81,7 @@ private:
 
 	void computeIntersections(SegmentIntersector *si);
 
-	void processOverlaps(int start, int end, SweepLineEvent *ev0,
+	void processOverlaps(size_t start, size_t end, SweepLineEvent *ev0,
 			SegmentIntersector *si);
 };
 
diff --git a/include/geos/geomgraph/index/SweepLineEvent.h b/include/geos/geomgraph/index/SweepLineEvent.h
index b481184..854afe3 100644
--- a/include/geos/geomgraph/index/SweepLineEvent.h
+++ b/include/geos/geomgraph/index/SweepLineEvent.h
@@ -57,9 +57,9 @@ public:
 
 	SweepLineEvent* getInsertEvent() { return insertEvent; }
 
-	int getDeleteEventIndex() { return deleteEventIndex; }
+	size_t getDeleteEventIndex() { return deleteEventIndex; }
 
-	void setDeleteEventIndex(int newDeleteEventIndex) {
+	void setDeleteEventIndex(size_t newDeleteEventIndex) {
 		deleteEventIndex=newDeleteEventIndex;
 	}
 
@@ -83,7 +83,7 @@ private:
 
 	SweepLineEvent *insertEvent; // null if this is an INSERT_EVENT event
 
-	int deleteEventIndex;
+	size_t deleteEventIndex;
 };
 
 class GEOS_DLL SweepLineEventLessThen {
diff --git a/include/geos/geomgraph/index/SweepLineSegment.h b/include/geos/geomgraph/index/SweepLineSegment.h
index d6c8f35..6e4b5c3 100644
--- a/include/geos/geomgraph/index/SweepLineSegment.h
+++ b/include/geos/geomgraph/index/SweepLineSegment.h
@@ -16,7 +16,7 @@
 #ifndef GEOS_GEOMGRAPH_INDEX_SWEEPLINESEGMENT_H
 #define GEOS_GEOMGRAPH_INDEX_SWEEPLINESEGMENT_H
 
-
+#include <cstddef>
 #include <geos/export.h>
 #include <geos/geomgraph/index/SweepLineEventObj.h> // for inheritance
 
@@ -39,7 +39,7 @@ namespace index { // geos::geomgraph::index
 
 class GEOS_DLL SweepLineSegment: public SweepLineEventOBJ {
 public:
-	SweepLineSegment(Edge *newEdge, int newPtIndex);
+	SweepLineSegment(Edge *newEdge, size_t newPtIndex);
 	~SweepLineSegment() override;
 	double getMinX();
 	double getMaxX();
@@ -47,7 +47,7 @@ public:
 protected:
 	Edge *edge;
 	const geom::CoordinateSequence* pts;
-	int ptIndex;
+	size_t ptIndex;
 };
 
 
diff --git a/include/geos/index/chain/MonotoneChainSelectAction.h b/include/geos/index/chain/MonotoneChainSelectAction.h
index 9cd1101..ec1e807 100644
--- a/include/geos/index/chain/MonotoneChainSelectAction.h
+++ b/include/geos/index/chain/MonotoneChainSelectAction.h
@@ -55,7 +55,7 @@ public:
 	virtual ~MonotoneChainSelectAction() {}
 
 	/// This function can be overridden if the original chain is needed
-	virtual void select(MonotoneChain& mc, unsigned int start);
+	virtual void select(MonotoneChain& mc, size_t start);
 
 	/**
 	 * This is a convenience function which can be overridden
diff --git a/include/geos/index/quadtree/NodeBase.h b/include/geos/index/quadtree/NodeBase.h
index 3152e89..10e197c 100644
--- a/include/geos/index/quadtree/NodeBase.h
+++ b/include/geos/index/quadtree/NodeBase.h
@@ -81,9 +81,9 @@ public:
 
 	unsigned int depth() const;
 
-	unsigned int size() const;
+	size_t size() const;
 
-	unsigned int getNodeCount() const;
+	size_t getNodeCount() const;
 
 	virtual std::string toString() const;
 
diff --git a/include/geos/index/quadtree/Quadtree.h b/include/geos/index/quadtree/Quadtree.h
index d237023..0ce3746 100644
--- a/include/geos/index/quadtree/Quadtree.h
+++ b/include/geos/index/quadtree/Quadtree.h
@@ -119,7 +119,7 @@ public:
 	int depth();
 
 	/// Returns the number of items in the tree.
-	int size();
+	size_t size();
 
 	void insert(const geom::Envelope *itemEnv, void *item) override;
 
diff --git a/include/geos/index/strtree/AbstractNode.h b/include/geos/index/strtree/AbstractNode.h
index 4edcf01..f1802d7 100644
--- a/include/geos/index/strtree/AbstractNode.h
+++ b/include/geos/index/strtree/AbstractNode.h
@@ -15,6 +15,7 @@
 #ifndef GEOS_INDEX_STRTREE_ABSTRACTNODE_H
 #define GEOS_INDEX_STRTREE_ABSTRACTNODE_H
 
+#include <cstddef>
 #include <geos/export.h>
 #include <geos/index/strtree/Boundable.h> // for inheritance
 
@@ -44,7 +45,7 @@ private:
 	std::vector<Boundable*> childBoundables;
 	int level;
 public:
-	AbstractNode(int newLevel, int capacity=10);
+	AbstractNode(int newLevel, size_t capacity = 10);
 		~AbstractNode() override;
 
 	// TODO: change signature to return by ref,
diff --git a/include/geos/index/sweepline/SweepLineEvent.h b/include/geos/index/sweepline/SweepLineEvent.h
index 7e40d95..c700ea3 100644
--- a/include/geos/index/sweepline/SweepLineEvent.h
+++ b/include/geos/index/sweepline/SweepLineEvent.h
@@ -15,6 +15,7 @@
 #ifndef GEOS_INDEX_SWEEPLINE_SWEEPLINEEVENT_H
 #define GEOS_INDEX_SWEEPLINE_SWEEPLINEEVENT_H
 
+#include <cstddef>
 #include <geos/export.h>
 
 // Forward declarations
@@ -48,9 +49,9 @@ public:
 
 	SweepLineEvent* getInsertEvent();
 
-	int getDeleteEventIndex();
+	size_t getDeleteEventIndex();
 
-	void setDeleteEventIndex(int newDeleteEventIndex);
+	void setDeleteEventIndex(size_t newDeleteEventIndex);
 
 	SweepLineInterval* getInterval();
 
@@ -73,7 +74,7 @@ private:
 	/// null if this is an INSERT_EVENT event
 	SweepLineEvent *insertEvent;
 
-	int deleteEventIndex;
+	size_t deleteEventIndex;
 
 	SweepLineInterval *sweepInt;
 
diff --git a/include/geos/index/sweepline/SweepLineIndex.h b/include/geos/index/sweepline/SweepLineIndex.h
index f4c95c6..5d885ee 100644
--- a/include/geos/index/sweepline/SweepLineIndex.h
+++ b/include/geos/index/sweepline/SweepLineIndex.h
@@ -15,9 +15,9 @@
 #ifndef GEOS_INDEX_SWEEPLINE_SWEEPLINEINDEX_H
 #define GEOS_INDEX_SWEEPLINE_SWEEPLINEINDEX_H
 
+#include <vector>
 #include <geos/export.h>
 
-#include <vector>
 
 #ifdef _MSC_VER
 #pragma warning(push)
@@ -73,7 +73,7 @@ private:
 	 */
 	void buildIndex();
 
-	void processOverlaps(int start, int end,
+	void processOverlaps(std::size_t start, std::size_t end,
 			SweepLineInterval *s0,
 			SweepLineOverlapAction *action);
 };
diff --git a/include/geos/io/WKBWriter.h b/include/geos/io/WKBWriter.h
index 373994a..32a3914 100644
--- a/include/geos/io/WKBWriter.h
+++ b/include/geos/io/WKBWriter.h
@@ -182,7 +182,7 @@ private:
 	void writeCoordinateSequence(const geom::CoordinateSequence &cs, bool sized);
 		// throws IOException
 
-	void writeCoordinate(const geom::CoordinateSequence &cs, int idx, bool is3d);
+	void writeCoordinate(const geom::CoordinateSequence &cs, size_t idx, bool is3d);
 		// throws IOException
 
 	void writeGeometryType(int geometryType, int SRID);
diff --git a/include/geos/linearref/LinearIterator.h b/include/geos/linearref/LinearIterator.h
index 3b978ed..2aa1779 100644
--- a/include/geos/linearref/LinearIterator.h
+++ b/include/geos/linearref/LinearIterator.h
@@ -74,7 +74,7 @@ public:
 	 * @param componentIndex the component to start at
 	 * @param vertexIndex the vertex to start at
 	 */
-	LinearIterator(const geom::Geometry *linear, unsigned int componentIndex, unsigned int vertexIndex);
+	LinearIterator(const geom::Geometry *linear, size_t componentIndex, size_t vertexIndex);
 
 	/**
 	 * Tests whether there are any vertices left to iterator over.
@@ -100,13 +100,13 @@ public:
 	 * The component index of the vertex the iterator is currently at.
 	 * @return the current component index
 	 */
-	unsigned int getComponentIndex() const;
+	size_t getComponentIndex() const;
 
 	/**
 	 * The vertex index of the vertex the iterator is currently at.
 	 * @return the current vertex index
 	 */
-	unsigned int getVertexIndex() const;
+	size_t getVertexIndex() const;
 
 	/**
 	 * Gets the {@link LineString} component the iterator is current at.
@@ -132,13 +132,13 @@ public:
 
 private:
 
-	static unsigned int segmentEndVertexIndex(const LinearLocation& loc);
+	static size_t segmentEndVertexIndex(const LinearLocation& loc);
 
 	const geom::LineString *currentLine;
-	unsigned int vertexIndex;
-	unsigned int componentIndex;
+	size_t vertexIndex;
+	size_t componentIndex;
 	const geom::Geometry *linear;
-	const unsigned int numLines;
+	const size_t numLines;
 
 	/**
 	 * Invariant: currentLine <> null if the iterator is pointing
diff --git a/include/geos/linearref/LinearLocation.h b/include/geos/linearref/LinearLocation.h
index fb0a74a..c129257 100644
--- a/include/geos/linearref/LinearLocation.h
+++ b/include/geos/linearref/LinearLocation.h
@@ -43,8 +43,8 @@ namespace linearref { // geos::linearref
 class LinearLocation
 {
 private:
-	unsigned int componentIndex;
-	unsigned int segmentIndex;
+	size_t componentIndex;
+	size_t segmentIndex;
 	double segmentFraction;
 
 	/**
@@ -85,9 +85,9 @@ public:
 	/**
 	 * Creates a location referring to the start of a linear geometry
 	 */
-	LinearLocation(unsigned int segmentIndex = 0, double segmentFraction = 0.0);
+	LinearLocation(size_t segmentIndex = 0, double segmentFraction = 0.0);
 
-	LinearLocation(unsigned int componentIndex, unsigned int segmentIndex, double segmentFraction);
+	LinearLocation(size_t componentIndex, size_t segmentIndex, double segmentFraction);
 
 	/**
 	 * Ensures the indexes are valid for a given linear {@link Geometry}.
@@ -128,14 +128,14 @@ public:
 	 *
 	 * @return the component index
 	 */
-	unsigned int getComponentIndex() const;
+	size_t getComponentIndex() const;
 
 	/**
 	 * Gets the segment index for this location
 	 *
 	 * @return the segment index
 	 */
-	unsigned int getSegmentIndex() const;
+	size_t getSegmentIndex() const;
 
 	/**
 	 * Gets the segment fraction for this location
@@ -198,7 +198,7 @@ public:
 	 * @return    a negative integer, zero, or a positive integer as this <code>LineStringLocation</code>
 	 *      is less than, equal to, or greater than the specified locationValues
 	 */
-	int compareLocationValues(unsigned int componentIndex1, unsigned int segmentIndex1, double segmentFraction1) const;
+	int compareLocationValues(size_t componentIndex1, size_t segmentIndex1, double segmentFraction1) const;
 
 	/**
 	 *  Compares two sets of location values for order.
@@ -214,8 +214,8 @@ public:
 	 *      is less than, equal to, or greater than the second set of locationValues
 	 */
 	static int compareLocationValues(
-		unsigned int componentIndex0, unsigned int segmentIndex0, double segmentFraction0,
-		unsigned int componentIndex1, unsigned int segmentIndex1, double segmentFraction1);
+		size_t componentIndex0, size_t segmentIndex0, double segmentFraction0,
+		size_t componentIndex1, size_t segmentIndex1, double segmentFraction1);
 
 	/**
 	 * Tests whether two locations
diff --git a/include/geos/noding/BasicSegmentString.h b/include/geos/noding/BasicSegmentString.h
index 13a934c..d009744 100644
--- a/include/geos/noding/BasicSegmentString.h
+++ b/include/geos/noding/BasicSegmentString.h
@@ -68,13 +68,13 @@ public:
 	{}
 
 	/// see dox in SegmentString.h
-	unsigned int size() const override
+	size_t size() const override
 	{
-		return static_cast<unsigned int>(pts->size());
+		return pts->size();
 	}
 
 	/// see dox in SegmentString.h
-	const geom::Coordinate& getCoordinate(unsigned int i) const override;
+	const geom::Coordinate& getCoordinate(size_t i) const override;
 
 	/// see dox in SegmentString.h
 	geom::CoordinateSequence* getCoordinates() const override;
@@ -92,7 +92,7 @@ public:
 	 *        Must not be the last index in the vertex list
 	 * @return the octant of the segment at the vertex
 	 */
-	int getSegmentOctant(unsigned int index) const;
+	int getSegmentOctant(size_t index) const;
 
 private:
 
diff --git a/include/geos/noding/IntersectionAdder.h b/include/geos/noding/IntersectionAdder.h
index e1689df..58d9090 100644
--- a/include/geos/noding/IntersectionAdder.h
+++ b/include/geos/noding/IntersectionAdder.h
@@ -81,8 +81,8 @@ private:
 	 * Note that closed edges require a special check for the point
 	 * shared by the beginning and end segments.
 	 */
-	bool isTrivialIntersection(const SegmentString* e0, int segIndex0,
-			const SegmentString* e1, int segIndex1);
+	bool isTrivialIntersection(const SegmentString* e0, size_t segIndex0,
+			const SegmentString* e1, size_t segIndex1);
 
     // Declare type as noncopyable
     IntersectionAdder(const IntersectionAdder& other) = delete;
@@ -157,12 +157,12 @@ public:
 	 * intersect (e.g. by an disjoint envelope test).
 	 */
 	void processIntersections(
-		SegmentString* e0,  int segIndex0,
-		SegmentString* e1,  int segIndex1) override;
+		SegmentString* e0,  size_t segIndex0,
+		SegmentString* e1,  size_t segIndex1) override;
 
 
-	static bool isAdjacentSegments(int i1, int i2) {
-		return std::abs(i1 - i2) == 1;
+	static bool isAdjacentSegments(size_t i1, size_t i2) {
+		return (i1 > i2 ? i1 - i2 : i2 - i1) == 1;
 	}
 
 	/**
diff --git a/include/geos/noding/IntersectionFinderAdder.h b/include/geos/noding/IntersectionFinderAdder.h
index 4759b39..3f2225c 100644
--- a/include/geos/noding/IntersectionFinderAdder.h
+++ b/include/geos/noding/IntersectionFinderAdder.h
@@ -79,8 +79,8 @@ public:
 	 * (e.g. by an disjoint envelope test).
 	 */
 	void processIntersections(
-		SegmentString* e0,  int segIndex0,
-		SegmentString* e1,  int segIndex1) override;
+		SegmentString* e0,  size_t segIndex0,
+		SegmentString* e1,  size_t segIndex1) override;
 
 	std::vector<geom::Coordinate>& getInteriorIntersections() {
 		return interiorIntersections;
diff --git a/include/geos/noding/NodedSegmentString.h b/include/geos/noding/NodedSegmentString.h
index 426fc5c..52b02be 100644
--- a/include/geos/noding/NodedSegmentString.h
+++ b/include/geos/noding/NodedSegmentString.h
@@ -124,7 +124,7 @@ public:
 		if (nextSegIndex < size())
 		{
 			geom::Coordinate const& nextPt =
-                getCoordinate(static_cast<unsigned int>(nextSegIndex));
+                getCoordinate(nextSegIndex);
 
 			// Normalize segment index if intPt falls on vertex
 			// The check for point equality is 2D only - Z values are ignored
@@ -143,12 +143,12 @@ public:
 
 	const SegmentNodeList& getNodeList() const;
 
-	unsigned int size() const override
+	size_t size() const override
 	{
-		return static_cast<unsigned int>(pts->size());
+		return pts->size();
 	}
 
-	const geom::Coordinate& getCoordinate(unsigned int i) const override;
+	const geom::Coordinate& getCoordinate(size_t i) const override;
 
 	geom::CoordinateSequence* getCoordinates() const override;
 
@@ -164,7 +164,7 @@ public:
 	 *        Must not be the last index in the vertex list
 	 * @return the octant of the segment at the vertex
 	 */
-	int getSegmentOctant(unsigned int index) const;
+	int getSegmentOctant(size_t index) const;
 
 	/** \brief
 	 * Add {SegmentNode}s for one or both
@@ -172,7 +172,7 @@ public:
 	 * intersection list.
 	 */
 	void addIntersections(algorithm::LineIntersector *li,
-			unsigned int segmentIndex, int geomIndex);
+			size_t segmentIndex, size_t geomIndex);
 
 	/** \brief
 	 * Add an SegmentNode for intersection intIndex.
@@ -182,8 +182,8 @@ public:
 	 * to use the higher of the two possible segmentIndexes
 	 */
 	void addIntersection(algorithm::LineIntersector *li,
-			unsigned int segmentIndex,
-			int geomIndex, int intIndex);
+			size_t segmentIndex,
+			size_t geomIndex, size_t intIndex);
 
 	/** \brief
 	 * Add an SegmentNode for intersection intIndex.
@@ -193,7 +193,7 @@ public:
 	 * to use the higher of the two possible segmentIndexes
 	 */
 	void addIntersection(const geom::Coordinate& intPt,
-			unsigned int segmentIndex);
+			size_t segmentIndex);
 
 
 private:
diff --git a/include/geos/noding/NodingValidator.h b/include/geos/noding/NodingValidator.h
index 2d161af..0aad997 100644
--- a/include/geos/noding/NodingValidator.h
+++ b/include/geos/noding/NodingValidator.h
@@ -71,8 +71,8 @@ private:
 			const SegmentString& ss1);
 
 	void checkInteriorIntersections(
-			const SegmentString& e0, unsigned int segIndex0,
-			const SegmentString& e1, unsigned int segIndex1);
+			const SegmentString& e0, size_t segIndex0,
+			const SegmentString& e1, size_t segIndex1);
 
 	/**
 	 * Checks for intersections between an endpoint of a segment string
diff --git a/include/geos/noding/SegmentIntersectionDetector.h b/include/geos/noding/SegmentIntersectionDetector.h
index 3de7927..6905193 100644
--- a/include/geos/noding/SegmentIntersectionDetector.h
+++ b/include/geos/noding/SegmentIntersectionDetector.h
@@ -16,6 +16,7 @@
 #ifndef GEOS_GEOM_PREP_SEGMENTINTERSECTIONDETECTOR_H
 #define GEOS_GEOM_PREP_SEGMENTINTERSECTIONDETECTOR_H
 
+#include <cstddef>
 #include <geos/noding/SegmentIntersector.h>
 #include <geos/algorithm/LineIntersector.h>
 #include <geos/geom/Coordinate.h>
@@ -160,8 +161,8 @@ public:
 	 * this call for segment pairs which they have determined do not intersect
 	 * (e.g. by an disjoint envelope test).
 	 */
-	void processIntersections(	noding::SegmentString * e0, int segIndex0,
-								noding::SegmentString * e1, int segIndex1 ) override;
+	void processIntersections(	noding::SegmentString * e0, size_t segIndex0,
+								noding::SegmentString * e1, size_t segIndex1 ) override;
 
 };
 
diff --git a/include/geos/noding/SegmentIntersector.h b/include/geos/noding/SegmentIntersector.h
index bd90d6d..f7d4535 100644
--- a/include/geos/noding/SegmentIntersector.h
+++ b/include/geos/noding/SegmentIntersector.h
@@ -15,6 +15,7 @@
 #ifndef GEOS_NODING_SEGMENTINTERSECTOR_H
 #define GEOS_NODING_SEGMENTINTERSECTOR_H
 
+#include <cstddef>
 #include <geos/export.h>
 
 #include <geos/inline.h>
@@ -55,8 +56,8 @@ public:
 	 * being intersected.
 	 */
 	virtual void processIntersections(
-		SegmentString* e0,  int segIndex0,
-		SegmentString* e1,  int segIndex1)=0;
+		SegmentString* e0,  size_t segIndex0,
+		SegmentString* e1,  size_t segIndex1) = 0;
 
 	/**
 	 * \brief
diff --git a/include/geos/noding/SegmentNode.h b/include/geos/noding/SegmentNode.h
index b321c7a..862230f 100644
--- a/include/geos/noding/SegmentNode.h
+++ b/include/geos/noding/SegmentNode.h
@@ -61,7 +61,7 @@ public:
 	geom::Coordinate coord;
 
 	/// the index of the containing line segment in the parent edge
-	unsigned int segmentIndex;
+	size_t segmentIndex;
 
 	/// Construct a node on the given NodedSegmentString
 	//
@@ -77,7 +77,7 @@ public:
 	///
 	SegmentNode(const NodedSegmentString& ss,
 		    const geom::Coordinate& nCoord,
-			unsigned int nSegmentIndex, int nSegmentOctant);
+			size_t nSegmentIndex, int nSegmentOctant);
 
 	~SegmentNode() {}
 
diff --git a/include/geos/noding/SegmentString.h b/include/geos/noding/SegmentString.h
index b9f7c84..750490e 100644
--- a/include/geos/noding/SegmentString.h
+++ b/include/geos/noding/SegmentString.h
@@ -77,9 +77,9 @@ public:
 	void setData(const void* data) { context=data; }
 
 
-	virtual unsigned int size() const=0;
+	virtual size_t size() const=0;
 
-	virtual const geom::Coordinate& getCoordinate(unsigned int i) const=0;
+	virtual const geom::Coordinate& getCoordinate(size_t i) const=0;
 
 	/// \brief
 	/// Return a pointer to the CoordinateSequence associated
diff --git a/include/geos/noding/SingleInteriorIntersectionFinder.h b/include/geos/noding/SingleInteriorIntersectionFinder.h
index aa93b1f..8a3c6c4 100644
--- a/include/geos/noding/SingleInteriorIntersectionFinder.h
+++ b/include/geos/noding/SingleInteriorIntersectionFinder.h
@@ -99,8 +99,8 @@ public:
 	 * (e.g. by an disjoint envelope test).
 	 */
 	void processIntersections(
-		SegmentString* e0,  int segIndex0,
-		SegmentString* e1,  int segIndex1) override;
+		SegmentString* e0,  size_t segIndex0,
+		SegmentString* e1,  size_t segIndex1) override;
 
 	bool isDone() const override
 	{
diff --git a/include/geos/noding/snapround/MCIndexPointSnapper.h b/include/geos/noding/snapround/MCIndexPointSnapper.h
index 7ca4ceb..2153617 100644
--- a/include/geos/noding/snapround/MCIndexPointSnapper.h
+++ b/include/geos/noding/snapround/MCIndexPointSnapper.h
@@ -19,6 +19,7 @@
 #ifndef GEOS_NODING_SNAPROUND_MCINDEXPOINTSNAPPER_H
 #define GEOS_NODING_SNAPROUND_MCINDEXPOINTSNAPPER_H
 
+#include <cstddef>
 #include <geos/export.h>
 
 #include <geos/inline.h>
@@ -68,7 +69,7 @@ public:
 	 * @return <code>true</code> if a node was added for this pixel
 	 */
 	bool snap(HotPixel& hotPixel, SegmentString* parentEdge,
-			unsigned int vertexIndex);
+			size_t vertexIndex);
 
 	bool snap(HotPixel& hotPixel) {
 		return snap(hotPixel, nullptr, 0);
diff --git a/include/geos/operation/buffer/BufferInputLineSimplifier.h b/include/geos/operation/buffer/BufferInputLineSimplifier.h
index da6934e..00ad99f 100644
--- a/include/geos/operation/buffer/BufferInputLineSimplifier.h
+++ b/include/geos/operation/buffer/BufferInputLineSimplifier.h
@@ -122,11 +122,11 @@ private:
 	 * @return the next non-deleted index, if any
 	 * @return inputLine.size() if there are no more non-deleted indices
 	 */
-	unsigned int findNextNonDeletedIndex(unsigned int index) const;
+	size_t findNextNonDeletedIndex(size_t index) const;
 
 	std::unique_ptr<geom::CoordinateSequence> collapseLine() const;
 
-	bool isDeletable(int i0, int i1, int i2, double distanceTol) const;
+	bool isDeletable(size_t i0, size_t i1, size_t i2, double distanceTol) const;
 
 	bool isShallowConcavity(const geom::Coordinate& p0,
 	                        const geom::Coordinate& p1,
@@ -148,7 +148,7 @@ private:
 	 */
 	bool isShallowSampled(const geom::Coordinate& p0,
 	                      const geom::Coordinate& p2,
-	                      int i0, int i2, double distanceTol) const;
+	                      size_t i0, size_t i2, double distanceTol) const;
 
 	bool isShallow(const geom::Coordinate& p0,
 	               const geom::Coordinate& p1,
diff --git a/include/geos/operation/distance/GeometryLocation.h b/include/geos/operation/distance/GeometryLocation.h
index 26053f5..f787fd4 100644
--- a/include/geos/operation/distance/GeometryLocation.h
+++ b/include/geos/operation/distance/GeometryLocation.h
@@ -50,7 +50,8 @@ namespace distance { // geos::operation::distance
 class GEOS_DLL GeometryLocation {
 private:
 	const geom::Geometry *component;
-	int segIndex;
+	size_t segIndex;
+	bool inside_area;
 	geom::Coordinate pt;
 public:
 	/** \brief
@@ -72,7 +73,7 @@ public:
 	 * @param pt the coordinate of the location
 	 */
 	GeometryLocation(const geom::Geometry *component,
-			int segIndex, const geom::Coordinate &pt);
+			size_t segIndex, const geom::Coordinate &pt);
 
 	/** \brief
 	 * Constructs a GeometryLocation specifying a point inside an
@@ -97,7 +98,7 @@ public:
 	 *
 	 * @return the segment index for the location, or INSIDE_AREA
 	 */
-	int getSegmentIndex();
+	size_t getSegmentIndex();
 
 	/**
 	 * Returns the geom::Coordinate of this location.
diff --git a/include/geos/simplify/TaggedLineSegment.h b/include/geos/simplify/TaggedLineSegment.h
index 325f1b7..46bd2e5 100644
--- a/include/geos/simplify/TaggedLineSegment.h
+++ b/include/geos/simplify/TaggedLineSegment.h
@@ -59,7 +59,7 @@ public:
 	TaggedLineSegment(const geom::Coordinate& p0,
 			const geom::Coordinate& p1,
 			const geom::Geometry* parent,
-			unsigned int index);
+			size_t index);
 
 	TaggedLineSegment(const geom::Coordinate& p0,
 			const geom::Coordinate& p1);
@@ -68,13 +68,13 @@ public:
 
 	const geom::Geometry* getParent() const;
 
-	unsigned int getIndex() const;
+	size_t getIndex() const;
 
 private:
 
 	const geom::Geometry* parent;
 
-	unsigned int index;
+	size_t index;
 
 };
 
diff --git a/src/algorithm/CGAlgorithms.cpp b/src/algorithm/CGAlgorithms.cpp
index 29154ac..f425a1b 100644
--- a/src/algorithm/CGAlgorithms.cpp
+++ b/src/algorithm/CGAlgorithms.cpp
@@ -110,28 +110,28 @@ CGAlgorithms::isCCW(const CoordinateSequence* ring)
 
 	// find highest point
 	const Coordinate *hiPt=&ring->getAt(0);
-	int hiIndex=0;
-	for (std::size_t i=1; i<=nPts; ++i)
+	size_t hiIndex = 0;
+	for (std::size_t i = 1; i <= nPts; ++i)
 	{
 		const Coordinate *p=&ring->getAt(i);
 		if (p->y > hiPt->y) {
 			hiPt = p;
-			hiIndex = static_cast<int>(i);
+			hiIndex = i;
 		}
 	}
 
 	// find distinct point before highest point
-	int iPrev = hiIndex;
+	auto iPrev = hiIndex;
 	do {
+		if (iPrev == 0)
+            iPrev = nPts;
 		iPrev = iPrev - 1;
-		if (iPrev < 0)
-            iPrev = static_cast<int>(nPts);
-	} while (ring->getAt(iPrev)==*hiPt && iPrev!=hiIndex);
+	} while (ring->getAt(iPrev) == *hiPt && iPrev != hiIndex);
 
 	// find distinct point after highest point
-	int iNext = hiIndex;
+	auto iNext = hiIndex;
 	do {
-		iNext = (iNext + 1) % static_cast<int>(nPts);
+		iNext = (iNext + 1) % nPts;
 	} while (ring->getAt(iNext)==*hiPt && iNext != hiIndex);
 
 	const Coordinate *prev=&ring->getAt(iPrev);
diff --git a/src/algorithm/LineIntersector.cpp b/src/algorithm/LineIntersector.cpp
index e9320fb..0ca981a 100644
--- a/src/algorithm/LineIntersector.cpp
+++ b/src/algorithm/LineIntersector.cpp
@@ -187,7 +187,7 @@ LineIntersector::computeIntLineIndex() {
 bool
 LineIntersector::isIntersection(const Coordinate& pt) const
 {
-	for (int i=0;i<result;i++) {
+	for (size_t i=0; i < result; ++i) {
 		if (intPt[i].equals2D(pt)) {
 			return true;
 		}
@@ -229,7 +229,7 @@ LineIntersector::computeIntLineIndex(int segmentIndex)
 
 /*public*/
 double
-LineIntersector::getEdgeDistance(int segmentIndex,int intIndex) const
+LineIntersector::getEdgeDistance(size_t segmentIndex,size_t intIndex) const
 {
 	double dist=computeEdgeDistance(intPt[intIndex],
 		*inputLines[segmentIndex][0],
@@ -250,7 +250,7 @@ LineIntersector::isInteriorIntersection()
 bool
 LineIntersector::isInteriorIntersection(int inputLineIndex)
 {
-	for (int i=0; i<result; i++)
+	for (size_t i = 0; i < result; ++i)
 	{
 		if (!(intPt[i].equals2D(*inputLines[inputLineIndex][0])
             		|| intPt[i].equals2D(*inputLines[inputLineIndex][1])))
diff --git a/src/geom/CoordinateSequence.cpp b/src/geom/CoordinateSequence.cpp
index 948a6c1..c8893dc 100644
--- a/src/geom/CoordinateSequence.cpp
+++ b/src/geom/CoordinateSequence.cpp
@@ -105,19 +105,19 @@ CoordinateSequence::minCoordinate(CoordinateSequence *cl)
 	return minCoord;
 }
 
-int
+size_t
 CoordinateSequence::indexOf(const Coordinate *coordinate,
 		const CoordinateSequence *cl)
 {
-	size_t size=cl->getSize();
-	for (size_t i=0; i<size; ++i)
+	size_t size = cl->size();
+	for (size_t i=0; i < size; ++i)
 	{
 		if ((*coordinate)==cl->getAt(i))
 		{
-			return static_cast<int>(i); // FIXME: what if we overflow the int ?
+			return i;
 		}
 	}
-	return -1;
+	return std::numeric_limits<std::size_t>::max();
 }
 
 void
@@ -161,9 +161,9 @@ CoordinateSequence::reverse(CoordinateSequence *cl)
 {
 
 	// FIXME: use a standard algorithm
-	int last = static_cast<int>(cl->getSize()) - 1;
-	int mid=last/2;
-	for(int i=0;i<=mid;i++) {
+	auto last = cl->size() - 1;
+	auto mid = last / 2;
+	for(size_t i=0; i <= mid; i++) {
 		const Coordinate tmp=cl->getAt(i);
 		cl->setAt(cl->getAt(last-i),i);
 		cl->setAt(tmp,last-i);
@@ -227,14 +227,14 @@ CoordinateSequence::add(const CoordinateSequence *cl,
 {
 	// FIXME:  don't rely on negative values for 'j' (the reverse case)
 
-	const int npts = static_cast<int>(cl->getSize());
+	const auto npts = cl->size();
 	if (direction) {
-		for (int i=0; i<npts; i++) {
+		for (size_t i = 0; i < npts; ++i) {
 			add(cl->getAt(i), allowRepeated);
 		}
 	} else {
-		for (int j=npts-1; j>=0; j--) {
-			add(cl->getAt(j), allowRepeated);
+		for (auto j = npts; j > 0; --j) {
+			add(cl->getAt(j - 1), allowRepeated);
 		}
 	}
 }
diff --git a/src/geom/IntersectionMatrix.cpp b/src/geom/IntersectionMatrix.cpp
index 824e9ba..9c391ec 100644
--- a/src/geom/IntersectionMatrix.cpp
+++ b/src/geom/IntersectionMatrix.cpp
@@ -158,22 +158,22 @@ IntersectionMatrix::set(int row, int col, int dimensionValue)
 void
 IntersectionMatrix::set(const string& dimensionSymbols)
 {
-	size_t limit = dimensionSymbols.length();
+	auto limit = dimensionSymbols.length();
 
-	for (int i = 0; i < static_cast<int>(limit); i++)
+	for (size_t i = 0; i < limit; i++)
 	{
-		int row = i / firstDim;
-		int col = i % secondDim;
+		auto row = i / firstDim;
+		auto col = i % secondDim;
 		matrix[row][col] = Dimension::toDimensionValue(dimensionSymbols[i]);
 	}
 }
 
 /*public*/
 void
-IntersectionMatrix::setAtLeast(int row, int col, int minimumDimensionValue)
+IntersectionMatrix::setAtLeast(size_t row, size_t col, int minimumDimensionValue)
 {
-	assert( row >= 0 && row < firstDim );
-	assert( col >= 0 && col < secondDim );
+	assert( row < firstDim );
+	assert( col < secondDim );
 
 	if (matrix[row][col] < minimumDimensionValue)
 	{
@@ -198,12 +198,12 @@ IntersectionMatrix::setAtLeastIfValid(int row, int col, int minimumDimensionValu
 void
 IntersectionMatrix::setAtLeast(string minimumDimensionSymbols)
 {
-	size_t limit = minimumDimensionSymbols.length();
+	auto limit = minimumDimensionSymbols.length();
 
-	for (int i = 0; i < static_cast<int>(limit); i++)
+	for (size_t i = 0; i < limit; i++)
 	{
-		int row = i / firstDim;
-		int col = i % secondDim;
+		auto row = i / firstDim;
+		auto col = i % secondDim;
 		setAtLeast(row, col, Dimension::toDimensionValue(minimumDimensionSymbols[i]));
 	}
 }
diff --git a/src/geom/LineString.cpp b/src/geom/LineString.cpp
index 0b1bcfb..244fd5d 100644
--- a/src/geom/LineString.cpp
+++ b/src/geom/LineString.cpp
@@ -127,7 +127,7 @@ LineString::getCoordinatesRO() const
 }
 
 const Coordinate&
-LineString::getCoordinateN(int n) const
+LineString::getCoordinateN(size_t n) const
 {
 	assert(points.get());
 	return points->getAt(n);
@@ -202,7 +202,7 @@ LineString::isClosed() const
 	if (isEmpty()) {
 		return false;
 	}
-	return getCoordinateN(0).equals2D(getCoordinateN(static_cast<int>(getNumPoints()-1)));
+	return getCoordinateN(0).equals2D(getCoordinateN(getNumPoints() - 1));
 }
 
 bool
diff --git a/src/geom/MultiPoint.cpp b/src/geom/MultiPoint.cpp
index 4d1fe92..f20af5b 100644
--- a/src/geom/MultiPoint.cpp
+++ b/src/geom/MultiPoint.cpp
@@ -68,7 +68,7 @@ MultiPoint::equalsExact(const Geometry *other, double tolerance) const
 	return GeometryCollection::equalsExact(other,tolerance);
   }
 
-const Coordinate* MultiPoint::getCoordinateN(int n) const {
+const Coordinate* MultiPoint::getCoordinateN(size_t n) const {
 	return ((*geometries)[n])->getCoordinate();
 }
 GeometryTypeId
diff --git a/src/geom/util/GeometryTransformer.cpp b/src/geom/util/GeometryTransformer.cpp
index 87735b2..94b079c 100644
--- a/src/geom/util/GeometryTransformer.cpp
+++ b/src/geom/util/GeometryTransformer.cpp
@@ -159,7 +159,7 @@ GeometryTransformer::transformMultiPoint(
 
 	vector<Geometry*>* transGeomList = new vector<Geometry*>();
 
-	for (unsigned int i=0, n=static_cast<unsigned int>(geom->getNumGeometries()); i<n; i++)
+	for (size_t i = 0, n = geom->getNumGeometries(); i < n; i++)
 	{
 		const Point* p = dynamic_cast<const Point*>(geom->getGeometryN(i));
 		assert(p);
@@ -232,7 +232,7 @@ GeometryTransformer::transformMultiLineString(
 
 	vector<Geometry*>* transGeomList = new vector<Geometry*>();
 
-	for (unsigned int i=0, n=static_cast<unsigned int>(geom->getNumGeometries()); i<n; i++)
+	for (size_t i = 0, n = geom->getNumGeometries(); i < n; i++)
 	{
 		const LineString* l = dynamic_cast<const LineString*>(
 				geom->getGeometryN(i));
@@ -276,7 +276,7 @@ GeometryTransformer::transformPolygon(
 	}
 
 	vector<Geometry*>* holes = new vector<Geometry*>();
-	for (unsigned int i=0, n=static_cast<unsigned int>(geom->getNumInteriorRing()); i<n; i++)
+	for (size_t i = 0, n = geom->getNumInteriorRing(); i<n; i++)
 	{
 		const LinearRing* lr = dynamic_cast<const LinearRing*>(
 			geom->getInteriorRingN(i));
diff --git a/src/geomgraph/DirectedEdge.cpp b/src/geomgraph/DirectedEdge.cpp
index 8e97aff..0a4bc62 100644
--- a/src/geomgraph/DirectedEdge.cpp
+++ b/src/geomgraph/DirectedEdge.cpp
@@ -92,7 +92,7 @@ DirectedEdge::DirectedEdge(Edge *newEdge, bool newIsForward):
 	if (isForwardVar) {
 		init(edge->getCoordinate(0), edge->getCoordinate(1));
 	} else {
-		int n=edge->getNumPoints()-1;
+		auto  n = edge->getNumPoints() - 1;
 		init(edge->getCoordinate(n), edge->getCoordinate(n-1));
 	}
 	computeDirectedLabel();
diff --git a/src/geomgraph/Edge.cpp b/src/geomgraph/Edge.cpp
index 91126ee..38ebd85 100644
--- a/src/geomgraph/Edge.cpp
+++ b/src/geomgraph/Edge.cpp
@@ -131,8 +131,8 @@ Edge::isCollapsed() const
 {
 	testInvariant();
 	if (!label.isArea()) return false;
-	if (getNumPoints()!= 3) return false;
-	if (pts->getAt(0)==pts->getAt(2) ) return true;
+	if (getNumPoints() != 3) return false;
+	if (pts->getAt(0) == pts->getAt(2)) return true;
 	return false;
 }
 
@@ -148,12 +148,12 @@ Edge::getCollapsedEdge()
 
 /*public*/
 void
-Edge::addIntersections(LineIntersector *li, int segmentIndex, int geomIndex)
+Edge::addIntersections(LineIntersector *li, size_t segmentIndex, size_t geomIndex)
 {
 #if GEOS_DEBUG
 	cerr<<"["<<this<<"] Edge::addIntersections("<<li->toString()<<", "<<segmentIndex<<", "<<geomIndex<<") called"<<endl;
 #endif
-	for (int i=0; i<li->getIntersectionNum();i++) {
+	for (size_t i = 0; i < li->getIntersectionNum(); ++i) {
 		addIntersection(li,segmentIndex,geomIndex,i);
 	}
 
@@ -163,19 +163,19 @@ Edge::addIntersections(LineIntersector *li, int segmentIndex, int geomIndex)
 /*public*/
 void
 Edge::addIntersection(LineIntersector *li,
-	int segmentIndex, int geomIndex, int intIndex)
+	size_t segmentIndex, size_t geomIndex, size_t intIndex)
 {
 #if GEOS_DEBUG
 	std::cerr << "["<<this<<"] Edge::addIntersection("<<li->toString()<<", "<<segmentIndex<<", "<<geomIndex<<", "<<intIndex<<") called"<< std::endl;
 #endif
 	const Coordinate& intPt=li->getIntersection(intIndex);
-	unsigned int normalizedSegmentIndex=segmentIndex;
-	double dist=li->getEdgeDistance(geomIndex,intIndex);
+	auto normalizedSegmentIndex = segmentIndex;
+	double dist = li->getEdgeDistance(geomIndex, intIndex);
 
 	// normalize the intersection point location
-	unsigned int nextSegIndex=normalizedSegmentIndex+1;
-	unsigned int npts=getNumPoints();
-	if (nextSegIndex<npts)
+	auto nextSegIndex = normalizedSegmentIndex + 1;
+	auto npts = getNumPoints();
+	if (nextSegIndex < npts)
 	{
 		const Coordinate& nextPt=pts->getAt(nextSegIndex);
         // Normalize segment index if intPt falls on vertex
@@ -203,15 +203,15 @@ Edge::equals(const Edge& e) const
 {
 	testInvariant();
 
-	unsigned int npts1=getNumPoints();
-	unsigned int npts2=e.getNumPoints();
+	auto npts1 = getNumPoints();
+	auto npts2 = e.getNumPoints();
 
 	if (npts1 != npts2 ) return false;
 
 	bool isEqualForward=true;
 	bool isEqualReverse=true;
 
-	for (unsigned int i=0, iRev=npts1-1; i<npts1; ++i, --iRev)
+	for (size_t i = 0, iRev = npts1 - 1; i < npts1; ++i, --iRev)
 	{
 		const Coordinate &e1pi=pts->getAt(i);
 		const Coordinate &e2pi=e.pts->getAt(i);
@@ -233,8 +233,8 @@ Edge::isPointwiseEqual(const Edge *e) const
 #if GEOS_DEBUG > 2
 	cerr<<"Edge::isPointwiseEqual call"<<endl;
 #endif
-	unsigned int npts=getNumPoints();
-	unsigned int enpts=e->getNumPoints();
+	auto npts = getNumPoints();
+	auto enpts = e->getNumPoints();
 	if (npts!=enpts) return false;
 #if GEOS_DEBUG
 	cerr<<"Edge::isPointwiseEqual scanning "<<enpts<<"x"<<npts<<" points"<<endl;
@@ -273,8 +273,8 @@ Edge::printReverse() const
 	   << " depthDelta:" << depthDelta
 	   << ":" << std::endl
 	   << "  LINESTRING(";
-	unsigned int npts=getNumPoints();
-	for (unsigned int i=npts; i>0; --i)
+	auto npts=getNumPoints();
+	for (auto i=npts; i>0; --i)
 	{
 		if (i<npts) os << ", ";
 		os << pts->getAt(i-1).toString();
@@ -291,8 +291,8 @@ Edge::getEnvelope()
 	if (env==nullptr)
 	{
 		env=new Envelope();
-		unsigned int npts=getNumPoints();
-		for (unsigned int i = 0; i<npts; ++i)
+		auto npts=getNumPoints();
+		for (size_t i = 0; i < npts; ++i)
 		{
 			env->expandToInclude(pts->getAt(i));
 		}
diff --git a/src/geomgraph/EdgeIntersectionList.cpp b/src/geomgraph/EdgeIntersectionList.cpp
index 6f0f09d..cc41ed7 100644
--- a/src/geomgraph/EdgeIntersectionList.cpp
+++ b/src/geomgraph/EdgeIntersectionList.cpp
@@ -63,7 +63,7 @@ EdgeIntersectionList::~EdgeIntersectionList()
 
 EdgeIntersection*
 EdgeIntersectionList::add(const Coordinate& coord,
-	int segmentIndex, double dist)
+	size_t segmentIndex, double dist)
 {
 	EdgeIntersection *eiNew=new EdgeIntersection(coord, segmentIndex, dist);
 
@@ -100,7 +100,7 @@ EdgeIntersectionList::isIntersection(const Coordinate& pt) const
 void
 EdgeIntersectionList::addEndpoints()
 {
-	int maxSegIndex=edge->getNumPoints()-1;
+	auto maxSegIndex = edge->getNumPoints() - 1;
 	add(edge->pts->getAt(0), 0, 0.0);
 	add(edge->pts->getAt(maxSegIndex), maxSegIndex, 0.0);
 }
@@ -134,7 +134,7 @@ EdgeIntersectionList::createSplitEdge(EdgeIntersection *ei0,
 #if GEOS_DEBUG
 	cerr<<"["<<this<<"] EdgeIntersectionList::createSplitEdge()"<<endl;
 #endif // GEOS_DEBUG
-	int npts=ei1->segmentIndex-ei0->segmentIndex+2;
+	auto npts = ei1->segmentIndex - ei0->segmentIndex + 2;
 
 	const Coordinate& lastSegStartPt=edge->pts->getAt(ei1->segmentIndex);
 
@@ -155,7 +155,7 @@ EdgeIntersectionList::createSplitEdge(EdgeIntersection *ei0,
 	vc->reserve(npts);
 
 	vc->push_back(ei0->coord);
-	for(int i=ei0->segmentIndex+1; i<=ei1->segmentIndex;i++)
+	for(auto i = ei0->segmentIndex + 1; i <= ei1->segmentIndex; ++i)
 	{
 		if ( ! useIntPt1 && ei1->segmentIndex == i )
 		{
diff --git a/src/geomgraph/index/MonotoneChainEdge.cpp b/src/geomgraph/index/MonotoneChainEdge.cpp
index 8d28c6d..e86ac28 100644
--- a/src/geomgraph/index/MonotoneChainEdge.cpp
+++ b/src/geomgraph/index/MonotoneChainEdge.cpp
@@ -69,14 +69,14 @@ MonotoneChainEdge::getCoordinates()
 	return pts;
 }
 
-vector<int> &
+vector<size_t> &
 MonotoneChainEdge::getStartIndexes()
 {
 	return startIndex;
 }
 
 double
-MonotoneChainEdge::getMinX(int chainIndex)
+MonotoneChainEdge::getMinX(size_t chainIndex)
 {
 	double x1=pts->getAt(startIndex[chainIndex]).x;
 	double x2=pts->getAt(startIndex[chainIndex+1]).x;
@@ -84,7 +84,7 @@ MonotoneChainEdge::getMinX(int chainIndex)
 }
 
 double
-MonotoneChainEdge::getMaxX(int chainIndex)
+MonotoneChainEdge::getMaxX(size_t chainIndex)
 {
 	double x1=pts->getAt(startIndex[chainIndex]).x;
 	double x2=pts->getAt(startIndex[chainIndex+1]).x;
@@ -101,14 +101,14 @@ MonotoneChainEdge::computeIntersects(const MonotoneChainEdge &mce,
 	{
 		for(size_t j=0; j<J; ++j)
 		{
-			computeIntersectsForChain(static_cast<int>(i),mce,static_cast<int>(j),si);
+			computeIntersectsForChain(i, mce, j, si);
 		}
 	}
 }
 
 void
-MonotoneChainEdge::computeIntersectsForChain(int chainIndex0,
-	const MonotoneChainEdge &mce, int chainIndex1,
+MonotoneChainEdge::computeIntersectsForChain(size_t chainIndex0,
+	const MonotoneChainEdge &mce, size_t chainIndex1,
 	SegmentIntersector &si)
 {
 	computeIntersectsForChain(startIndex[chainIndex0],
@@ -119,8 +119,8 @@ MonotoneChainEdge::computeIntersectsForChain(int chainIndex0,
 }
 
 void
-MonotoneChainEdge::computeIntersectsForChain(int start0, int end0,
-	const MonotoneChainEdge &mce, int start1, int end1,
+MonotoneChainEdge::computeIntersectsForChain(size_t start0, size_t end0,
+	const MonotoneChainEdge &mce, size_t start1, size_t end1,
 	SegmentIntersector &ei)
 {
 	// terminating condition for the recursion
@@ -141,8 +141,8 @@ MonotoneChainEdge::computeIntersectsForChain(int start0, int end0,
 	if (!env1.intersects(&env2)) return;
 	// the chains overlap, so split each in half and iterate
 	// (binary search)
-	int mid0=(start0+end0)/2;
-	int mid1=(start1+end1)/2;
+	size_t mid0 = (start0 + end0) / 2;
+	size_t mid1 = (start1 + end1) / 2;
 
 	// Assert: mid != start or end
 	// (since we checked above for end - start <= 1)
diff --git a/src/geomgraph/index/MonotoneChainIndexer.cpp b/src/geomgraph/index/MonotoneChainIndexer.cpp
index f1598e6..54e5b82 100644
--- a/src/geomgraph/index/MonotoneChainIndexer.cpp
+++ b/src/geomgraph/index/MonotoneChainIndexer.cpp
@@ -29,18 +29,18 @@ namespace index { // geos.geomgraph.index
 
 void
 MonotoneChainIndexer::getChainStartIndices(const CoordinateSequence* pts,
-	vector<int> &startIndexList)
+	vector<size_t> &startIndexList)
 {
 	// find the startpoint (and endpoints) of all monotone chains
 	// in this edge
-	int start=0;
+	size_t start=0;
 	//vector<int>* startIndexList=new vector<int>();
 	startIndexList.push_back(start);
 	do {
-		int last=findChainEnd(pts,start);
+		auto last = findChainEnd(pts, start);
 		startIndexList.push_back(last);
-		start=last;
-	} while(start<(int)pts->getSize()-1);
+		start = last;
+	} while(start < pts->size() - 1);
 	// copy list to an array of ints, for efficiency
 	//return startIndexList;
 }
@@ -48,17 +48,17 @@ MonotoneChainIndexer::getChainStartIndices(const CoordinateSequence* pts,
 /**
 * @return the index of the last point in the monotone chain
 */
-int MonotoneChainIndexer::findChainEnd(const CoordinateSequence* pts,int start){
+size_t MonotoneChainIndexer::findChainEnd(const CoordinateSequence* pts, size_t start){
 	// determine quadrant for chain
-	int chainQuad=Quadrant::quadrant(pts->getAt(start),pts->getAt(start + 1));
-	int last=start+1;
-	while(last<(int)pts->getSize()) {
+	auto chainQuad = Quadrant::quadrant(pts->getAt(start), pts->getAt(start + 1));
+	auto last = start + 1;
+	while(last < pts->size()) {
 		// compute quadrant for next possible segment in chain
-		int quad=Quadrant::quadrant(pts->getAt(last - 1),pts->getAt(last));
+		auto quad=Quadrant::quadrant(pts->getAt(last - 1),pts->getAt(last));
 		if (quad!=chainQuad) break;
-		last++;
+		++last;
 	}
-	return last-1;
+	return last - 1;
 }
 
 } // namespace geos.geomgraph.index
diff --git a/src/geomgraph/index/SegmentIntersector.cpp b/src/geomgraph/index/SegmentIntersector.cpp
index f728002..0e49b5f 100644
--- a/src/geomgraph/index/SegmentIntersector.cpp
+++ b/src/geomgraph/index/SegmentIntersector.cpp
@@ -44,9 +44,9 @@ namespace index { // geos.geomgraph.index
 using namespace geos::algorithm;
 
 bool
-SegmentIntersector::isAdjacentSegments(int i1,int i2)
+SegmentIntersector::isAdjacentSegments(size_t i1, size_t i2)
 {
-	return abs(i1-i2)==1;
+	return (i1 > i2 ? i1 - i2 : i2 - i1) == 1;
 }
 
 void
@@ -115,7 +115,9 @@ SegmentIntersector::hasProperInteriorIntersection()
  * shared by the beginning and end segments.
  */
 bool
-SegmentIntersector::isTrivialIntersection(Edge *e0,int segIndex0,Edge *e1,int segIndex1)
+SegmentIntersector::isTrivialIntersection(Edge *e0,
+		size_t segIndex0,Edge *e1,
+		size_t segIndex1)
 {
 //	if (e0->equals(e1))
 	if (e0==e1) {
@@ -123,7 +125,7 @@ SegmentIntersector::isTrivialIntersection(Edge *e0,int segIndex0,Edge *e1,int se
 			if (isAdjacentSegments(segIndex0,segIndex1))
 				return true;
 			if (e0->isClosed()) {
-				int maxSegIndex=e0->getNumPoints()-1;
+				auto maxSegIndex = e0->getNumPoints() - 1;
 				if ((segIndex0==0 && segIndex1==maxSegIndex)
 					|| (segIndex1==0 && segIndex0==maxSegIndex)) {
 					return true;
@@ -141,7 +143,7 @@ SegmentIntersector::isTrivialIntersection(Edge *e0,int segIndex0,Edge *e1,int se
  * certain pairs of segments for efficiency reasons.
  */
 void
-SegmentIntersector::addIntersections(Edge *e0,int segIndex0,Edge *e1,int segIndex1)
+SegmentIntersector::addIntersections(Edge *e0, size_t segIndex0, Edge *e1, size_t segIndex1)
 {
 
 #if GEOS_DEBUG
diff --git a/src/geomgraph/index/SimpleEdgeSetIntersector.cpp b/src/geomgraph/index/SimpleEdgeSetIntersector.cpp
index f15f7d1..7ebdf20 100644
--- a/src/geomgraph/index/SimpleEdgeSetIntersector.cpp
+++ b/src/geomgraph/index/SimpleEdgeSetIntersector.cpp
@@ -83,12 +83,12 @@ SimpleEdgeSetIntersector::computeIntersects(Edge *e0, Edge *e1,
 	const CoordinateSequence *pts0=e0->getCoordinates();
 	const CoordinateSequence *pts1=e1->getCoordinates();
 
-	auto npts0 = static_cast<int>(pts0->getSize());
-	auto npts1 = static_cast<int>(pts1->getSize());
+	auto npts0 = pts0->size();
+	auto npts1 = pts1->size();
 
-	for(int i0=0; i0<npts0-1; ++i0)
+	for(size_t i0 = 0; i0 < npts0 - 1; ++i0)
 	{
-		for(int i1=0; i1<npts1-1; ++i1)
+		for(size_t i1 = 0; i1<npts1 - 1; ++i1)
 		{
 			si->addIntersections(e0, i0, e1, i1);
 		}
diff --git a/src/geomgraph/index/SimpleMCSweepLineIntersector.cpp b/src/geomgraph/index/SimpleMCSweepLineIntersector.cpp
index 66f1f9b..2cd5bdb 100644
--- a/src/geomgraph/index/SimpleMCSweepLineIntersector.cpp
+++ b/src/geomgraph/index/SimpleMCSweepLineIntersector.cpp
@@ -89,16 +89,16 @@ void
 SimpleMCSweepLineIntersector::add(Edge *edge, void* edgeSet)
 {
 	MonotoneChainEdge *mce=edge->getMonotoneChainEdge();
-	vector<int> &startIndex=mce->getStartIndexes();
-	size_t n = startIndex.size()-1;
+	auto& startIndex = mce->getStartIndexes();
+	size_t n = startIndex.size() - 1;
 	events.reserve(events.size()+(n*2));
-	for(size_t i=0; i<n; ++i)
+	for(size_t i = 0; i < n; ++i)
 	{
 		GEOS_CHECK_FOR_INTERRUPTS();
-		MonotoneChain *mc=new MonotoneChain(mce, static_cast<int>(i));
-		SweepLineEvent *insertEvent=new SweepLineEvent(edgeSet,mce->getMinX(static_cast<int>(i)),nullptr,mc);
+		MonotoneChain *mc=new MonotoneChain(mce, i);
+		SweepLineEvent *insertEvent=new SweepLineEvent(edgeSet, mce->getMinX(i), nullptr, mc);
 		events.push_back(insertEvent);
-		events.push_back(new SweepLineEvent(edgeSet,mce->getMaxX(static_cast<int>(i)),insertEvent,mc));
+		events.push_back(new SweepLineEvent(edgeSet, mce->getMaxX(i), insertEvent, mc));
 	}
 }
 
@@ -117,7 +117,7 @@ SimpleMCSweepLineIntersector::prepareEvents()
 		SweepLineEvent *ev=events[i];
 		if (ev->isDelete())
 		{
-			ev->getInsertEvent()->setDeleteEventIndex(static_cast<int>(i));
+			ev->getInsertEvent()->setDeleteEventIndex(i);
 		}
 	}
 }
@@ -133,7 +133,7 @@ SimpleMCSweepLineIntersector::computeIntersections(SegmentIntersector *si)
 		SweepLineEvent *ev=events[i];
 		if (ev->isInsert())
 		{
-			processOverlaps(static_cast<int>(i),ev->getDeleteEventIndex(),ev,si);
+			processOverlaps(i, ev->getDeleteEventIndex(), ev, si);
 		}
 		if (si->getIsDone())
 		{
@@ -143,7 +143,7 @@ SimpleMCSweepLineIntersector::computeIntersections(SegmentIntersector *si)
 }
 
 void
-SimpleMCSweepLineIntersector::processOverlaps(int start, int end,
+SimpleMCSweepLineIntersector::processOverlaps(size_t start, size_t end,
 	SweepLineEvent *ev0, SegmentIntersector *si)
 {
 	MonotoneChain *mc0=(MonotoneChain*) ev0->getObject();
@@ -153,7 +153,7 @@ SimpleMCSweepLineIntersector::processOverlaps(int start, int end,
 	 * include current insert event object in list of event objects to test.
 	 * Last index can be skipped, because it must be a Delete event.
 	 */
-	for(int i=start; i<end; ++i)
+	for(auto i = start; i < end; ++i)
 	{
 		SweepLineEvent *ev1=events[i];
 		if (ev1->isInsert())
diff --git a/src/geomgraph/index/SimpleSweepLineIntersector.cpp b/src/geomgraph/index/SimpleSweepLineIntersector.cpp
index c785c36..6893d35 100644
--- a/src/geomgraph/index/SimpleSweepLineIntersector.cpp
+++ b/src/geomgraph/index/SimpleSweepLineIntersector.cpp
@@ -89,7 +89,7 @@ SimpleSweepLineIntersector::add(Edge *edge, void* edgeSet)
 	std::size_t n=pts->getSize()-1;
 	for(std::size_t i=0; i<n; ++i)
 	{
-		SweepLineSegment *ss=new SweepLineSegment(edge, static_cast<int>(i));
+		SweepLineSegment *ss=new SweepLineSegment(edge, i);
 		SweepLineEvent *insertEvent=new SweepLineEvent(edgeSet, ss->getMinX(), nullptr, ss);
 		events.push_back(insertEvent);
 		events.push_back(new SweepLineEvent(edgeSet, ss->getMaxX(), insertEvent, ss));
@@ -131,7 +131,7 @@ SimpleSweepLineIntersector::computeIntersections(SegmentIntersector *si)
 }
 
 void
-SimpleSweepLineIntersector::processOverlaps(int start,int end,SweepLineEvent *ev0,
+SimpleSweepLineIntersector::processOverlaps(size_t start, size_t end,SweepLineEvent *ev0,
 	SegmentIntersector *si)
 {
 
@@ -142,7 +142,7 @@ SimpleSweepLineIntersector::processOverlaps(int start,int end,SweepLineEvent *ev
 	 * include current insert event object in list of event objects to test.
 	 * Last index can be skipped, because it must be a Delete event.
  	 */
-	for(int i=start; i<end; ++i)
+	for(auto i = start; i < end; ++i)
 	{
 		SweepLineEvent *ev1=events[i];
 		if (ev1->isInsert())
diff --git a/src/geomgraph/index/SweepLineSegment.cpp b/src/geomgraph/index/SweepLineSegment.cpp
index e389f06..2a72b70 100644
--- a/src/geomgraph/index/SweepLineSegment.cpp
+++ b/src/geomgraph/index/SweepLineSegment.cpp
@@ -25,7 +25,7 @@ namespace geos {
 namespace geomgraph { // geos.geomgraph
 namespace index { // geos.geomgraph.index
 
-SweepLineSegment::SweepLineSegment(Edge *newEdge, int newPtIndex):
+SweepLineSegment::SweepLineSegment(Edge *newEdge, size_t newPtIndex):
 	edge(newEdge),
 	pts(newEdge->getCoordinates()),
 	ptIndex(newPtIndex)
diff --git a/src/index/chain/MonotoneChain.cpp b/src/index/chain/MonotoneChain.cpp
index ea2232d..3a9e689 100644
--- a/src/index/chain/MonotoneChain.cpp
+++ b/src/index/chain/MonotoneChain.cpp
@@ -92,14 +92,14 @@ MonotoneChain::computeSelect(const Envelope& searchEnv,
     if(end0-start0==1)
     {
         //Debug.println("computeSelect:"+p0+p1);
-        mcs.select(*this, static_cast<unsigned int>(start0));
+        mcs.select(*this, start0);
         return;
     }
     // nothing to do if the envelopes don't overlap
     if (!searchEnv.intersects(mcs.tempEnv1))
         return;
     // the chains overlap,so split each in half and iterate (binary search)
-    unsigned int mid= static_cast<unsigned int>((start0 + end0) / 2);
+    size_t mid = (start0 + end0) / 2;
 
     // Assert: mid != start or end (since we checked above for end-start <= 1)
     // check terminating conditions before recursing
diff --git a/src/index/chain/MonotoneChainSelectAction.cpp b/src/index/chain/MonotoneChainSelectAction.cpp
index 66ace46..ac505a1 100644
--- a/src/index/chain/MonotoneChainSelectAction.cpp
+++ b/src/index/chain/MonotoneChainSelectAction.cpp
@@ -28,7 +28,7 @@ namespace index { // geos.index
 namespace chain { // geos.index.chain
 
 void
-MonotoneChainSelectAction::select(MonotoneChain& mc, unsigned int start)
+MonotoneChainSelectAction::select(MonotoneChain& mc, size_t start)
 {
 	mc.getLineSegment(start, selectedSegment);
 
diff --git a/src/index/quadtree/NodeBase.cpp b/src/index/quadtree/NodeBase.cpp
index a492046..5d2a841 100644
--- a/src/index/quadtree/NodeBase.cpp
+++ b/src/index/quadtree/NodeBase.cpp
@@ -151,10 +151,10 @@ NodeBase::depth() const
 	return maxSubDepth + 1;
 }
 
-unsigned int
+size_t
 NodeBase::size() const
 {
-	unsigned int subSize=0;
+	size_t subSize = 0;
 	for(int i=0; i<4; i++)
 	{
 		if (subnode[i] != nullptr)
@@ -162,13 +162,13 @@ NodeBase::size() const
 			subSize += subnode[i]->size();
 		}
 	}
-	return subSize + static_cast<unsigned int>(items.size());
+	return subSize + items.size();
 }
 
-unsigned int
+size_t
 NodeBase::getNodeCount() const
 {
-	unsigned int subSize=0;
+	size_t subSize = 0;
 	for(int i=0; i<4; ++i)
 	{
 		if (subnode[i] != nullptr)
diff --git a/src/index/quadtree/Quadtree.cpp b/src/index/quadtree/Quadtree.cpp
index a58bdcf..e8e02ef 100644
--- a/src/index/quadtree/Quadtree.cpp
+++ b/src/index/quadtree/Quadtree.cpp
@@ -80,7 +80,7 @@ Quadtree::depth()
 }
 
 /*public*/
-int
+size_t
 Quadtree::size()
 {
 	return root.size();
diff --git a/src/index/strtree/AbstractNode.cpp b/src/index/strtree/AbstractNode.cpp
index 4000231..f0d64d9 100644
--- a/src/index/strtree/AbstractNode.cpp
+++ b/src/index/strtree/AbstractNode.cpp
@@ -30,7 +30,7 @@ namespace strtree { // geos.index.strtree
  * @param level 0 if this node is a leaf, 1 if a parent of a leaf, and so on;
  * the root node will have the highest level
  */
-AbstractNode::AbstractNode(int newLevel, int capacity) {
+AbstractNode::AbstractNode(int newLevel, size_t capacity) {
 	childBoundables.reserve(capacity);
 	bounds=nullptr;
 	level=newLevel;
diff --git a/src/index/strtree/SIRtree.cpp b/src/index/strtree/SIRtree.cpp
index b5a2cbd..3ba538f 100644
--- a/src/index/strtree/SIRtree.cpp
+++ b/src/index/strtree/SIRtree.cpp
@@ -86,7 +86,7 @@ SIRtree::~SIRtree() {
 
 class SIRAbstractNode: public AbstractNode {
 public:
-	SIRAbstractNode(int level, int capacity)
+	SIRAbstractNode(int level, size_t capacity)
 		:
 		AbstractNode(level, capacity)
 	{}
@@ -119,7 +119,7 @@ protected:
 AbstractNode*
 SIRtree::createNode(int level)
 {
-	AbstractNode *an = new SIRAbstractNode(level, static_cast<int>(nodeCapacity));
+	AbstractNode *an = new SIRAbstractNode(level, nodeCapacity);
 	nodes->push_back(an);
 	return an;
 }
diff --git a/src/index/strtree/STRtree.cpp b/src/index/strtree/STRtree.cpp
index b9f5e68..59d808c 100644
--- a/src/index/strtree/STRtree.cpp
+++ b/src/index/strtree/STRtree.cpp
@@ -277,7 +277,7 @@ std::pair<const void*, const void*> STRtree::nearestNeighbour(BoundablePair* ini
 class STRAbstractNode: public AbstractNode{
 public:
 
-	STRAbstractNode(int level, int capacity)
+	STRAbstractNode(int level, size_t capacity)
 		:
 		AbstractNode(level, capacity)
 	{}
@@ -314,7 +314,7 @@ protected:
 AbstractNode*
 STRtree::createNode(int level)
 {
-	AbstractNode *an = new STRAbstractNode(level, static_cast<int>(nodeCapacity));
+	AbstractNode *an = new STRAbstractNode(level, nodeCapacity);
 	nodes->push_back(an);
 	return an;
 }
diff --git a/src/index/sweepline/SweepLineEvent.cpp b/src/index/sweepline/SweepLineEvent.cpp
index f0c1b20..6e9aeb9 100644
--- a/src/index/sweepline/SweepLineEvent.cpp
+++ b/src/index/sweepline/SweepLineEvent.cpp
@@ -49,14 +49,14 @@ SweepLineEvent::getInsertEvent()
 	return insertEvent;
 }
 
-int
+size_t
 SweepLineEvent::getDeleteEventIndex()
 {
 	return deleteEventIndex;
 }
 
 void
-SweepLineEvent::setDeleteEventIndex(int newDeleteEventIndex)
+SweepLineEvent::setDeleteEventIndex(size_t newDeleteEventIndex)
 {
 	deleteEventIndex=newDeleteEventIndex;
 }
diff --git a/src/index/sweepline/SweepLineIndex.cpp b/src/index/sweepline/SweepLineIndex.cpp
index 89037da..33db463 100644
--- a/src/index/sweepline/SweepLineIndex.cpp
+++ b/src/index/sweepline/SweepLineIndex.cpp
@@ -62,7 +62,7 @@ SweepLineIndex::buildIndex()
             SweepLineEvent *ev=events[i];
             if (ev->isDelete())
             {
-                ev->getInsertEvent()->setDeleteEventIndex(static_cast<int>(i));
+                ev->getInsertEvent()->setDeleteEventIndex(i);
             }
         }
         indexBuilt = true;
@@ -77,12 +77,12 @@ SweepLineIndex::computeOverlaps(SweepLineOverlapAction *action)
     buildIndex();
 
     const std::vector<SweepLineEvent*>::size_type n=events.size();
-    for(std::vector<SweepLineEvent*>::size_type i=0; i<n; i++)
+    for(size_t i = 0; i < n; i++)
     {
         SweepLineEvent *ev=events[i];
         if (ev->isInsert())
         {
-            processOverlaps(static_cast<int>(i),
+            processOverlaps(i,
                 ev->getDeleteEventIndex(),
                 ev->getInterval(), action);
         }
@@ -90,7 +90,7 @@ SweepLineIndex::computeOverlaps(SweepLineOverlapAction *action)
 }
 
 void
-SweepLineIndex::processOverlaps(int start, int end,
+SweepLineIndex::processOverlaps(size_t start, size_t end,
 		SweepLineInterval *s0, SweepLineOverlapAction *action)
 {
 	/**
@@ -98,7 +98,7 @@ SweepLineIndex::processOverlaps(int start, int end,
 	 * include current insert event object in list of event objects to test.
 	 * Last index can be skipped, because it must be a Delete event.
 	 */
-	for(int i=start; i<end; i++)
+	for(auto i = start; i < end; i++)
 	{
 		SweepLineEvent *ev=events[i];
 		if (ev->isInsert()) {
diff --git a/src/io/WKBWriter.cpp b/src/io/WKBWriter.cpp
index 72c0aa8..dbc0d4c 100644
--- a/src/io/WKBWriter.cpp
+++ b/src/io/WKBWriter.cpp
@@ -283,11 +283,11 @@ WKBWriter::writeCoordinateSequence(const CoordinateSequence &cs,
 	if ( outputDimension > 2) is3d = true;
 
 	if (sized) writeInt(static_cast<int>(size));
-	for (std::size_t i=0; i<size; i++) writeCoordinate(cs, static_cast<int>(i), is3d);
+	for (std::size_t i = 0; i < size; i++) writeCoordinate(cs, i, is3d);
 }
 
 void
-WKBWriter::writeCoordinate(const CoordinateSequence &cs, int idx,
+WKBWriter::writeCoordinate(const CoordinateSequence &cs, size_t idx,
 	bool is3d)
 {
 #if DEBUG_WKB_WRITER
diff --git a/src/io/WKTWriter.cpp b/src/io/WKTWriter.cpp
index fae7135..a5cf1b0 100644
--- a/src/io/WKTWriter.cpp
+++ b/src/io/WKTWriter.cpp
@@ -77,7 +77,7 @@ WKTWriter::toLineString(const CoordinateSequence& seq)
 {
 	stringstream buf(ios_base::in|ios_base::out);
     buf << "LINESTRING ";
-	unsigned int npts = static_cast<unsigned int>(seq.getSize());
+	auto npts = seq.size();
 	if ( npts == 0 )
 	{
 		buf << "EMPTY";
@@ -85,7 +85,7 @@ WKTWriter::toLineString(const CoordinateSequence& seq)
 	else
 	{
 		buf << "(";
-		for (unsigned int i=0; i<npts; ++i)
+		for (size_t i = 0; i < npts; ++i)
 		{
 			if (i) buf << ", ";
 			buf << seq.getX(i) << " " << seq.getY(i);
@@ -360,7 +360,7 @@ WKTWriter::appendLineStringText(const LineString *lineString, int level,
 				writer->write(", ");
 				if (i%10==0) indent(level + 2, writer);
 			}
-			appendCoordinate(&(lineString->getCoordinateN(static_cast<int>(i))), writer);
+			appendCoordinate(&(lineString->getCoordinateN(i)), writer);
 		}
 		writer->write(")");
 	}
@@ -394,13 +394,11 @@ WKTWriter::appendMultiPointText(const MultiPoint *multiPoint,
 		writer->write("EMPTY");
 	} else {
 		writer->write("(");
-		for (unsigned int i=0, n=static_cast<unsigned int>(multiPoint->getNumGeometries());
-				i<n; i++)
+		for (size_t i = 0, n = multiPoint->getNumGeometries();
+				i < n; ++i)
 		{
-			if (i > 0)
-			{
-				writer->write(", ");
-			}
+			if (i > 0) writer->write(", ");
+
 			appendCoordinate(
 				dynamic_cast<const Point*>(multiPoint->getGeometryN(i))->getCoordinate(),
 				writer);
@@ -417,8 +415,8 @@ void WKTWriter::appendMultiLineStringText(const MultiLineString *multiLineString
 		int level2=level;
 		bool doIndent=indentFirst;
 		writer->write("(");
-		for (unsigned int i=0, n=static_cast<unsigned int>(multiLineString->getNumGeometries());
-				i<n; i++)
+		for (size_t i = 0, n = multiLineString->getNumGeometries();
+				i < n; ++i)
 		{
 			if (i>0) {
 				writer->write(", ");
@@ -441,8 +439,8 @@ void WKTWriter::appendMultiPolygonText(const MultiPolygon *multiPolygon, int lev
 		int level2=level;
 		bool doIndent=false;
 		writer->write("(");
-		for (unsigned int i=0, n=static_cast<unsigned int>(multiPolygon->getNumGeometries());
-				i < n; i++)
+		for (size_t i = 0, n = multiPolygon->getNumGeometries();
+				i < n; ++i)
 		{
 			if (i>0) {
 				writer->write(", ");
@@ -469,8 +467,8 @@ WKTWriter::appendGeometryCollectionText(
 	} else {
 		int level2=level;
 		writer->write("(");
-		for (unsigned int i=0, n=static_cast<unsigned int>(geometryCollection->getNumGeometries());
-				i < n ; ++i)
+		for (size_t i = 0, n = geometryCollection->getNumGeometries();
+				i < n; ++i)
 		{
 			if (i>0) {
 				writer->write(", ");
diff --git a/src/linearref/ExtractLineByLocation.cpp b/src/linearref/ExtractLineByLocation.cpp
index 0cc960c..11ec0e0 100644
--- a/src/linearref/ExtractLineByLocation.cpp
+++ b/src/linearref/ExtractLineByLocation.cpp
@@ -90,15 +90,15 @@ LineString* ExtractLineByLocation::computeLine(const LinearLocation& start, cons
 	CoordinateSequence* coordinates = line->getCoordinates();
 	CoordinateArraySequence newCoordinateArray;
 
-    const unsigned int indexStep = 1;
-	unsigned int startSegmentIndex = start.getSegmentIndex();
+    const size_t indexStep = 1;
+	auto startSegmentIndex = start.getSegmentIndex();
 
 	if (start.getSegmentFraction() > 0.0)
     {
 		startSegmentIndex += indexStep;
     }
 
-    unsigned int lastSegmentIndex = end.getSegmentIndex();
+    auto lastSegmentIndex = end.getSegmentIndex();
 	if (end.getSegmentFraction() == 1.0)
     {
 		lastSegmentIndex += indexStep;
@@ -107,7 +107,7 @@ LineString* ExtractLineByLocation::computeLine(const LinearLocation& start, cons
 	if (lastSegmentIndex >= coordinates->size())
     {
         assert(coordinates->size() > 0);
-        lastSegmentIndex = static_cast<unsigned int>(coordinates->size() - indexStep);
+        lastSegmentIndex = coordinates->size() - indexStep;
     }
 
 	if (! start.isVertex())
@@ -115,7 +115,7 @@ LineString* ExtractLineByLocation::computeLine(const LinearLocation& start, cons
 		newCoordinateArray.add(start.getCoordinate(line));
     }
 
-	for (unsigned int i = startSegmentIndex; i <= lastSegmentIndex; i++)
+	for (auto i = startSegmentIndex; i <= lastSegmentIndex; i++)
 	{
 		newCoordinateArray.add((*coordinates)[i]);
 	}
diff --git a/src/linearref/LengthLocationMap.cpp b/src/linearref/LengthLocationMap.cpp
index b3ef79d..c60fafe 100644
--- a/src/linearref/LengthLocationMap.cpp
+++ b/src/linearref/LengthLocationMap.cpp
@@ -97,8 +97,8 @@ LengthLocationMap::getLocationForward(double length) const
 		 */
 		if (it.isEndOfLine()) {
 			if (totalLength == length) {
-				unsigned int compIndex = it.getComponentIndex();
-				unsigned int segIndex = it.getVertexIndex();
+				auto compIndex = it.getComponentIndex();
+				auto segIndex = it.getVertexIndex();
 				return LinearLocation(compIndex, segIndex, 0.0);
 			}
 		}
@@ -110,8 +110,8 @@ LengthLocationMap::getLocationForward(double length) const
 			if (totalLength + segLen > length)
 			{
 				double frac = (length - totalLength) / segLen;
-				unsigned int compIndex = it.getComponentIndex();
-				unsigned int segIndex = it.getVertexIndex();
+				auto compIndex = it.getComponentIndex();
+				auto segIndex = it.getVertexIndex();
 				return LinearLocation(compIndex, segIndex, frac);
 			}
 			totalLength += segLen;
@@ -129,7 +129,7 @@ LengthLocationMap::resolveHigher(const LinearLocation& loc) const
 {
   if (! loc.isEndpoint(*linearGeom)) return loc;
 
-  unsigned int compIndex = loc.getComponentIndex();
+  auto compIndex = loc.getComponentIndex();
   // if last component can't resolve any higher
   if (compIndex >= linearGeom->getNumGeometries() - 1) return loc;
 
diff --git a/src/linearref/LinearIterator.cpp b/src/linearref/LinearIterator.cpp
index b7dd762..a1cd0b4 100644
--- a/src/linearref/LinearIterator.cpp
+++ b/src/linearref/LinearIterator.cpp
@@ -31,7 +31,7 @@ namespace geos
 namespace linearref   // geos.linearref
 {
 
-unsigned int LinearIterator::segmentEndVertexIndex(const LinearLocation& loc)
+size_t LinearIterator::segmentEndVertexIndex(const LinearLocation& loc)
 {
 	if (loc.getSegmentFraction() > 0.0)
 		return loc.getSegmentIndex() + 1;
@@ -42,7 +42,7 @@ LinearIterator::LinearIterator(const Geometry* linear) :
 		vertexIndex(0),
 		componentIndex(0),
 		linear(linear),
-		numLines(static_cast<unsigned int>(linear->getNumGeometries()))
+		numLines(linear->getNumGeometries())
 {
 	loadCurrentLine();
 }
@@ -52,16 +52,16 @@ LinearIterator::LinearIterator(const Geometry* linear, const LinearLocation& sta
 		vertexIndex(segmentEndVertexIndex(start)),
 		componentIndex(start.getComponentIndex()),
 		linear(linear),
-		numLines(static_cast<unsigned int>(linear->getNumGeometries()))
+		numLines(linear->getNumGeometries())
 {
 	loadCurrentLine();
 }
 
-LinearIterator::LinearIterator(const Geometry* linear, unsigned int componentIndex, unsigned int vertexIndex) :
+LinearIterator::LinearIterator(const Geometry* linear, size_t componentIndex, size_t vertexIndex) :
 		vertexIndex(vertexIndex),
 		componentIndex(componentIndex),
 		linear(linear),
-		numLines(static_cast<unsigned int>(linear->getNumGeometries()))
+		numLines(linear->getNumGeometries())
 {
 	loadCurrentLine();
 }
@@ -112,12 +112,12 @@ bool LinearIterator::isEndOfLine() const
 	return true;
 }
 
-unsigned int LinearIterator::getComponentIndex() const
+size_t LinearIterator::getComponentIndex() const
 {
 	return componentIndex;
 }
 
-unsigned int LinearIterator::getVertexIndex() const
+size_t LinearIterator::getVertexIndex() const
 {
 	return vertexIndex;
 }
diff --git a/src/linearref/LinearLocation.cpp b/src/linearref/LinearLocation.cpp
index fdcebb2..16bd4b3 100644
--- a/src/linearref/LinearLocation.cpp
+++ b/src/linearref/LinearLocation.cpp
@@ -56,7 +56,7 @@ LinearLocation::pointAlongSegmentByFraction(const Coordinate& p0, const Coordina
 }
 
 /* public */
-LinearLocation::LinearLocation(unsigned int segmentIndex,
+LinearLocation::LinearLocation(size_t segmentIndex,
 		double segmentFraction)
 	:
 	componentIndex(0),
@@ -66,8 +66,8 @@ LinearLocation::LinearLocation(unsigned int segmentIndex,
 
 
 /* public */
-LinearLocation::LinearLocation(unsigned int componentIndex,
-		unsigned int segmentIndex, double segmentFraction)
+LinearLocation::LinearLocation(size_t componentIndex,
+		size_t segmentIndex, double segmentFraction)
 	:
 	componentIndex(componentIndex),
 	segmentIndex(segmentIndex),
@@ -108,7 +108,7 @@ LinearLocation::clamp(const Geometry* linear)
 	if (segmentIndex >= linear->getNumPoints())
 	{
 		const LineString* line = dynamic_cast<const LineString*> (linear->getGeometryN(componentIndex));
-		segmentIndex = static_cast<unsigned int>(line->getNumPoints() - 1);
+		segmentIndex = line->getNumPoints() - 1;
 		segmentFraction = 1.0;
 	}
 }
@@ -139,9 +139,9 @@ LinearLocation::getSegmentLength(const Geometry* linearGeom) const
 	const LineString* lineComp = dynamic_cast<const LineString*> (linearGeom->getGeometryN(componentIndex));
 
 	// ensure segment index is valid
-	unsigned int segIndex = segmentIndex;
+	size_t segIndex = segmentIndex;
 	if (segmentIndex >= lineComp->getNumPoints() - 1)
-		segIndex = static_cast<unsigned int>(lineComp->getNumPoints() - 2);
+		segIndex = lineComp->getNumPoints() - 2;
 
 	Coordinate p0 = lineComp->getCoordinateN(segIndex);
 	Coordinate p1 = lineComp->getCoordinateN(segIndex + 1);
@@ -152,21 +152,21 @@ LinearLocation::getSegmentLength(const Geometry* linearGeom) const
 void
 LinearLocation::setToEnd(const Geometry* linear)
 {
-	componentIndex = static_cast<unsigned int>(linear->getNumGeometries() - 1);
+	componentIndex = linear->getNumGeometries() - 1;
 	const LineString* lastLine = dynamic_cast<const LineString*>(linear->getGeometryN(componentIndex));
-	segmentIndex = static_cast<unsigned int>(lastLine->getNumPoints() - 1);
+	segmentIndex = lastLine->getNumPoints() - 1;
 	segmentFraction = 1.0;
 }
 
 /* public */
-unsigned int
+size_t
 LinearLocation::getComponentIndex() const
 {
 	return componentIndex;
 }
 
 /* public */
-unsigned int
+size_t
 LinearLocation::getSegmentIndex() const
 {
 	return segmentIndex;
@@ -210,7 +210,7 @@ LinearLocation::getSegment(const Geometry* linearGeom) const
 	// check for endpoint - return last segment of the line if so
 	if (segmentIndex >= lineComp->getNumPoints() - 1)
 	{
-		Coordinate prev = lineComp->getCoordinateN(static_cast<int>(lineComp->getNumPoints() - 2));
+		Coordinate prev = lineComp->getCoordinateN(lineComp->getNumPoints() - 2);
 		return std::unique_ptr<LineSegment>(new LineSegment(prev, p0));
 	}
 	Coordinate p1 = lineComp->getCoordinateN(segmentIndex + 1);
@@ -254,8 +254,8 @@ LinearLocation::compareTo(const LinearLocation& other) const
 
 /* public */
 int
-LinearLocation::compareLocationValues(unsigned int componentIndex1,
-		unsigned int segmentIndex1, double segmentFraction1) const
+LinearLocation::compareLocationValues(size_t componentIndex1,
+		size_t segmentIndex1, double segmentFraction1) const
 {
 	// compare component indices
 	if (componentIndex < componentIndex1) return -1;
@@ -274,9 +274,9 @@ LinearLocation::compareLocationValues(unsigned int componentIndex1,
 /* public static */
 int
 LinearLocation::compareLocationValues(
-	unsigned int componentIndex0, unsigned int segmentIndex0,
+	size_t componentIndex0, size_t segmentIndex0,
 	double segmentFraction0,
-	unsigned int componentIndex1, unsigned int segmentIndex1,
+	size_t componentIndex1, size_t segmentIndex1,
 	double segmentFraction1)
 {
 	// compare component indices
diff --git a/src/linearref/LocationIndexOfLine.cpp b/src/linearref/LocationIndexOfLine.cpp
index f2c5240..7b00513 100644
--- a/src/linearref/LocationIndexOfLine.cpp
+++ b/src/linearref/LocationIndexOfLine.cpp
@@ -50,7 +50,7 @@ LocationIndexOfLine::indicesOf(const Geometry* subLine) const
 {
 	Coordinate startPt = dynamic_cast<const LineString*> (subLine->getGeometryN(0))->getCoordinateN(0);
 	const LineString* lastLine = dynamic_cast<const LineString*> (subLine->getGeometryN(subLine->getNumGeometries() - 1));
-	Coordinate endPt = lastLine->getCoordinateN(static_cast<int>(lastLine->getNumPoints() - 1));
+	Coordinate endPt = lastLine->getCoordinateN(lastLine->getNumPoints() - 1);
 
 	LocationIndexOfPoint locPt(linearGeom);
 	LinearLocation *subLineLoc = new LinearLocation[2];
diff --git a/src/linearref/LocationIndexOfPoint.cpp b/src/linearref/LocationIndexOfPoint.cpp
index 8ddf0dd..bed28d5 100644
--- a/src/linearref/LocationIndexOfPoint.cpp
+++ b/src/linearref/LocationIndexOfPoint.cpp
@@ -42,8 +42,8 @@ LocationIndexOfPoint::indexOfFromStart(const Coordinate& inputPt,
   const LinearLocation* minIndex) const
 {
 	double minDistance = numeric_limits<double>::max();
-	int minComponentIndex = 0;
-	int minSegmentIndex = 0;
+	size_t minComponentIndex = 0;
+	size_t minSegmentIndex = 0;
 	double minFrac = -1.0;
 
 	LineSegment seg;
@@ -57,8 +57,8 @@ LocationIndexOfPoint::indexOfFromStart(const Coordinate& inputPt,
 			double segDistance = seg.distance(inputPt);
 			double segFrac = seg.segmentFraction(inputPt);
 
-			int candidateComponentIndex = it.getComponentIndex();
-			int candidateSegmentIndex = it.getVertexIndex();
+			auto candidateComponentIndex = it.getComponentIndex();
+			auto candidateSegmentIndex = it.getVertexIndex();
 			if (segDistance < minDistance)
 			{
 				// ensure after minLocation, if any
diff --git a/src/noding/BasicSegmentString.cpp b/src/noding/BasicSegmentString.cpp
index 3e341ea..9717094 100644
--- a/src/noding/BasicSegmentString.cpp
+++ b/src/noding/BasicSegmentString.cpp
@@ -40,7 +40,7 @@ namespace noding { // geos.noding
 
 /*public*/
 int
-BasicSegmentString::getSegmentOctant(unsigned int index) const
+BasicSegmentString::getSegmentOctant(size_t index) const
 {
 	if (index >= size() - 1) return -1;
 	return Octant::octant(getCoordinate(index), getCoordinate(index+1));
@@ -48,7 +48,7 @@ BasicSegmentString::getSegmentOctant(unsigned int index) const
 
 /* virtual public */
 const geom::Coordinate&
-BasicSegmentString::getCoordinate(unsigned int i) const
+BasicSegmentString::getCoordinate(size_t i) const
 {
 	return pts->getAt(i);
 }
diff --git a/src/noding/IntersectionAdder.cpp b/src/noding/IntersectionAdder.cpp
index 35faa91..2288261 100644
--- a/src/noding/IntersectionAdder.cpp
+++ b/src/noding/IntersectionAdder.cpp
@@ -30,7 +30,7 @@ namespace noding { // geos.noding
 /*private*/
 bool
 IntersectionAdder::isTrivialIntersection(const SegmentString* e0,
-		int segIndex0, const SegmentString* e1, int segIndex1)
+		size_t segIndex0, const SegmentString* e1, size_t segIndex1)
 {
 	if (e0 != e1) return false;
 
@@ -40,7 +40,7 @@ IntersectionAdder::isTrivialIntersection(const SegmentString* e0,
 
 	if (! e0->isClosed()) return false;
 
-	int maxSegIndex = e0->size() - 1;
+	auto maxSegIndex = e0->size() - 1;
 	if ( (segIndex0 == 0 && segIndex1 == maxSegIndex)
 		||  (segIndex1 == 0 && segIndex0 == maxSegIndex) )
 	{
@@ -53,8 +53,8 @@ IntersectionAdder::isTrivialIntersection(const SegmentString* e0,
 /*public*/
 void
 IntersectionAdder::processIntersections(
-		SegmentString* e0,  int segIndex0,
-		SegmentString* e1,  int segIndex1)
+		SegmentString* e0,  size_t segIndex0,
+		SegmentString* e1,  size_t segIndex1)
 {
 	// don't bother intersecting a segment with itself
 	if (e0 == e1 && segIndex0 == segIndex1) return;
diff --git a/src/noding/IntersectionFinderAdder.cpp b/src/noding/IntersectionFinderAdder.cpp
index bf8f555..a777f39 100644
--- a/src/noding/IntersectionFinderAdder.cpp
+++ b/src/noding/IntersectionFinderAdder.cpp
@@ -31,8 +31,8 @@ namespace noding { // geos.noding
 
 void
 IntersectionFinderAdder::processIntersections(
-		SegmentString* e0,  int segIndex0,
-		SegmentString* e1,  int segIndex1)
+		SegmentString* e0,  size_t segIndex0,
+		SegmentString* e1,  size_t segIndex1)
 {
 	// don't bother intersecting a segment with itself
 	if (e0 == e1 && segIndex0 == segIndex1) return;
@@ -49,7 +49,7 @@ IntersectionFinderAdder::processIntersections(
 	{
 		if (li.isInteriorIntersection())
 		{
-			for (int intIndex=0, n=li.getIntersectionNum(); intIndex<n; intIndex++)
+			for (size_t intIndex = 0, n = li.getIntersectionNum(); intIndex < n; ++intIndex)
 			{
 				interiorIntersections.push_back(li.getIntersection(intIndex));
 			}
diff --git a/src/noding/MCIndexNoder.cpp b/src/noding/MCIndexNoder.cpp
index 9bcb2a8..aefae13 100644
--- a/src/noding/MCIndexNoder.cpp
+++ b/src/noding/MCIndexNoder.cpp
@@ -151,7 +151,7 @@ MCIndexNoder::SegmentOverlapAction::overlap(MonotoneChain& mc1, size_t start1,
 		);
 	assert(ss2);
 
-	si.processIntersections(ss1, static_cast<int>(start1), ss2, static_cast<int>(start2));
+	si.processIntersections(ss1, start1, ss2, start2);
 }
 
 
diff --git a/src/noding/MCIndexSegmentSetMutualIntersector.cpp b/src/noding/MCIndexSegmentSetMutualIntersector.cpp
index b04ba4c..e837b5c 100644
--- a/src/noding/MCIndexSegmentSetMutualIntersector.cpp
+++ b/src/noding/MCIndexSegmentSetMutualIntersector.cpp
@@ -167,7 +167,7 @@ MCIndexSegmentSetMutualIntersector::SegmentOverlapAction::overlap(
     SegmentString * ss1 = (SegmentString *)(mc1.getContext());
     SegmentString * ss2 = (SegmentString *)(mc2.getContext());
 
-    si.processIntersections(ss1, static_cast<int>(start1), ss2, static_cast<int>(start2));
+    si.processIntersections(ss1, start1, ss2, start2);
 }
 
 } // geos::noding
diff --git a/src/noding/NodedSegmentString.cpp b/src/noding/NodedSegmentString.cpp
index 693594f..712b722 100644
--- a/src/noding/NodedSegmentString.cpp
+++ b/src/noding/NodedSegmentString.cpp
@@ -52,7 +52,7 @@ NodedSegmentString::safeOctant(const Coordinate& p0, const Coordinate& p1)
 
 /*public*/
 int
-NodedSegmentString::getSegmentOctant(unsigned int index) const
+NodedSegmentString::getSegmentOctant(size_t index) const
 {
 	if (index >= size() - 1) return -1;
 	return safeOctant(getCoordinate(index), getCoordinate(index+1));
@@ -61,10 +61,10 @@ NodedSegmentString::getSegmentOctant(unsigned int index) const
 
 /*public*/
 void
-NodedSegmentString::addIntersections(LineIntersector *li, unsigned int
-		segmentIndex, int geomIndex)
+NodedSegmentString::addIntersections(LineIntersector *li,
+	 	size_t segmentIndex, size_t geomIndex)
 {
-	for (int i=0, n=li->getIntersectionNum(); i<n; ++i) {
+	for (size_t i = 0, n = li->getIntersectionNum(); i < n; ++i) {
 		addIntersection(li, segmentIndex, geomIndex, i);
 	}
 }
@@ -72,8 +72,8 @@ NodedSegmentString::addIntersections(LineIntersector *li, unsigned int
 /*public*/
 void
 NodedSegmentString::addIntersection(LineIntersector *li,
-		unsigned int segmentIndex,
-		int geomIndex, int intIndex)
+		size_t segmentIndex,
+		size_t geomIndex, size_t intIndex)
 {
     ::geos::ignore_unused_variable_warning(geomIndex);
 
@@ -84,9 +84,9 @@ NodedSegmentString::addIntersection(LineIntersector *li,
 /*public*/
 void
 NodedSegmentString::addIntersection(const Coordinate& intPt,
-	unsigned int segmentIndex)
+	size_t segmentIndex)
 {
-	unsigned int normalizedSegmentIndex = segmentIndex;
+	size_t normalizedSegmentIndex = segmentIndex;
 
 	if ( segmentIndex > size()-2 )
 	{
@@ -94,7 +94,7 @@ NodedSegmentString::addIntersection(const Coordinate& intPt,
 	}
 
 	// normalize the intersection point location
-	unsigned int nextSegIndex = normalizedSegmentIndex + 1;
+	auto nextSegIndex = normalizedSegmentIndex + 1;
 	if (nextSegIndex < size())
 	{
 		const Coordinate& nextPt = pts->getAt(nextSegIndex);
@@ -147,7 +147,7 @@ NodedSegmentString::getNodedSubstrings(
 
 /* virtual public */
 const geom::Coordinate&
-NodedSegmentString::getCoordinate(unsigned int i) const
+NodedSegmentString::getCoordinate(size_t i) const
 {
 	return pts->getAt(i);
 }
diff --git a/src/noding/NodingValidator.cpp b/src/noding/NodingValidator.cpp
index a230565..906294d 100644
--- a/src/noding/NodingValidator.cpp
+++ b/src/noding/NodingValidator.cpp
@@ -62,7 +62,7 @@ void
 NodingValidator::checkCollapses(const SegmentString& ss) const
 {
 	const CoordinateSequence& pts = *(ss.getCoordinates());
-	for (unsigned int i=0, n = static_cast<unsigned int>(pts.getSize() - 2); i < n; ++i)
+	for (size_t i = 0, n = pts.size() - 2; i < n; ++i)
 	{
 		checkCollapse(pts[i], pts[i + 1], pts[i + 2]);
 	}
@@ -108,8 +108,8 @@ NodingValidator::checkInteriorIntersections(const SegmentString& ss0,
 {
 	const CoordinateSequence& pts0 = *(ss0.getCoordinates());
 	const CoordinateSequence& pts1 = *(ss1.getCoordinates());
-	for (unsigned int i0=0, n0 = static_cast<unsigned int>(pts0.size()); i0 < n0 - 1; i0++) {
-		for (unsigned int i1=0, n1 = static_cast<unsigned int>(pts1.size()); i1 < n1 - 1; i1++) {
+	for (size_t i0 = 0, n0 = pts0.size(); i0 < n0 - 1; ++i0) {
+		for (size_t i1 = 0, n1 = pts1.size(); i1 < n1 - 1; ++i1) {
 			checkInteriorIntersections(ss0, i0, ss1, i1);
 		}
 	}
@@ -119,8 +119,8 @@ NodingValidator::checkInteriorIntersections(const SegmentString& ss0,
 /* private */
 void
 NodingValidator::checkInteriorIntersections(
-		const SegmentString& e0, unsigned int segIndex0,
-		const SegmentString& e1, unsigned int segIndex1)
+		const SegmentString& e0, size_t segIndex0,
+		const SegmentString& e1, size_t segIndex1)
 {
 	if (&e0 == &e1 && segIndex0 == segIndex1) return;
 	const Coordinate& p00 = e0.getCoordinates()->getAt(segIndex0);
@@ -171,7 +171,7 @@ NodingValidator::checkEndPtVertexIntersections(const Coordinate& testPt,
 	{
 		const SegmentString* ss0 = *it;
 		const CoordinateSequence& pts = *(ss0->getCoordinates());
-		for (unsigned int j=1, n=static_cast<unsigned int>(pts.size()-1); j < n; ++j)
+		for (size_t j = 1, n=pts.size() - 1; j < n; ++j)
 		{
 			if (pts[j].equals(testPt))
 			{
@@ -193,7 +193,7 @@ bool
 NodingValidator::hasInteriorIntersection(const LineIntersector& aLi,
 		const Coordinate& p0, const Coordinate& p1) const
 {
-	for (int i=0, n=aLi.getIntersectionNum(); i<n; i++)
+	for (size_t i=0, n = aLi.getIntersectionNum(); i < n; ++i)
 	{
 		const Coordinate &intPt=aLi.getIntersection(i);
 		if (!(intPt==p0 || intPt==p1))
diff --git a/src/noding/SegmentIntersectionDetector.cpp b/src/noding/SegmentIntersectionDetector.cpp
index b4800e6..e7fd399 100644
--- a/src/noding/SegmentIntersectionDetector.cpp
+++ b/src/noding/SegmentIntersectionDetector.cpp
@@ -29,8 +29,8 @@ namespace noding { // geos::noding
 void
 SegmentIntersectionDetector::
 processIntersections(
-	noding::SegmentString * e0, int segIndex0,
-	noding::SegmentString * e1, int segIndex1 )
+	noding::SegmentString * e0, size_t segIndex0,
+	noding::SegmentString * e1, size_t segIndex1 )
 {
 	// don't bother intersecting a segment with itself
 	if (e0 == e1 && segIndex0 == segIndex1) return;
diff --git a/src/noding/SegmentNode.cpp b/src/noding/SegmentNode.cpp
index eb27ae5..5d3bbce 100644
--- a/src/noding/SegmentNode.cpp
+++ b/src/noding/SegmentNode.cpp
@@ -39,7 +39,7 @@ namespace noding { // geos.noding
 
 /*public*/
 SegmentNode::SegmentNode(const NodedSegmentString& ss, const Coordinate& nCoord,
-		unsigned int nSegmentIndex, int nSegmentOctant)
+		size_t nSegmentIndex, int nSegmentOctant)
 	:
 	segString(ss),
 	segmentOctant(nSegmentOctant),
diff --git a/src/noding/SegmentNodeList.cpp b/src/noding/SegmentNodeList.cpp
index 59a13da..1799a84 100644
--- a/src/noding/SegmentNodeList.cpp
+++ b/src/noding/SegmentNodeList.cpp
@@ -60,8 +60,8 @@ SegmentNodeList::~SegmentNodeList()
 SegmentNode*
 SegmentNodeList::add(const Coordinate& intPt, size_t segmentIndex)
 {
-	SegmentNode *eiNew=new SegmentNode(edge, intPt, static_cast<unsigned int>(segmentIndex),
-			edge.getSegmentOctant(static_cast<unsigned int>(segmentIndex)));
+	SegmentNode *eiNew=new SegmentNode(edge, intPt, segmentIndex,
+			edge.getSegmentOctant(segmentIndex));
 
 	std::pair<SegmentNodeList::iterator,bool> p = nodeMap.insert(eiNew);
 	if ( p.second ) { // new SegmentNode inserted
@@ -78,7 +78,7 @@ SegmentNodeList::add(const Coordinate& intPt, size_t segmentIndex)
 
 void SegmentNodeList::addEndpoints()
 {
-	int maxSegIndex = edge.size() - 1;
+	size_t maxSegIndex = edge.size() - 1;
 	add(&(edge.getCoordinate(0)), 0);
 	add(&(edge.getCoordinate(maxSegIndex)), maxSegIndex);
 }
@@ -98,7 +98,7 @@ SegmentNodeList::addCollapsedNodes()
 			e=collapsedVertexIndexes.end();
 		i != e; ++i)
 	{
-		auto vertexIndex = static_cast<unsigned int>(*i);
+		auto vertexIndex = *i;
 		add(edge.getCoordinate(vertexIndex), vertexIndex);
 	}
 }
@@ -113,8 +113,8 @@ SegmentNodeList::findCollapsesFromExistingVertices(
 
 	for (size_t i=0, n=edge.size()-2; i<n; ++i)
 	{
-		const Coordinate& p0 = edge.getCoordinate(static_cast<unsigned int>(i));
-		const Coordinate& p2 = edge.getCoordinate(static_cast<unsigned int>(i + 2));
+		const Coordinate& p0 = edge.getCoordinate(i);
+		const Coordinate& p2 = edge.getCoordinate(i + 2);
 		if (p0.equals2D(p2)) {
 			// add base of collapse as node
 			collapsedVertexIndexes.push_back(i + 1);
@@ -151,10 +151,11 @@ bool
 SegmentNodeList::findCollapseIndex(SegmentNode& ei0, SegmentNode& ei1,
 		size_t& collapsedVertexIndex)
 {
+	assert(ei1.segmentIndex >= ei0.segmentIndex);
 	// only looking for equal nodes
 	if (! ei0.coord.equals2D(ei1.coord)) return false;
 
-	int numVerticesBetween = ei1.segmentIndex - ei0.segmentIndex;
+	auto numVerticesBetween = ei1.segmentIndex - ei0.segmentIndex;
 	if (! ei1.isInterior()) {
 		numVerticesBetween--;
 	}
@@ -271,7 +272,7 @@ SegmentNodeList::createSplitEdge(SegmentNode *ei0, SegmentNode *ei1)
 	pts->setAt(ei0->coord, ipt++);
 	for (size_t i=ei0->segmentIndex+1; i<=ei1->segmentIndex; i++)
 	{
-		pts->setAt(edge.getCoordinate(static_cast<unsigned int>(i)),ipt++);
+		pts->setAt(edge.getCoordinate(i),ipt++);
 	}
 	if (useIntPt1) 	pts->setAt(ei1->coord, ipt++);
 
diff --git a/src/noding/SimpleNoder.cpp b/src/noding/SimpleNoder.cpp
index 77c501b..8bc6fb5 100644
--- a/src/noding/SimpleNoder.cpp
+++ b/src/noding/SimpleNoder.cpp
@@ -35,8 +35,8 @@ SimpleNoder::computeIntersects(SegmentString* e0, SegmentString* e1)
 
 	const CoordinateSequence* pts0 = e0->getCoordinates();
 	const CoordinateSequence* pts1 = e1->getCoordinates();
-	for (unsigned int i0=0, n0=static_cast<unsigned int>(pts0->getSize()-1); i0<n0; i0++) {
-		for (unsigned int i1=0, n1=static_cast<unsigned int>(pts1->getSize()-1); i1<n1; i1++) {
+	for (size_t i0=0, n0 = pts0->getSize() - 1; i0 < n0; i0++) {
+		for (size_t i1=0, n1 = pts1->getSize() - 1; i1 < n1; i1++) {
 			segInt->processIntersections(e0, i0, e1, i1);
 		}
 	}
diff --git a/src/noding/SingleInteriorIntersectionFinder.cpp b/src/noding/SingleInteriorIntersectionFinder.cpp
index a7798a4..e735ea0 100644
--- a/src/noding/SingleInteriorIntersectionFinder.cpp
+++ b/src/noding/SingleInteriorIntersectionFinder.cpp
@@ -29,8 +29,8 @@ namespace noding { // geos.noding
 /*public (override) */
 void
 SingleInteriorIntersectionFinder::processIntersections(
-	SegmentString* e0,  int segIndex0,
-	SegmentString* e1,  int segIndex1)
+	SegmentString* e0,  size_t segIndex0,
+	SegmentString* e1,  size_t segIndex1)
 {
 	using geos::geom::Coordinate;
 
diff --git a/src/noding/snapround/HotPixel.cpp b/src/noding/snapround/HotPixel.cpp
index a1f75eb..bc7156d 100644
--- a/src/noding/snapround/HotPixel.cpp
+++ b/src/noding/snapround/HotPixel.cpp
@@ -174,13 +174,13 @@ HotPixel::intersectsPixelClosure(const Coordinate& p0,
 bool
 HotPixel::addSnappedNode(NodedSegmentString& segStr, size_t segIndex)
 {
-	const Coordinate& p0 = segStr.getCoordinate(static_cast<unsigned int>(segIndex));
-	const Coordinate& p1 = segStr.getCoordinate(static_cast<unsigned int>(segIndex + 1));
+	const Coordinate& p0 = segStr.getCoordinate(segIndex);
+	const Coordinate& p1 = segStr.getCoordinate(segIndex + 1);
 
 	if (intersects(p0, p1))
 	{
 		//cout << "snapped: " <<  snapPt << endl;
-		segStr.addIntersection(getCoordinate(), static_cast<unsigned int>(segIndex));
+		segStr.addIntersection(getCoordinate(), segIndex);
 		return true;
 	}
 	return false;
diff --git a/src/noding/snapround/MCIndexPointSnapper.cpp b/src/noding/snapround/MCIndexPointSnapper.cpp
index cf3e050..accfd94 100644
--- a/src/noding/snapround/MCIndexPointSnapper.cpp
+++ b/src/noding/snapround/MCIndexPointSnapper.cpp
@@ -42,7 +42,7 @@ public:
 
 	HotPixelSnapAction(HotPixel& nHotPixel,
 			SegmentString* nParentEdge,
-			unsigned int nVertexIndex)
+			size_t nVertexIndex)
 		:
 		MonotoneChainSelectAction(),
 		hotPixel(nHotPixel),
@@ -53,7 +53,7 @@ public:
 
 	bool isNodeAdded() const { return isNodeAddedVar; }
 
-	void select(chain::MonotoneChain& mc, unsigned int startIndex) override
+	void select(chain::MonotoneChain& mc, size_t startIndex) override
 	{
 		// This is casting away 'constness'!
 		NodedSegmentString& ss = *(static_cast<NodedSegmentString*>(mc.getContext()));
@@ -76,7 +76,7 @@ public:
 private:
 	HotPixel& hotPixel;
 	SegmentString* parentEdge;
-	unsigned int vertexIndex;
+	size_t vertexIndex;
 	bool isNodeAddedVar;
 
     // Declare type as noncopyable
@@ -114,7 +114,7 @@ private:
 bool
 MCIndexPointSnapper::snap(HotPixel& hotPixel,
 		SegmentString* parentEdge,
-		unsigned int vertexIndex)
+		size_t vertexIndex)
 {
 	const Envelope& pixelEnv = hotPixel.getSafeEnvelope();
 	HotPixelSnapAction hotPixelSnapAction(hotPixel, parentEdge, vertexIndex);
diff --git a/src/noding/snapround/MCIndexSnapRounder.cpp b/src/noding/snapround/MCIndexSnapRounder.cpp
index 7075f11..b756c1b 100644
--- a/src/noding/snapround/MCIndexSnapRounder.cpp
+++ b/src/noding/snapround/MCIndexSnapRounder.cpp
@@ -69,7 +69,7 @@ void
 MCIndexSnapRounder::computeVertexSnaps(NodedSegmentString* e)
 {
 	CoordinateSequence& pts0 = *(e->getCoordinates());
-	for (unsigned int i=0, n=static_cast<unsigned int>(pts0.size()-1); i<n; ++i)
+	for (size_t i = 0, n = pts0.size() - 1; i < n; ++i)
 	{
 		HotPixel hotPixel(pts0[i], scaleFactor, li);
 		bool isNodeAdded = pointSnapper->snap(hotPixel, e, i);
diff --git a/src/noding/snapround/SimpleSnapRounder.cpp b/src/noding/snapround/SimpleSnapRounder.cpp
index 716bc0b..ba3ff60 100644
--- a/src/noding/snapround/SimpleSnapRounder.cpp
+++ b/src/noding/snapround/SimpleSnapRounder.cpp
@@ -136,7 +136,7 @@ SimpleSnapRounder::computeSnaps(NodedSegmentString* ss, vector<Coordinate>& snap
 	{
 		const Coordinate& snapPt = *it;
 		HotPixel hotPixel(snapPt, scaleFactor, li);
-		for (int i=0, n=ss->size()-1; i<n; ++i) {
+		for (size_t i = 0, n = ss->size() - 1; i < n; ++i) {
 			hotPixel.addSnappedNode(*ss, i);
 		}
 	}
@@ -149,12 +149,12 @@ SimpleSnapRounder::computeVertexSnaps(NodedSegmentString* e0, NodedSegmentString
 	const CoordinateSequence* pts0 = e0->getCoordinates();
 	const CoordinateSequence* pts1 = e1->getCoordinates();
 
-	for (unsigned int i0=0, n0=static_cast<unsigned int>(pts0->getSize()-1); i0<n0; i0++)
+	for (size_t i0 = 0, n0 = pts0->getSize() - 1; i0 < n0; ++i0)
 	{
 		const Coordinate& p0 = pts0->getAt(i0);
 
 		HotPixel hotPixel(p0, scaleFactor, li);
-		for (unsigned int i1=1, n1=static_cast<unsigned int>(pts1->getSize()-1); i1<n1; i1++)
+		for (size_t i1 = 1, n1 = pts1->getSize()-1; i1 < n1; ++i1)
 		{
         		// don't snap a vertex to itself
 			if (i0 == i1 && e0 == e1) {
diff --git a/src/operation/IsSimpleOp.cpp b/src/operation/IsSimpleOp.cpp
index 7ae0038..520f751 100644
--- a/src/operation/IsSimpleOp.cpp
+++ b/src/operation/IsSimpleOp.cpp
@@ -200,7 +200,7 @@ IsSimpleOp::hasNonEndpointIntersection(GeometryGraph &graph)
 	vector<Edge*> *edges=graph.getEdges();
 	for (vector<Edge*>::iterator i=edges->begin();i<edges->end();i++) {
 		Edge *e=*i;
-		int maxSegmentIndex=e->getMaximumSegmentIndex();
+		auto maxSegmentIndex = e->getMaximumSegmentIndex();
 		EdgeIntersectionList &eiL=e->getEdgeIntersectionList();
 		for ( EdgeIntersectionList::iterator eiIt=eiL.begin(),
 			eiEnd=eiL.end(); eiIt!=eiEnd; ++eiIt )
diff --git a/src/operation/buffer/BufferInputLineSimplifier.cpp b/src/operation/buffer/BufferInputLineSimplifier.cpp
index bc56c29..6b9d147 100644
--- a/src/operation/buffer/BufferInputLineSimplifier.cpp
+++ b/src/operation/buffer/BufferInputLineSimplifier.cpp
@@ -79,10 +79,10 @@ BufferInputLineSimplifier::deleteShallowConcavities()
 	 * Do not simplify end line segments of the line string.
 	 * This ensures that end caps are generated consistently.
 	 */
-	unsigned int index = 1;
+	size_t index = 1;
 
-	unsigned int midIndex = findNextNonDeletedIndex(index);
-	unsigned int lastIndex = findNextNonDeletedIndex(midIndex);
+	auto midIndex = findNextNonDeletedIndex(index);
+	auto lastIndex = findNextNonDeletedIndex(midIndex);
 
 	bool isChanged = false;
 	while (lastIndex < inputLine.size())
@@ -109,14 +109,14 @@ BufferInputLineSimplifier::deleteShallowConcavities()
 }
 
 /* private */
-unsigned int
-BufferInputLineSimplifier::findNextNonDeletedIndex(unsigned int index) const
+size_t
+BufferInputLineSimplifier::findNextNonDeletedIndex(size_t index) const
 {
 	std::size_t next = index + 1;
 	const std::size_t len = inputLine.size();
 	while (next < len && isDeleted[next] == DELETE)
 		next++;
-	return static_cast<unsigned int>(next);
+	return next;
 }
 
 /* private */
@@ -137,7 +137,7 @@ BufferInputLineSimplifier::collapseLine() const
 
 /* private */
 bool
-BufferInputLineSimplifier::isDeletable(int i0, int i1, int i2,
+BufferInputLineSimplifier::isDeletable(size_t i0, size_t i1, size_t i2,
                                        double distanceTol) const
 {
 	const Coordinate& p0 = inputLine[i0];
@@ -173,14 +173,14 @@ BufferInputLineSimplifier::isShallowConcavity(const geom::Coordinate& p0,
 bool
 BufferInputLineSimplifier::isShallowSampled(const geom::Coordinate& p0,
                                             const geom::Coordinate& p2,
-                                            int i0, int i2,
+                                            size_t i0, size_t i2,
                                             double distanceTol) const
 {
 	// check every n'th point to see if it is within tolerance
-	int inc = (i2 - i0) / NUM_PTS_TO_CHECK;
+	auto inc = (i2 - i0) / NUM_PTS_TO_CHECK;
 	if (inc <= 0) inc = 1;
 
-	for (int i = i0; i < i2; i += inc) {
+	for (size_t i = i0; i < i2; i += inc) {
 		if (! isShallow(p0, p2, inputLine[i], distanceTol))
 			return false;
 	}
diff --git a/src/operation/buffer/OffsetCurveBuilder.cpp b/src/operation/buffer/OffsetCurveBuilder.cpp
index c3f1804..a9cd15f 100644
--- a/src/operation/buffer/OffsetCurveBuilder.cpp
+++ b/src/operation/buffer/OffsetCurveBuilder.cpp
@@ -128,12 +128,12 @@ OffsetCurveBuilder::getSingleSidedLineCurve(const CoordinateSequence* inputPts,
     const CoordinateSequence& simp1 = *simp1_;
 
 
-    int n1 = static_cast<int>(simp1.size()) - 1;
+    auto n1 = simp1.size() - 1;
     if ( ! n1 )
       throw util::IllegalArgumentException("Cannot get offset of single-vertex line");
     segGen->initSideSegments(simp1[0], simp1[1], Position::LEFT);
     segGen->addFirstSegment();
-    for (int i = 2; i <= n1; ++i) {
+    for (size_t i = 2; i <= n1; ++i) {
       segGen->addNextSegment(simp1[i], true);
     }
     segGen->addLastSegment();
@@ -147,13 +147,13 @@ OffsetCurveBuilder::getSingleSidedLineCurve(const CoordinateSequence* inputPts,
       BufferInputLineSimplifier::simplify( *inputPts, -distTol );
     const CoordinateSequence& simp2 = *simp2_;
 
-    int n2 = static_cast<int>(simp2.size()) - 1;
+    auto n2 = simp2.size() - 1;
     if ( ! n2 )
       throw util::IllegalArgumentException("Cannot get offset of single-vertex line");
     segGen->initSideSegments(simp2[n2], simp2[n2-1], Position::LEFT);
     segGen->addFirstSegment();
-    for (int i = n2-2; i >= 0; --i) {
-      segGen->addNextSegment(simp2[i], true);
+    for (size_t i = n2 - 1; i > 0; --i) {
+      segGen->addNextSegment(simp2[i - 1], true);
     }
     segGen->addLastSegment();
   }
@@ -207,9 +207,9 @@ OffsetCurveBuilder::computeLineBufferCurve(const CoordinateSequence& inputPts,
 	const CoordinateSequence& simp1 = *simp1_;
 
 
-	int n1 = static_cast<int>(simp1.size()) - 1;
+	auto n1 = simp1.size() - 1;
 	segGen.initSideSegments(simp1[0], simp1[1], Position::LEFT);
-	for (int i = 2; i <= n1; ++i) {
+	for (size_t i = 2; i <= n1; ++i) {
 		segGen.addNextSegment(simp1[i], true);
 	}
 	segGen.addLastSegment();
@@ -222,10 +222,10 @@ OffsetCurveBuilder::computeLineBufferCurve(const CoordinateSequence& inputPts,
 		BufferInputLineSimplifier::simplify(inputPts, -distTol);
 	const CoordinateSequence& simp2 = *simp2_;
 
-	int n2 = static_cast<int>(simp2.size()) - 1;
+	auto n2 = simp2.size() - 1;
 	segGen.initSideSegments(simp2[n2], simp2[n2-1], Position::LEFT);
-	for (int i = n2-2; i >= 0; --i) {
-		segGen.addNextSegment(simp2[i], true);
+	for (size_t i = n2 - 1; i > 0; --i) {
+		segGen.addNextSegment(simp2[i - 1], true);
 	}
 	segGen.addLastSegment();
 	// add line cap for start of line
@@ -248,9 +248,9 @@ OffsetCurveBuilder::computeRingBufferCurve(const CoordinateSequence& inputPts,
 		BufferInputLineSimplifier::simplify(inputPts, distTol);
 	const CoordinateSequence& simp = *simp_;
 
-	int n = static_cast<int>(simp.size())-1;
+	auto n = simp.size() - 1;
 	segGen.initSideSegments(simp[n-1], simp[0], side);
-	for (int i = 1; i <= n; i++) {
+	for (size_t i = 1; i <= n; i++) {
 		bool addStartPoint = i != 1;
 		segGen.addNextSegment(simp[i], addStartPoint);
 	}
@@ -276,11 +276,11 @@ OffsetCurveBuilder::computeSingleSidedBufferCurve(
       BufferInputLineSimplifier::simplify(inputPts, -distTol);
     const CoordinateSequence& simp2 = *simp2_;
 
-    int n2 = static_cast<int>(simp2.size()) - 1;
+    auto n2 = simp2.size() - 1;
     segGen.initSideSegments(simp2[n2], simp2[n2-1], Position::LEFT);
     segGen.addFirstSegment();
-    for (int i = n2-2; i >= 0; --i) {
-      segGen.addNextSegment(simp2[i], true);
+    for (size_t  i = n2 - 1; i > 0; --i) {
+      segGen.addNextSegment(simp2[i - 1], true);
     }
 
   } else {
@@ -294,10 +294,10 @@ OffsetCurveBuilder::computeSingleSidedBufferCurve(
       BufferInputLineSimplifier::simplify(inputPts, distTol);
     const CoordinateSequence& simp1 = *simp1_;
 
-    int n1 = static_cast<int>(simp1.size()) - 1;
+    auto n1 = simp1.size() - 1;
     segGen.initSideSegments(simp1[0], simp1[1], Position::LEFT);
     segGen.addFirstSegment();
-    for (int i = 2; i <= n1; ++i) {
+    for (size_t i = 2; i <= n1; ++i) {
       segGen.addNextSegment(simp1[i], true);
     }
 
diff --git a/src/operation/buffer/OffsetCurveSetBuilder.cpp b/src/operation/buffer/OffsetCurveSetBuilder.cpp
index 6fe3572..f384d42 100644
--- a/src/operation/buffer/OffsetCurveSetBuilder.cpp
+++ b/src/operation/buffer/OffsetCurveSetBuilder.cpp
@@ -172,7 +172,7 @@ OffsetCurveSetBuilder::add(const Geometry& g)
 void
 OffsetCurveSetBuilder::addCollection(const GeometryCollection *gc)
 {
-	for (int i=0, n=static_cast<int>(gc->getNumGeometries()); i<n; i++) {
+	for (size_t i = 0, n = gc->getNumGeometries(); i < n; i++) {
 		const Geometry *g=gc->getGeometryN(i);
 		add(*g);
 	}
diff --git a/src/operation/buffer/OffsetSegmentGenerator.cpp b/src/operation/buffer/OffsetSegmentGenerator.cpp
index 523b003..b67e177 100644
--- a/src/operation/buffer/OffsetSegmentGenerator.cpp
+++ b/src/operation/buffer/OffsetSegmentGenerator.cpp
@@ -324,7 +324,7 @@ OffsetSegmentGenerator::addCollinear(bool addStartPoint)
    */
 
   li.computeIntersection(s0,s1,s1,s2);
-  int numInt=li.getIntersectionNum();
+  auto numInt = li.getIntersectionNum();
 
   /**
    * if numInt is<2, the lines are parallel and in the same direction.
diff --git a/src/operation/buffer/SubgraphDepthLocater.cpp b/src/operation/buffer/SubgraphDepthLocater.cpp
index 5229f5c..51c23e7 100644
--- a/src/operation/buffer/SubgraphDepthLocater.cpp
+++ b/src/operation/buffer/SubgraphDepthLocater.cpp
@@ -234,8 +234,8 @@ SubgraphDepthLocater::findStabbedSegments(
 //
 #define SKIP_LS 1
 
-	int n = static_cast<int>(pts->getSize())-1;
-	for (int i=0; i<n; ++i) {
+	auto n = pts->getSize() - 1;
+	for (size_t i = 0; i < n; ++i) {
 #ifndef SKIP_LS
 		seg.p0=pts->getAt(i);
 		seg.p1=pts->getAt(i + 1);
diff --git a/src/operation/distance/DistanceOp.cpp b/src/operation/distance/DistanceOp.cpp
index f365633..0a62068 100644
--- a/src/operation/distance/DistanceOp.cpp
+++ b/src/operation/distance/DistanceOp.cpp
@@ -569,9 +569,9 @@ DistanceOp::computeMinDistance(
 				delete closestPt;
 
 				delete locGeom[0];
-				locGeom[0] = new GeometryLocation(line0, static_cast<int>(i), *c1);
+				locGeom[0] = new GeometryLocation(line0, i, *c1);
 				delete locGeom[1];
-				locGeom[1] = new GeometryLocation(line1, static_cast<int>(j), *c2);
+				locGeom[1] = new GeometryLocation(line1, j, *c2);
 			}
 			if (minDistance<=terminateDistance) return;
 		}
@@ -607,7 +607,7 @@ DistanceOp::computeMinDistance(const LineString *line,
 			seg.closestPoint(*coord, segClosestPoint);
 
 			delete locGeom[0];
-			locGeom[0] = new GeometryLocation(line, static_cast<int>(i), segClosestPoint);
+			locGeom[0] = new GeometryLocation(line, i, segClosestPoint);
 			delete locGeom[1];
 			locGeom[1] = new GeometryLocation(pt, 0, *coord);
         	}
diff --git a/src/operation/distance/GeometryLocation.cpp b/src/operation/distance/GeometryLocation.cpp
index 4aef6f6..4a8116c 100644
--- a/src/operation/distance/GeometryLocation.cpp
+++ b/src/operation/distance/GeometryLocation.cpp
@@ -29,10 +29,11 @@ namespace distance { // geos.operation.distance
 * Constructs a GeometryLocation specifying a point on a geometry, as well as the
 * segment that the point is on (or INSIDE_AREA if the point is not on a segment).
 */
-GeometryLocation::GeometryLocation(const Geometry *newComponent, int newSegIndex, const Coordinate &newPt)
+GeometryLocation::GeometryLocation(const Geometry *newComponent, size_t newSegIndex, const Coordinate &newPt)
 {
 	component = newComponent;
 	segIndex = newSegIndex;
+	inside_area = false;
 	pt = newPt;
 }
 
@@ -42,6 +43,7 @@ GeometryLocation::GeometryLocation(const Geometry *newComponent, int newSegIndex
 GeometryLocation::GeometryLocation(const Geometry *newComponent, const Coordinate &newPt)
 {
 	component = newComponent;
+	inside_area = true;
 	segIndex = INSIDE_AREA;
 	pt = newPt;
 }
@@ -58,7 +60,7 @@ const Geometry* GeometryLocation::getGeometryComponent() {
 *
 * @return the segment index for the location, or INSIDE_AREA
 */
-int
+size_t
 GeometryLocation::getSegmentIndex()
 {
 	return segIndex;
@@ -73,7 +75,7 @@ GeometryLocation::getCoordinate()
 }
 
 bool GeometryLocation::isInsideArea() {
-	return segIndex == INSIDE_AREA;
+	return inside_area;
 }
 
 } // namespace geos.operation.distance
diff --git a/src/operation/intersection/RectangleIntersection.cpp b/src/operation/intersection/RectangleIntersection.cpp
index 04f5615..aba0408 100644
--- a/src/operation/intersection/RectangleIntersection.cpp
+++ b/src/operation/intersection/RectangleIntersection.cpp
@@ -126,7 +126,7 @@ RectangleIntersection::clip_linestring_parts(const geom::LineString * gi,
 {
   using namespace geos::geom;
 
-  int n = static_cast<int>(gi->getNumPoints());
+  auto n = gi->getNumPoints();
 
   if(gi == nullptr || n<1)
 	return false;
@@ -148,7 +148,7 @@ RectangleIntersection::clip_linestring_parts(const geom::LineString * gi,
 
   // Start iterating
 
-  int i = 0;
+  size_t i = 0;
 
   while(i<n)
 	{
@@ -257,7 +257,7 @@ RectangleIntersection::clip_linestring_parts(const geom::LineString * gi,
 		  // outside. We may have to output partial linestrings
 		  // while iterating until we go strictly outside
 
-		  int start_index = i;			// 1st valid original point
+		  auto start_index = i;			// 1st valid original point
 		  bool go_outside = false;
 
 		  while(!go_outside && ++i<n)
@@ -423,7 +423,7 @@ RectangleIntersection::clip_polygon_to_linestrings(const geom::Polygon * g,
   // - Clipped ones become linestrings
   // - Intact ones become new polygons without holes
 
-  for(int i=0, n= static_cast<int>(g->getNumInteriorRing()); i<n; ++i)
+  for(size_t i = 0, n = g->getNumInteriorRing(); i < n; ++i)
 	{
 	  if(clip_linestring_parts(g->getInteriorRingN(i), parts, rect))
 		{
@@ -499,7 +499,7 @@ RectangleIntersection::clip_polygon_to_polygons(const geom::Polygon * g,
   // - Intact ones become holes in new polygons formed by exterior parts
 
 
-  for(int i=0, n = static_cast<int>(g->getNumInteriorRing()); i<n; ++i)
+  for(size_t i = 0, n = g->getNumInteriorRing(); i < n; ++i)
 	{
 	  RectangleIntersectionBuilder holeparts(*_gf);
     const LineString *hole = g->getInteriorRingN(i);
@@ -584,7 +584,7 @@ RectangleIntersection::clip_multipoint(const geom::MultiPoint * g,
 {
   if(g == nullptr || g->isEmpty())
 	return;
-  for(int i=0, n=static_cast<int>(g->getNumGeometries()); i<n; ++i)
+  for(size_t i = 0, n = g->getNumGeometries(); i < n; ++i)
 	{
 	  clip_point(dynamic_cast<const geom::Point *>(g->getGeometryN(i)),
 				 parts, rect);
@@ -599,7 +599,7 @@ RectangleIntersection::clip_multilinestring(const geom::MultiLineString * g,
   if(g == nullptr || g->isEmpty())
 	return;
 
-  for(int i=0, n = static_cast<int>(g->getNumGeometries()); i<n; ++i)
+  for(size_t i = 0, n = g->getNumGeometries(); i < n; ++i)
 	{
 	  clip_linestring(dynamic_cast<const geom::LineString *>(g->getGeometryN(i)),
 					  parts, rect);
@@ -615,7 +615,7 @@ RectangleIntersection::clip_multipolygon(const geom::MultiPolygon * g,
   if(g == nullptr || g->isEmpty())
 	return;
 
-  for(int i=0, n = static_cast<int>(g->getNumGeometries()); i<n; ++i)
+  for(size_t i = 0, n = g->getNumGeometries(); i < n; ++i)
 	{
 	  clip_polygon(dynamic_cast<const geom::Polygon *>(g->getGeometryN(i)),
 				   parts, rect, keep_polygons);
@@ -629,10 +629,9 @@ RectangleIntersection::clip_geometrycollection(
 							 const Rectangle & rect,
 							 bool keep_polygons)
 {
-  if(g == nullptr || g->isEmpty())
-	return;
+  if(g == nullptr || g->isEmpty()) return;
 
-  for(int i=0, n=static_cast<int>(g->getNumGeometries()); i<n; ++i)
+  for(size_t i = 0, n = g->getNumGeometries(); i < n; ++i)
 	{
 	  clip_geom(g->getGeometryN(i),
 				parts, rect, keep_polygons);
diff --git a/src/operation/intersection/RectangleIntersectionBuilder.cpp b/src/operation/intersection/RectangleIntersectionBuilder.cpp
index 5bd0c4e..777b246 100644
--- a/src/operation/intersection/RectangleIntersectionBuilder.cpp
+++ b/src/operation/intersection/RectangleIntersectionBuilder.cpp
@@ -258,7 +258,7 @@ double distance(const Rectangle & rect,
 /**
  * \brief Reverse given segment in a coordinate vector
  */
-void reverse_points(std::vector<Coordinate> &v, int start, int end)
+void reverse_points(std::vector<Coordinate> &v, size_t start, size_t end)
 {
   geom::Coordinate p1;
   geom::Coordinate p2;
@@ -284,9 +284,9 @@ normalize_ring(std::vector<Coordinate> &ring)
 
   // Find the "smallest" coordinate
 
-  int best_pos = 0;
-  int n = static_cast<int>(ring.size());
-  for(int pos = 0; pos<n; ++pos)
+  size_t best_pos = 0;
+  auto n = ring.size();
+  for(size_t pos = 0; pos < n; ++pos)
 	{
     // TODO: use CoordinateLessThan ?
 	  if(ring[pos].x < ring[best_pos].x)
@@ -297,15 +297,14 @@ normalize_ring(std::vector<Coordinate> &ring)
 	}
 
   // Quick exit if the ring is already normalized
-  if(best_pos == 0)
-	return;
+  if(best_pos == 0) return;
 
   // Flip hands -algorithm to the part without the
   // duplicate last coordinate at n-1:
 
-  reverse_points(ring,0,best_pos-1);
-  reverse_points(ring,best_pos,n-2);
-  reverse_points(ring,0,n-2);
+  reverse_points(ring,0, best_pos - 1);
+  reverse_points(ring,best_pos, n - 2);
+	reverse_points(ring,0, n - 2);
 
   // And make sure the ring is valid by duplicating the first coordinate
   // at the end:
diff --git a/src/operation/linemerge/LineSequencer.cpp b/src/operation/linemerge/LineSequencer.cpp
index f55564e..5bd9407 100644
--- a/src/operation/linemerge/LineSequencer.cpp
+++ b/src/operation/linemerge/LineSequencer.cpp
@@ -74,7 +74,7 @@ LineSequencer::isSequenced(const Geometry* geom)
 
 
 		const Coordinate* startNode = &(line.getCoordinateN(0));
-		const Coordinate* endNode = &(line.getCoordinateN(static_cast<int>(line.getNumPoints() - 1)));
+		const Coordinate* endNode = &(line.getCoordinateN(line.getNumPoints() - 1));
 
 		/**
 		 * If this linestring is connected to a previous subgraph,
diff --git a/src/operation/polygonize/PolygonizeGraph.cpp b/src/operation/polygonize/PolygonizeGraph.cpp
index 682e9cd..c64cb44 100644
--- a/src/operation/polygonize/PolygonizeGraph.cpp
+++ b/src/operation/polygonize/PolygonizeGraph.cpp
@@ -382,9 +382,9 @@ PolygonizeGraph::computeNextCCWEdges(Node *node, long label)
 	 * Must use a SIGNED int here to allow for beak condition
 	 * to be true.
 	 */
-	for(int i=static_cast<int>(edges.size())-1; i>=0; --i)
+	for(auto i = edges.size(); i > 0; --i)
 	{
-		PolygonizeDirectedEdge *de=(PolygonizeDirectedEdge*)edges[i];
+		PolygonizeDirectedEdge *de=(PolygonizeDirectedEdge*)edges[i - 1];
 		PolygonizeDirectedEdge *sym=(PolygonizeDirectedEdge*) de->getSym();
 		PolygonizeDirectedEdge *outDE=nullptr;
 		if (de->getLabel()==label) outDE=de;
diff --git a/src/operation/predicate/RectangleContains.cpp b/src/operation/predicate/RectangleContains.cpp
index 530df13..fedc255 100644
--- a/src/operation/predicate/RectangleContains.cpp
+++ b/src/operation/predicate/RectangleContains.cpp
@@ -55,7 +55,7 @@ RectangleContains::isContainedInBoundary(const Geometry& geom)
 	if (const LineString *l=dynamic_cast<const LineString *>(&geom))
 		return isLineStringContainedInBoundary(*l);
 
-	for (unsigned i=0, n=static_cast<unsigned>(geom.getNumGeometries()); i<n; ++i)
+	for (size_t i = 0, n = geom.getNumGeometries(); i < n; ++i)
 	{
 		const Geometry &comp = *(geom.getGeometryN(i));
 		if ( !isContainedInBoundary(comp) )
@@ -93,7 +93,7 @@ bool
 RectangleContains::isLineStringContainedInBoundary(const LineString& line)
 {
 	const CoordinateSequence &seq = *(line.getCoordinatesRO());
-	for (unsigned int i=0, n=static_cast<unsigned int>(seq.getSize()-1); i<n; ++i) {
+	for (size_t i = 0, n =seq.size() - 1; i < n; ++i) {
 		const Coordinate& p0=seq.getAt(i);
 		const Coordinate& p1=seq.getAt(i+1);
 		if (! isLineSegmentContainedInBoundary(p0, p1))
diff --git a/src/operation/relate/EdgeEndBuilder.cpp b/src/operation/relate/EdgeEndBuilder.cpp
index 6c09e91..ca171dd 100644
--- a/src/operation/relate/EdgeEndBuilder.cpp
+++ b/src/operation/relate/EdgeEndBuilder.cpp
@@ -93,7 +93,7 @@ void
 EdgeEndBuilder::createEdgeEndForPrev(Edge *edge, vector<EdgeEnd*> *l,
 		EdgeIntersection *eiCurr, EdgeIntersection *eiPrev)
 {
-	int iPrev=eiCurr->segmentIndex;
+	auto iPrev = eiCurr->segmentIndex;
 	if (eiCurr->dist==0.0) {
 		// if at the start of the edge there is no previous edge
 		if (iPrev==0) return;
@@ -123,7 +123,7 @@ void
 EdgeEndBuilder::createEdgeEndForNext(Edge *edge, vector<EdgeEnd*> *l,
 		EdgeIntersection *eiCurr, EdgeIntersection *eiNext)
 {
-	int iNext=eiCurr->segmentIndex + 1;
+	size_t iNext = eiCurr->segmentIndex + 1;
 	// if there is no next edge there is nothing to do
 	if (iNext>=edge->getNumPoints() && eiNext==nullptr) return;
 	Coordinate pNext(edge->getCoordinate(iNext));
diff --git a/src/operation/valid/IsValidOp.cpp b/src/operation/valid/IsValidOp.cpp
index 5ce171d..c8d8165 100644
--- a/src/operation/valid/IsValidOp.cpp
+++ b/src/operation/valid/IsValidOp.cpp
@@ -70,7 +70,7 @@ IsValidOp::findPtNotNode(const CoordinateSequence *testCoords,
 	// find a point in the testCoords which is not a node of the searchRing
 	EdgeIntersectionList &eiList=searchEdge->getEdgeIntersectionList();
 	// somewhat inefficient - is there a better way? (Use a node map, for instance?)
-	unsigned int npts = static_cast<int>(testCoords->getSize());
+	auto npts = testCoords->getSize();
 	for(unsigned int i=0; i<npts; ++i)
 	{
 		const Coordinate& pt=testCoords->getAt(i);
@@ -231,10 +231,10 @@ IsValidOp::checkValid(const Polygon *g)
 void
 IsValidOp::checkValid(const MultiPolygon *g)
 {
-	unsigned int ngeoms = static_cast<unsigned int>(g->getNumGeometries());
+	auto ngeoms = g->getNumGeometries();
 	vector<const Polygon *>polys(ngeoms);
 
-	for (unsigned int i=0; i<ngeoms; ++i)
+	for (size_t i=0; i < ngeoms; ++i)
 	{
 		const Polygon *p = dynamic_cast<const Polygon *>(g->getGeometryN(i));
 
@@ -284,7 +284,7 @@ IsValidOp::checkValid(const MultiPolygon *g)
 void
 IsValidOp::checkValid(const GeometryCollection *gc)
 {
-	for(unsigned int i=0, ngeoms=static_cast<unsigned int>(gc->getNumGeometries()); i<ngeoms; ++i)
+	for(size_t i = 0, ngeoms=gc->getNumGeometries(); i < ngeoms; ++i)
 	{
 		const Geometry *g=gc->getGeometryN(i);
 		checkValid(g);
@@ -382,11 +382,11 @@ IsValidOp::checkHolesInShell(const Polygon *p, GeometryGraph *graph)
 	const LinearRing *shell=static_cast<const LinearRing*>(
 			p->getExteriorRing());
 
-	int nholes = static_cast<int>(p->getNumInteriorRing());
+	auto nholes = p->getNumInteriorRing();
 
 	if(shell->isEmpty())
 	{
-		for(int i=0; i<nholes; ++i)
+		for(size_t i = 0; i < nholes; ++i)
 		{
 			assert(dynamic_cast<const LinearRing*>(
 				p->getInteriorRingN(i)));
@@ -409,7 +409,7 @@ IsValidOp::checkHolesInShell(const Polygon *p, GeometryGraph *graph)
 	//SIRtreePointInRing pir(shell);
 	MCPointInRing pir(shell);
 
-	for(int i=0; i<nholes; ++i)
+	for(size_t i = 0; i < nholes; ++i)
 	{
 		assert(dynamic_cast<const LinearRing*>(
 				p->getInteriorRingN(i)));
@@ -446,8 +446,8 @@ IsValidOp::checkHolesNotNested(const Polygon *p, GeometryGraph *graph)
 	//QuadtreeNestedRingTester nestedTester(graph);
 	IndexedNestedRingTester nestedTester(graph);
 
-	int nholes = static_cast<int>(p->getNumInteriorRing());
-	for(int i=0; i<nholes; ++i)
+	auto nholes = p->getNumInteriorRing();
+	for(size_t i = 0; i < nholes; ++i)
 	{
 		assert(dynamic_cast<const LinearRing*>(
 				p->getInteriorRingN(i)));
@@ -474,7 +474,7 @@ IsValidOp::checkHolesNotNested(const Polygon *p, GeometryGraph *graph)
 void
 IsValidOp::checkShellsNotNested(const MultiPolygon *mp, GeometryGraph *graph)
 {
-	for(unsigned int i=0, ngeoms = static_cast<int>(mp->getNumGeometries()); i<ngeoms; ++i)
+	for(size_t i = 0, ngeoms = mp->getNumGeometries(); i < ngeoms; ++i)
 	{
 		const Polygon *p=dynamic_cast<const Polygon *>(
 				mp->getGeometryN(i));
@@ -484,7 +484,7 @@ IsValidOp::checkShellsNotNested(const MultiPolygon *mp, GeometryGraph *graph)
 				p->getExteriorRing());
 		assert(shell);
 
-		for(unsigned int j=0; j<ngeoms; ++j)
+		for(size_t j = 0; j < ngeoms; ++j)
 		{
 			if (i==j) continue;
 
@@ -524,7 +524,7 @@ IsValidOp::checkShellNotNested(const LinearRing *shell, const Polygon *p,
 	if (!insidePolyShell) return;
 
 	// if no holes, this is an error!
-	int nholes = static_cast<int>(p->getNumInteriorRing());
+	auto nholes = p->getNumInteriorRing();
 	if (nholes<=0) {
 		validErr=new TopologyValidationError(
 			TopologyValidationError::eNestedShells,
@@ -540,7 +540,7 @@ IsValidOp::checkShellNotNested(const LinearRing *shell, const Polygon *p,
 	 * an error.
 	 */
 	const Coordinate *badNestedPt=nullptr;
-	for(int i=0; i<nholes; ++i) {
+	for(size_t i = 0; i < nholes; ++i) {
 		assert(dynamic_cast<const LinearRing*>(
 				p->getInteriorRingN(i)));
 		const LinearRing *hole=static_cast<const LinearRing*>(
@@ -604,8 +604,8 @@ IsValidOp::checkConnectedInteriors(GeometryGraph &graph)
 void
 IsValidOp::checkInvalidCoordinates(const CoordinateSequence *cs)
 {
-	unsigned int size = static_cast<unsigned int>(cs->getSize());
-	for (unsigned int i=0; i<size; ++i)
+	auto size = cs->size();
+	for (size_t i = 0; i < size; ++i)
 	{
 		if (! isValid(cs->getAt(i)) )
 		{
@@ -625,8 +625,8 @@ IsValidOp::checkInvalidCoordinates(const Polygon *poly)
 	checkInvalidCoordinates(poly->getExteriorRing()->getCoordinatesRO());
 	if (validErr != nullptr) return;
 
-	int nholes = static_cast<int>(poly->getNumInteriorRing());
-	for (int i=0; i<nholes; ++i)
+	auto nholes = poly->getNumInteriorRing();
+	for (size_t i = 0; i < nholes; ++i)
 	{
 		checkInvalidCoordinates(
 			poly->getInteriorRingN(i)->getCoordinatesRO()
@@ -643,8 +643,8 @@ IsValidOp::checkClosedRings(const Polygon *poly)
 	checkClosedRing(lr);
 	if (validErr) return;
 
-	int nholes = static_cast<int>(poly->getNumInteriorRing());
-	for (int i=0; i<nholes; ++i)
+	auto nholes = poly->getNumInteriorRing();
+	for (size_t i = 0; i < nholes; ++i)
 	{
 		lr=(const LinearRing *)poly->getInteriorRingN(i);
 		checkClosedRing(lr);
diff --git a/src/precision/PrecisionReducerCoordinateOperation.cpp b/src/precision/PrecisionReducerCoordinateOperation.cpp
index 799f71b..211d9db 100644
--- a/src/precision/PrecisionReducerCoordinateOperation.cpp
+++ b/src/precision/PrecisionReducerCoordinateOperation.cpp
@@ -37,14 +37,14 @@ CoordinateSequence*
 PrecisionReducerCoordinateOperation::edit(const CoordinateSequence *cs,
                                           const Geometry *geom)
 {
-	unsigned int csSize = static_cast<unsigned int>(cs->getSize());
+	auto csSize = cs->size();
 
 	if ( csSize == 0 ) return nullptr;
 
 	vector<Coordinate> *vc = new vector<Coordinate>(csSize);
 
 	// copy coordinates and reduce
-	for (unsigned int i=0; i<csSize; ++i) {
+	for (size_t i = 0; i < csSize; ++i) {
 		Coordinate coord=cs->getAt(i);
 		targetPM.makePrecise(&coord);
 		(*vc)[i] = coord;
diff --git a/src/precision/SimpleGeometryPrecisionReducer.cpp b/src/precision/SimpleGeometryPrecisionReducer.cpp
index 7112cd5..8cc2757 100644
--- a/src/precision/SimpleGeometryPrecisionReducer.cpp
+++ b/src/precision/SimpleGeometryPrecisionReducer.cpp
@@ -70,7 +70,7 @@ PrecisionReducerCoordinateOperation::edit(const CoordinateSequence *cs,
 {
 	if (cs->getSize()==0) return nullptr;
 
-	unsigned int csSize=static_cast<unsigned int>(cs->getSize());
+	auto csSize = cs->size();
 
 	vector<Coordinate> *vc = new vector<Coordinate>(csSize);
 
diff --git a/src/simplify/TaggedLineSegment.cpp b/src/simplify/TaggedLineSegment.cpp
index 3c4e5aa..343d09e 100644
--- a/src/simplify/TaggedLineSegment.cpp
+++ b/src/simplify/TaggedLineSegment.cpp
@@ -34,7 +34,7 @@ namespace simplify { // geos::simplify
 TaggedLineSegment::TaggedLineSegment(const geom::Coordinate& p0,
 			const geom::Coordinate& p1,
 			const geom::Geometry* nParent,
-			unsigned int nIndex)
+			size_t nIndex)
 	:
 	LineSegment(p0, p1),
 	parent(nParent),
@@ -65,7 +65,7 @@ TaggedLineSegment::getParent() const
 	return parent;
 }
 
-unsigned int
+size_t
 TaggedLineSegment::getIndex() const
 {
 	return index;
diff --git a/src/simplify/TaggedLineString.cpp b/src/simplify/TaggedLineString.cpp
index 0c2bfdc..f7b94fa 100644
--- a/src/simplify/TaggedLineString.cpp
+++ b/src/simplify/TaggedLineString.cpp
@@ -88,7 +88,7 @@ TaggedLineString::init()
 			TaggedLineSegment* seg = new TaggedLineSegment(
 					pts->getAt(i),
 					pts->getAt(i+1),
-					parentLine, static_cast<unsigned int>(i));
+					parentLine, i);
 
 			segs.push_back(seg);
 		}
diff --git a/src/triangulate/quadedge/QuadEdgeSubdivision.cpp b/src/triangulate/quadedge/QuadEdgeSubdivision.cpp
index d05386e..bed1152 100644
--- a/src/triangulate/quadedge/QuadEdgeSubdivision.cpp
+++ b/src/triangulate/quadedge/QuadEdgeSubdivision.cpp
@@ -174,8 +174,8 @@ QuadEdgeSubdivision::locateFromEdge(const Vertex &v,
 {
     ::geos::ignore_unused_variable_warning(startEdge);
 
-    int iter = 0;
-    int maxIter = static_cast<int>(quadEdges.size());
+    size_t iter = 0;
+    auto maxIter = quadEdges.size();
 
     QuadEdge *e = startingEdges[0];
 
diff --git a/tests/unit/algorithm/RobustLineIntersectionTest.cpp b/tests/unit/algorithm/RobustLineIntersectionTest.cpp
index e398274..f3c248d 100644
--- a/tests/unit/algorithm/RobustLineIntersectionTest.cpp
+++ b/tests/unit/algorithm/RobustLineIntersectionTest.cpp
@@ -56,19 +56,19 @@ namespace tut
 	 *              elements
 	 */
 	void checkIntersection(const std::vector<Coordinate>& pt,
-	                         int expectedIntersectionNum,
+	                         size_t expectedIntersectionNum,
 	                         const std::vector<Coordinate>& intPt,
 	                         double distanceTolerance)
 	{
 		geos::algorithm::LineIntersector li;
 		li.computeIntersection(pt[0], pt[1], pt[2], pt[3]);
 
-		int intNum = li.getIntersectionNum();
+		auto intNum = li.getIntersectionNum();
 		ensure_equals(intNum, expectedIntersectionNum);
 
 		if ( intPt.empty() ) return;
 
-		ensure_equals(intPt.size(), static_cast<std::vector<Coordinate>::size_type>(intNum));
+		ensure_equals(intPt.size(), intNum);
 
 		// test that both points are represented here
 		//bool isIntPointsCorrect = true;
diff --git a/tests/unit/algorithm/RobustLineIntersectorTest.cpp b/tests/unit/algorithm/RobustLineIntersectorTest.cpp
index 0f45798..bcdb065 100644
--- a/tests/unit/algorithm/RobustLineIntersectorTest.cpp
+++ b/tests/unit/algorithm/RobustLineIntersectorTest.cpp
@@ -66,8 +66,8 @@ namespace tut
     Coordinate x(15, 15);
     i.computeIntersection(p1, p2, q1, q2);
 
-    ensure_equals(i.getIntersectionNum(), (int)LineIntersector::POINT_INTERSECTION);
-    ensure_equals(i.getIntersectionNum(), 1);
+    ensure_equals(i.getIntersectionNum(), LineIntersector::POINT_INTERSECTION);
+    ensure_equals(i.getIntersectionNum(), 1UL);
     ensure_equals(i.getIntersection(0), x);
     ensure("isProper", i.isProper());
     ensure("hasIntersection", i.hasIntersection());
@@ -85,8 +85,8 @@ namespace tut
     Coordinate q2(30, 10);
     i.computeIntersection(p1, p2, q1, q2);
 
-    ensure_equals(i.getIntersectionNum(), (int)LineIntersector::NO_INTERSECTION);
-    ensure_equals(i.getIntersectionNum(), 0);
+    ensure_equals(i.getIntersectionNum(), LineIntersector::NO_INTERSECTION);
+    ensure_equals(i.getIntersectionNum(), 0UL);
     ensure("!isProper", !i.isProper());
     ensure("!hasIntersection", !i.hasIntersection());
 	}
@@ -103,8 +103,8 @@ namespace tut
     Coordinate q2(30, 10);
     i.computeIntersection(p1, p2, q1, q2);
 
-    ensure_equals(i.getIntersectionNum(), (int)LineIntersector::POINT_INTERSECTION);
-    ensure_equals(i.getIntersectionNum(), 1);
+    ensure_equals(i.getIntersectionNum(), LineIntersector::POINT_INTERSECTION);
+    ensure_equals(i.getIntersectionNum(), 1UL);
     ensure("!isProper", !i.isProper());
     ensure("hasIntersection", i.hasIntersection());
 	}
@@ -121,8 +121,8 @@ namespace tut
     Coordinate q2(30, 10);
     i.computeIntersection(p1, p2, q1, q2);
 
-    ensure_equals(i.getIntersectionNum(), (int)LineIntersector::COLLINEAR_INTERSECTION);
-    ensure_equals(i.getIntersectionNum(), 2);
+    ensure_equals(i.getIntersectionNum(), LineIntersector::COLLINEAR_INTERSECTION);
+    ensure_equals(i.getIntersectionNum(), 2UL);
     ensure("!isProper", !i.isProper());
     ensure("hasIntersection", i.hasIntersection());
 	}
@@ -139,8 +139,8 @@ namespace tut
     Coordinate q2(30, 10);
     i.computeIntersection(p1, p2, q1, q2);
 
-    ensure_equals(i.getIntersectionNum(), (int)LineIntersector::COLLINEAR_INTERSECTION);
-    ensure_equals(i.getIntersectionNum(), 2);
+    ensure_equals(i.getIntersectionNum(), LineIntersector::COLLINEAR_INTERSECTION);
+    ensure_equals(i.getIntersectionNum(), 2UL);
     ensure("!isProper", !i.isProper());
     ensure("hasIntersection", i.hasIntersection());
 	}
@@ -153,7 +153,7 @@ namespace tut
     i.computeIntersection(Coordinate(100, 100), Coordinate(10, 100),
         Coordinate(100, 10), Coordinate(100, 100));
     ensure("hasIntersection", i.hasIntersection());
-    ensure_equals(i.getIntersectionNum(), 1);
+    ensure_equals(i.getIntersectionNum(), 1UL);
 	}
 
 	// 7 - testEndpointIntersection2
@@ -164,7 +164,7 @@ namespace tut
     i.computeIntersection(Coordinate(190, 50), Coordinate(120, 100),
         Coordinate(120, 100), Coordinate(50, 150));
     ensure("hasIntersection", i.hasIntersection());
-    ensure_equals(i.getIntersectionNum(), 1);
+    ensure_equals(i.getIntersectionNum(), 1UL);
     ensure_equals(i.getIntersection(1), Coordinate(120, 100));
 	}
 
@@ -176,7 +176,7 @@ namespace tut
     i.computeIntersection(Coordinate(180, 200), Coordinate(160, 180),
         Coordinate(220, 240), Coordinate(140, 160));
     ensure("hasIntersection", i.hasIntersection());
-    ensure_equals(i.getIntersectionNum(), 2);
+    ensure_equals(i.getIntersectionNum(), 2UL);
 	}
 
 	// 9 - testIsProper1
@@ -187,7 +187,7 @@ namespace tut
     i.computeIntersection(Coordinate(30, 10), Coordinate(30, 30),
         Coordinate(10, 10), Coordinate(90, 11));
     ensure("hasIntersection", i.hasIntersection());
-    ensure_equals(i.getIntersectionNum(), 1);
+    ensure_equals(i.getIntersectionNum(), 1UL);
     ensure("isProper", i.isProper());
 	}
 
@@ -199,7 +199,7 @@ namespace tut
     i.computeIntersection(Coordinate(10, 30), Coordinate(10, 0),
         Coordinate(11, 90), Coordinate(10, 10));
     ensure("hasIntersection", i.hasIntersection());
-    ensure_equals(i.getIntersectionNum(), 1);
+    ensure_equals(i.getIntersectionNum(), 1UL);
     ensure("!isProper", !i.isProper());
 	}
 

-----------------------------------------------------------------------

Summary of changes:
 include/geos/algorithm/LineIntersector.h           |  8 ++---
 .../geos/algorithm/distance/PointPairDistance.h    |  2 +-
 include/geos/geom/CoordinateList.h                 |  3 +-
 include/geos/geom/CoordinateSequence.h             |  2 +-
 include/geos/geom/IntersectionMatrix.h             |  2 +-
 include/geos/geom/LineString.h                     |  2 +-
 include/geos/geom/MultiPoint.h                     |  2 +-
 include/geos/geomgraph/Edge.h                      | 16 ++++-----
 include/geos/geomgraph/EdgeIntersection.h          |  8 ++---
 include/geos/geomgraph/EdgeIntersectionList.h      |  2 +-
 include/geos/geomgraph/index/MonotoneChain.h       |  4 +--
 include/geos/geomgraph/index/MonotoneChainEdge.h   | 16 ++++-----
 .../geos/geomgraph/index/MonotoneChainIndexer.h    |  6 ++--
 include/geos/geomgraph/index/SegmentIntersector.h  |  6 ++--
 .../geomgraph/index/SimpleMCSweepLineIntersector.h |  2 +-
 .../geomgraph/index/SimpleSweepLineIntersector.h   |  2 +-
 include/geos/geomgraph/index/SweepLineEvent.h      |  6 ++--
 include/geos/geomgraph/index/SweepLineSegment.h    |  6 ++--
 .../geos/index/chain/MonotoneChainSelectAction.h   |  2 +-
 include/geos/index/quadtree/NodeBase.h             |  4 +--
 include/geos/index/quadtree/Quadtree.h             |  2 +-
 include/geos/index/strtree/AbstractNode.h          |  3 +-
 include/geos/index/sweepline/SweepLineEvent.h      |  7 ++--
 include/geos/index/sweepline/SweepLineIndex.h      |  4 +--
 include/geos/io/WKBWriter.h                        |  2 +-
 include/geos/linearref/LinearIterator.h            | 14 ++++----
 include/geos/linearref/LinearLocation.h            | 18 +++++-----
 include/geos/noding/BasicSegmentString.h           |  8 ++---
 include/geos/noding/IntersectionAdder.h            | 12 +++----
 include/geos/noding/IntersectionFinderAdder.h      |  4 +--
 include/geos/noding/NodedSegmentString.h           | 18 +++++-----
 include/geos/noding/NodingValidator.h              |  4 +--
 include/geos/noding/SegmentIntersectionDetector.h  |  5 +--
 include/geos/noding/SegmentIntersector.h           |  5 +--
 include/geos/noding/SegmentNode.h                  |  4 +--
 include/geos/noding/SegmentString.h                |  4 +--
 .../geos/noding/SingleInteriorIntersectionFinder.h |  4 +--
 .../geos/noding/snapround/MCIndexPointSnapper.h    |  3 +-
 .../operation/buffer/BufferInputLineSimplifier.h   |  6 ++--
 include/geos/operation/distance/GeometryLocation.h |  7 ++--
 include/geos/simplify/TaggedLineSegment.h          |  6 ++--
 src/algorithm/CGAlgorithms.cpp                     | 18 +++++-----
 src/algorithm/LineIntersector.cpp                  |  6 ++--
 src/geom/CoordinateSequence.cpp                    | 24 +++++++-------
 src/geom/IntersectionMatrix.cpp                    | 22 ++++++-------
 src/geom/LineString.cpp                            |  4 +--
 src/geom/MultiPoint.cpp                            |  2 +-
 src/geom/util/GeometryTransformer.cpp              |  6 ++--
 src/geomgraph/DirectedEdge.cpp                     |  2 +-
 src/geomgraph/Edge.cpp                             | 38 +++++++++++-----------
 src/geomgraph/EdgeIntersectionList.cpp             |  8 ++---
 src/geomgraph/index/MonotoneChainEdge.cpp          | 20 ++++++------
 src/geomgraph/index/MonotoneChainIndexer.cpp       | 24 +++++++-------
 src/geomgraph/index/SegmentIntersector.cpp         | 12 ++++---
 src/geomgraph/index/SimpleEdgeSetIntersector.cpp   |  8 ++---
 .../index/SimpleMCSweepLineIntersector.cpp         | 20 ++++++------
 src/geomgraph/index/SimpleSweepLineIntersector.cpp |  6 ++--
 src/geomgraph/index/SweepLineSegment.cpp           |  2 +-
 src/index/chain/MonotoneChain.cpp                  |  4 +--
 src/index/chain/MonotoneChainSelectAction.cpp      |  2 +-
 src/index/quadtree/NodeBase.cpp                    | 10 +++---
 src/index/quadtree/Quadtree.cpp                    |  2 +-
 src/index/strtree/AbstractNode.cpp                 |  2 +-
 src/index/strtree/SIRtree.cpp                      |  4 +--
 src/index/strtree/STRtree.cpp                      |  4 +--
 src/index/sweepline/SweepLineEvent.cpp             |  4 +--
 src/index/sweepline/SweepLineIndex.cpp             | 10 +++---
 src/io/WKBWriter.cpp                               |  4 +--
 src/io/WKTWriter.cpp                               | 28 ++++++++--------
 src/linearref/ExtractLineByLocation.cpp            | 10 +++---
 src/linearref/LengthLocationMap.cpp                | 10 +++---
 src/linearref/LinearIterator.cpp                   | 14 ++++----
 src/linearref/LinearLocation.cpp                   | 30 ++++++++---------
 src/linearref/LocationIndexOfLine.cpp              |  2 +-
 src/linearref/LocationIndexOfPoint.cpp             |  8 ++---
 src/noding/BasicSegmentString.cpp                  |  4 +--
 src/noding/IntersectionAdder.cpp                   |  8 ++---
 src/noding/IntersectionFinderAdder.cpp             |  6 ++--
 src/noding/MCIndexNoder.cpp                        |  2 +-
 src/noding/MCIndexSegmentSetMutualIntersector.cpp  |  2 +-
 src/noding/NodedSegmentString.cpp                  | 20 ++++++------
 src/noding/NodingValidator.cpp                     | 14 ++++----
 src/noding/SegmentIntersectionDetector.cpp         |  4 +--
 src/noding/SegmentNode.cpp                         |  2 +-
 src/noding/SegmentNodeList.cpp                     | 17 +++++-----
 src/noding/SimpleNoder.cpp                         |  4 +--
 src/noding/SingleInteriorIntersectionFinder.cpp    |  4 +--
 src/noding/snapround/HotPixel.cpp                  |  6 ++--
 src/noding/snapround/MCIndexPointSnapper.cpp       |  8 ++---
 src/noding/snapround/MCIndexSnapRounder.cpp        |  2 +-
 src/noding/snapround/SimpleSnapRounder.cpp         |  6 ++--
 src/operation/IsSimpleOp.cpp                       |  2 +-
 src/operation/buffer/BufferInputLineSimplifier.cpp | 20 ++++++------
 src/operation/buffer/OffsetCurveBuilder.cpp        | 34 +++++++++----------
 src/operation/buffer/OffsetCurveSetBuilder.cpp     |  2 +-
 src/operation/buffer/OffsetSegmentGenerator.cpp    |  2 +-
 src/operation/buffer/SubgraphDepthLocater.cpp      |  4 +--
 src/operation/distance/DistanceOp.cpp              |  6 ++--
 src/operation/distance/GeometryLocation.cpp        |  8 +++--
 .../intersection/RectangleIntersection.cpp         | 21 ++++++------
 .../intersection/RectangleIntersectionBuilder.cpp  | 17 +++++-----
 src/operation/linemerge/LineSequencer.cpp          |  2 +-
 src/operation/polygonize/PolygonizeGraph.cpp       |  4 +--
 src/operation/predicate/RectangleContains.cpp      |  4 +--
 src/operation/relate/EdgeEndBuilder.cpp            |  4 +--
 src/operation/valid/IsValidOp.cpp                  | 38 +++++++++++-----------
 .../PrecisionReducerCoordinateOperation.cpp        |  4 +--
 src/precision/SimpleGeometryPrecisionReducer.cpp   |  2 +-
 src/simplify/TaggedLineSegment.cpp                 |  4 +--
 src/simplify/TaggedLineString.cpp                  |  2 +-
 src/triangulate/quadedge/QuadEdgeSubdivision.cpp   |  4 +--
 .../unit/algorithm/RobustLineIntersectionTest.cpp  |  6 ++--
 tests/unit/algorithm/RobustLineIntersectorTest.cpp | 30 ++++++++---------
 113 files changed, 473 insertions(+), 467 deletions(-)


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list