[geos-commits] [SCM] geos branch master updated. 6f0c2bac087180369760e9fed244bb797582a3b2
git at osgeo.org
git at osgeo.org
Sat Sep 9 13:06:41 PDT 2017
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 6f0c2bac087180369760e9fed244bb797582a3b2 (commit)
from 661420a67efa46dd99fb1b990ee67d34abb1b965 (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 6f0c2bac087180369760e9fed244bb797582a3b2
Author: Mateusz Loskot <mateusz at loskot.net>
Date: Sat Sep 9 21:42:52 2017 +0200
Apply clang-tidy-4.0 modernize-use-nullptr
Used command:
run-clang-tidy.py -header-filter='.*' -checks='-*,modernize-use-nullptr' -fix
Part of GEOS RFC 5: C++11 Compilation Mode
diff --git a/include/geos/algorithm/LineIntersector.h b/include/geos/algorithm/LineIntersector.h
index 009597d..2b8ae84 100644
--- a/include/geos/algorithm/LineIntersector.h
+++ b/include/geos/algorithm/LineIntersector.h
@@ -77,7 +77,7 @@ public:
static double nonRobustComputeEdgeDistance(const geom::Coordinate& p,const geom::Coordinate& p1,const geom::Coordinate& p2);
- LineIntersector(const geom::PrecisionModel* initialPrecisionModel=NULL)
+ LineIntersector(const geom::PrecisionModel* initialPrecisionModel=nullptr)
:
precisionModel(initialPrecisionModel),
result(0),
diff --git a/include/geos/geom/Lineal.h b/include/geos/geom/Lineal.h
index baa5aeb..bb62b57 100644
--- a/include/geos/geom/Lineal.h
+++ b/include/geos/geom/Lineal.h
@@ -37,7 +37,7 @@ namespace geom { // geos::geom
class GEOS_DLL Lineal : public virtual Geometry
{
protected:
- Lineal(): Geometry(0) {}
+ Lineal(): Geometry(nullptr) {}
};
} // namespace geos::geom
diff --git a/include/geos/geom/Polygonal.h b/include/geos/geom/Polygonal.h
index 79dcb82..39ab1bd 100644
--- a/include/geos/geom/Polygonal.h
+++ b/include/geos/geom/Polygonal.h
@@ -37,7 +37,7 @@ namespace geom { // geos::geom
class GEOS_DLL Polygonal : public virtual Geometry
{
protected:
- Polygonal(): Geometry(0) {}
+ Polygonal(): Geometry(nullptr) {}
};
} // namespace geos::geom
diff --git a/include/geos/geom/Puntal.h b/include/geos/geom/Puntal.h
index 90b447c..d9d9f4c 100644
--- a/include/geos/geom/Puntal.h
+++ b/include/geos/geom/Puntal.h
@@ -37,7 +37,7 @@ namespace geom { // geos::geom
class GEOS_DLL Puntal : public virtual Geometry
{
protected:
- Puntal(): Geometry(0) {}
+ Puntal(): Geometry(nullptr) {}
};
} // namespace geos::geom
diff --git a/include/geos/geom/prep/PreparedLineString.h b/include/geos/geom/prep/PreparedLineString.h
index 159a4e8..4001966 100644
--- a/include/geos/geom/prep/PreparedLineString.h
+++ b/include/geos/geom/prep/PreparedLineString.h
@@ -51,7 +51,7 @@ public:
PreparedLineString(const Geometry * geom)
:
BasicPreparedGeometry( geom),
- segIntFinder( NULL)
+ segIntFinder( nullptr)
{ }
~PreparedLineString();
diff --git a/include/geos/geomgraph/DirectedEdgeStar.h b/include/geos/geomgraph/DirectedEdgeStar.h
index 2e26dd8..325bada 100644
--- a/include/geos/geomgraph/DirectedEdgeStar.h
+++ b/include/geos/geomgraph/DirectedEdgeStar.h
@@ -59,7 +59,7 @@ public:
DirectedEdgeStar()
:
EdgeEndStar(),
- resultAreaEdgeList(0),
+ resultAreaEdgeList(nullptr),
label()
{}
diff --git a/include/geos/geomgraph/GeometryGraph.h b/include/geos/geomgraph/GeometryGraph.h
index 72224a6..0a9f42e 100644
--- a/include/geos/geomgraph/GeometryGraph.h
+++ b/include/geos/geomgraph/GeometryGraph.h
@@ -214,7 +214,7 @@ public:
index::SegmentIntersector* computeSelfNodes(
algorithm::LineIntersector *li,
bool computeRingSelfNodes,
- const geom::Envelope *env=0)
+ const geom::Envelope *env=nullptr)
{
return computeSelfNodes(*li, computeRingSelfNodes, env);
}
@@ -223,7 +223,7 @@ public:
algorithm::LineIntersector *li,
bool computeRingSelfNodes,
bool isDoneIfProperInt,
- const geom::Envelope *env=0)
+ const geom::Envelope *env=nullptr)
{
return computeSelfNodes(*li, computeRingSelfNodes, isDoneIfProperInt, env);
}
@@ -232,15 +232,15 @@ public:
// be deprecated.
index::SegmentIntersector* computeSelfNodes(
algorithm::LineIntersector& li,
- bool computeRingSelfNodes, const geom::Envelope *env=0);
+ bool computeRingSelfNodes, const geom::Envelope *env=nullptr);
index::SegmentIntersector* computeSelfNodes(
algorithm::LineIntersector& li,
- bool computeRingSelfNodes, bool isDoneIfProperInt, const geom::Envelope *env=0);
+ bool computeRingSelfNodes, bool isDoneIfProperInt, const geom::Envelope *env=nullptr);
index::SegmentIntersector* computeEdgeIntersections(GeometryGraph *g,
algorithm::LineIntersector *li, bool includeProper,
- const geom::Envelope *env=0);
+ const geom::Envelope *env=nullptr);
std::vector<Edge*> *getEdges();
diff --git a/include/geos/geomgraph/index/SweepLineEvent.h b/include/geos/geomgraph/index/SweepLineEvent.h
index 5fe5999..b481184 100644
--- a/include/geos/geomgraph/index/SweepLineEvent.h
+++ b/include/geos/geomgraph/index/SweepLineEvent.h
@@ -51,9 +51,9 @@ public:
virtual ~SweepLineEvent();
- bool isInsert() { return insertEvent==NULL; }
+ bool isInsert() { return insertEvent==nullptr; }
- bool isDelete() { return insertEvent!=NULL; }
+ bool isDelete() { return insertEvent!=nullptr; }
SweepLineEvent* getInsertEvent() { return insertEvent; }
diff --git a/include/geos/index/chain/MonotoneChainBuilder.h b/include/geos/index/chain/MonotoneChainBuilder.h
index cddb053..6e5ff52 100644
--- a/include/geos/index/chain/MonotoneChainBuilder.h
+++ b/include/geos/index/chain/MonotoneChainBuilder.h
@@ -71,7 +71,7 @@ public:
static std::vector<MonotoneChain*>* getChains(const geom::CoordinateSequence *pts)
{
- return getChains(pts, NULL);
+ return getChains(pts, nullptr);
}
/** \brief
diff --git a/include/geos/index/sweepline/SweepLineInterval.h b/include/geos/index/sweepline/SweepLineInterval.h
index 687cdef..164dd01 100644
--- a/include/geos/index/sweepline/SweepLineInterval.h
+++ b/include/geos/index/sweepline/SweepLineInterval.h
@@ -23,7 +23,7 @@ namespace sweepline { // geos:index:sweepline
class GEOS_DLL SweepLineInterval {
public:
- SweepLineInterval(double newMin, double newMax, void* newItem=0);
+ SweepLineInterval(double newMin, double newMax, void* newItem=nullptr);
double getMin();
double getMax();
void* getItem();
diff --git a/include/geos/io/ByteOrderDataInStream.h b/include/geos/io/ByteOrderDataInStream.h
index ddd3f3c..9cac179 100644
--- a/include/geos/io/ByteOrderDataInStream.h
+++ b/include/geos/io/ByteOrderDataInStream.h
@@ -43,7 +43,7 @@ class GEOS_DLL ByteOrderDataInStream {
public:
- ByteOrderDataInStream(std::istream *s=NULL);
+ ByteOrderDataInStream(std::istream *s=nullptr);
~ByteOrderDataInStream();
diff --git a/include/geos/noding/FastNodingValidator.h b/include/geos/noding/FastNodingValidator.h
index 15e2288..f1d89d7 100644
--- a/include/geos/noding/FastNodingValidator.h
+++ b/include/geos/noding/FastNodingValidator.h
@@ -104,7 +104,7 @@ private:
void execute()
{
- if (segInt.get() != NULL) return;
+ if (segInt.get() != nullptr) return;
checkInteriorIntersections();
}
diff --git a/include/geos/noding/IntersectionAdder.h b/include/geos/noding/IntersectionAdder.h
index 0928543..eaacc90 100644
--- a/include/geos/noding/IntersectionAdder.h
+++ b/include/geos/noding/IntersectionAdder.h
@@ -103,7 +103,7 @@ public:
hasProper(false),
hasProperInterior(false),
hasInterior(false),
- properIntersectionPoint(NULL),
+ properIntersectionPoint(nullptr),
li(newLi),
numIntersections(0),
numInteriorIntersections(0),
diff --git a/include/geos/noding/MCIndexNoder.h b/include/geos/noding/MCIndexNoder.h
index 4007e6e..f2cd1bf 100644
--- a/include/geos/noding/MCIndexNoder.h
+++ b/include/geos/noding/MCIndexNoder.h
@@ -76,11 +76,11 @@ private:
public:
- MCIndexNoder(SegmentIntersector *nSegInt=NULL)
+ MCIndexNoder(SegmentIntersector *nSegInt=nullptr)
:
SinglePassNoder(nSegInt),
idCounter(0),
- nodedSegStrings(NULL),
+ nodedSegStrings(nullptr),
nOverlaps(0)
{}
diff --git a/include/geos/noding/SegmentIntersectionDetector.h b/include/geos/noding/SegmentIntersectionDetector.h
index a1cbb4b..b75d3ec 100644
--- a/include/geos/noding/SegmentIntersectionDetector.h
+++ b/include/geos/noding/SegmentIntersectionDetector.h
@@ -65,8 +65,8 @@ public:
_hasIntersection(false),
_hasProperIntersection(false),
_hasNonProperIntersection(false),
- intPt( NULL),
- intSegments( NULL)
+ intPt( nullptr),
+ intSegments( nullptr)
{ }
~SegmentIntersectionDetector()
diff --git a/include/geos/noding/SegmentSetMutualIntersector.h b/include/geos/noding/SegmentSetMutualIntersector.h
index 02cfa65..5668a90 100644
--- a/include/geos/noding/SegmentSetMutualIntersector.h
+++ b/include/geos/noding/SegmentSetMutualIntersector.h
@@ -39,7 +39,7 @@ class SegmentSetMutualIntersector
public:
SegmentSetMutualIntersector()
- : segInt(0)
+ : segInt(nullptr)
{}
virtual ~SegmentSetMutualIntersector() {}
diff --git a/include/geos/noding/SimpleNoder.h b/include/geos/noding/SimpleNoder.h
index 0801d62..86489b9 100644
--- a/include/geos/noding/SimpleNoder.h
+++ b/include/geos/noding/SimpleNoder.h
@@ -54,7 +54,7 @@ private:
virtual void computeIntersects(SegmentString *e0, SegmentString *e1);
public:
- SimpleNoder(SegmentIntersector* nSegInt=NULL)
+ SimpleNoder(SegmentIntersector* nSegInt=nullptr)
:
SinglePassNoder(nSegInt)
{}
diff --git a/include/geos/noding/SinglePassNoder.h b/include/geos/noding/SinglePassNoder.h
index 3fc3fe0..e9106ff 100644
--- a/include/geos/noding/SinglePassNoder.h
+++ b/include/geos/noding/SinglePassNoder.h
@@ -56,7 +56,7 @@ protected:
public:
- SinglePassNoder(SegmentIntersector* nSegInt=NULL): segInt(nSegInt) {}
+ SinglePassNoder(SegmentIntersector* nSegInt=nullptr): segInt(nSegInt) {}
virtual ~SinglePassNoder() {}
diff --git a/include/geos/noding/snapround/MCIndexPointSnapper.h b/include/geos/noding/snapround/MCIndexPointSnapper.h
index a7b1084..527151b 100644
--- a/include/geos/noding/snapround/MCIndexPointSnapper.h
+++ b/include/geos/noding/snapround/MCIndexPointSnapper.h
@@ -71,7 +71,7 @@ public:
unsigned int vertexIndex);
bool snap(HotPixel& hotPixel) {
- return snap(hotPixel, 0, 0);
+ return snap(hotPixel, nullptr, 0);
}
diff --git a/include/geos/operation/buffer/BufferBuilder.h b/include/geos/operation/buffer/BufferBuilder.h
index be3a39f..f55c7a0 100644
--- a/include/geos/operation/buffer/BufferBuilder.h
+++ b/include/geos/operation/buffer/BufferBuilder.h
@@ -101,11 +101,11 @@ public:
BufferBuilder(const BufferParameters& nBufParams)
:
bufParams(nBufParams),
- workingPrecisionModel(NULL),
- li(NULL),
- intersectionAdder(NULL),
- workingNoder(NULL),
- geomFact(NULL),
+ workingPrecisionModel(nullptr),
+ li(nullptr),
+ intersectionAdder(nullptr),
+ workingNoder(nullptr),
+ geomFact(nullptr),
edgeList()
{}
diff --git a/include/geos/operation/buffer/BufferOp.h b/include/geos/operation/buffer/BufferOp.h
index 86e9624..eb5b1c9 100644
--- a/include/geos/operation/buffer/BufferOp.h
+++ b/include/geos/operation/buffer/BufferOp.h
@@ -171,7 +171,7 @@ public:
:
argGeom(g),
bufParams(),
- resultGeometry(NULL)
+ resultGeometry(nullptr)
{
}
@@ -187,7 +187,7 @@ public:
:
argGeom(g),
bufParams(params),
- resultGeometry(NULL)
+ resultGeometry(nullptr)
{
}
diff --git a/include/geos/operation/buffer/OffsetSegmentString.h b/include/geos/operation/buffer/OffsetSegmentString.h
index e1f8ddb..5a3859a 100644
--- a/include/geos/operation/buffer/OffsetSegmentString.h
+++ b/include/geos/operation/buffer/OffsetSegmentString.h
@@ -83,7 +83,7 @@ public:
OffsetSegmentString()
:
ptList(new geom::CoordinateArraySequence()),
- precisionModel(NULL),
+ precisionModel(nullptr),
minimumVertexDistance (0.0)
{
}
@@ -98,7 +98,7 @@ public:
if ( ptList ) ptList->clear();
else ptList = new geom::CoordinateArraySequence();
- precisionModel = NULL;
+ precisionModel = nullptr;
minimumVertexDistance = 0.0;
}
@@ -167,7 +167,7 @@ public:
{
closeRing();
geom::CoordinateSequence* ret = ptList;
- ptList = 0;
+ ptList = nullptr;
return ret;
}
diff --git a/include/geos/operation/linemerge/LineSequencer.h b/include/geos/operation/linemerge/LineSequencer.h
index 8dfd9a1..03e3813 100644
--- a/include/geos/operation/linemerge/LineSequencer.h
+++ b/include/geos/operation/linemerge/LineSequencer.h
@@ -202,7 +202,7 @@ public:
LineSequencer()
:
- factory(0),
+ factory(nullptr),
lineCount(0),
isRun(false),
sequencedGeometry(nullptr),
diff --git a/include/geos/operation/overlay/OverlayOp.h b/include/geos/operation/overlay/OverlayOp.h
index e56dfa0..e504541 100644
--- a/include/geos/operation/overlay/OverlayOp.h
+++ b/include/geos/operation/overlay/OverlayOp.h
@@ -201,7 +201,7 @@ private:
void computeOverlay(OpCode opCode); // throw(TopologyException *);
- void insertUniqueEdges(std::vector<geomgraph::Edge*> *edges, const geom::Envelope *env=0);
+ void insertUniqueEdges(std::vector<geomgraph::Edge*> *edges, const geom::Envelope *env=nullptr);
/*
* If either of the GeometryLocations for the existing label is
@@ -241,7 +241,7 @@ private:
* but in the original arg Geometry it is actually
* in the interior due to the Boundary Determination Rule)
*/
- void copyPoints(int argIndex, const geom::Envelope *env=0);
+ void copyPoints(int argIndex, const geom::Envelope *env=nullptr);
/** \brief
* Compute initial labelling for all DirectedEdges at each node.
diff --git a/include/geos/operation/overlay/PointBuilder.h b/include/geos/operation/overlay/PointBuilder.h
index 0182b4b..d85b3ee 100644
--- a/include/geos/operation/overlay/PointBuilder.h
+++ b/include/geos/operation/overlay/PointBuilder.h
@@ -82,7 +82,7 @@ public:
PointBuilder(OverlayOp *newOp,
const geom::GeometryFactory *newGeometryFactory,
- algorithm::PointLocator *newPtLocator=NULL)
+ algorithm::PointLocator *newPtLocator=nullptr)
:
op(newOp),
geometryFactory(newGeometryFactory),
diff --git a/include/geos/operation/union/CascadedPolygonUnion.h b/include/geos/operation/union/CascadedPolygonUnion.h
index 2cecfbc..775fd7e 100644
--- a/include/geos/operation/union/CascadedPolygonUnion.h
+++ b/include/geos/operation/union/CascadedPolygonUnion.h
@@ -147,7 +147,7 @@ public:
*/
CascadedPolygonUnion(std::vector<geom::Polygon*>* polys)
: inputPolys(polys),
- geomFactory(NULL)
+ geomFactory(nullptr)
{}
/**
diff --git a/include/geos/operation/union/CascadedUnion.h b/include/geos/operation/union/CascadedUnion.h
index 1f001b9..e01b8e5 100644
--- a/include/geos/operation/union/CascadedUnion.h
+++ b/include/geos/operation/union/CascadedUnion.h
@@ -105,7 +105,7 @@ public:
*/
CascadedUnion(const std::vector<geom::Geometry*>* geoms)
: inputGeoms(geoms),
- geomFactory(NULL)
+ geomFactory(nullptr)
{}
/**
diff --git a/include/geos/operation/union/GeometryListHolder.h b/include/geos/operation/union/GeometryListHolder.h
index f046952..e88f968 100644
--- a/include/geos/operation/union/GeometryListHolder.h
+++ b/include/geos/operation/union/GeometryListHolder.h
@@ -54,7 +54,7 @@ public:
geom::Geometry* getGeometry(std::size_t index)
{
if (index >= this->base_type::size())
- return NULL;
+ return nullptr;
return (*this)[index];
}
diff --git a/include/geos/operation/union/UnaryUnionOp.h b/include/geos/operation/union/UnaryUnionOp.h
index 5fcc0cf..832e173 100644
--- a/include/geos/operation/union/UnaryUnionOp.h
+++ b/include/geos/operation/union/UnaryUnionOp.h
@@ -118,7 +118,7 @@ public:
template <class T>
UnaryUnionOp(const T& geoms)
:
- geomFact(0)
+ geomFact(nullptr)
{
extractGeoms(geoms);
}
diff --git a/include/geos/operation/valid/IsValidOp.h b/include/geos/operation/valid/IsValidOp.h
index 4b04a59..f42c9d1 100644
--- a/include/geos/operation/valid/IsValidOp.h
+++ b/include/geos/operation/valid/IsValidOp.h
@@ -225,7 +225,7 @@ public:
:
parentGeometry(geom),
isChecked(false),
- validErr(NULL),
+ validErr(nullptr),
isSelfTouchingRingFormingHoleValid(false)
{}
diff --git a/include/geos/operation/valid/SimpleNestedRingTester.h b/include/geos/operation/valid/SimpleNestedRingTester.h
index ec926bf..2ec3e4b 100644
--- a/include/geos/operation/valid/SimpleNestedRingTester.h
+++ b/include/geos/operation/valid/SimpleNestedRingTester.h
@@ -61,7 +61,7 @@ public:
:
graph(newGraph),
rings(),
- nestedPt(NULL)
+ nestedPt(nullptr)
{}
~SimpleNestedRingTester() {
diff --git a/include/geos/operation/valid/SweeplineNestedRingTester.h b/include/geos/operation/valid/SweeplineNestedRingTester.h
index 137b3c0..d79fe13 100644
--- a/include/geos/operation/valid/SweeplineNestedRingTester.h
+++ b/include/geos/operation/valid/SweeplineNestedRingTester.h
@@ -75,7 +75,7 @@ public:
graph(newGraph),
rings(),
sweepLine(new index::sweepline::SweepLineIndex()),
- nestedPt(NULL)
+ nestedPt(nullptr)
{}
~SweeplineNestedRingTester()
diff --git a/include/geos/precision/GeometryPrecisionReducer.h b/include/geos/precision/GeometryPrecisionReducer.h
index 40069b1..861c327 100644
--- a/include/geos/precision/GeometryPrecisionReducer.h
+++ b/include/geos/precision/GeometryPrecisionReducer.h
@@ -108,7 +108,7 @@ public:
GeometryPrecisionReducer(const geom::PrecisionModel &pm)
:
- newFactory(0),
+ newFactory(nullptr),
targetPM(pm),
removeCollapsed(true),
isPointwise(false)
diff --git a/include/geos/profiler.h b/include/geos/profiler.h
index 377703e..42b8527 100644
--- a/include/geos/profiler.h
+++ b/include/geos/profiler.h
@@ -73,13 +73,13 @@ public:
/** \brief start a new timer */
void start() {
- gettimeofday(&starttime, NULL);
+ gettimeofday(&starttime, nullptr);
}
/** \brief stop current timer */
void stop()
{
- gettimeofday(&stoptime, NULL);
+ gettimeofday(&stoptime, nullptr);
double elapsed = 1000000*(stoptime.tv_sec-starttime.tv_sec)+
(stoptime.tv_usec-starttime.tv_usec);
diff --git a/src/algorithm/ConvexHull.cpp b/src/algorithm/ConvexHull.cpp
index 0ef2ead..568c386 100644
--- a/src/algorithm/ConvexHull.cpp
+++ b/src/algorithm/ConvexHull.cpp
@@ -481,7 +481,7 @@ ConvexHull::lineOrPolygon(const Coordinate::ConstVect &input)
}
CoordinateSequence *cl2=toCoordinateSequence(cleaned);
LinearRing *linearRing=geomFactory->createLinearRing(cl2);
- return geomFactory->createPolygon(linearRing,NULL);
+ return geomFactory->createPolygon(linearRing,nullptr);
}
/*private*/
@@ -497,7 +497,7 @@ ConvexHull::cleanRing(const Coordinate::ConstVect &original,
assert(last);
assert(original[0]->equals2D(*last));
- const Coordinate *prev = NULL;
+ const Coordinate *prev = nullptr;
for (size_t i=0; i<npts-1; ++i)
{
const Coordinate *curr = original[i];
@@ -506,7 +506,7 @@ ConvexHull::cleanRing(const Coordinate::ConstVect &original,
// skip consecutive equal coordinates
if (curr->equals2D(*next)) continue;
- if ( prev != NULL && isBetween(*prev, *curr, *next) )
+ if ( prev != nullptr && isBetween(*prev, *curr, *next) )
{
continue;
}
diff --git a/src/algorithm/LineIntersector.cpp b/src/algorithm/LineIntersector.cpp
index ab5c7a5..2a4258b 100644
--- a/src/algorithm/LineIntersector.cpp
+++ b/src/algorithm/LineIntersector.cpp
@@ -773,7 +773,7 @@ LineIntersector::intersection(const Coordinate& p1,
#endif
}
- if (precisionModel!=NULL) {
+ if (precisionModel!=nullptr) {
precisionModel->makePrecise(intPtOut);
}
diff --git a/src/algorithm/MCPointInRing.cpp b/src/algorithm/MCPointInRing.cpp
index 5885487..74904d8 100644
--- a/src/algorithm/MCPointInRing.cpp
+++ b/src/algorithm/MCPointInRing.cpp
@@ -53,8 +53,8 @@ MCPointInRing::MCPointInRing(const LinearRing *newRing)
:
ring(newRing),
interval(),
- pts(NULL),
- tree(NULL),
+ pts(nullptr),
+ tree(nullptr),
crossings(0)
{
buildIndex();
diff --git a/src/algorithm/MinimumDiameter.cpp b/src/algorithm/MinimumDiameter.cpp
index 8d57986..6b1b6d2 100644
--- a/src/algorithm/MinimumDiameter.cpp
+++ b/src/algorithm/MinimumDiameter.cpp
@@ -68,12 +68,12 @@ namespace algorithm { // geos.algorithm
MinimumDiameter::MinimumDiameter(const Geometry* newInputGeom)
{
minBaseSeg=new LineSegment();
- minWidthPt=NULL;
+ minWidthPt=nullptr;
minPtIndex=0;
minWidth=0.0;
inputGeom=newInputGeom;
isConvex=false;
- convexHullPts=NULL;
+ convexHullPts=nullptr;
}
/**
@@ -89,11 +89,11 @@ MinimumDiameter::MinimumDiameter(const Geometry* newInputGeom)
MinimumDiameter::MinimumDiameter(const Geometry* newInputGeom, const bool newIsConvex)
{
minBaseSeg=new LineSegment();
- minWidthPt=NULL;
+ minWidthPt=nullptr;
minWidth=0.0;
inputGeom=newInputGeom;
isConvex=newIsConvex;
- convexHullPts=NULL;
+ convexHullPts=nullptr;
}
MinimumDiameter::~MinimumDiameter()
@@ -152,8 +152,8 @@ MinimumDiameter::getDiameter()
{
computeMinimumDiameter();
// return empty linestring if no minimum width calculated
- if (minWidthPt==NULL)
- return inputGeom->getFactory()->createLineString(NULL);
+ if (minWidthPt==nullptr)
+ return inputGeom->getFactory()->createLineString(nullptr);
Coordinate basePt;
minBaseSeg->project(*minWidthPt, basePt);
@@ -169,7 +169,7 @@ void
MinimumDiameter::computeMinimumDiameter()
{
// check if computation is cached
- if (minWidthPt!=NULL)
+ if (minWidthPt!=nullptr)
return;
if (isConvex)
computeWidthConvex(inputGeom);
@@ -203,9 +203,9 @@ MinimumDiameter::computeWidthConvex(const Geometry *geom)
case 0:
minWidth=0.0;
delete minWidthPt;
- minWidthPt=NULL;
+ minWidthPt=nullptr;
delete minBaseSeg;
- minBaseSeg=NULL;
+ minBaseSeg=nullptr;
break;
case 1:
minWidth = 0.0;
@@ -351,7 +351,7 @@ Geometry* MinimumDiameter::getMinimumRectangle()
seq->setAt(p0, 4); // close
LinearRing* shell = inputGeom->getFactory()->createLinearRing( seq );
- return inputGeom->getFactory()->createPolygon( shell, NULL );
+ return inputGeom->getFactory()->createPolygon( shell, nullptr );
}
double MinimumDiameter::computeC(double a, double b, const Coordinate& p)
diff --git a/src/algorithm/SIRtreePointInRing.cpp b/src/algorithm/SIRtreePointInRing.cpp
index a443162..18087e5 100644
--- a/src/algorithm/SIRtreePointInRing.cpp
+++ b/src/algorithm/SIRtreePointInRing.cpp
@@ -35,7 +35,7 @@ namespace algorithm { // geos.algorithm
SIRtreePointInRing::SIRtreePointInRing(LinearRing *newRing):
PointInRing(),
ring(newRing),
- sirTree(NULL),
+ sirTree(nullptr),
crossings(0)
{
buildIndex();
diff --git a/src/geom/CoordinateSequence.cpp b/src/geom/CoordinateSequence.cpp
index 35ea113..948a6c1 100644
--- a/src/geom/CoordinateSequence.cpp
+++ b/src/geom/CoordinateSequence.cpp
@@ -82,10 +82,10 @@ CoordinateSequence::hasRepeatedPoints(const CoordinateSequence *cl)
const Coordinate*
CoordinateSequence::minCoordinate() const
{
- const Coordinate* minCoord=NULL;
+ const Coordinate* minCoord=nullptr;
const std::size_t size=getSize();
for(std::size_t i=0; i<size; i++) {
- if(minCoord==NULL || minCoord->compareTo(getAt(i))>0) {
+ if(minCoord==nullptr || minCoord->compareTo(getAt(i))>0) {
minCoord=&getAt(i);
}
}
@@ -95,10 +95,10 @@ CoordinateSequence::minCoordinate() const
const Coordinate*
CoordinateSequence::minCoordinate(CoordinateSequence *cl)
{
- const Coordinate* minCoord=NULL;
+ const Coordinate* minCoord=nullptr;
const std::size_t size=cl->getSize();
for(std::size_t i=0;i<size; i++) {
- if(minCoord==NULL || minCoord->compareTo(cl->getAt(i))>0) {
+ if(minCoord==nullptr || minCoord->compareTo(cl->getAt(i))>0) {
minCoord=&(cl->getAt(i));
}
}
@@ -177,7 +177,7 @@ CoordinateSequence::equals(const CoordinateSequence *cl1,
// FIXME: use std::equals()
if (cl1==cl2) return true;
- if (cl1==NULL||cl2==NULL) return false;
+ if (cl1==nullptr||cl2==nullptr) return false;
size_t npts1=cl1->getSize();
if (npts1!=cl2->getSize()) return false;
for (size_t i=0; i<npts1; i++) {
diff --git a/src/geom/Geometry.cpp b/src/geom/Geometry.cpp
index efe4388..07f4fe8 100644
--- a/src/geom/Geometry.cpp
+++ b/src/geom/Geometry.cpp
@@ -110,9 +110,9 @@ Geometry::Geometry(const GeometryFactory *newFactory)
:
envelope(nullptr),
_factory(newFactory),
- _userData(NULL)
+ _userData(nullptr)
{
- if ( _factory == NULL ) {
+ if ( _factory == nullptr ) {
_factory = GeometryFactory::getDefaultInstance();
}
SRID=_factory->getSRID();
@@ -123,7 +123,7 @@ Geometry::Geometry(const Geometry &geom)
:
SRID(geom.getSRID()),
_factory(geom._factory),
- _userData(NULL)
+ _userData(nullptr)
{
if ( geom.envelope.get() )
{
@@ -164,7 +164,7 @@ Geometry::hasNullElements(const vector<Geometry *>* lrs)
{
size_t n=lrs->size();
for (size_t i=0; i<n; ++i) {
- if ((*lrs)[i]==NULL) {
+ if ((*lrs)[i]==nullptr) {
return true;
}
}
@@ -198,7 +198,7 @@ Point*
Geometry::getCentroid() const
{
Coordinate centPt;
- if ( ! getCentroid(centPt) ) return NULL;
+ if ( ! getCentroid(centPt) ) return nullptr;
// We don't use createPointFromInternalCoord here
// because ::getCentroid() takes care about rounding
@@ -223,13 +223,13 @@ Geometry::getInteriorPoint() const
int dim=getDimension();
if (dim==0) {
InteriorPointPoint intPt(this);
- if ( ! intPt.getInteriorPoint(interiorPt) ) return NULL;
+ if ( ! intPt.getInteriorPoint(interiorPt) ) return nullptr;
} else if (dim==1) {
InteriorPointLine intPt(this);
- if ( ! intPt.getInteriorPoint(interiorPt) ) return NULL;
+ if ( ! intPt.getInteriorPoint(interiorPt) ) return nullptr;
} else {
InteriorPointArea intPt(this);
- if ( ! intPt.getInteriorPoint(interiorPt) ) return NULL;
+ if ( ! intPt.getInteriorPoint(interiorPt) ) return nullptr;
}
Point *p=getFactory()->createPointFromInternalCoord(&interiorPt, this);
return p;
@@ -256,7 +256,7 @@ void
Geometry::geometryChangedAction()
{
//delete envelope;
- envelope.reset(NULL);
+ envelope.reset(nullptr);
}
bool
@@ -544,7 +544,7 @@ Geometry::Union(const Geometry *other) const
if ( isEmpty() ) return other->clone();
if ( other->isEmpty() ) return clone();
- Geometry *out = NULL;
+ Geometry *out = nullptr;
#ifdef SHORTCIRCUIT_PREDICATES
// if envelopes are disjoint return a MULTI geom or
@@ -562,7 +562,7 @@ Geometry::Union(const Geometry *other) const
v->reserve(ngeomsThis+ngeomsOther);
- if ( NULL != (coll = dynamic_cast<const GeometryCollection *>(this)) )
+ if ( nullptr != (coll = dynamic_cast<const GeometryCollection *>(this)) )
{
for (size_t i=0; i<ngeomsThis; ++i)
v->push_back(coll->getGeometryN(i)->clone());
@@ -570,7 +570,7 @@ Geometry::Union(const Geometry *other) const
v->push_back(this->clone());
}
- if ( NULL != (coll = dynamic_cast<const GeometryCollection *>(other)) )
+ if ( nullptr != (coll = dynamic_cast<const GeometryCollection *>(other)) )
{
for (size_t i=0; i<ngeomsOther; ++i)
v->push_back(coll->getGeometryN(i)->clone());
@@ -626,7 +626,7 @@ Geometry::symDifference(const Geometry *other) const
v->reserve(ngeomsThis+ngeomsOther);
- if ( NULL != (coll = dynamic_cast<const GeometryCollection *>(this)) )
+ if ( nullptr != (coll = dynamic_cast<const GeometryCollection *>(this)) )
{
for (size_t i=0; i<ngeomsThis; ++i)
v->push_back(coll->getGeometryN(i)->clone());
@@ -634,7 +634,7 @@ Geometry::symDifference(const Geometry *other) const
v->push_back(this->clone());
}
- if ( NULL != (coll = dynamic_cast<const GeometryCollection *>(other)) )
+ if ( nullptr != (coll = dynamic_cast<const GeometryCollection *>(other)) )
{
for (size_t i=0; i<ngeomsOther; ++i)
v->push_back(coll->getGeometryN(i)->clone());
diff --git a/src/geom/GeometryCollection.cpp b/src/geom/GeometryCollection.cpp
index ecbfd4d..7b011f7 100644
--- a/src/geom/GeometryCollection.cpp
+++ b/src/geom/GeometryCollection.cpp
@@ -61,7 +61,7 @@ GeometryCollection::GeometryCollection(const GeometryCollection &gc)
GeometryCollection::GeometryCollection(vector<Geometry *> *newGeoms, const GeometryFactory *factory):
Geometry(factory)
{
- if (newGeoms==NULL) {
+ if (newGeoms==nullptr) {
geometries=new vector<Geometry *>();
return;
}
diff --git a/src/geom/GeometryFactory.cpp b/src/geom/GeometryFactory.cpp
index d8c306b..4c2b2a0 100644
--- a/src/geom/GeometryFactory.cpp
+++ b/src/geom/GeometryFactory.cpp
@@ -281,7 +281,7 @@ GeometryFactory::toGeometry(const Envelope* envelope) const
coord.y = envelope->getMinY();
cl->add(coord);
- Polygon *p = createPolygon(createLinearRing(cl), NULL);
+ Polygon *p = createPolygon(createLinearRing(cl), nullptr);
return p;
}
@@ -296,7 +296,7 @@ GeometryFactory::getPrecisionModel() const
Point*
GeometryFactory::createPoint() const
{
- return new Point(NULL, this);
+ return new Point(nullptr, this);
}
/*public*/
@@ -326,7 +326,7 @@ Point*
GeometryFactory::createPoint(const CoordinateSequence &fromCoords) const
{
CoordinateSequence *newCoords = fromCoords.clone();
- Point *g = NULL;
+ Point *g = nullptr;
try {
g = new Point(newCoords,this);
} catch (...) {
@@ -341,7 +341,7 @@ GeometryFactory::createPoint(const CoordinateSequence &fromCoords) const
MultiLineString*
GeometryFactory::createMultiLineString() const
{
- return new MultiLineString(NULL,this);
+ return new MultiLineString(nullptr,this);
}
/*public*/
@@ -364,7 +364,7 @@ GeometryFactory::createMultiLineString(const vector<Geometry *> &fromLines)
if ( ! line ) throw geos::util::IllegalArgumentException("createMultiLineString called with a vector containing non-LineStrings");
(*newGeoms)[i] = new LineString(*line);
}
- MultiLineString *g = NULL;
+ MultiLineString *g = nullptr;
try {
g = new MultiLineString(newGeoms,this);
} catch (...) {
@@ -381,14 +381,14 @@ GeometryFactory::createMultiLineString(const vector<Geometry *> &fromLines)
GeometryCollection*
GeometryFactory::createGeometryCollection() const
{
- return new GeometryCollection(NULL,this);
+ return new GeometryCollection(nullptr,this);
}
/*public*/
Geometry*
GeometryFactory::createEmptyGeometry() const
{
- return new GeometryCollection(NULL,this);
+ return new GeometryCollection(nullptr,this);
}
/*public*/
@@ -406,7 +406,7 @@ GeometryFactory::createGeometryCollection(const vector<Geometry *> &fromGeoms) c
for (size_t i=0; i<fromGeoms.size(); i++) {
(*newGeoms)[i] = fromGeoms[i]->clone();
}
- GeometryCollection *g = NULL;
+ GeometryCollection *g = nullptr;
try {
g = new GeometryCollection(newGeoms,this);
} catch (...) {
@@ -423,7 +423,7 @@ GeometryFactory::createGeometryCollection(const vector<Geometry *> &fromGeoms) c
MultiPolygon*
GeometryFactory::createMultiPolygon() const
{
- return new MultiPolygon(NULL,this);
+ return new MultiPolygon(nullptr,this);
}
/*public*/
@@ -442,7 +442,7 @@ GeometryFactory::createMultiPolygon(const vector<Geometry *> &fromPolys) const
{
(*newGeoms)[i] = fromPolys[i]->clone();
}
- MultiPolygon *g = NULL;
+ MultiPolygon *g = nullptr;
try {
g = new MultiPolygon(newGeoms,this);
} catch (...) {
@@ -459,7 +459,7 @@ GeometryFactory::createMultiPolygon(const vector<Geometry *> &fromPolys) const
LinearRing*
GeometryFactory::createLinearRing() const
{
- return new LinearRing(NULL,this);
+ return new LinearRing(nullptr,this);
}
/*public*/
@@ -481,7 +481,7 @@ LinearRing*
GeometryFactory::createLinearRing(const CoordinateSequence& fromCoords) const
{
CoordinateSequence *newCoords = fromCoords.clone();
- LinearRing *g = NULL;
+ LinearRing *g = nullptr;
// construction failure will delete newCoords
g = new LinearRing(newCoords, this);
return g;
@@ -504,7 +504,7 @@ GeometryFactory::createMultiPoint(const vector<Geometry *> &fromPoints) const
(*newGeoms)[i] = fromPoints[i]->clone();
}
- MultiPoint *g = NULL;
+ MultiPoint *g = nullptr;
try {
g = new MultiPoint(newGeoms,this);
} catch (...) {
@@ -521,7 +521,7 @@ GeometryFactory::createMultiPoint(const vector<Geometry *> &fromPoints) const
MultiPoint*
GeometryFactory::createMultiPoint() const
{
- return new MultiPoint(NULL, this);
+ return new MultiPoint(nullptr, this);
}
/*public*/
@@ -535,7 +535,7 @@ GeometryFactory::createMultiPoint(const CoordinateSequence &fromCoords) const
Point *pt=createPoint(fromCoords.getAt(i));
pts->push_back(pt);
}
- MultiPoint *mp = NULL;
+ MultiPoint *mp = nullptr;
try {
mp = createMultiPoint(pts);
} catch (...) {
@@ -557,7 +557,7 @@ GeometryFactory::createMultiPoint(const std::vector<Coordinate> &fromCoords) con
Point *pt=createPoint(fromCoords[i]);
pts->push_back(pt);
}
- MultiPoint *mp = NULL;
+ MultiPoint *mp = nullptr;
try {
mp = createMultiPoint(pts);
} catch (...) {
@@ -572,7 +572,7 @@ GeometryFactory::createMultiPoint(const std::vector<Coordinate> &fromCoords) con
Polygon*
GeometryFactory::createPolygon() const
{
- return new Polygon(NULL, NULL, this);
+ return new Polygon(nullptr, nullptr, this);
}
/*public*/
@@ -594,7 +594,7 @@ GeometryFactory::createPolygon(const LinearRing &shell, const vector<Geometry *>
{
(*newHoles)[i] = holes[i]->clone();
}
- Polygon *g = NULL;
+ Polygon *g = nullptr;
try {
g = new Polygon(newRing, newHoles, this);
} catch (...) {
@@ -611,7 +611,7 @@ GeometryFactory::createPolygon(const LinearRing &shell, const vector<Geometry *>
LineString *
GeometryFactory::createLineString() const
{
- return new LineString(NULL, this);
+ return new LineString(nullptr, this);
}
/*public*/
@@ -643,7 +643,7 @@ GeometryFactory::createLineString(const CoordinateSequence &fromCoords)
const
{
CoordinateSequence *newCoords = fromCoords.clone();
- LineString *g = NULL;
+ LineString *g = nullptr;
// construction failure will delete newCoords
g = new LineString(newCoords, this);
return g;
diff --git a/src/geom/LineString.cpp b/src/geom/LineString.cpp
index c0cf23b..2afe34b 100644
--- a/src/geom/LineString.cpp
+++ b/src/geom/LineString.cpp
@@ -69,7 +69,7 @@ LineString::reverse() const
void
LineString::validateConstruction()
{
- if (points.get()==NULL)
+ if (points.get()==nullptr)
{
points.reset(getFactory()->getCoordinateSequenceFactory()->create());
return;
@@ -118,7 +118,7 @@ LineString::getCoordinates() const
const CoordinateSequence*
LineString::getCoordinatesRO() const
{
- assert(0 != points.get());
+ assert(nullptr != points.get());
return points.get();
}
@@ -176,7 +176,7 @@ Point*
LineString::getStartPoint() const
{
if (isEmpty()) {
- return NULL;
+ return nullptr;
//return new Point(NULL,NULL);
}
return getPointN(0);
@@ -186,7 +186,7 @@ Point*
LineString::getEndPoint() const
{
if (isEmpty()) {
- return NULL;
+ return nullptr;
//return new Point(NULL,NULL);
}
return getPointN(getNumPoints() - 1);
@@ -364,7 +364,7 @@ LineString::compareToSameClass(const Geometry *ls) const
const Coordinate*
LineString::getCoordinate() const
{
- if (isEmpty()) return NULL;
+ if (isEmpty()) return nullptr;
return &(points->getAt(0));
}
diff --git a/src/geom/MultiLineString.cpp b/src/geom/MultiLineString.cpp
index 02f58d0..3e5e6eb 100644
--- a/src/geom/MultiLineString.cpp
+++ b/src/geom/MultiLineString.cpp
@@ -84,7 +84,7 @@ Geometry*
MultiLineString::getBoundary() const
{
if (isEmpty()) {
- return getFactory()->createGeometryCollection(NULL);
+ return getFactory()->createGeometryCollection(nullptr);
}
//Geometry *in = toInternalGeometry(this);
GeometryGraph gg(0, this);
diff --git a/src/geom/Point.cpp b/src/geom/Point.cpp
index 116a77d..0f02d68 100644
--- a/src/geom/Point.cpp
+++ b/src/geom/Point.cpp
@@ -48,7 +48,7 @@ Point::Point(CoordinateSequence *newCoords, const GeometryFactory *factory)
Geometry(factory),
coordinates(newCoords)
{
- if (coordinates.get()==NULL) {
+ if (coordinates.get()==nullptr) {
coordinates.reset(factory->getCoordinateSequenceFactory()->create());
return;
}
@@ -129,7 +129,7 @@ Point::getY() const
const Coordinate *
Point::getCoordinate() const
{
- return coordinates->getSize()!=0 ? &(coordinates->getAt(0)) : NULL;
+ return coordinates->getSize()!=0 ? &(coordinates->getAt(0)) : nullptr;
}
string
@@ -141,7 +141,7 @@ Point::getGeometryType() const
Geometry *
Point::getBoundary() const
{
- return getFactory()->createGeometryCollection(NULL);
+ return getFactory()->createGeometryCollection(nullptr);
}
Envelope::Ptr
diff --git a/src/geom/Polygon.cpp b/src/geom/Polygon.cpp
index 92cce89..01142f8 100644
--- a/src/geom/Polygon.cpp
+++ b/src/geom/Polygon.cpp
@@ -73,18 +73,18 @@ Polygon::Polygon(LinearRing *newShell, vector<Geometry *> *newHoles,
const GeometryFactory *newFactory):
Geometry(newFactory)
{
- if (newShell==NULL) {
- shell=getFactory()->createLinearRing(NULL);
+ if (newShell==nullptr) {
+ shell=getFactory()->createLinearRing(nullptr);
}
else
{
- if (newHoles != NULL && newShell->isEmpty() && hasNonEmptyElements(newHoles)) {
+ if (newHoles != nullptr && newShell->isEmpty() && hasNonEmptyElements(newHoles)) {
throw util::IllegalArgumentException("shell is empty but holes are not");
}
shell=newShell;
}
- if (newHoles==NULL)
+ if (newHoles==nullptr)
{
holes=new vector<Geometry *>();
}
@@ -151,7 +151,7 @@ Polygon::getCoordinateDimension() const
{
int dimension=2;
- if( shell != NULL )
+ if( shell != nullptr )
dimension = max(dimension,shell->getCoordinateDimension());
size_t nholes=holes->size();
@@ -476,7 +476,7 @@ bool
Polygon::isRectangle() const
{
if ( getNumInteriorRing() != 0 ) return false;
- assert(shell!=NULL);
+ assert(shell!=nullptr);
if ( shell->getNumPoints() != 5 ) return false;
const CoordinateSequence &seq = *(shell->getCoordinatesRO());
diff --git a/src/geom/prep/PreparedGeometryFactory.cpp b/src/geom/prep/PreparedGeometryFactory.cpp
index 79830c6..3eb5554 100644
--- a/src/geom/prep/PreparedGeometryFactory.cpp
+++ b/src/geom/prep/PreparedGeometryFactory.cpp
@@ -41,12 +41,12 @@ PreparedGeometryFactory::create( const geom::Geometry * g) const
{
using geos::geom::GeometryTypeId;
- if (0 == g)
+ if (nullptr == g)
{
throw util::IllegalArgumentException("PreparedGeometry constructd with null Geometry object");
}
- PreparedGeometry* pg = 0;
+ PreparedGeometry* pg = nullptr;
switch ( g->getGeometryTypeId() )
{
diff --git a/src/geom/prep/PreparedPolygon.cpp b/src/geom/prep/PreparedPolygon.cpp
index 3eb77da..25cb739 100644
--- a/src/geom/prep/PreparedPolygon.cpp
+++ b/src/geom/prep/PreparedPolygon.cpp
@@ -39,7 +39,7 @@ namespace prep { // geos.geom.prep
// public:
//
PreparedPolygon::PreparedPolygon(const geom::Geometry * geom)
- : BasicPreparedGeometry(geom), segIntFinder(0), ptOnGeomLoc(0)
+ : BasicPreparedGeometry(geom), segIntFinder(nullptr), ptOnGeomLoc(nullptr)
{
isRectangle = getGeometry().isRectangle();
}
diff --git a/src/geom/util/GeometryCombiner.cpp b/src/geom/util/GeometryCombiner.cpp
index e6a42e9..9b00945 100644
--- a/src/geom/util/GeometryCombiner.cpp
+++ b/src/geom/util/GeometryCombiner.cpp
@@ -61,7 +61,7 @@ GeometryCombiner::GeometryCombiner(std::vector<Geometry*> const& geoms)
GeometryFactory const*
GeometryCombiner::extractFactory(std::vector<Geometry*> const& geoms)
{
- return geoms.empty() ? NULL : geoms.front()->getFactory();
+ return geoms.empty() ? nullptr : geoms.front()->getFactory();
}
Geometry* GeometryCombiner::combine()
@@ -76,10 +76,10 @@ Geometry* GeometryCombiner::combine()
}
if (elems.empty()) {
- if (geomFactory != NULL) {
- return geomFactory->createGeometryCollection(NULL);
+ if (geomFactory != nullptr) {
+ return geomFactory->createGeometryCollection(nullptr);
}
- return NULL;
+ return nullptr;
}
// return the "simplest possible" geometry
@@ -89,7 +89,7 @@ Geometry* GeometryCombiner::combine()
void
GeometryCombiner::extractElements(Geometry* geom, std::vector<Geometry*>& elems)
{
- if (geom == NULL)
+ if (geom == nullptr)
return;
for (std::size_t i = 0; i < geom->getNumGeometries(); ++i) {
diff --git a/src/geom/util/GeometryEditor.cpp b/src/geom/util/GeometryEditor.cpp
index d276e15..09b8fa0 100644
--- a/src/geom/util/GeometryEditor.cpp
+++ b/src/geom/util/GeometryEditor.cpp
@@ -48,7 +48,7 @@ namespace util { // geos.geom.util
* an edited Geometry with the same GeometryFactory as the input Geometry.
*/
GeometryEditor::GeometryEditor(){
- factory=NULL;
+ factory=nullptr;
}
/**
@@ -74,7 +74,7 @@ Geometry*
GeometryEditor::edit(const Geometry *geometry, GeometryEditorOperation *operation)
{
// if client did not supply a GeometryFactory, use the one from the input Geometry
- if (factory == NULL)
+ if (factory == nullptr)
factory=geometry->getFactory();
if ( const GeometryCollection *gc =
@@ -100,7 +100,7 @@ GeometryEditor::edit(const Geometry *geometry, GeometryEditorOperation *operatio
// Unsupported Geometry classes should be caught in the GeometryEditorOperation.
assert(!static_cast<bool>("SHOULD NEVER GET HERE"));
- return NULL;
+ return nullptr;
}
Polygon*
@@ -112,7 +112,7 @@ GeometryEditor::editPolygon(const Polygon *polygon,GeometryEditorOperation *oper
if (newPolygon->isEmpty()) {
//RemoveSelectedPlugIn relies on this behaviour. [Jon Aquino]
if ( newPolygon->getFactory() != factory ) {
- Polygon *ret = factory->createPolygon(NULL, NULL);
+ Polygon *ret = factory->createPolygon(nullptr, nullptr);
delete newPolygon;
return ret;
} else {
@@ -127,7 +127,7 @@ GeometryEditor::editPolygon(const Polygon *polygon,GeometryEditorOperation *oper
//RemoveSelectedPlugIn relies on this behaviour. [Jon Aquino]
delete shell;
delete newPolygon;
- return factory->createPolygon(NULL,NULL);
+ return factory->createPolygon(nullptr,nullptr);
}
vector<Geometry*> *holes=new vector<Geometry*>;
diff --git a/src/geom/util/GeometryTransformer.cpp b/src/geom/util/GeometryTransformer.cpp
index fddd1f1..70a1515 100644
--- a/src/geom/util/GeometryTransformer.cpp
+++ b/src/geom/util/GeometryTransformer.cpp
@@ -54,8 +54,8 @@ namespace util { // geos.geom.util
/*public*/
GeometryTransformer::GeometryTransformer()
:
- factory(NULL),
- inputGeom(NULL),
+ factory(nullptr),
+ inputGeom(nullptr),
pruneEmptyGeometry(true),
preserveGeometryCollectionType(true),
preserveCollections(false),
@@ -86,21 +86,21 @@ GeometryTransformer::transform(const Geometry* nInputGeom)
factory = inputGeom->getFactory();
if ( const Point* p=dynamic_cast<const Point*>(inputGeom) )
- return transformPoint(p, NULL);
+ return transformPoint(p, nullptr);
if ( const MultiPoint* mp=dynamic_cast<const MultiPoint*>(inputGeom) )
- return transformMultiPoint(mp, NULL);
+ return transformMultiPoint(mp, nullptr);
if ( const LinearRing* lr=dynamic_cast<const LinearRing*>(inputGeom) )
- return transformLinearRing(lr, NULL);
+ return transformLinearRing(lr, nullptr);
if ( const LineString* ls=dynamic_cast<const LineString*>(inputGeom) )
- return transformLineString(ls, NULL);
+ return transformLineString(ls, nullptr);
if ( const MultiLineString* mls=dynamic_cast<const MultiLineString*>(inputGeom) )
- return transformMultiLineString(mls, NULL);
+ return transformMultiLineString(mls, nullptr);
if ( const Polygon* p=dynamic_cast<const Polygon*>(inputGeom) )
- return transformPolygon(p, NULL);
+ return transformPolygon(p, nullptr);
if ( const MultiPolygon* mp=dynamic_cast<const MultiPolygon*>(inputGeom) )
- return transformMultiPolygon(mp, NULL);
+ return transformMultiPolygon(mp, nullptr);
if ( const GeometryCollection* gc=dynamic_cast<const GeometryCollection*>(inputGeom) )
- return transformGeometryCollection(gc, NULL);
+ return transformGeometryCollection(gc, nullptr);
throw IllegalArgumentException("Unknown Geometry subtype.");
}
@@ -165,7 +165,7 @@ GeometryTransformer::transformMultiPoint(
assert(p);
Geometry::Ptr transformGeom = transformPoint(p, geom);
- if ( transformGeom.get() == NULL ) continue;
+ if ( transformGeom.get() == nullptr ) continue;
if ( transformGeom->isEmpty() ) continue;
// If an exception is thrown we'll leak
@@ -239,7 +239,7 @@ GeometryTransformer::transformMultiLineString(
assert(l);
Geometry::Ptr transformGeom = transformLineString(l, geom);
- if ( transformGeom.get() == NULL ) continue;
+ if ( transformGeom.get() == nullptr ) continue;
if ( transformGeom->isEmpty() ) continue;
// If an exception is thrown we'll leak
@@ -268,7 +268,7 @@ GeometryTransformer::transformPolygon(
assert(lr);
Geometry::Ptr shell = transformLinearRing(lr, geom);
- if ( shell.get() == NULL
+ if ( shell.get() == nullptr
|| ! dynamic_cast<LinearRing*>(shell.get())
|| shell->isEmpty() )
{
@@ -284,7 +284,7 @@ GeometryTransformer::transformPolygon(
Geometry::Ptr hole(transformLinearRing(lr, geom));
- if ( hole.get() == NULL || hole->isEmpty() ) {
+ if ( hole.get() == nullptr || hole->isEmpty() ) {
continue;
}
@@ -309,7 +309,7 @@ GeometryTransformer::transformPolygon(
{
// would like to use a manager constructor here
vector<Geometry*>* components = new vector<Geometry*>();
- if ( shell.get() != NULL ) {
+ if ( shell.get() != nullptr ) {
components->push_back(shell.release());
}
@@ -343,7 +343,7 @@ GeometryTransformer::transformMultiPolygon(
assert(p);
Geometry::Ptr transformGeom = transformPolygon(p, geom);
- if ( transformGeom.get() == NULL ) continue;
+ if ( transformGeom.get() == nullptr ) continue;
if ( transformGeom->isEmpty() ) continue;
// If an exception is thrown we'll leak
@@ -371,7 +371,7 @@ GeometryTransformer::transformGeometryCollection(
{
Geometry::Ptr transformGeom = transform(
geom->getGeometryN(i)); // no parent ?
- if ( transformGeom.get() == NULL ) continue;
+ if ( transformGeom.get() == nullptr ) continue;
if ( pruneEmptyGeometry && transformGeom->isEmpty() ) continue;
// If an exception is thrown we'll leak
diff --git a/src/geom/util/SineStarFactory.cpp b/src/geom/util/SineStarFactory.cpp
index 2086a63..0689aaa 100644
--- a/src/geom/util/SineStarFactory.cpp
+++ b/src/geom/util/SineStarFactory.cpp
@@ -85,7 +85,7 @@ SineStarFactory::createSineStar() const
geomFact->getCoordinateSequenceFactory()->create( pts.release() )
);
unique_ptr<LinearRing> ring ( geomFact->createLinearRing( cs.release() ) );
- unique_ptr<Polygon> poly ( geomFact->createPolygon(ring.release(), 0) );
+ unique_ptr<Polygon> poly ( geomFact->createPolygon(ring.release(), nullptr) );
return poly;
}
diff --git a/src/geomgraph/DirectedEdge.cpp b/src/geomgraph/DirectedEdge.cpp
index cb146c8..8e97aff 100644
--- a/src/geomgraph/DirectedEdge.cpp
+++ b/src/geomgraph/DirectedEdge.cpp
@@ -76,11 +76,11 @@ DirectedEdge::DirectedEdge(Edge *newEdge, bool newIsForward):
isForwardVar(newIsForward),
isInResultVar(false),
isVisitedVar(false),
- sym(NULL),
- next(NULL),
- nextMin(NULL),
- edgeRing(NULL),
- minEdgeRing(NULL)
+ sym(nullptr),
+ next(nullptr),
+ nextMin(nullptr),
+ edgeRing(nullptr),
+ minEdgeRing(nullptr)
{
depth[0]=0;
depth[1]=-999;
diff --git a/src/geomgraph/DirectedEdgeStar.cpp b/src/geomgraph/DirectedEdgeStar.cpp
index a41870b..58447d9 100644
--- a/src/geomgraph/DirectedEdgeStar.cpp
+++ b/src/geomgraph/DirectedEdgeStar.cpp
@@ -90,7 +90,7 @@ DirectedEdge*
DirectedEdgeStar::getRightmostEdge()
{
EdgeEndStar::iterator it=begin();
- if ( it==end() ) return NULL;
+ if ( it==end() ) return nullptr;
assert(*it);
assert(dynamic_cast<DirectedEdge*>(*it));
@@ -121,7 +121,7 @@ DirectedEdgeStar::getRightmostEdge()
return deLast;
}
assert(0); // found two horizontal edges incident on node
- return NULL;
+ return nullptr;
}
/*public*/
@@ -192,7 +192,7 @@ DirectedEdgeStar::updateLabelling(const Label& nodeLabel)
std::vector<DirectedEdge*>*
DirectedEdgeStar::getResultAreaEdges()
{
- if (resultAreaEdgeList!=NULL) return resultAreaEdgeList;
+ if (resultAreaEdgeList!=nullptr) return resultAreaEdgeList;
resultAreaEdgeList=new std::vector<DirectedEdge*>();
@@ -216,8 +216,8 @@ DirectedEdgeStar::linkResultDirectedEdges()
// make sure edges are copied to resultAreaEdges list
getResultAreaEdges();
// find first area edge (if any) to start linking at
- DirectedEdge *firstOut=NULL;
- DirectedEdge *incoming=NULL;
+ DirectedEdge *firstOut=nullptr;
+ DirectedEdge *incoming=nullptr;
int state=SCANNING_FOR_INCOMING;
// link edges in CCW order
for (std::vector<DirectedEdge*>::iterator
@@ -235,7 +235,7 @@ DirectedEdgeStar::linkResultDirectedEdges()
assert(nextIn);
// record first outgoing edge, in order to link the last incoming edge
- if (firstOut==NULL && nextOut->isInResult()) firstOut=nextOut;
+ if (firstOut==nullptr && nextOut->isInResult()) firstOut=nextOut;
switch (state) {
case SCANNING_FOR_INCOMING:
@@ -251,7 +251,7 @@ DirectedEdgeStar::linkResultDirectedEdges()
}
}
if (state==LINKING_TO_OUTGOING) {
- if (firstOut==NULL)
+ if (firstOut==nullptr)
{
throw util::TopologyException("no outgoing dirEdge found",
getCoordinate());
@@ -267,8 +267,8 @@ void
DirectedEdgeStar::linkMinimalDirectedEdges(EdgeRing *er)
{
// find first area edge (if any) to start linking at
- DirectedEdge *firstOut=NULL;
- DirectedEdge *incoming=NULL;
+ DirectedEdge *firstOut=nullptr;
+ DirectedEdge *incoming=nullptr;
int state=SCANNING_FOR_INCOMING;
// link edges in CW order
@@ -285,7 +285,7 @@ DirectedEdgeStar::linkMinimalDirectedEdges(EdgeRing *er)
assert(nextIn);
// record first outgoing edge, in order to link the last incoming edge
- if (firstOut==NULL && nextOut->getEdgeRing()==er) firstOut=nextOut;
+ if (firstOut==nullptr && nextOut->getEdgeRing()==er) firstOut=nextOut;
switch (state) {
case SCANNING_FOR_INCOMING:
if (nextIn->getEdgeRing()!=er) continue;
@@ -301,7 +301,7 @@ DirectedEdgeStar::linkMinimalDirectedEdges(EdgeRing *er)
}
}
if (state==LINKING_TO_OUTGOING) {
- assert(firstOut!=NULL); // found null for first outgoing dirEdge
+ assert(firstOut!=nullptr); // found null for first outgoing dirEdge
assert(firstOut->getEdgeRing()==er); // unable to link last incoming dirEdge
assert(incoming);
incoming->setNextMin(firstOut);
@@ -315,8 +315,8 @@ DirectedEdgeStar::linkAllDirectedEdges()
//getEdges();
// find first area edge (if any) to start linking at
- DirectedEdge *prevOut=NULL;
- DirectedEdge *firstIn=NULL;
+ DirectedEdge *prevOut=nullptr;
+ DirectedEdge *firstIn=nullptr;
// link edges in CW order
EdgeEndStar::reverse_iterator rbeginIt=rbegin();
@@ -330,8 +330,8 @@ DirectedEdgeStar::linkAllDirectedEdges()
DirectedEdge *nextIn=nextOut->getSym();
assert(nextIn);
- if (firstIn==NULL) firstIn=nextIn;
- if (prevOut!=NULL) nextIn->setNext(prevOut);
+ if (firstIn==nullptr) firstIn=nextIn;
+ if (prevOut!=nullptr) nextIn->setNext(prevOut);
// record outgoing edge, in order to link the last incoming edge
prevOut=nextOut;
}
diff --git a/src/geomgraph/Edge.cpp b/src/geomgraph/Edge.cpp
index a55726f..91126ee 100644
--- a/src/geomgraph/Edge.cpp
+++ b/src/geomgraph/Edge.cpp
@@ -89,8 +89,8 @@ Edge::~Edge()
Edge::Edge(CoordinateSequence* newPts, const Label& newLabel)
:
GraphComponent(newLabel),
- mce(NULL),
- env(NULL),
+ mce(nullptr),
+ env(nullptr),
isIsolatedVar(true),
depth(),
depthDelta(0),
@@ -104,8 +104,8 @@ Edge::Edge(CoordinateSequence* newPts, const Label& newLabel)
Edge::Edge(CoordinateSequence* newPts)
:
GraphComponent(),
- mce(NULL),
- env(NULL),
+ mce(nullptr),
+ env(nullptr),
isIsolatedVar(true),
depth(),
depthDelta(0),
@@ -120,7 +120,7 @@ MonotoneChainEdge*
Edge::getMonotoneChainEdge()
{
testInvariant();
- if (mce==NULL) mce=new MonotoneChainEdge(this);
+ if (mce==nullptr) mce=new MonotoneChainEdge(this);
return mce;
}
@@ -288,7 +288,7 @@ Envelope*
Edge::getEnvelope()
{
// compute envelope lazily
- if (env==NULL)
+ if (env==nullptr)
{
env=new Envelope();
unsigned int npts=getNumPoints();
diff --git a/src/geomgraph/EdgeEnd.cpp b/src/geomgraph/EdgeEnd.cpp
index 4fef63f..9650b8a 100644
--- a/src/geomgraph/EdgeEnd.cpp
+++ b/src/geomgraph/EdgeEnd.cpp
@@ -42,9 +42,9 @@ using namespace geos::algorithm;
/*public*/
EdgeEnd::EdgeEnd()
:
- edge(NULL),
+ edge(nullptr),
label(),
- node(NULL),
+ node(nullptr),
dx(0.0),
dy(0.0),
quadrant(0)
@@ -56,7 +56,7 @@ EdgeEnd::EdgeEnd(Edge* newEdge)
:
edge(newEdge),
label(),
- node(NULL),
+ node(nullptr),
dx(0.0),
dy(0.0),
quadrant(0)
@@ -69,7 +69,7 @@ EdgeEnd::EdgeEnd(Edge* newEdge, const Coordinate& newP0,
:
edge(newEdge),
label(newLabel),
- node(NULL),
+ node(nullptr),
dx(0.0),
dy(0.0),
quadrant(0)
@@ -83,7 +83,7 @@ EdgeEnd::EdgeEnd(Edge* newEdge, const Coordinate& newP0,
:
edge(newEdge),
label(),
- node(NULL),
+ node(nullptr),
dx(0.0),
dy(0.0),
quadrant(0)
diff --git a/src/geomgraph/EdgeEndStar.cpp b/src/geomgraph/EdgeEndStar.cpp
index a8fd178..b23b015 100644
--- a/src/geomgraph/EdgeEndStar.cpp
+++ b/src/geomgraph/EdgeEndStar.cpp
@@ -76,7 +76,7 @@ EdgeEnd*
EdgeEndStar::getNextCW(EdgeEnd *ee)
{
EdgeEndStar::iterator it=find(ee);
- if ( it==end() ) return NULL;
+ if ( it==end() ) return nullptr;
if ( it==begin() ) { it=end(); --it; }
else --it;
return *it;
diff --git a/src/geomgraph/EdgeList.cpp b/src/geomgraph/EdgeList.cpp
index 340b48e..f87b8b5 100644
--- a/src/geomgraph/EdgeList.cpp
+++ b/src/geomgraph/EdgeList.cpp
@@ -80,7 +80,7 @@ EdgeList::findEqualEdge(Edge *e)
#endif
if ( it != ocaMap.end() ) return it->second;
- return 0;
+ return nullptr;
}
Edge*
diff --git a/src/geomgraph/EdgeRing.cpp b/src/geomgraph/EdgeRing.cpp
index 3e8ff9c..a4ec1c4 100644
--- a/src/geomgraph/EdgeRing.cpp
+++ b/src/geomgraph/EdgeRing.cpp
@@ -64,9 +64,9 @@ EdgeRing::EdgeRing(DirectedEdge *newStart,
edges(),
pts(newGeometryFactory->getCoordinateSequenceFactory()->create()),
label(Location::UNDEF), // new Label(Location::UNDEF)),
- ring(NULL),
+ ring(nullptr),
isHoleVar(false),
- shell(NULL)
+ shell(nullptr)
{
/*
* Commented out to fix different polymorphism in C++ (from Java)
@@ -90,7 +90,7 @@ EdgeRing::~EdgeRing()
* destroyed by `ring' dtor and we must not destroy
* it twice.
*/
- if ( ring == NULL )
+ if ( ring == nullptr )
{
delete pts;
}
@@ -149,7 +149,7 @@ bool
EdgeRing::isShell()
{
testInvariant();
- return (shell==NULL);
+ return (shell==nullptr);
}
EdgeRing*
@@ -163,7 +163,7 @@ void
EdgeRing::setShell(EdgeRing *newShell)
{
shell=newShell;
- if (shell!=NULL) shell->addHole(this);
+ if (shell!=nullptr) shell->addHole(this);
testInvariant();
}
@@ -202,7 +202,7 @@ EdgeRing::computeRing()
{
testInvariant();
- if (ring!=NULL) return; // don't compute more than once
+ if (ring!=nullptr) return; // don't compute more than once
ring=geometryFactory->createLinearRing(pts);
isHoleVar=CGAlgorithms::isCCW(pts);
@@ -230,7 +230,7 @@ EdgeRing::computePoints(DirectedEdge *newStart)
do {
//util::Assert::isTrue(de!=NULL,"EdgeRing::computePoints: found null Directed Edge");
//assert(de!=NULL); // EdgeRing::computePoints: found null Directed Edge
- if(de==NULL)
+ if(de==nullptr)
throw util::TopologyException(
"EdgeRing::computePoints: found null Directed Edge");
@@ -333,7 +333,7 @@ void
EdgeRing::addPoints(Edge *edge, bool isForward, bool isFirstEdge)
{
// EdgeRing::addPoints: can't add points after LinearRing construction
- assert(ring==NULL);
+ assert(ring==nullptr);
assert(edge);
const CoordinateSequence* edgePts=edge->getCoordinates();
diff --git a/src/geomgraph/GeometryGraph.cpp b/src/geomgraph/GeometryGraph.cpp
index 53d4bbf..dafe6ee 100644
--- a/src/geomgraph/GeometryGraph.cpp
+++ b/src/geomgraph/GeometryGraph.cpp
@@ -547,7 +547,7 @@ GeometryGraph::GeometryGraph(int newArgIndex,
argIndex(newArgIndex),
hasTooFewPointsVar(false)
{
- if (parentGeom!=NULL) add(parentGeom);
+ if (parentGeom!=nullptr) add(parentGeom);
}
GeometryGraph::GeometryGraph(int newArgIndex,
@@ -561,13 +561,13 @@ GeometryGraph::GeometryGraph(int newArgIndex,
argIndex(newArgIndex),
hasTooFewPointsVar(false)
{
- if (parentGeom!=NULL) add(parentGeom);
+ if (parentGeom!=nullptr) add(parentGeom);
}
GeometryGraph::GeometryGraph()
:
PlanarGraph(),
- parentGeom(NULL),
+ parentGeom(nullptr),
useBoundaryDeterminationRule(true),
boundaryNodeRule(algorithm::BoundaryNodeRule::getBoundaryOGCSFS()),
argIndex(-1),
diff --git a/src/geomgraph/NodeFactory.cpp b/src/geomgraph/NodeFactory.cpp
index c9fe34e..ae1a754 100644
--- a/src/geomgraph/NodeFactory.cpp
+++ b/src/geomgraph/NodeFactory.cpp
@@ -28,7 +28,7 @@ namespace geomgraph { // geos.geomgraph
Node *
NodeFactory::createNode(const Coordinate &coord) const
{
- return new Node(coord,NULL);
+ return new Node(coord,nullptr);
}
const NodeFactory &
diff --git a/src/geomgraph/NodeMap.cpp b/src/geomgraph/NodeMap.cpp
index 7cc7ffe..44ebc92 100644
--- a/src/geomgraph/NodeMap.cpp
+++ b/src/geomgraph/NodeMap.cpp
@@ -62,7 +62,7 @@ NodeMap::addNode(const Coordinate& coord)
cerr<<"["<<this<<"] NodeMap::addNode("<<coord.toString()<<")";
#endif
Node *node=find(coord);
- if (node==NULL) {
+ if (node==nullptr) {
#if GEOS_DEBUG
cerr<<" is new"<<endl;
#endif
@@ -94,7 +94,7 @@ NodeMap::addNode(Node *n)
#endif
Coordinate *c=const_cast<Coordinate *>(&n->getCoordinate());
Node *node=find(*c);
- if (node==NULL) {
+ if (node==nullptr) {
#if GEOS_DEBUG
cerr<<" is new"<<endl;
#endif
@@ -136,7 +136,7 @@ NodeMap::find(const Coordinate& coord) const
NodeMap::const_iterator found=nodeMap.find(c);
if (found==nodeMap.end())
- return NULL;
+ return nullptr;
else
return found->second;
}
diff --git a/src/geomgraph/PlanarGraph.cpp b/src/geomgraph/PlanarGraph.cpp
index a1db6e5..859f1bd 100644
--- a/src/geomgraph/PlanarGraph.cpp
+++ b/src/geomgraph/PlanarGraph.cpp
@@ -111,7 +111,7 @@ PlanarGraph::isBoundaryNode(int geomIndex, const Coordinate& coord)
assert(nodes);
Node *node=nodes->find(coord);
- if (node==NULL) return false;
+ if (node==nullptr) return false;
const Label& label = node->getLabel();
if (! label.isNull() && label.getLocation(geomIndex)==Location::BOUNDARY)
@@ -290,7 +290,7 @@ PlanarGraph::findEdgeEnd(Edge *e)
// should test using values rather then pointers ?
if (ee->getEdge()==e) return ee;
}
- return NULL;
+ return nullptr;
}
/*public*/
@@ -308,7 +308,7 @@ PlanarGraph::findEdge(const Coordinate& p0, const Coordinate& p1)
if (p0==eCoord->getAt(0) && p1==eCoord->getAt(1))
return e;
}
- return NULL;
+ return nullptr;
}
/*public*/
@@ -342,7 +342,7 @@ PlanarGraph::findEdgeInSameDirection(const Coordinate& p0,
}
}
- return NULL;
+ return nullptr;
}
/*private*/
diff --git a/src/geomgraph/index/SimpleMCSweepLineIntersector.cpp b/src/geomgraph/index/SimpleMCSweepLineIntersector.cpp
index 92d8669..4f1e56e 100644
--- a/src/geomgraph/index/SimpleMCSweepLineIntersector.cpp
+++ b/src/geomgraph/index/SimpleMCSweepLineIntersector.cpp
@@ -49,7 +49,7 @@ SimpleMCSweepLineIntersector::computeIntersections(vector<Edge*> *edges,
SegmentIntersector *si, bool testAllSegments)
{
if (testAllSegments)
- add(edges,NULL);
+ add(edges,nullptr);
else
add(edges);
computeIntersections(si);
@@ -96,7 +96,7 @@ SimpleMCSweepLineIntersector::add(Edge *edge, void* edgeSet)
{
GEOS_CHECK_FOR_INTERRUPTS();
MonotoneChain *mc=new MonotoneChain(mce,i);
- SweepLineEvent *insertEvent=new SweepLineEvent(edgeSet,mce->getMinX(i),NULL,mc);
+ SweepLineEvent *insertEvent=new SweepLineEvent(edgeSet,mce->getMinX(i),nullptr,mc);
events.push_back(insertEvent);
events.push_back(new SweepLineEvent(edgeSet,mce->getMaxX(i),insertEvent,mc));
}
@@ -161,7 +161,7 @@ SimpleMCSweepLineIntersector::processOverlaps(int start, int end,
MonotoneChain *mc1=(MonotoneChain*) ev1->getObject();
// don't compare edges in same group
// null group indicates that edges should be compared
- if (ev0->edgeSet==NULL || (ev0->edgeSet!=ev1->edgeSet))
+ if (ev0->edgeSet==nullptr || (ev0->edgeSet!=ev1->edgeSet))
{
mc0->computeIntersections(mc1,si);
nOverlaps++;
diff --git a/src/geomgraph/index/SimpleSweepLineIntersector.cpp b/src/geomgraph/index/SimpleSweepLineIntersector.cpp
index e409fc0..0b09710 100644
--- a/src/geomgraph/index/SimpleSweepLineIntersector.cpp
+++ b/src/geomgraph/index/SimpleSweepLineIntersector.cpp
@@ -47,7 +47,7 @@ SimpleSweepLineIntersector::computeIntersections(vector<Edge*> *edges,
SegmentIntersector *si, bool testAllSegments)
{
if (testAllSegments)
- add(edges,NULL);
+ add(edges,nullptr);
else
add(edges);
computeIntersections(si);
@@ -90,7 +90,7 @@ SimpleSweepLineIntersector::add(Edge *edge, void* edgeSet)
for(std::size_t i=0; i<n; ++i)
{
SweepLineSegment *ss=new SweepLineSegment(edge, i);
- SweepLineEvent *insertEvent=new SweepLineEvent(edgeSet, ss->getMinX(), NULL, ss);
+ SweepLineEvent *insertEvent=new SweepLineEvent(edgeSet, ss->getMinX(), nullptr, ss);
events.push_back(insertEvent);
events.push_back(new SweepLineEvent(edgeSet, ss->getMaxX(), insertEvent, ss));
}
@@ -148,7 +148,7 @@ SimpleSweepLineIntersector::processOverlaps(int start,int end,SweepLineEvent *ev
if (ev1->isInsert())
{
SweepLineSegment *ss1=(SweepLineSegment*) ev1->getObject();
- if (ev0->edgeSet==NULL || (ev0->edgeSet!=ev1->edgeSet))
+ if (ev0->edgeSet==nullptr || (ev0->edgeSet!=ev1->edgeSet))
{
ss0->computeIntersections(ss1,si);
nOverlaps++;
diff --git a/src/geomgraph/index/SweepLineEvent.cpp b/src/geomgraph/index/SweepLineEvent.cpp
index f076eeb..81951f8 100644
--- a/src/geomgraph/index/SweepLineEvent.cpp
+++ b/src/geomgraph/index/SweepLineEvent.cpp
@@ -32,7 +32,7 @@ SweepLineEvent::SweepLineEvent(void* newEdgeSet, double x,
insertEvent(newInsertEvent),
deleteEventIndex(0)
{
- if(insertEvent!=NULL) eventType=DELETE_EVENT;
+ if(insertEvent!=nullptr) eventType=DELETE_EVENT;
else eventType=INSERT_EVENT;
}
diff --git a/src/index/bintree/Bintree.cpp b/src/index/bintree/Bintree.cpp
index 35f333d..c09dc82 100644
--- a/src/index/bintree/Bintree.cpp
+++ b/src/index/bintree/Bintree.cpp
@@ -66,14 +66,14 @@ Bintree::~Bintree()
int
Bintree::depth()
{
- if (root!=NULL) return root->depth();
+ if (root!=nullptr) return root->depth();
return 0;
}
int
Bintree::size()
{
- if (root!=NULL) return root->size();
+ if (root!=nullptr) return root->size();
return 0;
}
@@ -85,7 +85,7 @@ Bintree::size()
int
Bintree::nodeSize()
{
- if (root!=NULL) return root->nodeSize();
+ if (root!=nullptr) return root->nodeSize();
return 0;
}
diff --git a/src/index/bintree/Key.cpp b/src/index/bintree/Key.cpp
index 2a38375..96dca54 100644
--- a/src/index/bintree/Key.cpp
+++ b/src/index/bintree/Key.cpp
@@ -35,7 +35,7 @@ Key::computeLevel(Interval *newInterval)
Key::Key(Interval *newInterval)
{
- interval=NULL;
+ interval=nullptr;
pt=0.0;
level=0;
computeKey(newInterval);
diff --git a/src/index/bintree/Node.cpp b/src/index/bintree/Node.cpp
index 8bb367a..5d9cd56 100644
--- a/src/index/bintree/Node.cpp
+++ b/src/index/bintree/Node.cpp
@@ -38,9 +38,9 @@ Node*
Node::createExpanded(Node *node,Interval *addInterval)
{
Interval *expandInt=new Interval(addInterval);
- if (node!=NULL) expandInt->expandToInclude(node->interval);
+ if (node!=nullptr) expandInt->expandToInclude(node->interval);
Node *largerNode=createNode(expandInt);
- if (node!=NULL) largerNode->insert(node);
+ if (node!=nullptr) largerNode->insert(node);
delete expandInt;
return largerNode;
}
@@ -99,7 +99,7 @@ Node::find(Interval *searchInterval)
int subnodeIndex=getSubnodeIndex(searchInterval,centre);
if (subnodeIndex==-1)
return this;
- if (subnode[subnodeIndex]!=NULL) {
+ if (subnode[subnodeIndex]!=nullptr) {
// query lies in subnode, so search it
Node *node=subnode[subnodeIndex];
return node->find(searchInterval);
@@ -111,7 +111,7 @@ Node::find(Interval *searchInterval)
void
Node::insert(Node *node)
{
- assert(interval==NULL || interval->contains(node->interval));
+ assert(interval==nullptr || interval->contains(node->interval));
int index=getSubnodeIndex(node->interval,centre);
assert(index >= 0);
if (node->level==level-1) {
@@ -132,7 +132,7 @@ Node::insert(Node *node)
Node*
Node::getSubnode(int index)
{
- if (subnode[index]==NULL) {
+ if (subnode[index]==nullptr) {
subnode[index]=createSubnode(index);
}
return subnode[index];
diff --git a/src/index/bintree/NodeBase.cpp b/src/index/bintree/NodeBase.cpp
index a6b28c8..ee89d93 100644
--- a/src/index/bintree/NodeBase.cpp
+++ b/src/index/bintree/NodeBase.cpp
@@ -44,8 +44,8 @@ NodeBase::getSubnodeIndex(Interval *interval, double centre)
NodeBase::NodeBase()
{
items=new vector<void*>();
- subnode[0]=NULL;
- subnode[1]=NULL;
+ subnode[0]=nullptr;
+ subnode[1]=nullptr;
}
NodeBase::~NodeBase() {
@@ -55,8 +55,8 @@ NodeBase::~NodeBase() {
delete items;
delete subnode[0];
delete subnode[1];
- subnode[0]=NULL;
- subnode[1]=NULL;
+ subnode[0]=nullptr;
+ subnode[1]=nullptr;
}
vector<void*>*
@@ -72,7 +72,7 @@ void NodeBase::add(void* item){
vector<void*>* NodeBase::addAllItems(vector<void*> *newItems) {
items->insert(items->end(),newItems->begin(),newItems->end());
for(int i=0;i<2;i++) {
- if (subnode[i]!=NULL) {
+ if (subnode[i]!=nullptr) {
subnode[i]->addAllItems(newItems);
}
}
@@ -86,7 +86,7 @@ NodeBase::addAllItemsFromOverlapping(Interval *interval,vector<void*> *resultIte
return items;
resultItems->insert(resultItems->end(),items->begin(),items->end());
for (int i=0;i<2;i++) {
- if (subnode[i]!=NULL) {
+ if (subnode[i]!=nullptr) {
subnode[i]->addAllItemsFromOverlapping(interval,resultItems);
}
}
@@ -98,7 +98,7 @@ NodeBase::depth()
{
int maxSubDepth=0;
for (int i=0;i<2;i++) {
- if (subnode[i]!=NULL) {
+ if (subnode[i]!=nullptr) {
int sqd=subnode[i]->depth();
if (sqd>maxSubDepth)
maxSubDepth=sqd;
@@ -112,7 +112,7 @@ NodeBase::size()
{
int subSize=0;
for (int i=0;i<2;i++) {
- if (subnode[i]!=NULL) {
+ if (subnode[i]!=nullptr) {
subSize+=subnode[i]->size();
}
}
@@ -124,7 +124,7 @@ NodeBase::nodeSize()
{
int subSize=0;
for (int i=0;i<2;i++) {
- if (subnode[i]!=NULL) {
+ if (subnode[i]!=nullptr) {
subSize+=subnode[i]->nodeSize();
}
}
diff --git a/src/index/bintree/Root.cpp b/src/index/bintree/Root.cpp
index f706bbe..0dfe939 100644
--- a/src/index/bintree/Root.cpp
+++ b/src/index/bintree/Root.cpp
@@ -47,7 +47,7 @@ Root::insert(Interval *itemInterval,void* item)
* If the subnode doesn't exist or this item is not contained in it,
* have to expand the tree upward to contain the item.
*/
- if (node==NULL || !node->getInterval()->contains(itemInterval))
+ if (node==nullptr || !node->getInterval()->contains(itemInterval))
{
Node* largerNode=Node::createExpanded(node,itemInterval);
// delete subnode[index];
diff --git a/src/index/chain/MonotoneChain.cpp b/src/index/chain/MonotoneChain.cpp
index 9396bc3..633e74a 100644
--- a/src/index/chain/MonotoneChain.cpp
+++ b/src/index/chain/MonotoneChain.cpp
@@ -34,7 +34,7 @@ MonotoneChain::MonotoneChain(const geom::CoordinateSequence& newPts,
size_t nstart, size_t nend, void* nContext)
:
pts(newPts),
- env(0),
+ env(nullptr),
context(nContext),
start(nstart),
end(nend),
@@ -50,7 +50,7 @@ MonotoneChain::~MonotoneChain()
const Envelope&
MonotoneChain::getEnvelope() const
{
- if (0 == env)
+ if (nullptr == env)
{
const Coordinate& p0 = pts[start];
const Coordinate& p1 = pts[end];
diff --git a/src/index/intervalrtree/SortedPackedIntervalRTree.cpp b/src/index/intervalrtree/SortedPackedIntervalRTree.cpp
index eef0c12..eda819b 100644
--- a/src/index/intervalrtree/SortedPackedIntervalRTree.cpp
+++ b/src/index/intervalrtree/SortedPackedIntervalRTree.cpp
@@ -34,7 +34,7 @@ namespace intervalrtree {
void
SortedPackedIntervalRTree::init()
{
- if (root != NULL) return;
+ if (root != nullptr) return;
root = buildTree();
}
@@ -104,13 +104,13 @@ SortedPackedIntervalRTree::buildLevel( IntervalRTreeNode::ConstVect * src, Inter
SortedPackedIntervalRTree::SortedPackedIntervalRTree()
:
leaves( new IntervalRTreeNode::ConstVect()),
- root( NULL),
+ root( nullptr),
level( 0)
{ }
SortedPackedIntervalRTree::~SortedPackedIntervalRTree()
{
- if ( root != NULL )
+ if ( root != nullptr )
{
// deleting root cascades to all IntervalRTreeNode's
delete root;
@@ -128,7 +128,7 @@ SortedPackedIntervalRTree::~SortedPackedIntervalRTree()
void
SortedPackedIntervalRTree::insert( double min, double max, void * item)
{
- if (root != NULL)
+ if (root != nullptr)
throw new util::UnsupportedOperationException( "Index cannot be added to once it has been queried");
leaves->push_back( new IntervalRTreeLeafNode( min, max, item));
diff --git a/src/index/quadtree/Node.cpp b/src/index/quadtree/Node.cpp
index 1499203..2e30440 100644
--- a/src/index/quadtree/Node.cpp
+++ b/src/index/quadtree/Node.cpp
@@ -101,7 +101,7 @@ Node::find(const Envelope *searchEnv)
int subnodeIndex=getSubnodeIndex(searchEnv, centre);
if (subnodeIndex==-1)
return this;
- if (subnode[subnodeIndex]!=NULL) {
+ if (subnode[subnodeIndex]!=nullptr) {
// query lies in subquad, so search it
Node *node=subnode[subnodeIndex];
return node->find(searchEnv);
@@ -145,7 +145,7 @@ Node*
Node::getSubnode(int index)
{
assert(index >=0 && index < 4);
- if (subnode[index] == NULL)
+ if (subnode[index] == nullptr)
{
subnode[index] = createSubnode(index).release();
}
diff --git a/src/index/quadtree/NodeBase.cpp b/src/index/quadtree/NodeBase.cpp
index 5db94a3..108bf66 100644
--- a/src/index/quadtree/NodeBase.cpp
+++ b/src/index/quadtree/NodeBase.cpp
@@ -63,10 +63,10 @@ NodeBase::getSubnodeIndex(const Envelope *env, const Coordinate& centre)
NodeBase::NodeBase()
{
- subnode[0]=0;
- subnode[1]=0;
- subnode[2]=0;
- subnode[3]=0;
+ subnode[0]=nullptr;
+ subnode[1]=nullptr;
+ subnode[2]=nullptr;
+ subnode[3]=nullptr;
}
NodeBase::~NodeBase()
@@ -75,10 +75,10 @@ NodeBase::~NodeBase()
delete subnode[1];
delete subnode[2];
delete subnode[3];
- subnode[0]=NULL;
- subnode[1]=NULL;
- subnode[2]=NULL;
- subnode[3]=NULL;
+ subnode[0]=nullptr;
+ subnode[1]=nullptr;
+ subnode[2]=nullptr;
+ subnode[3]=nullptr;
}
vector<void*>&
@@ -141,7 +141,7 @@ NodeBase::depth() const
unsigned int maxSubDepth=0;
for (int i=0; i<4; ++i)
{
- if (subnode[i] != NULL)
+ if (subnode[i] != nullptr)
{
unsigned int sqd=subnode[i]->depth();
if ( sqd > maxSubDepth )
@@ -157,7 +157,7 @@ NodeBase::size() const
unsigned int subSize=0;
for(int i=0; i<4; i++)
{
- if (subnode[i] != NULL)
+ if (subnode[i] != nullptr)
{
subSize += subnode[i]->size();
}
@@ -171,7 +171,7 @@ NodeBase::getNodeCount() const
unsigned int subSize=0;
for(int i=0; i<4; ++i)
{
- if (subnode[i] != NULL)
+ if (subnode[i] != nullptr)
{
subSize += subnode[i]->size();
}
@@ -188,7 +188,7 @@ NodeBase::toString() const
for (int i=0; i<4; i++)
{
s<<"subnode["<<i<<"] ";
- if ( subnode[i] == NULL ) s<<"NULL";
+ if ( subnode[i] == nullptr ) s<<"NULL";
else s<<subnode[i]->toString();
s<<endl;
}
@@ -206,7 +206,7 @@ NodeBase::visit(const Envelope* searchEnv, ItemVisitor& visitor)
visitItems(searchEnv, visitor);
for (int i = 0; i < 4; i++) {
- if (subnode[i] != NULL) {
+ if (subnode[i] != nullptr) {
subnode[i]->visit(searchEnv, visitor);
}
}
@@ -246,7 +246,7 @@ NodeBase::remove(const Envelope* itemEnv, void* item)
if (subnode[i]->isPrunable())
{
delete subnode[i];
- subnode[i] = NULL;
+ subnode[i] = nullptr;
}
break;
}
diff --git a/src/index/quadtree/Root.cpp b/src/index/quadtree/Root.cpp
index 27a2424..a0301fc 100644
--- a/src/index/quadtree/Root.cpp
+++ b/src/index/quadtree/Root.cpp
@@ -76,10 +76,10 @@ Root::insert(const Envelope *itemEnv, void* item)
* If the subquad doesn't exist or this item is not contained in it,
* have to expand the tree upward to contain the item.
*/
- if (node==NULL || !node->getEnvelope()->contains(itemEnv))
+ if (node==nullptr || !node->getEnvelope()->contains(itemEnv))
{
std::unique_ptr<Node> snode (node); // may be NULL
- node = 0; subnode[index] = 0;
+ node = nullptr; subnode[index] = nullptr;
std::unique_ptr<Node> largerNode =
Node::createExpanded(std::move(snode), *itemEnv);
diff --git a/src/index/strtree/AbstractNode.cpp b/src/index/strtree/AbstractNode.cpp
index 7198f16..4000231 100644
--- a/src/index/strtree/AbstractNode.cpp
+++ b/src/index/strtree/AbstractNode.cpp
@@ -32,7 +32,7 @@ namespace strtree { // geos.index.strtree
*/
AbstractNode::AbstractNode(int newLevel, int capacity) {
childBoundables.reserve(capacity);
- bounds=NULL;
+ bounds=nullptr;
level=newLevel;
}
@@ -42,7 +42,7 @@ AbstractNode::~AbstractNode() {
const void *
AbstractNode::getBounds() const
{
- if (bounds==NULL) {
+ if (bounds==nullptr) {
bounds = computeBounds();
}
return bounds;
@@ -61,7 +61,7 @@ int AbstractNode::getLevel() {
* (wrapped in an ItemBoundable)
*/
void AbstractNode::addChildBoundable(Boundable *childBoundable) {
- assert(bounds==NULL);
+ assert(bounds==nullptr);
childBoundables.push_back(childBoundable);
}
diff --git a/src/index/strtree/AbstractSTRtree.cpp b/src/index/strtree/AbstractSTRtree.cpp
index fd2f926..44d73f3 100644
--- a/src/index/strtree/AbstractSTRtree.cpp
+++ b/src/index/strtree/AbstractSTRtree.cpp
@@ -33,7 +33,7 @@ namespace strtree { // geos.index.strtree
AbstractSTRtree::~AbstractSTRtree()
{
- assert(0 != itemBoundables);
+ assert(nullptr != itemBoundables);
BoundableList::iterator it = itemBoundables->begin();
BoundableList::iterator end = itemBoundables->end();
while (it != end)
@@ -43,7 +43,7 @@ AbstractSTRtree::~AbstractSTRtree()
}
delete itemBoundables;
- assert(0 != nodes);
+ assert(nullptr != nodes);
for (std::size_t i = 0, nsize = nodes->size(); i < nsize; i++)
{
delete (*nodes)[i];
@@ -125,7 +125,7 @@ AbstractSTRtree::query(const void* searchBounds, vector<void*>& matches)
{
if (!built) build();
- if (itemBoundables->empty()) assert(root->getBounds()==NULL);
+ if (itemBoundables->empty()) assert(root->getBounds()==nullptr);
if (getIntersectsOp()->intersects(root->getBounds(), searchBounds))
{
@@ -139,7 +139,7 @@ AbstractSTRtree::query(const void* searchBounds, ItemVisitor& visitor)
{
if (!built) build();
- if (itemBoundables->empty()) assert(root->getBounds()==NULL);
+ if (itemBoundables->empty()) assert(root->getBounds()==nullptr);
if (getIntersectsOp()->intersects(root->getBounds(),searchBounds))
{
@@ -184,7 +184,7 @@ AbstractSTRtree::remove(const void* searchBounds, void* item)
{
if (!built) build();
if (itemBoundables->empty()) {
- assert(root->getBounds() == NULL);
+ assert(root->getBounds() == nullptr);
}
if (getIntersectsOp()->intersects(root->getBounds(), searchBounds)) {
return remove(searchBounds, *root, item);
@@ -362,7 +362,7 @@ ItemsList* AbstractSTRtree::itemsTree(AbstractNode* node)
ItemsList* valuesTreeForChild =
itemsTree(static_cast<AbstractNode*>(childBoundable));
// only add if not null (which indicates an item somewhere in this tree
- if (valuesTreeForChild != NULL)
+ if (valuesTreeForChild != nullptr)
valuesTreeForNode->push_back_owned(valuesTreeForChild);
}
else if (dynamic_cast<ItemBoundable*>(childBoundable)) {
@@ -374,7 +374,7 @@ ItemsList* AbstractSTRtree::itemsTree(AbstractNode* node)
}
}
if (valuesTreeForNode->empty())
- return NULL;
+ return nullptr;
return valuesTreeForNode.release();
}
@@ -386,7 +386,7 @@ ItemsList* AbstractSTRtree::itemsTree()
}
ItemsList* valuesTree (itemsTree(root));
- if (valuesTree == NULL)
+ if (valuesTree == nullptr)
return new ItemsList();
return valuesTree;
diff --git a/src/index/strtree/BoundablePair.cpp b/src/index/strtree/BoundablePair.cpp
index 36b6262..8a0c21c 100644
--- a/src/index/strtree/BoundablePair.cpp
+++ b/src/index/strtree/BoundablePair.cpp
@@ -63,7 +63,7 @@ bool BoundablePair::isLeaves() const {
}
bool BoundablePair::isComposite(const Boundable* item) {
- return dynamic_cast<const AbstractNode*>(item) != NULL;
+ return dynamic_cast<const AbstractNode*>(item) != nullptr;
}
double BoundablePair::area(const Boundable* b) {
diff --git a/src/index/strtree/SIRtree.cpp b/src/index/strtree/SIRtree.cpp
index 001ca21..3c5505b 100644
--- a/src/index/strtree/SIRtree.cpp
+++ b/src/index/strtree/SIRtree.cpp
@@ -100,12 +100,12 @@ protected:
void* computeBounds() const
{
- Interval* bounds=NULL;
+ Interval* bounds=nullptr;
const BoundableList& b = *getChildBoundables();
for(unsigned int i=0; i<b.size(); ++i)
{
const Boundable* childBoundable=b[i];
- if (bounds==NULL) {
+ if (bounds==nullptr) {
bounds=new Interval(*((Interval*)childBoundable->getBounds()));
} else {
bounds->expandToInclude((Interval*)childBoundable->getBounds());
diff --git a/src/index/strtree/STRtree.cpp b/src/index/strtree/STRtree.cpp
index 9bc8435..4670811 100644
--- a/src/index/strtree/STRtree.cpp
+++ b/src/index/strtree/STRtree.cpp
@@ -211,7 +211,7 @@ std::pair<const void*, const void*> STRtree::nearestNeighbour(STRtree* tree, Ite
std::pair<const void*, const void*> STRtree::nearestNeighbour(BoundablePair* initBndPair, double maxDistance) {
double distanceLowerBound = maxDistance;
- BoundablePair* minPair = NULL;
+ BoundablePair* minPair = nullptr;
BoundablePair::BoundablePairQueue priQ;
priQ.push(initBndPair);
@@ -291,10 +291,10 @@ protected:
void* computeBounds() const
{
- Envelope* bounds=NULL;
+ Envelope* bounds=nullptr;
const BoundableList& b = *getChildBoundables();
- if ( b.empty() ) return NULL;
+ if ( b.empty() ) return nullptr;
BoundableList::const_iterator i=b.begin();
BoundableList::const_iterator e=b.end();
diff --git a/src/index/sweepline/SweepLineEvent.cpp b/src/index/sweepline/SweepLineEvent.cpp
index 3b86f2a..f0c1b20 100644
--- a/src/index/sweepline/SweepLineEvent.cpp
+++ b/src/index/sweepline/SweepLineEvent.cpp
@@ -27,20 +27,20 @@ SweepLineEvent::SweepLineEvent(double x, SweepLineEvent *newInsertEvent,
insertEvent(newInsertEvent),
sweepInt(newSweepInt)
{
- if (insertEvent!=0)
+ if (insertEvent!=nullptr)
eventType=SweepLineEvent::DELETE_EVENT;
}
bool
SweepLineEvent::isInsert()
{
- return insertEvent==0;
+ return insertEvent==nullptr;
}
bool
SweepLineEvent::isDelete()
{
- return insertEvent!=0;
+ return insertEvent!=nullptr;
}
SweepLineEvent*
diff --git a/src/index/sweepline/SweepLineIndex.cpp b/src/index/sweepline/SweepLineIndex.cpp
index 2101f2c..89037da 100644
--- a/src/index/sweepline/SweepLineIndex.cpp
+++ b/src/index/sweepline/SweepLineIndex.cpp
@@ -44,7 +44,7 @@ void
SweepLineIndex::add(SweepLineInterval *sweepInt)
{
// FIXME: who's going to delete the newly-created events ?
- SweepLineEvent *insertEvent=new SweepLineEvent(sweepInt->getMin(),NULL,sweepInt);
+ SweepLineEvent *insertEvent=new SweepLineEvent(sweepInt->getMin(),nullptr,sweepInt);
events.push_back(insertEvent);
events.push_back(new SweepLineEvent(sweepInt->getMax(), insertEvent, sweepInt));
}
diff --git a/src/io/CLocalizer.cpp b/src/io/CLocalizer.cpp
index b4e4713..bea037f 100644
--- a/src/io/CLocalizer.cpp
+++ b/src/io/CLocalizer.cpp
@@ -32,8 +32,8 @@ CLocalizer::CLocalizer()
// Avoid multithreading issues caused by setlocale
_configthreadlocale(_ENABLE_PER_THREAD_LOCALE);
#endif
- char* p = std::setlocale(LC_NUMERIC, NULL);
- if (0 != p)
+ char* p = std::setlocale(LC_NUMERIC, nullptr);
+ if (nullptr != p)
{
saved_locale = p;
}
diff --git a/src/io/WKBReader.cpp b/src/io/WKBReader.cpp
index 99cf8cd..655282b 100644
--- a/src/io/WKBReader.cpp
+++ b/src/io/WKBReader.cpp
@@ -355,11 +355,11 @@ WKBReader::readPolygon()
cout<<"WKB numRings: "<<numRings<<endl;
#endif
- LinearRing *shell = NULL;
+ LinearRing *shell = nullptr;
if( numRings > 0 )
shell = readLinearRing();
- vector<Geometry *>*holes=NULL;
+ vector<Geometry *>*holes=nullptr;
if ( numRings > 1 )
{
try {
diff --git a/src/io/WKBWriter.cpp b/src/io/WKBWriter.cpp
index 7beaa97..42debda 100644
--- a/src/io/WKBWriter.cpp
+++ b/src/io/WKBWriter.cpp
@@ -45,7 +45,7 @@ namespace geos {
namespace io { // geos.io
WKBWriter::WKBWriter(int dims, int bo, bool srid):
- defaultOutputDimension(dims), byteOrder(bo), includeSRID(srid), outStream(NULL)
+ defaultOutputDimension(dims), byteOrder(bo), includeSRID(srid), outStream(nullptr)
{
if ( dims < 2 || dims > 3 )
throw util::IllegalArgumentException("WKB output dimension must be 2 or 3");
diff --git a/src/io/WKTReader.cpp b/src/io/WKTReader.cpp
index 25e24dc..441b4ed 100644
--- a/src/io/WKTReader.cpp
+++ b/src/io/WKTReader.cpp
@@ -63,7 +63,7 @@ WKTReader::read(const string &wellKnownText)
//unique_ptr<StringTokenizer> tokenizer(new StringTokenizer(wellKnownText));
CLocalizer clocale;
StringTokenizer tokenizer(wellKnownText);
- Geometry *g=NULL;
+ Geometry *g=nullptr;
g=readGeometryTaggedText(&tokenizer);
return g;
}
@@ -367,11 +367,11 @@ WKTReader::readMultiPointText(StringTokenizer *tokenizer)
Polygon*
WKTReader::readPolygonText(StringTokenizer *tokenizer)
{
- Polygon *poly=NULL;
- LinearRing *shell=NULL;
+ Polygon *poly=nullptr;
+ LinearRing *shell=nullptr;
string nextToken=getNextEmptyOrOpener(tokenizer);
if (nextToken=="EMPTY") {
- return geometryFactory->createPolygon(NULL,NULL);
+ return geometryFactory->createPolygon(nullptr,nullptr);
}
vector<Geometry *> *holes=new vector<Geometry *>();
@@ -397,19 +397,19 @@ WKTReader::readPolygonText(StringTokenizer *tokenizer)
MultiLineString* WKTReader::readMultiLineStringText(StringTokenizer *tokenizer) {
string nextToken=getNextEmptyOrOpener(tokenizer);
if (nextToken=="EMPTY") {
- return geometryFactory->createMultiLineString(NULL);
+ return geometryFactory->createMultiLineString(nullptr);
}
vector<Geometry *> *lineStrings=new vector<Geometry *>();
- LineString *lineString = NULL;
+ LineString *lineString = nullptr;
try {
lineString=readLineStringText(tokenizer);
lineStrings->push_back(lineString);
- lineString=NULL;
+ lineString=nullptr;
nextToken=getNextCloserOrComma(tokenizer);
while(nextToken==",") {
lineString=readLineStringText(tokenizer);
lineStrings->push_back(lineString);
- lineString=NULL;
+ lineString=nullptr;
nextToken=getNextCloserOrComma(tokenizer);
}
} catch (...) {
@@ -427,19 +427,19 @@ MultiLineString* WKTReader::readMultiLineStringText(StringTokenizer *tokenizer)
MultiPolygon* WKTReader::readMultiPolygonText(StringTokenizer *tokenizer) {
string nextToken=getNextEmptyOrOpener(tokenizer);
if (nextToken=="EMPTY") {
- return geometryFactory->createMultiPolygon(NULL);
+ return geometryFactory->createMultiPolygon(nullptr);
}
vector<Geometry *> *polygons=new vector<Geometry *>();
- Polygon *polygon = NULL;
+ Polygon *polygon = nullptr;
try {
polygon=readPolygonText(tokenizer);
polygons->push_back(polygon);
- polygon=NULL;
+ polygon=nullptr;
nextToken=getNextCloserOrComma(tokenizer);
while(nextToken==",") {
polygon=readPolygonText(tokenizer);
polygons->push_back(polygon);
- polygon=NULL;
+ polygon=nullptr;
nextToken=getNextCloserOrComma(tokenizer);
}
} catch (...) {
@@ -457,19 +457,19 @@ MultiPolygon* WKTReader::readMultiPolygonText(StringTokenizer *tokenizer) {
GeometryCollection* WKTReader::readGeometryCollectionText(StringTokenizer *tokenizer) {
string nextToken=getNextEmptyOrOpener(tokenizer);
if (nextToken=="EMPTY") {
- return geometryFactory->createGeometryCollection(NULL);
+ return geometryFactory->createGeometryCollection(nullptr);
}
vector<Geometry *> *geoms=new vector<Geometry *>();
- Geometry *geom=NULL;
+ Geometry *geom=nullptr;
try {
geom=readGeometryTaggedText(tokenizer);
geoms->push_back(geom);
- geom=NULL;
+ geom=nullptr;
nextToken=getNextCloserOrComma(tokenizer);
while(nextToken==",") {
geom=readGeometryTaggedText(tokenizer);
geoms->push_back(geom);
- geom=NULL;
+ geom=nullptr;
nextToken=getNextCloserOrComma(tokenizer);
}
} catch (...) {
diff --git a/src/io/WKTWriter.cpp b/src/io/WKTWriter.cpp
index c965796..2c540b7 100644
--- a/src/io/WKTWriter.cpp
+++ b/src/io/WKTWriter.cpp
@@ -236,7 +236,7 @@ WKTWriter::appendPointTaggedText(const Coordinate* coordinate, int level,
Writer *writer)
{
writer->write("POINT ");
- if( outputDimension == 3 && !old3D && coordinate != NULL )
+ if( outputDimension == 3 && !old3D && coordinate != nullptr )
writer->write( "Z " );
appendPointText(coordinate, level, writer);
@@ -306,7 +306,7 @@ void
WKTWriter::appendPointText(const Coordinate* coordinate, int /*level*/,
Writer *writer)
{
- if (coordinate==NULL) {
+ if (coordinate==nullptr) {
writer->write("EMPTY");
} else {
writer->write("(");
diff --git a/src/linearref/ExtractLineByLocation.cpp b/src/linearref/ExtractLineByLocation.cpp
index 835188e..f8c968f 100644
--- a/src/linearref/ExtractLineByLocation.cpp
+++ b/src/linearref/ExtractLineByLocation.cpp
@@ -80,7 +80,7 @@ Geometry *ExtractLineByLocation::reverse(const Geometry *linear)
else
{
assert(!static_cast<bool>("non-linear geometry encountered"));
- return 0;
+ return nullptr;
}
}
}
diff --git a/src/linearref/LinearGeometryBuilder.cpp b/src/linearref/LinearGeometryBuilder.cpp
index d2acf22..bc88c6e 100644
--- a/src/linearref/LinearGeometryBuilder.cpp
+++ b/src/linearref/LinearGeometryBuilder.cpp
@@ -45,7 +45,7 @@ LinearGeometryBuilder::LinearGeometryBuilder(const GeometryFactory* geomFact) :
geomFact(geomFact),
ignoreInvalidLines(false),
fixInvalidLines(false),
- coordList(0) {}
+ coordList(nullptr) {}
/* public */
void
@@ -100,7 +100,7 @@ LinearGeometryBuilder::endLine()
if (coordList)
{
delete coordList;
- coordList = 0;
+ coordList = nullptr;
}
return;
}
@@ -120,7 +120,7 @@ LinearGeometryBuilder::endLine()
}
}
- LineString* line = 0;
+ LineString* line = nullptr;
try
{
line = geomFact->createLineString(coordList);
@@ -134,7 +134,7 @@ LinearGeometryBuilder::endLine()
}
if (line) lines.push_back(line);
- coordList = 0;
+ coordList = nullptr;
}
/* public */
diff --git a/src/linearref/LinearIterator.cpp b/src/linearref/LinearIterator.cpp
index 6e9d0b5..b652ea5 100644
--- a/src/linearref/LinearIterator.cpp
+++ b/src/linearref/LinearIterator.cpp
@@ -70,7 +70,7 @@ void LinearIterator::loadCurrentLine()
{
if (componentIndex >= numLines)
{
- currentLine = 0;
+ currentLine = nullptr;
return;
}
currentLine = dynamic_cast<const LineString *> (linear->getGeometryN(componentIndex));
diff --git a/src/linearref/LocationIndexOfPoint.cpp b/src/linearref/LocationIndexOfPoint.cpp
index 53f6b63..8ddf0dd 100644
--- a/src/linearref/LocationIndexOfPoint.cpp
+++ b/src/linearref/LocationIndexOfPoint.cpp
@@ -97,7 +97,7 @@ LocationIndexOfPoint::LocationIndexOfPoint(const Geometry *linearGeom) :
LinearLocation LocationIndexOfPoint::indexOf(const Coordinate& inputPt) const
{
- return indexOfFromStart(inputPt, 0);
+ return indexOfFromStart(inputPt, nullptr);
}
LinearLocation
diff --git a/src/noding/GeometryNoder.cpp b/src/noding/GeometryNoder.cpp
index fe2ad05..bf02d7b 100644
--- a/src/noding/GeometryNoder.cpp
+++ b/src/noding/GeometryNoder.cpp
@@ -58,7 +58,7 @@ public:
if ( ls ) {
geom::CoordinateSequence* coord = ls->getCoordinates();
// coord ownership transferred to SegmentString
- SegmentString *ss = new NodedSegmentString(coord, 0);
+ SegmentString *ss = new NodedSegmentString(coord, nullptr);
_to.push_back(ss);
}
}
@@ -125,7 +125,7 @@ GeometryNoder::getNoded()
extractSegmentStrings(argGeom, lineList);
Noder& noder = getNoder();
- SegmentString::NonConstVect* nodedEdges = 0;
+ SegmentString::NonConstVect* nodedEdges = nullptr;
try {
noder.computeNodes( &lineList );
diff --git a/src/noding/IteratedNoder.cpp b/src/noding/IteratedNoder.cpp
index cf17bde..ca1f60c 100644
--- a/src/noding/IteratedNoder.cpp
+++ b/src/noding/IteratedNoder.cpp
@@ -60,7 +60,7 @@ IteratedNoder::computeNodes(SegmentString::NonConstVect* segStrings)
nodedSegStrings = segStrings;
int nodingIterationCount = 0;
int lastNodesCreated = -1;
- vector<SegmentString*> *lastStrings = 0;
+ vector<SegmentString*> *lastStrings = nullptr;
do {
// NOTE: will change this.nodedSegStrings
diff --git a/src/noding/snapround/HotPixel.cpp b/src/noding/snapround/HotPixel.cpp
index 6c9c178..bc7156d 100644
--- a/src/noding/snapround/HotPixel.cpp
+++ b/src/noding/snapround/HotPixel.cpp
@@ -58,7 +58,7 @@ HotPixel::getSafeEnvelope() const
{
static const double SAFE_ENV_EXPANSION_FACTOR = 0.75;
- if (safeEnv.get() == NULL) {
+ if (safeEnv.get() == nullptr) {
double safeTolerance = SAFE_ENV_EXPANSION_FACTOR / scaleFactor;
safeEnv = unique_ptr<Envelope>(new Envelope(originalPt.x - safeTolerance,
originalPt.x + safeTolerance,
diff --git a/src/operation/IsSimpleOp.cpp b/src/operation/IsSimpleOp.cpp
index e832106..7ae0038 100644
--- a/src/operation/IsSimpleOp.cpp
+++ b/src/operation/IsSimpleOp.cpp
@@ -81,7 +81,7 @@ EndpointInfo::EndpointInfo(const Coordinate& newPt)
IsSimpleOp::IsSimpleOp()
:
isClosedEndpointsInInterior(true),
- geom(0),
+ geom(nullptr),
nonSimpleLocation()
{}
@@ -269,11 +269,11 @@ IsSimpleOp::addEndpoint(
map<const Coordinate*,EndpointInfo*,CoordinateLessThen>::iterator it=endPoints.find(p);
EndpointInfo *eiInfo;
if (it==endPoints.end()) {
- eiInfo=NULL;
+ eiInfo=nullptr;
} else {
eiInfo=it->second;
}
- if (eiInfo==NULL) {
+ if (eiInfo==nullptr) {
eiInfo=new EndpointInfo(*p);
endPoints[p]=eiInfo;
}
diff --git a/src/operation/buffer/BufferBuilder.cpp b/src/operation/buffer/BufferBuilder.cpp
index b9881be..bdea573 100644
--- a/src/operation/buffer/BufferBuilder.cpp
+++ b/src/operation/buffer/BufferBuilder.cpp
@@ -188,7 +188,7 @@ BufferBuilder::bufferLineSingleSided( const Geometry* g, double distance,
CoordinateSequence* seq = lineList[i];
// SegmentString takes ownership of CoordinateSequence
- SegmentString* ss = new NodedSegmentString(seq, NULL);
+ SegmentString* ss = new NodedSegmentString(seq, nullptr);
curveList.push_back( ss );
}
lineList.clear();
@@ -256,7 +256,7 @@ BufferBuilder::bufferLineSingleSided( const Geometry* g, double distance,
// Remove end points if they are a part of the original line to be
// buffered.
CoordinateSequence::Ptr coords(mergedLines->back()->getCoordinates());
- if ( NULL != coords.get() )
+ if ( nullptr != coords.get() )
{
// Use 98% of the buffer width as the point-distance requirement - this
// is to ensure that the point that is "distance" +/- epsilon is not
@@ -368,7 +368,7 @@ BufferBuilder::buffer(const Geometry *g, double distance)
// throw(GEOSException *)
{
const PrecisionModel *precisionModel=workingPrecisionModel;
- if (precisionModel==NULL)
+ if (precisionModel==nullptr)
precisionModel=g->getPrecisionModel();
assert(precisionModel);
@@ -410,7 +410,7 @@ BufferBuilder::buffer(const Geometry *g, double distance)
std::cerr << std::endl << edgeList << std::endl;
#endif
- Geometry* resultGeom=NULL;
+ Geometry* resultGeom=nullptr;
std::unique_ptr< std::vector<Geometry*> > resultPolyList;
std::vector<BufferSubgraph*> subgraphList;
@@ -476,14 +476,14 @@ Noder*
BufferBuilder::getNoder(const PrecisionModel* pm)
{
// this doesn't change workingNoder precisionModel!
- if (workingNoder != NULL) return workingNoder;
+ if (workingNoder != nullptr) return workingNoder;
// otherwise use a fast (but non-robust) noder
if ( li ) // reuse existing IntersectionAdder and LineIntersector
{
li->setPrecisionModel(pm);
- assert(intersectionAdder!=NULL);
+ assert(intersectionAdder!=nullptr);
}
else
{
@@ -581,7 +581,7 @@ BufferBuilder::insertUniqueEdge(Edge *e)
// fast lookup
Edge *existingEdge = edgeList.findEqualEdge(e);
// If an identical edge already exists, simply update its label
- if (existingEdge != NULL) {
+ if (existingEdge != nullptr) {
Label& existingLabel = existingEdge->getLabel();
Label labelToMerge = e->getLabel();
@@ -694,7 +694,7 @@ BufferBuilder::buildSubgraphs(const std::vector<BufferSubgraph*>& subgraphList,
geom::Geometry*
BufferBuilder::createEmptyResultGeometry() const
{
- geom::Geometry* emptyGeom = geomFact->createPolygon(NULL, NULL);
+ geom::Geometry* emptyGeom = geomFact->createPolygon(nullptr, nullptr);
return emptyGeom;
}
diff --git a/src/operation/buffer/BufferOp.cpp b/src/operation/buffer/BufferOp.cpp
index eb12dce..872ce63 100644
--- a/src/operation/buffer/BufferOp.cpp
+++ b/src/operation/buffer/BufferOp.cpp
@@ -132,7 +132,7 @@ BufferOp::computeGeometry()
bufferOriginalPrecision();
- if (resultGeometry!=NULL) return;
+ if (resultGeometry!=nullptr) return;
#if GEOS_DEBUG
std::cerr << "bufferOriginalPrecision failed (" << saveException.what() << "), trying with reduced precision"
@@ -167,7 +167,7 @@ BufferOp::bufferReducedPrecision()
// don't propagate the exception - it will be detected by fact that resultGeometry is null
}
- if (resultGeometry!=NULL) {
+ if (resultGeometry!=nullptr) {
// debug
//if ( saveException ) std::cerr<<saveException->toString()<<std::endl;
return;
diff --git a/src/operation/buffer/BufferSubgraph.cpp b/src/operation/buffer/BufferSubgraph.cpp
index 40c88b0..98ee051 100644
--- a/src/operation/buffer/BufferSubgraph.cpp
+++ b/src/operation/buffer/BufferSubgraph.cpp
@@ -53,8 +53,8 @@ BufferSubgraph::BufferSubgraph()
finder(),
dirEdgeList(),
nodes(),
- rightMostCoord(NULL),
- env(NULL)
+ rightMostCoord(nullptr),
+ env(nullptr)
{
}
@@ -155,7 +155,7 @@ BufferSubgraph::computeNodeDepth(Node *n)
// throw(TopologyException *)
{
// find a visited dirEdge to start at
- DirectedEdge *startEdge=NULL;
+ DirectedEdge *startEdge=nullptr;
assert(dynamic_cast<DirectedEdgeStar *>(n->getEdges()));
DirectedEdgeStar *ees=static_cast<DirectedEdgeStar *>(n->getEdges());
@@ -176,7 +176,7 @@ BufferSubgraph::computeNodeDepth(Node *n)
//if (startEdge==null) return;
// only compute string append if assertion would fail
- if (startEdge == NULL)
+ if (startEdge == nullptr)
{
throw util::TopologyException(
"unable to find edge to compute depths at",
@@ -319,7 +319,7 @@ BufferSubgraph::contains(set<Node*>&nodeSet, Node *node)
Envelope *
BufferSubgraph::getEnvelope()
{
- if (env == NULL) {
+ if (env == nullptr) {
env = new Envelope();
std::size_t const size = dirEdgeList.size();
for(std::size_t i=0; i<size; ++i)
diff --git a/src/operation/buffer/RightmostEdgeFinder.cpp b/src/operation/buffer/RightmostEdgeFinder.cpp
index b77d020..89a83a7 100644
--- a/src/operation/buffer/RightmostEdgeFinder.cpp
+++ b/src/operation/buffer/RightmostEdgeFinder.cpp
@@ -43,8 +43,8 @@ RightmostEdgeFinder::RightmostEdgeFinder()
minIndex(-1), // FIXME: don't use -1 as a sentinel, or we won't be
// able to use an unsigned int here
minCoord(Coordinate::getNull()),
- minDe(NULL),
- orientedDe(NULL)
+ minDe(nullptr),
+ orientedDe(nullptr)
{
}
diff --git a/src/operation/buffer/SubgraphDepthLocater.cpp b/src/operation/buffer/SubgraphDepthLocater.cpp
index 724891c..647a24a 100644
--- a/src/operation/buffer/SubgraphDepthLocater.cpp
+++ b/src/operation/buffer/SubgraphDepthLocater.cpp
@@ -247,7 +247,7 @@ SubgraphDepthLocater::findStabbedSegments(
#else
const Coordinate *low=&(pts->getAt(i));
const Coordinate *high=&(pts->getAt(i+1));
- const Coordinate *swap=NULL;
+ const Coordinate *swap=nullptr;
#endif
diff --git a/src/operation/distance/DistanceOp.cpp b/src/operation/distance/DistanceOp.cpp
index 7b1de13..0a62068 100644
--- a/src/operation/distance/DistanceOp.cpp
+++ b/src/operation/distance/DistanceOp.cpp
@@ -89,7 +89,7 @@ DistanceOp::nearestPoints(const Geometry *g0, const Geometry *g1)
DistanceOp::DistanceOp(const Geometry *g0, const Geometry *g1):
geom(2),
terminateDistance(0.0),
- minDistanceLocation(0),
+ minDistanceLocation(nullptr),
minDistance(DoubleMax)
{
geom[0] = g0;
@@ -99,7 +99,7 @@ DistanceOp::DistanceOp(const Geometry *g0, const Geometry *g1):
DistanceOp::DistanceOp(const Geometry& g0, const Geometry& g1):
geom(2),
terminateDistance(0.0),
- minDistanceLocation(0),
+ minDistanceLocation(nullptr),
minDistance(DoubleMax)
{
geom[0] = &g0;
@@ -110,7 +110,7 @@ DistanceOp::DistanceOp(const Geometry& g0, const Geometry& g1, double tdist)
:
geom(2),
terminateDistance(tdist),
- minDistanceLocation(0),
+ minDistanceLocation(nullptr),
minDistance(DoubleMax)
{
geom[0] = &g0;
@@ -141,7 +141,7 @@ DistanceOp::distance()
{
using geos::util::IllegalArgumentException;
- if ( geom[0] == 0 || geom[1] == 0 )
+ if ( geom[0] == nullptr || geom[1] == nullptr )
throw IllegalArgumentException("null geometries are not supported");
if ( geom[0]->isEmpty() || geom[1]->isEmpty() ) return 0.0;
computeMinDistance();
@@ -163,16 +163,16 @@ DistanceOp::nearestPoints()
// lazily creates minDistanceLocation
computeMinDistance();
- assert(0 != minDistanceLocation);
+ assert(nullptr != minDistanceLocation);
std::vector<GeometryLocation*>& locs = *minDistanceLocation;
// Empty input geometries result in this behaviour
- if ( locs[0] == 0 || locs[1] == 0 )
+ if ( locs[0] == nullptr || locs[1] == nullptr )
{
// either both or none are set..
- assert(locs[0] == 0 && locs[1] == 0);
+ assert(locs[0] == nullptr && locs[1] == nullptr);
- return 0;
+ return nullptr;
}
GeometryLocation* loc0 = locs[0];
@@ -199,12 +199,12 @@ DistanceOp::updateMinDistance(vector<GeometryLocation*>& locGeom, bool flip)
assert(minDistanceLocation);
// if not set then don't update
- if (locGeom[0]==NULL)
+ if (locGeom[0]==nullptr)
{
#if GEOS_DEBUG
std::cerr << "updateMinDistance called with loc[0] == null and loc[1] == " << locGeom[1] << std::endl;
#endif
- assert(locGeom[1] == NULL);
+ assert(locGeom[1] == nullptr);
return;
}
@@ -423,8 +423,8 @@ DistanceOp::computeFacetDistance()
return;
};
- locGeom[0]=NULL;
- locGeom[1]=NULL;
+ locGeom[0]=nullptr;
+ locGeom[1]=nullptr;
computeMinDistanceLinesPoints(lines0, pts1, locGeom);
updateMinDistance(locGeom, false);
if (minDistance <= terminateDistance) {
@@ -434,8 +434,8 @@ DistanceOp::computeFacetDistance()
return;
};
- locGeom[0]=NULL;
- locGeom[1]=NULL;
+ locGeom[0]=nullptr;
+ locGeom[1]=nullptr;
computeMinDistanceLinesPoints(lines1, pts0, locGeom);
updateMinDistance(locGeom, true);
if (minDistance <= terminateDistance){
@@ -445,8 +445,8 @@ DistanceOp::computeFacetDistance()
return;
};
- locGeom[0]=NULL;
- locGeom[1]=NULL;
+ locGeom[0]=nullptr;
+ locGeom[1]=nullptr;
computeMinDistancePoints(pts0, pts1, locGeom);
updateMinDistance(locGeom, false);
diff --git a/src/operation/intersection/Rectangle.cpp b/src/operation/intersection/Rectangle.cpp
index 1ee4993..46e4253 100644
--- a/src/operation/intersection/Rectangle.cpp
+++ b/src/operation/intersection/Rectangle.cpp
@@ -44,7 +44,7 @@ namespace intersection { // geos::operation::intersection
Rectangle::toPolygon(const geom::GeometryFactory &f) const
{
geom::LinearRing* ls = toLinearRing(f);
- return f.createPolygon(ls, 0);
+ return f.createPolygon(ls, nullptr);
}
geom::LinearRing*
diff --git a/src/operation/intersection/RectangleIntersection.cpp b/src/operation/intersection/RectangleIntersection.cpp
index 335603a..ca6da12 100644
--- a/src/operation/intersection/RectangleIntersection.cpp
+++ b/src/operation/intersection/RectangleIntersection.cpp
@@ -104,7 +104,7 @@ RectangleIntersection::clip_point(const geom::Point * g,
RectangleIntersectionBuilder & parts,
const Rectangle & rect)
{
- if(g == NULL)
+ if(g == nullptr)
return;
double x = g->getX();
@@ -123,7 +123,7 @@ RectangleIntersection::clip_linestring_parts(const geom::LineString * gi,
int n = gi->getNumPoints();
- if(gi == NULL || n<1)
+ if(gi == nullptr || n<1)
return false;
// For shorthand code
@@ -376,7 +376,7 @@ RectangleIntersection::clip_polygon_to_linestrings(const geom::Polygon * g,
RectangleIntersectionBuilder & toParts,
const Rectangle & rect)
{
- if(g == NULL || g->isEmpty())
+ if(g == nullptr || g->isEmpty())
return;
// Clip the exterior first to see what's going on
@@ -425,7 +425,7 @@ RectangleIntersection::clip_polygon_to_linestrings(const geom::Polygon * g,
// clones
LinearRing *hole = dynamic_cast<LinearRing*>(g->getInteriorRingN(i)->clone());
// becomes exterior
- Polygon *poly = _gf->createPolygon(hole, 0);
+ Polygon *poly = _gf->createPolygon(hole, nullptr);
toParts.add(poly);
}
else if(!parts.empty())
@@ -445,7 +445,7 @@ RectangleIntersection::clip_polygon_to_polygons(const geom::Polygon * g,
RectangleIntersectionBuilder & toParts,
const Rectangle & rect)
{
- if(g == NULL || g->isEmpty())
+ if(g == nullptr || g->isEmpty())
return;
// Clip the exterior first to see what's going on
@@ -502,7 +502,7 @@ RectangleIntersection::clip_polygon_to_polygons(const geom::Polygon * g,
{
// becomes exterior
LinearRing *cloned = dynamic_cast<LinearRing*>(hole->clone());
- Polygon *poly = _gf->createPolygon(cloned, 0);
+ Polygon *poly = _gf->createPolygon(cloned, nullptr);
parts.add(poly);
}
else
@@ -562,7 +562,7 @@ RectangleIntersection::clip_linestring(const geom::LineString * g,
RectangleIntersectionBuilder & parts,
const Rectangle & rect)
{
- if(g == NULL || g->isEmpty())
+ if(g == nullptr || g->isEmpty())
return;
// If everything was in, just clone the original
@@ -577,7 +577,7 @@ RectangleIntersection::clip_multipoint(const geom::MultiPoint * g,
RectangleIntersectionBuilder & parts,
const Rectangle & rect)
{
- if(g == NULL || g->isEmpty())
+ if(g == nullptr || g->isEmpty())
return;
for(int i=0, n=g->getNumGeometries(); i<n; ++i)
{
@@ -591,7 +591,7 @@ RectangleIntersection::clip_multilinestring(const geom::MultiLineString * g,
RectangleIntersectionBuilder & parts,
const Rectangle & rect)
{
- if(g == NULL || g->isEmpty())
+ if(g == nullptr || g->isEmpty())
return;
for(int i=0, n=g->getNumGeometries(); i<n; ++i)
@@ -607,7 +607,7 @@ RectangleIntersection::clip_multipolygon(const geom::MultiPolygon * g,
const Rectangle & rect,
bool keep_polygons)
{
- if(g == NULL || g->isEmpty())
+ if(g == nullptr || g->isEmpty())
return;
for(int i=0, n=g->getNumGeometries(); i<n; ++i)
@@ -624,7 +624,7 @@ RectangleIntersection::clip_geometrycollection(
const Rectangle & rect,
bool keep_polygons)
{
- if(g == NULL || g->isEmpty())
+ if(g == nullptr || g->isEmpty())
return;
for(int i=0, n=g->getNumGeometries(); i<n; ++i)
diff --git a/src/operation/intersection/RectangleIntersectionBuilder.cpp b/src/operation/intersection/RectangleIntersectionBuilder.cpp
index c341ea7..4084432 100644
--- a/src/operation/intersection/RectangleIntersectionBuilder.cpp
+++ b/src/operation/intersection/RectangleIntersectionBuilder.cpp
@@ -392,11 +392,11 @@ RectangleIntersectionBuilder::reconnectPolygons(const Rectangle & rect)
// Reconnect all lines into one or more linearrings
// using box boundaries if necessary
- std::vector<Coordinate> *ring = NULL;
+ std::vector<Coordinate> *ring = nullptr;
- while(!lines.empty() || ring != NULL)
+ while(!lines.empty() || ring != nullptr)
{
- if(ring == NULL)
+ if(ring == nullptr)
{
ring = new std::vector<Coordinate>();
LineString *line = lines.front();
@@ -430,7 +430,7 @@ RectangleIntersectionBuilder::reconnectPolygons(const Rectangle & rect)
geom::CoordinateSequence *shell_cs = _csf.create(ring);
geom::LinearRing *shell = _gf.createLinearRing(shell_cs);
exterior.push_back(make_pair(shell, new LinearRingVect()));
- ring = NULL;
+ ring = nullptr;
}
else
{
diff --git a/src/operation/linemerge/EdgeString.cpp b/src/operation/linemerge/EdgeString.cpp
index 6c7ec6f..e59e1fd 100644
--- a/src/operation/linemerge/EdgeString.cpp
+++ b/src/operation/linemerge/EdgeString.cpp
@@ -43,7 +43,7 @@ namespace linemerge { // geos.operation.linemerge
EdgeString::EdgeString(const GeometryFactory *newFactory):
factory(newFactory),
directedEdges(),
- coordinates(NULL)
+ coordinates(nullptr)
{
}
@@ -62,7 +62,7 @@ EdgeString::add(LineMergeDirectedEdge *directedEdge)
CoordinateSequence *
EdgeString::getCoordinates()
{
- if (coordinates==NULL) {
+ if (coordinates==nullptr) {
int forwardDirectedEdges = 0;
int reverseDirectedEdges = 0;
coordinates=factory->getCoordinateSequenceFactory()->create();
diff --git a/src/operation/linemerge/LineMergeDirectedEdge.cpp b/src/operation/linemerge/LineMergeDirectedEdge.cpp
index 5f991b5..0016826 100644
--- a/src/operation/linemerge/LineMergeDirectedEdge.cpp
+++ b/src/operation/linemerge/LineMergeDirectedEdge.cpp
@@ -49,7 +49,7 @@ LineMergeDirectedEdge*
LineMergeDirectedEdge::getNext()
{
if (getToNode()->getDegree()!=2) {
- return NULL;
+ return nullptr;
}
if (getToNode()->getOutEdges()->getEdges()[0]==getSym()) {
return (LineMergeDirectedEdge*) getToNode()->getOutEdges()->getEdges()[1];
diff --git a/src/operation/linemerge/LineMergeGraph.cpp b/src/operation/linemerge/LineMergeGraph.cpp
index 111df47..4d5f9b5 100644
--- a/src/operation/linemerge/LineMergeGraph.cpp
+++ b/src/operation/linemerge/LineMergeGraph.cpp
@@ -105,7 +105,7 @@ planargraph::Node *
LineMergeGraph::getNode(const Coordinate &coordinate)
{
planargraph::Node *node=findNode(coordinate);
- if (node==NULL) {
+ if (node==nullptr) {
node=new planargraph::Node(coordinate);
newNodes.push_back(node);
add(node);
diff --git a/src/operation/linemerge/LineMerger.cpp b/src/operation/linemerge/LineMerger.cpp
index 8a665ce..42ac1a0 100644
--- a/src/operation/linemerge/LineMerger.cpp
+++ b/src/operation/linemerge/LineMerger.cpp
@@ -53,8 +53,8 @@ LineMerger::add(vector<Geometry*> *geometries)
}
LineMerger::LineMerger():
- mergedLineStrings(NULL),
- factory(NULL)
+ mergedLineStrings(nullptr),
+ factory(nullptr)
{
}
@@ -93,14 +93,14 @@ LineMerger::add(const Geometry *geometry)
void
LineMerger::add(const LineString *lineString)
{
- if (factory==NULL) factory=lineString->getFactory();
+ if (factory==nullptr) factory=lineString->getFactory();
graph.addEdge(lineString);
}
void
LineMerger::merge()
{
- if (mergedLineStrings!=NULL) return;
+ if (mergedLineStrings!=nullptr) return;
// reset marks (this allows incremental processing)
GraphComponent::setMarkedMap(graph.nodeIterator(), graph.nodeEnd(),
@@ -213,7 +213,7 @@ LineMerger::buildEdgeStringStartingWith(LineMergeDirectedEdge *start)
edgeString->add(current);
current->getEdge()->setMarked(true);
current=current->getNext();
- } while (current!=NULL && current!=start);
+ } while (current!=nullptr && current!=start);
return edgeString;
}
@@ -227,7 +227,7 @@ LineMerger::getMergedLineStrings()
// Explicitly give ownership to the caller.
vector<LineString*>* ret = mergedLineStrings;
- mergedLineStrings = NULL;
+ mergedLineStrings = nullptr;
return ret;
}
diff --git a/src/operation/linemerge/LineSequencer.cpp b/src/operation/linemerge/LineSequencer.cpp
index 798344f..384679e 100644
--- a/src/operation/linemerge/LineSequencer.cpp
+++ b/src/operation/linemerge/LineSequencer.cpp
@@ -54,7 +54,7 @@ LineSequencer::isSequenced(const Geometry* geom)
{
const MultiLineString *mls;
- if ( 0 == (mls=dynamic_cast<const MultiLineString *>(geom)) )
+ if ( nullptr == (mls=dynamic_cast<const MultiLineString *>(geom)) )
{
return true;
}
@@ -63,7 +63,7 @@ LineSequencer::isSequenced(const Geometry* geom)
Coordinate::ConstSet prevSubgraphNodes;
Coordinate::ConstVect currNodes;
- const Coordinate* lastNode = NULL;
+ const Coordinate* lastNode = nullptr;
for (std::size_t i=0, n=mls->getNumGeometries(); i<n; ++i)
{
@@ -89,7 +89,7 @@ LineSequencer::isSequenced(const Geometry* geom)
return false;
}
- if (lastNode != NULL)
+ if (lastNode != nullptr)
{
if (! startNode->equals2D(*lastNode))
{
@@ -155,7 +155,7 @@ LineSequencer::findSequences()
delete subgraph;
delAll(*sequences);
delete sequences;
- return NULL;
+ return nullptr;
}
delete subgraph;
}
@@ -166,7 +166,7 @@ LineSequencer::findSequences()
void
LineSequencer::addLine(const LineString *lineString)
{
- if (factory == NULL) {
+ if (factory == nullptr) {
factory = lineString->getFactory();
}
graph.addEdge(lineString);
@@ -181,7 +181,7 @@ LineSequencer::computeSequence()
isRun = true;
Sequences* sequences = findSequences();
- if (sequences == NULL) return;
+ if (sequences == nullptr) return;
sequencedGeometry = unique_ptr<Geometry>(buildSequencedGeometry(*sequences));
isSequenceableVar = true;
@@ -233,7 +233,7 @@ LineSequencer::buildSequencedGeometry(const Sequences& sequences)
}
if ( lines->size() == 0 ) {
- return NULL;
+ return nullptr;
} else {
Geometry::NonConstVect *l=lines.get();
lines.release();
@@ -255,14 +255,14 @@ const planargraph::Node*
LineSequencer::findLowestDegreeNode(const planargraph::Subgraph& graph)
{
size_t minDegree = numeric_limits<size_t>::max();
- const planargraph::Node* minDegreeNode = NULL;
+ const planargraph::Node* minDegreeNode = nullptr;
for (planargraph::NodeMap::container::const_iterator
it = graph.nodeBegin(), itEnd = graph.nodeEnd();
it != itEnd;
++it )
{
const planargraph::Node* node = (*it).second;
- if (minDegreeNode == NULL || node->getDegree() < minDegree)
+ if (minDegreeNode == nullptr || node->getDegree() < minDegree)
{
minDegree = node->getDegree();
minDegreeNode = node;
@@ -278,8 +278,8 @@ LineSequencer::findUnvisitedBestOrientedDE(const planargraph::Node* node)
using planargraph::DirectedEdge;
using planargraph::DirectedEdgeStar;
- const DirectedEdge* wellOrientedDE = NULL;
- const DirectedEdge* unvisitedDE = NULL;
+ const DirectedEdge* wellOrientedDE = nullptr;
+ const DirectedEdge* unvisitedDE = nullptr;
const DirectedEdgeStar* des=node->getOutEdges();
for (DirectedEdge::NonConstVect::const_iterator i=des->begin(),
e=des->end();
@@ -292,7 +292,7 @@ LineSequencer::findUnvisitedBestOrientedDE(const planargraph::Node* node)
if (de->getEdgeDirection()) wellOrientedDE = de;
}
}
- if (wellOrientedDE != NULL)
+ if (wellOrientedDE != nullptr)
return wellOrientedDE;
return unvisitedDE;
}
@@ -311,7 +311,7 @@ LineSequencer::addReverseSubpath(const planargraph::DirectedEdge *de,
// trace an unvisited path *backwards* from this de
Node* endNode = de->getToNode();
- Node* fromNode = NULL;
+ Node* fromNode = nullptr;
while (true) {
deList.insert(lit, de->getSym());
de->getEdge()->setVisited(true);
@@ -319,7 +319,7 @@ LineSequencer::addReverseSubpath(const planargraph::DirectedEdge *de,
const DirectedEdge* unvisitedOutDE = findUnvisitedBestOrientedDE(fromNode);
// this must terminate, since we are continually marking edges as visited
- if (unvisitedOutDE == NULL) break;
+ if (unvisitedOutDE == nullptr) break;
de = unvisitedOutDE->getSym();
}
if ( expectedClosed ) {
@@ -356,7 +356,7 @@ LineSequencer::findSequence(planargraph::Subgraph& graph)
while (lit != seq->begin()) {
const DirectedEdge* prev = *(--lit);
const DirectedEdge* unvisitedOutDE = findUnvisitedBestOrientedDE(prev->getFromNode());
- if (unvisitedOutDE != NULL)
+ if (unvisitedOutDE != nullptr)
addReverseSubpath(unvisitedOutDE->getSym(), *seq, lit, true);
}
diff --git a/src/operation/overlay/MaximalEdgeRing.cpp b/src/operation/overlay/MaximalEdgeRing.cpp
index 7d29a55..d7d3c4a 100644
--- a/src/operation/overlay/MaximalEdgeRing.cpp
+++ b/src/operation/overlay/MaximalEdgeRing.cpp
@@ -115,7 +115,7 @@ MaximalEdgeRing::buildMinimalRings(vector<MinimalEdgeRing*>& minEdgeRings)
{
DirectedEdge *de=startDe;
do {
- if(de->getMinEdgeRing()==NULL) {
+ if(de->getMinEdgeRing()==nullptr) {
MinimalEdgeRing *minEr=new MinimalEdgeRing(de, geometryFactory);
minEdgeRings.push_back(minEr);
}
@@ -129,7 +129,7 @@ MaximalEdgeRing::buildMinimalRings(vector<EdgeRing*>& minEdgeRings)
{
DirectedEdge *de=startDe;
do {
- if(de->getMinEdgeRing()==NULL) {
+ if(de->getMinEdgeRing()==nullptr) {
MinimalEdgeRing *minEr=new MinimalEdgeRing(de, geometryFactory);
minEdgeRings.push_back(minEr);
}
diff --git a/src/operation/overlay/OverlayOp.cpp b/src/operation/overlay/OverlayOp.cpp
index aa8a465..e2e9b2f 100644
--- a/src/operation/overlay/OverlayOp.cpp
+++ b/src/operation/overlay/OverlayOp.cpp
@@ -137,11 +137,11 @@ OverlayOp::OverlayOp(const Geometry *g0, const Geometry *g1)
*/
geomFact(g0->getFactory()),
- resultGeom(NULL),
+ resultGeom(nullptr),
graph(OverlayNodeFactory::instance()),
- resultPolyList(NULL),
- resultLineList(NULL),
- resultPointList(NULL)
+ resultPolyList(nullptr),
+ resultLineList(nullptr),
+ resultPointList(nullptr)
{
@@ -677,7 +677,7 @@ OverlayOp::computeOverlay(OverlayOp::OpCode opCode)
{
// Compute the target envelope
- const Envelope *env = 0;
+ const Envelope *env = nullptr;
const Envelope *env0 = getArgGeometry(0)->getEnvelopeInternal();
const Envelope *env1 = getArgGeometry(1)->getEnvelopeInternal();
Envelope opEnv;
diff --git a/src/operation/overlay/PolygonBuilder.cpp b/src/operation/overlay/PolygonBuilder.cpp
index d644a02..8bb1bfb 100644
--- a/src/operation/overlay/PolygonBuilder.cpp
+++ b/src/operation/overlay/PolygonBuilder.cpp
@@ -153,7 +153,7 @@ PolygonBuilder::buildMaximalEdgeRings(const vector<DirectedEdge*> *dirEdges,
if (de->isInResult() && de->getLabel().isArea())
{
// if this edge has not yet been processed
- if (de->getEdgeRing() == NULL)
+ if (de->getEdgeRing() == nullptr)
{
MaximalEdgeRing *er;
try
@@ -199,7 +199,7 @@ PolygonBuilder::buildMinimalEdgeRings(
// at this point we can go ahead and attempt to place
// holes, if this EdgeRing is a polygon
EdgeRing *shell=findShell(&minEdgeRings);
- if(shell != NULL)
+ if(shell != nullptr)
{
placePolygonHoles(shell, &minEdgeRings);
newShellList.push_back(shell);
@@ -224,7 +224,7 @@ EdgeRing*
PolygonBuilder::findShell(vector<MinimalEdgeRing*> *minEdgeRings)
{
int shellCount=0;
- EdgeRing *shell=NULL;
+ EdgeRing *shell=nullptr;
#if GEOS_DEBUG
cerr<<"PolygonBuilder::findShell got "<<minEdgeRings->size()<<" minEdgeRings"<<endl;
@@ -292,9 +292,9 @@ PolygonBuilder::placeFreeHoles(std::vector<EdgeRing*>& newShellList,
{
EdgeRing *hole=*it;
// only place this hole if it doesn't yet have a shell
- if (hole->getShell()==NULL) {
+ if (hole->getShell()==nullptr) {
EdgeRing *shell=findEdgeRingContaining(hole, newShellList);
- if ( shell == NULL )
+ if ( shell == nullptr )
{
#if GEOS_DEBUG
Geometry* geom;
@@ -332,15 +332,15 @@ PolygonBuilder::findEdgeRingContaining(EdgeRing *testEr,
LinearRing *testRing=testEr->getLinearRing();
const Envelope *testEnv=testRing->getEnvelopeInternal();
const Coordinate& testPt=testRing->getCoordinateN(0);
- EdgeRing *minShell=NULL;
- const Envelope *minEnv=NULL;
+ EdgeRing *minShell=nullptr;
+ const Envelope *minEnv=nullptr;
for(size_t i=0, n=newShellList.size(); i<n; i++)
{
- LinearRing *lr=NULL;
+ LinearRing *lr=nullptr;
EdgeRing *tryShell=newShellList[i];
LinearRing *tryRing=tryShell->getLinearRing();
const Envelope *tryEnv=tryRing->getEnvelopeInternal();
- if (minShell!=NULL) {
+ if (minShell!=nullptr) {
lr=minShell->getLinearRing();
minEnv=lr->getEnvelopeInternal();
}
@@ -352,7 +352,7 @@ PolygonBuilder::findEdgeRingContaining(EdgeRing *testEr,
// check if this new containing ring is smaller than
// the current minimum ring
if (isContained) {
- if (minShell==NULL
+ if (minShell==nullptr
|| minEnv->contains(tryEnv)) {
minShell=tryShell;
}
diff --git a/src/operation/overlay/validate/FuzzyPointLocator.cpp b/src/operation/overlay/validate/FuzzyPointLocator.cpp
index f8d7449..5e6db07 100644
--- a/src/operation/overlay/validate/FuzzyPointLocator.cpp
+++ b/src/operation/overlay/validate/FuzzyPointLocator.cpp
@@ -68,7 +68,7 @@ FuzzyPointLocator::extractLineWork(const geom::Geometry& geom)
for (size_t i=0, n=g.getNumGeometries(); i<n; ++i)
{
const Geometry* gComp = g.getGeometryN(i);
- Geometry* lineGeom = NULL;
+ Geometry* lineGeom = nullptr;
// only get linework for polygonal components
if (gComp->getDimension() == 2) {
diff --git a/src/operation/overlay/validate/OffsetPointGenerator.cpp b/src/operation/overlay/validate/OffsetPointGenerator.cpp
index 127a923..3501366 100644
--- a/src/operation/overlay/validate/OffsetPointGenerator.cpp
+++ b/src/operation/overlay/validate/OffsetPointGenerator.cpp
@@ -57,7 +57,7 @@ OffsetPointGenerator::OffsetPointGenerator(const geom::Geometry& geom,
std::unique_ptr< std::vector<geom::Coordinate> >
OffsetPointGenerator::getPoints()
{
- assert (offsetPts.get() == NULL);
+ assert (offsetPts.get() == nullptr);
offsetPts.reset(new vector<Coordinate>());
vector<const LineString*> lines;
diff --git a/src/operation/polygonize/EdgeRing.cpp b/src/operation/polygonize/EdgeRing.cpp
index 7125301..1d01e21 100644
--- a/src/operation/polygonize/EdgeRing.cpp
+++ b/src/operation/polygonize/EdgeRing.cpp
@@ -51,18 +51,18 @@ EdgeRing::findEdgeRingContaining(EdgeRing *testEr,
vector<EdgeRing*> *shellList)
{
const LinearRing *testRing=testEr->getRingInternal();
- if ( ! testRing ) return NULL;
+ if ( ! testRing ) return nullptr;
const Envelope *testEnv=testRing->getEnvelopeInternal();
Coordinate testPt=testRing->getCoordinateN(0);
- EdgeRing *minShell=NULL;
- const Envelope *minEnv=NULL;
+ EdgeRing *minShell=nullptr;
+ const Envelope *minEnv=nullptr;
typedef std::vector<EdgeRing*> ERList;
for(ERList::size_type i=0, e=shellList->size(); i<e; ++i) {
EdgeRing *tryShell=(*shellList)[i];
LinearRing *tryRing=tryShell->getRingInternal();
const Envelope *tryEnv=tryRing->getEnvelopeInternal();
- if (minShell!=NULL) minEnv=minShell->getRingInternal()->getEnvelopeInternal();
+ if (minShell!=nullptr) minEnv=minShell->getRingInternal()->getEnvelopeInternal();
bool isContained=false;
// the hole envelope cannot equal the shell envelope
@@ -86,7 +86,7 @@ EdgeRing::findEdgeRingContaining(EdgeRing *testEr,
// check if this new containing ring is smaller
// than the current minimum ring
if (isContained) {
- if (minShell==NULL || minEnv->contains(tryEnv)) {
+ if (minShell==nullptr || minEnv->contains(tryEnv)) {
minShell=tryShell;
}
}
@@ -128,9 +128,9 @@ EdgeRing::isInList(const Coordinate& pt,
EdgeRing::EdgeRing(const GeometryFactory *newFactory)
:
factory(newFactory),
- ring(0),
- ringPts(0),
- holes(0)
+ ring(nullptr),
+ ringPts(nullptr),
+ holes(nullptr)
{
#ifdef DEBUG_ALLOC
cerr<<"["<<this<<"] EdgeRing(factory)"<<endl;
@@ -169,7 +169,7 @@ EdgeRing::isHole(){
void
EdgeRing::addHole(LinearRing *hole)
{
- if (holes==NULL)
+ if (holes==nullptr)
holes=new vector<Geometry*>();
holes->push_back(hole);
}
@@ -179,8 +179,8 @@ Polygon*
EdgeRing::getPolygon()
{
Polygon *poly=factory->createPolygon(ring, holes);
- ring=NULL;
- holes=NULL;
+ ring=nullptr;
+ holes=nullptr;
return poly;
}
@@ -196,7 +196,7 @@ EdgeRing::isValid()
CoordinateSequence*
EdgeRing::getCoordinates()
{
- if (ringPts==NULL)
+ if (ringPts==nullptr)
{
ringPts=factory->getCoordinateSequenceFactory()->create();
for (DeList::size_type i=0, e=deList.size(); i<e; ++i) {
@@ -222,7 +222,7 @@ EdgeRing::getLineString()
LinearRing *
EdgeRing::getRingInternal()
{
- if (ring!=NULL) return ring;
+ if (ring!=nullptr) return ring;
getCoordinates();
try {
@@ -244,7 +244,7 @@ LinearRing *
EdgeRing::getRingOwnership()
{
LinearRing *ret = getRingInternal();
- ring = NULL;
+ ring = nullptr;
return ret;
}
diff --git a/src/operation/polygonize/PolygonizeDirectedEdge.cpp b/src/operation/polygonize/PolygonizeDirectedEdge.cpp
index 5e72a16..dbd5f52 100644
--- a/src/operation/polygonize/PolygonizeDirectedEdge.cpp
+++ b/src/operation/polygonize/PolygonizeDirectedEdge.cpp
@@ -45,8 +45,8 @@ PolygonizeDirectedEdge::PolygonizeDirectedEdge(Node *newFrom,
DirectedEdge(newFrom, newTo,
newDirectionPt, nEdgeDirection)
{
- edgeRing=NULL;
- next=NULL;
+ edgeRing=nullptr;
+ next=nullptr;
label=-1;
}
@@ -94,7 +94,7 @@ PolygonizeDirectedEdge::setNext(PolygonizeDirectedEdge *newNext)
bool
PolygonizeDirectedEdge::isInRing() const
{
- return edgeRing!=NULL;
+ return edgeRing!=nullptr;
}
/*
diff --git a/src/operation/polygonize/PolygonizeGraph.cpp b/src/operation/polygonize/PolygonizeGraph.cpp
index b767b00..682e9cd 100644
--- a/src/operation/polygonize/PolygonizeGraph.cpp
+++ b/src/operation/polygonize/PolygonizeGraph.cpp
@@ -78,7 +78,7 @@ PolygonizeGraph::deleteAllEdges(Node *node)
PolygonizeDirectedEdge *de=(PolygonizeDirectedEdge*)edges[i];
de->setMarked(true);
PolygonizeDirectedEdge *sym=(PolygonizeDirectedEdge*) de->getSym();
- if (sym!=NULL)
+ if (sym!=nullptr)
sym->setMarked(true);
}
}
@@ -150,7 +150,7 @@ Node *
PolygonizeGraph::getNode(const Coordinate& pt)
{
Node *node=findNode(pt);
- if (node==NULL) {
+ if (node==nullptr) {
node=new Node(pt);
newNodes.push_back(node);
// ensure node is only added once to graph
@@ -211,7 +211,7 @@ PolygonizeGraph::findIntersectionNodes(PolygonizeDirectedEdge *startDE,
intNodes.push_back(node);
}
de=de->getNext();
- assert(de!=NULL); // found NULL DE in ring
+ assert(de!=nullptr); // found NULL DE in ring
assert(de==startDE || !de->isInRing()); // found DE already in ring
} while (de!=startDE);
}
@@ -340,23 +340,23 @@ void
PolygonizeGraph::computeNextCWEdges(Node *node)
{
DirectedEdgeStar *deStar=node->getOutEdges();
- PolygonizeDirectedEdge *startDE=NULL;
- PolygonizeDirectedEdge *prevDE=NULL;
+ PolygonizeDirectedEdge *startDE=nullptr;
+ PolygonizeDirectedEdge *prevDE=nullptr;
// the edges are stored in CCW order around the star
std::vector<DirectedEdge*> &pde=deStar->getEdges();
for(unsigned int i=0; i<pde.size(); ++i) {
PolygonizeDirectedEdge *outDE=(PolygonizeDirectedEdge*)pde[i];
if (outDE->isMarked()) continue;
- if (startDE==NULL)
+ if (startDE==nullptr)
startDE=outDE;
- if (prevDE!=NULL) {
+ if (prevDE!=nullptr) {
PolygonizeDirectedEdge *sym=(PolygonizeDirectedEdge*) prevDE->getSym();
sym->setNext(outDE);
}
prevDE=outDE;
}
- if (prevDE!=NULL) {
+ if (prevDE!=nullptr) {
PolygonizeDirectedEdge *sym=(PolygonizeDirectedEdge*) prevDE->getSym();
sym->setNext(startDE);
}
@@ -372,8 +372,8 @@ void
PolygonizeGraph::computeNextCCWEdges(Node *node, long label)
{
DirectedEdgeStar *deStar=node->getOutEdges();
- PolygonizeDirectedEdge *firstOutDE=NULL;
- PolygonizeDirectedEdge *prevInDE=NULL;
+ PolygonizeDirectedEdge *firstOutDE=nullptr;
+ PolygonizeDirectedEdge *prevInDE=nullptr;
// the edges are stored in CCW order around the star
std::vector<DirectedEdge*> &edges=deStar->getEdges();
@@ -386,25 +386,25 @@ PolygonizeGraph::computeNextCCWEdges(Node *node, long label)
{
PolygonizeDirectedEdge *de=(PolygonizeDirectedEdge*)edges[i];
PolygonizeDirectedEdge *sym=(PolygonizeDirectedEdge*) de->getSym();
- PolygonizeDirectedEdge *outDE=NULL;
+ PolygonizeDirectedEdge *outDE=nullptr;
if (de->getLabel()==label) outDE=de;
- PolygonizeDirectedEdge *inDE=NULL;
+ PolygonizeDirectedEdge *inDE=nullptr;
if (sym->getLabel()==label) inDE= sym;
- if (outDE==NULL && inDE==NULL) continue; // this edge is not in edgering
- if (inDE != NULL) {
+ if (outDE==nullptr && inDE==nullptr) continue; // this edge is not in edgering
+ if (inDE != nullptr) {
prevInDE=inDE;
}
- if (outDE != NULL) {
- if (prevInDE != NULL) {
+ if (outDE != nullptr) {
+ if (prevInDE != nullptr) {
prevInDE->setNext(outDE);
- prevInDE=NULL;
+ prevInDE=nullptr;
}
- if (firstOutDE==NULL)
+ if (firstOutDE==nullptr)
firstOutDE=outDE;
}
}
- if (prevInDE != NULL) {
- assert(firstOutDE != NULL);
+ if (prevInDE != nullptr) {
+ assert(firstOutDE != nullptr);
prevInDE->setNext(firstOutDE);
}
}
@@ -418,7 +418,7 @@ PolygonizeGraph::findDirEdgesInRing(PolygonizeDirectedEdge *startDE,
do {
edges.push_back(de);
de=de->getNext();
- assert(de != NULL); // found NULL DE in ring
+ assert(de != nullptr); // found NULL DE in ring
assert(de==startDE || !de->isInRing()); // found DE already in ring
} while (de != startDE);
}
@@ -434,7 +434,7 @@ PolygonizeGraph::findEdgeRing(PolygonizeDirectedEdge *startDE)
er->add(de);
de->setRing(er);
de=de->getNext();
- assert(de != NULL); // found NULL DE in ring
+ assert(de != nullptr); // found NULL DE in ring
assert(de==startDE || ! de->isInRing()); // found DE already in ring
} while (de != startDE);
return er;
@@ -460,7 +460,7 @@ PolygonizeGraph::deleteDangles(std::vector<const LineString*>& dangleLines)
// delete this edge and its sym
de->setMarked(true);
PolygonizeDirectedEdge *sym=(PolygonizeDirectedEdge*) de->getSym();
- if (sym != NULL)
+ if (sym != nullptr)
sym->setMarked(true);
// save the line as a dangle
PolygonizeEdge *e=(PolygonizeEdge*) de->getEdge();
diff --git a/src/operation/polygonize/Polygonizer.cpp b/src/operation/polygonize/Polygonizer.cpp
index d041b37..69ce959 100644
--- a/src/operation/polygonize/Polygonizer.cpp
+++ b/src/operation/polygonize/Polygonizer.cpp
@@ -62,13 +62,13 @@ Polygonizer::LineStringAdder::filter_ro(const Geometry *g)
*/
Polygonizer::Polygonizer():
lineStringAdder(this),
- graph(NULL),
+ graph(nullptr),
dangles(),
cutEdges(),
invalidRingLines(),
holeList(),
shellList(),
- polyList(NULL)
+ polyList(nullptr)
{
}
@@ -160,7 +160,7 @@ void
Polygonizer::add(const LineString *line)
{
// create a new graph using the factory from the input Geometry
- if (graph==NULL)
+ if (graph==nullptr)
graph=new PolygonizeGraph(line->getFactory());
graph->addEdge(line);
}
@@ -174,7 +174,7 @@ Polygonizer::getPolygons()
{
polygonize();
vector<Polygon *> *ret = polyList;
- polyList = NULL;
+ polyList = nullptr;
return ret;
}
@@ -207,12 +207,12 @@ void
Polygonizer::polygonize()
{
// check if already computed
- if (polyList!=NULL) return;
+ if (polyList!=nullptr) return;
polyList=new vector<Polygon*>();
// if no geometries were supplied it's possible graph could be null
- if (graph==NULL) return;
+ if (graph==nullptr) return;
graph->deleteDangles(dangles);
@@ -307,7 +307,7 @@ Polygonizer::assignHoleToShell(EdgeRing *holeER,
{
EdgeRing *shell = EdgeRing::findEdgeRingContaining(holeER, &shellList);
- if (shell!=NULL)
+ if (shell!=nullptr)
shell->addHole(holeER->getRingOwnership());
}
diff --git a/src/operation/predicate/RectangleIntersects.cpp b/src/operation/predicate/RectangleIntersects.cpp
index 17ca4e2..fd66c5e 100644
--- a/src/operation/predicate/RectangleIntersects.cpp
+++ b/src/operation/predicate/RectangleIntersects.cpp
@@ -144,7 +144,7 @@ protected:
const geom::Polygon *poly;
// if test geometry is not polygonal this check is not needed
- if ( 0 == (poly=dynamic_cast<const geom::Polygon *>(&geom)) ) {
+ if ( nullptr == (poly=dynamic_cast<const geom::Polygon *>(&geom)) ) {
return;
}
diff --git a/src/operation/relate/EdgeEndBuilder.cpp b/src/operation/relate/EdgeEndBuilder.cpp
index 3451292..6c09e91 100644
--- a/src/operation/relate/EdgeEndBuilder.cpp
+++ b/src/operation/relate/EdgeEndBuilder.cpp
@@ -61,24 +61,24 @@ EdgeEndBuilder::computeEdgeEnds(Edge *edge, vector<EdgeEnd*> *l)
// no intersections, so there is nothing to do
if (it==eiList.end()) return;
- EdgeIntersection *eiPrev=NULL;
- EdgeIntersection *eiCurr=NULL;
+ EdgeIntersection *eiPrev=nullptr;
+ EdgeIntersection *eiCurr=nullptr;
EdgeIntersection *eiNext=*it;
it++;
do {
eiPrev=eiCurr;
eiCurr=eiNext;
- eiNext=NULL;
+ eiNext=nullptr;
if (it!=eiList.end()) {
eiNext=*it;
it++;
}
- if (eiCurr!=NULL) {
+ if (eiCurr!=nullptr) {
createEdgeEndForPrev(edge,l,eiCurr,eiPrev);
createEdgeEndForNext(edge,l,eiCurr,eiNext);
}
- } while (eiCurr!=NULL);
+ } while (eiCurr!=nullptr);
}
/**
@@ -101,7 +101,7 @@ EdgeEndBuilder::createEdgeEndForPrev(Edge *edge, vector<EdgeEnd*> *l,
}
Coordinate pPrev(edge->getCoordinate(iPrev));
// if prev intersection is past the previous vertex, use it instead
- if (eiPrev!=NULL && eiPrev->segmentIndex>=iPrev)
+ if (eiPrev!=nullptr && eiPrev->segmentIndex>=iPrev)
pPrev=eiPrev->coord;
Label label( edge->getLabel() );
// since edgeStub is oriented opposite to it's parent edge, have to flip sides for edge label
@@ -125,10 +125,10 @@ EdgeEndBuilder::createEdgeEndForNext(Edge *edge, vector<EdgeEnd*> *l,
{
int iNext=eiCurr->segmentIndex + 1;
// if there is no next edge there is nothing to do
- if (iNext>=edge->getNumPoints() && eiNext==NULL) return;
+ if (iNext>=edge->getNumPoints() && eiNext==nullptr) return;
Coordinate pNext(edge->getCoordinate(iNext));
// if the next intersection is in the same segment as the current, use it as the endpoint
- if (eiNext!=NULL && eiNext->segmentIndex==eiCurr->segmentIndex)
+ if (eiNext!=nullptr && eiNext->segmentIndex==eiCurr->segmentIndex)
pNext=eiNext->coord;
EdgeEnd *e = new EdgeEnd(edge, eiCurr->coord, pNext, edge->getLabel());
//Debug.println(e);
diff --git a/src/operation/union/CascadedPolygonUnion.cpp b/src/operation/union/CascadedPolygonUnion.cpp
index 04c2328..56b43c4 100644
--- a/src/operation/union/CascadedPolygonUnion.cpp
+++ b/src/operation/union/CascadedPolygonUnion.cpp
@@ -127,7 +127,7 @@ geom::Geometry* CascadedPolygonUnion::Union(const geom::MultiPolygon* multipoly)
geom::Geometry* CascadedPolygonUnion::Union()
{
if (inputPolys->empty())
- return NULL;
+ return nullptr;
geomFactory = inputPolys->front()->getFactory();
@@ -171,7 +171,7 @@ geom::Geometry* CascadedPolygonUnion::binaryUnion(GeometryListHolder* geoms,
std::size_t start, std::size_t end)
{
if (end - start <= 1) {
- return unionSafe(geoms->getGeometry(start), NULL);
+ return unionSafe(geoms->getGeometry(start), nullptr);
}
else if (end - start == 2) {
return unionSafe(geoms->getGeometry(start), geoms->getGeometry(start + 1));
@@ -212,12 +212,12 @@ CascadedPolygonUnion::reduceToGeometries(index::strtree::ItemsList* geomTree)
geom::Geometry*
CascadedPolygonUnion::unionSafe(geom::Geometry* g0, geom::Geometry* g1)
{
- if (g0 == NULL && g1 == NULL)
- return NULL;
+ if (g0 == nullptr && g1 == nullptr)
+ return nullptr;
- if (g0 == NULL)
+ if (g0 == nullptr)
return g1->clone();
- if (g1 == NULL)
+ if (g1 == nullptr)
return g0->clone();
return unionOptimized(g0, g1);
diff --git a/src/operation/union/CascadedUnion.cpp b/src/operation/union/CascadedUnion.cpp
index e9b57f0..3b812e6 100644
--- a/src/operation/union/CascadedUnion.cpp
+++ b/src/operation/union/CascadedUnion.cpp
@@ -41,7 +41,7 @@ geom::Geometry* CascadedUnion::Union(std::vector<geom::Geometry*>* polys)
geom::Geometry* CascadedUnion::Union()
{
if (inputGeoms->empty())
- return NULL;
+ return nullptr;
geomFactory = inputGeoms->front()->getFactory();
@@ -85,7 +85,7 @@ geom::Geometry* CascadedUnion::binaryUnion(GeometryListHolder* geoms,
std::size_t start, std::size_t end)
{
if (end - start <= 1) {
- return unionSafe(geoms->getGeometry(start), NULL);
+ return unionSafe(geoms->getGeometry(start), nullptr);
}
else if (end - start == 2) {
return unionSafe(geoms->getGeometry(start), geoms->getGeometry(start + 1));
@@ -126,12 +126,12 @@ CascadedUnion::reduceToGeometries(index::strtree::ItemsList* geomTree)
geom::Geometry*
CascadedUnion::unionSafe(geom::Geometry* g0, geom::Geometry* g1)
{
- if (g0 == NULL && g1 == NULL)
- return NULL;
+ if (g0 == nullptr && g1 == nullptr)
+ return nullptr;
- if (g0 == NULL)
+ if (g0 == nullptr)
return g1->clone();
- if (g1 == NULL)
+ if (g1 == nullptr)
return g0->clone();
return unionOptimized(g0, g1);
diff --git a/src/operation/valid/ConnectedInteriorTester.cpp b/src/operation/valid/ConnectedInteriorTester.cpp
index 1fad3cd..4205d0f 100644
--- a/src/operation/valid/ConnectedInteriorTester.cpp
+++ b/src/operation/valid/ConnectedInteriorTester.cpp
@@ -215,7 +215,7 @@ ConnectedInteriorTester::buildEdgeRings(std::vector<EdgeEnd*> *dirEdges,
#endif
// if this edge has not yet been processed
- if(de->isInResult() && de->getEdgeRing()==NULL)
+ if(de->isInResult() && de->getEdgeRing()==nullptr)
{
MaximalEdgeRing* er = new MaximalEdgeRing(de,
geometryFactory.get());
@@ -271,13 +271,13 @@ ConnectedInteriorTester::visitInteriorRing(const LineString *ring, PlanarGraph &
const Coordinate& pt1=findDifferentPoint(pts, pt0);
Edge *e=graph.findEdgeInSameDirection(pt0, pt1);
DirectedEdge *de=static_cast<DirectedEdge*>(graph.findEdgeEnd(e));
- DirectedEdge *intDe=NULL;
+ DirectedEdge *intDe=nullptr;
if (de->getLabel().getLocation(0,Position::RIGHT)==Location::INTERIOR) {
intDe=de;
} else if (de->getSym()->getLabel().getLocation(0,Position::RIGHT)==Location::INTERIOR) {
intDe=de->getSym();
}
- assert(intDe!=NULL); // unable to find dirEdge with Interior on RHS
+ assert(intDe!=nullptr); // unable to find dirEdge with Interior on RHS
visitLinkedDirectedEdges(intDe);
}
@@ -290,7 +290,7 @@ ConnectedInteriorTester::visitLinkedDirectedEdges(DirectedEdge *start)
//Debug.println(de);
do {
// found null Directed Edge
- assert(de!=NULL);
+ assert(de!=nullptr);
de->setVisited(true);
de=de->getNext();
diff --git a/src/operation/valid/IndexedNestedRingTester.cpp b/src/operation/valid/IndexedNestedRingTester.cpp
index ed35f7f..16c3886 100644
--- a/src/operation/valid/IndexedNestedRingTester.cpp
+++ b/src/operation/valid/IndexedNestedRingTester.cpp
@@ -79,7 +79,7 @@ IndexedNestedRingTester::isNonNested()
// Unable to find a ring point not a node of
// the search ring
- assert(innerRingPt!=NULL);
+ assert(innerRingPt!=nullptr);
bool isInside = algorithm::CGAlgorithms::isPointInRing(
*innerRingPt, searchRingPts);
diff --git a/src/operation/valid/IndexedNestedRingTester.h b/src/operation/valid/IndexedNestedRingTester.h
index eb6407b..a7a7568 100644
--- a/src/operation/valid/IndexedNestedRingTester.h
+++ b/src/operation/valid/IndexedNestedRingTester.h
@@ -54,8 +54,8 @@ public:
:
graph(newGraph),
//totalEnv(0),
- index(0),
- nestedPt(0)
+ index(nullptr),
+ nestedPt(nullptr)
{
}
diff --git a/src/operation/valid/IsValidOp.cpp b/src/operation/valid/IsValidOp.cpp
index fce1f5b..88578e2 100644
--- a/src/operation/valid/IsValidOp.cpp
+++ b/src/operation/valid/IsValidOp.cpp
@@ -78,7 +78,7 @@ IsValidOp::findPtNotNode(const CoordinateSequence *testCoords,
return &pt;
}
}
- return NULL;
+ return nullptr;
}
@@ -86,7 +86,7 @@ bool
IsValidOp::isValid()
{
checkValid();
- return validErr==NULL;
+ return validErr==nullptr;
}
/* static public */
@@ -124,9 +124,9 @@ IsValidOp::checkValid()
void
IsValidOp::checkValid(const Geometry *g)
{
- assert( validErr == NULL );
+ assert( validErr == nullptr );
- if (0 == g)
+ if (nullptr == g)
return;
// empty geometries are always valid!
@@ -167,7 +167,7 @@ void
IsValidOp::checkValid(const LineString *g)
{
checkInvalidCoordinates(g->getCoordinatesRO());
- if (validErr != NULL) return;
+ if (validErr != nullptr) return;
GeometryGraph graph(0,g);
checkTooFewPoints(&graph);
@@ -179,14 +179,14 @@ IsValidOp::checkValid(const LineString *g)
void
IsValidOp::checkValid(const LinearRing *g){
checkInvalidCoordinates(g->getCoordinatesRO());
- if (validErr != NULL) return;
+ if (validErr != nullptr) return;
checkClosedRing(g);
- if (validErr != NULL) return;
+ if (validErr != nullptr) return;
GeometryGraph graph(0, g);
checkTooFewPoints(&graph);
- if (validErr!=NULL) return;
+ if (validErr!=nullptr) return;
LineIntersector li;
delete graph.computeSelfNodes(&li, true, true);
@@ -201,29 +201,29 @@ void
IsValidOp::checkValid(const Polygon *g)
{
checkInvalidCoordinates(g);
- if (validErr != NULL) return;
+ if (validErr != nullptr) return;
checkClosedRings(g);
- if (validErr != NULL) return;
+ if (validErr != nullptr) return;
GeometryGraph graph(0,g);
checkTooFewPoints(&graph);
- if (validErr!=NULL) return;
+ if (validErr!=nullptr) return;
checkConsistentArea(&graph);
- if (validErr!=NULL) return;
+ if (validErr!=nullptr) return;
if (!isSelfTouchingRingFormingHoleValid) {
checkNoSelfIntersectingRings(&graph);
- if (validErr!=NULL) return;
+ if (validErr!=nullptr) return;
}
checkHolesInShell(g,&graph);
- if (validErr!=NULL) return;
+ if (validErr!=nullptr) return;
checkHolesNotNested(g,&graph);
- if (validErr!=NULL) return;
+ if (validErr!=nullptr) return;
checkConnectedInteriors(graph);
}
@@ -239,10 +239,10 @@ IsValidOp::checkValid(const MultiPolygon *g)
const Polygon *p = dynamic_cast<const Polygon *>(g->getGeometryN(i));
checkInvalidCoordinates(p);
- if (validErr != NULL) return;
+ if (validErr != nullptr) return;
checkClosedRings(p);
- if (validErr != NULL) return;
+ if (validErr != nullptr) return;
polys[i]=p;
}
@@ -250,33 +250,33 @@ IsValidOp::checkValid(const MultiPolygon *g)
GeometryGraph graph(0,g);
checkTooFewPoints(&graph);
- if (validErr!=NULL) return;
+ if (validErr!=nullptr) return;
checkConsistentArea(&graph);
- if (validErr!=NULL) return;
+ if (validErr!=nullptr) return;
if (!isSelfTouchingRingFormingHoleValid)
{
checkNoSelfIntersectingRings(&graph);
- if (validErr!=NULL) return;
+ if (validErr!=nullptr) return;
}
for(unsigned int i=0; i<ngeoms; ++i)
{
const Polygon *p=polys[i];
checkHolesInShell(p, &graph);
- if (validErr!=NULL) return;
+ if (validErr!=nullptr) return;
}
for(unsigned int i=0; i<ngeoms; ++i)
{
const Polygon *p=polys[i];
checkHolesNotNested(p, &graph);
- if (validErr!=NULL) return;
+ if (validErr!=nullptr) return;
}
checkShellsNotNested(g,&graph);
- if (validErr!=NULL) return;
+ if (validErr!=nullptr) return;
checkConnectedInteriors(graph);
}
@@ -288,7 +288,7 @@ IsValidOp::checkValid(const GeometryCollection *gc)
{
const Geometry *g=gc->getGeometryN(i);
checkValid(g);
- if (validErr!=NULL) return;
+ if (validErr!=nullptr) return;
}
}
@@ -343,7 +343,7 @@ IsValidOp::checkNoSelfIntersectingRings(GeometryGraph *graph)
{
Edge *e=(*edges)[i];
checkNoSelfIntersectingRing(e->getEdgeIntersectionList());
- if(validErr!=NULL) return;
+ if(validErr!=nullptr) return;
}
}
@@ -425,7 +425,7 @@ IsValidOp::checkHolesInShell(const Polygon *p, GeometryGraph *graph)
* split the polygon into disconnected interiors.
* This will be caught by a subsequent check.
*/
- if (holePt==NULL) return;
+ if (holePt==nullptr) return;
bool outside = !pir.isInside(*holePt);
if (outside) {
@@ -496,7 +496,7 @@ IsValidOp::checkShellsNotNested(const MultiPolygon *mp, GeometryGraph *graph)
checkShellNotNested(shell, p2, graph);
- if (validErr!=NULL) return;
+ if (validErr!=nullptr) return;
}
}
}
@@ -518,7 +518,7 @@ IsValidOp::checkShellNotNested(const LinearRing *shell, const Polygon *p,
// if no point could be found, we can assume that the shell
// is outside the polygon
- if (shellPt==NULL) return;
+ if (shellPt==nullptr) return;
bool insidePolyShell=CGAlgorithms::isPointInRing(*shellPt, polyPts);
if (!insidePolyShell) return;
@@ -539,14 +539,14 @@ IsValidOp::checkShellNotNested(const LinearRing *shell, const Polygon *p,
* Otherwise, the shell is not properly contained in a hole, which is
* an error.
*/
- const Coordinate *badNestedPt=NULL;
+ const Coordinate *badNestedPt=nullptr;
for(int i=0; i<nholes; ++i) {
assert(dynamic_cast<const LinearRing*>(
p->getInteriorRingN(i)));
const LinearRing *hole=static_cast<const LinearRing*>(
p->getInteriorRingN(i));
badNestedPt = checkShellInsideHole(shell, hole, graph);
- if (badNestedPt==NULL) return;
+ if (badNestedPt==nullptr) return;
}
validErr=new TopologyValidationError(
TopologyValidationError::eNestedShells, *badNestedPt
@@ -580,10 +580,10 @@ IsValidOp::checkShellInsideHole(const LinearRing *shell,
if (holePt) {
bool insideShell=CGAlgorithms::isPointInRing(*holePt, shellPts);
if (insideShell) return holePt;
- return NULL;
+ return nullptr;
}
assert(0); // points in shell and hole appear to be equal
- return NULL;
+ return nullptr;
}
/*private*/
@@ -623,7 +623,7 @@ void
IsValidOp::checkInvalidCoordinates(const Polygon *poly)
{
checkInvalidCoordinates(poly->getExteriorRing()->getCoordinatesRO());
- if (validErr != NULL) return;
+ if (validErr != nullptr) return;
int nholes=poly->getNumInteriorRing();
for (int i=0; i<nholes; ++i)
@@ -631,7 +631,7 @@ IsValidOp::checkInvalidCoordinates(const Polygon *poly)
checkInvalidCoordinates(
poly->getInteriorRingN(i)->getCoordinatesRO()
);
- if (validErr != NULL) return;
+ if (validErr != nullptr) return;
}
}
diff --git a/src/operation/valid/QuadtreeNestedRingTester.cpp b/src/operation/valid/QuadtreeNestedRingTester.cpp
index c3ddae3..897bba5 100644
--- a/src/operation/valid/QuadtreeNestedRingTester.cpp
+++ b/src/operation/valid/QuadtreeNestedRingTester.cpp
@@ -42,8 +42,8 @@ QuadtreeNestedRingTester::QuadtreeNestedRingTester(GeometryGraph *newGraph):
graph(newGraph),
rings(),
totalEnv(),
- qt(NULL),
- nestedPt(NULL)
+ qt(nullptr),
+ nestedPt(nullptr)
{
}
@@ -95,7 +95,7 @@ QuadtreeNestedRingTester::isNonNested()
searchRing, graph);
// Unable to find a ring point not a node of the search ring
- assert(innerRingPt!=NULL);
+ assert(innerRingPt!=nullptr);
bool isInside=CGAlgorithms::isPointInRing(*innerRingPt,searchRingPts);
if (isInside) {
diff --git a/src/operation/valid/SimpleNestedRingTester.cpp b/src/operation/valid/SimpleNestedRingTester.cpp
index 082c6c5..7f23044 100644
--- a/src/operation/valid/SimpleNestedRingTester.cpp
+++ b/src/operation/valid/SimpleNestedRingTester.cpp
@@ -47,7 +47,7 @@ SimpleNestedRingTester::isNonNested()
continue;
const Coordinate *innerRingPt=IsValidOp::findPtNotNode(innerRingPts,searchRing,graph);
// Unable to find a ring point not a node of the search ring
- assert(innerRingPt!=NULL);
+ assert(innerRingPt!=nullptr);
bool isInside=CGAlgorithms::isPointInRing(*innerRingPt,searchRingPts);
if (isInside) {
diff --git a/src/operation/valid/SweeplineNestedRingTester.cpp b/src/operation/valid/SweeplineNestedRingTester.cpp
index ded25b1..ac1b741 100644
--- a/src/operation/valid/SweeplineNestedRingTester.cpp
+++ b/src/operation/valid/SweeplineNestedRingTester.cpp
@@ -83,7 +83,7 @@ SweeplineNestedRingTester::isInside(LinearRing *innerRing,LinearRing *searchRing
const Coordinate *innerRingPt=IsValidOp::findPtNotNode(innerRingPts, searchRing, graph);
// Unable to find a ring point not a node of the search ring
- assert(innerRingPt!=NULL);
+ assert(innerRingPt!=nullptr);
bool isInside=CGAlgorithms::isPointInRing(*innerRingPt,searchRingPts);
if (isInside) {
diff --git a/src/planargraph/Edge.cpp b/src/planargraph/Edge.cpp
index 1023c1c..782c950 100644
--- a/src/planargraph/Edge.cpp
+++ b/src/planargraph/Edge.cpp
@@ -62,7 +62,7 @@ Edge::getDirEdge(Node *fromNode)
if (dirEdge[1]->getFromNode()==fromNode) return dirEdge[1];
// node not found
// possibly should throw an exception here?
- return NULL;
+ return nullptr;
}
/**
@@ -76,7 +76,7 @@ Edge::getOppositeNode(Node *node)
if (dirEdge[1]->getFromNode()==node) return dirEdge[1]->getToNode();
// node not found
// possibly should throw an exception here?
- return NULL;
+ return nullptr;
}
std::ostream& operator<<(std::ostream& os, const Edge& n) {
diff --git a/src/planargraph/NodeMap.cpp b/src/planargraph/NodeMap.cpp
index a527999..a05902a 100644
--- a/src/planargraph/NodeMap.cpp
+++ b/src/planargraph/NodeMap.cpp
@@ -82,7 +82,7 @@ NodeMap::find(const geom::Coordinate& coord)
{
container::iterator found=nodeMap.find(coord);
if (found==nodeMap.end())
- return NULL;
+ return nullptr;
else
return found->second;
}
diff --git a/src/planargraph/PlanarGraph.cpp b/src/planargraph/PlanarGraph.cpp
index 510a74a..6150475 100644
--- a/src/planargraph/PlanarGraph.cpp
+++ b/src/planargraph/PlanarGraph.cpp
@@ -78,7 +78,7 @@ void
PlanarGraph::remove(DirectedEdge *de)
{
DirectedEdge *sym = de->getSym();
- if (sym!=NULL) sym->setSym(NULL);
+ if (sym!=nullptr) sym->setSym(nullptr);
de->getFromNode()->getOutEdges()->remove(de);
for(unsigned int i=0; i<dirEdges.size(); ++i) {
if(dirEdges[i]==de) {
@@ -101,7 +101,7 @@ PlanarGraph::remove(Node *node)
DirectedEdge *de =outEdges[i];
DirectedEdge *sym = de->getSym();
// remove the diredge that points to this node
- if (sym!=NULL) remove(sym);
+ if (sym!=nullptr) remove(sym);
// remove this diredge from the graph collection
for(unsigned int j=0; j<dirEdges.size(); ++j) {
if (dirEdges[j]==de) {
@@ -110,7 +110,7 @@ PlanarGraph::remove(Node *node)
}
}
Edge *edge=de->getEdge();
- if (edge!=NULL) {
+ if (edge!=nullptr) {
for(unsigned int k=0; k<edges.size(); ++k) {
if(edges[k]==edge) {
edges.erase(edges.begin()+k);
diff --git a/src/precision/MinimumClearance.cpp b/src/precision/MinimumClearance.cpp
index c30b3ac..ed020f8 100644
--- a/src/precision/MinimumClearance.cpp
+++ b/src/precision/MinimumClearance.cpp
@@ -161,7 +161,7 @@ void MinimumClearance::compute() {
};
// already computed
- if (minClearancePts.get() != NULL)
+ if (minClearancePts.get() != nullptr)
return;
// initialize to "No Distance Exists" state
diff --git a/src/precision/PrecisionReducerCoordinateOperation.cpp b/src/precision/PrecisionReducerCoordinateOperation.cpp
index 70b2aba..e6e9e85 100644
--- a/src/precision/PrecisionReducerCoordinateOperation.cpp
+++ b/src/precision/PrecisionReducerCoordinateOperation.cpp
@@ -39,7 +39,7 @@ PrecisionReducerCoordinateOperation::edit(const CoordinateSequence *cs,
{
unsigned int csSize = cs->getSize();
- if ( csSize == 0 ) return NULL;
+ if ( csSize == 0 ) return nullptr;
vector<Coordinate> *vc = new vector<Coordinate>(csSize);
@@ -77,8 +77,8 @@ PrecisionReducerCoordinateOperation::edit(const CoordinateSequence *cs,
CoordinateSequence *collapsedCoords = reducedCoords;
if ( removeCollapsed )
{
- delete reducedCoords; reducedCoords=0;
- collapsedCoords=0;
+ delete reducedCoords; reducedCoords=nullptr;
+ collapsedCoords=nullptr;
}
// return null or orginal length coordinate array
diff --git a/src/precision/SimpleGeometryPrecisionReducer.cpp b/src/precision/SimpleGeometryPrecisionReducer.cpp
index 3370d71..29d1297 100644
--- a/src/precision/SimpleGeometryPrecisionReducer.cpp
+++ b/src/precision/SimpleGeometryPrecisionReducer.cpp
@@ -68,7 +68,7 @@ CoordinateSequence*
PrecisionReducerCoordinateOperation::edit(const CoordinateSequence *cs,
const Geometry *geom)
{
- if (cs->getSize()==0) return NULL;
+ if (cs->getSize()==0) return nullptr;
unsigned int csSize=cs->getSize();
@@ -108,8 +108,8 @@ PrecisionReducerCoordinateOperation::edit(const CoordinateSequence *cs,
CoordinateSequence *collapsedCoords = reducedCoords;
if (sgpr->getRemoveCollapsed())
{
- delete reducedCoords; reducedCoords=0;
- collapsedCoords=0;
+ delete reducedCoords; reducedCoords=nullptr;
+ collapsedCoords=nullptr;
}
// return null or orginal length coordinate array
if (noRepeatedCoords->getSize()<minLength) {
diff --git a/src/simplify/TaggedLineSegment.cpp b/src/simplify/TaggedLineSegment.cpp
index b5865b6..3c4e5aa 100644
--- a/src/simplify/TaggedLineSegment.cpp
+++ b/src/simplify/TaggedLineSegment.cpp
@@ -46,7 +46,7 @@ TaggedLineSegment::TaggedLineSegment(const geom::Coordinate& p0,
const geom::Coordinate& p1)
:
LineSegment(p0, p1),
- parent(NULL),
+ parent(nullptr),
index(0)
{
}
diff --git a/src/simplify/TaggedLineStringSimplifier.cpp b/src/simplify/TaggedLineStringSimplifier.cpp
index ceaa50e..24ce036 100644
--- a/src/simplify/TaggedLineStringSimplifier.cpp
+++ b/src/simplify/TaggedLineStringSimplifier.cpp
@@ -52,8 +52,8 @@ TaggedLineStringSimplifier::TaggedLineStringSimplifier(
inputIndex(nInputIndex),
outputIndex(nOutputIndex),
li(new algorithm::LineIntersector()),
- line(NULL),
- linePts(NULL),
+ line(nullptr),
+ linePts(nullptr),
distanceTolerance(0.0)
{
}
diff --git a/src/triangulate/DelaunayTriangulationBuilder.cpp b/src/triangulate/DelaunayTriangulationBuilder.cpp
index fff47be..2df4578 100644
--- a/src/triangulate/DelaunayTriangulationBuilder.cpp
+++ b/src/triangulate/DelaunayTriangulationBuilder.cpp
@@ -65,7 +65,7 @@ DelaunayTriangulationBuilder::toVertices(
}
DelaunayTriangulationBuilder::DelaunayTriangulationBuilder() :
- siteCoords(NULL), tolerance(0.0), subdiv(NULL)
+ siteCoords(nullptr), tolerance(0.0), subdiv(nullptr)
{
}
@@ -99,7 +99,7 @@ DelaunayTriangulationBuilder::setSites(const CoordinateSequence& coords)
void
DelaunayTriangulationBuilder::create()
{
- if(subdiv != NULL || siteCoords == NULL)
+ if(subdiv != nullptr || siteCoords == nullptr)
return;
Envelope siteEnv;
diff --git a/src/triangulate/VoronoiDiagramBuilder.cpp b/src/triangulate/VoronoiDiagramBuilder.cpp
index b9ea42b..8d79c1e 100644
--- a/src/triangulate/VoronoiDiagramBuilder.cpp
+++ b/src/triangulate/VoronoiDiagramBuilder.cpp
@@ -38,7 +38,7 @@ using namespace geos::geom;
VoronoiDiagramBuilder::VoronoiDiagramBuilder() :
- tolerance(0.0), clipEnv(0)
+ tolerance(0.0), clipEnv(nullptr)
{
}
diff --git a/src/triangulate/quadedge/LastFoundQuadEdgeLocator.cpp b/src/triangulate/quadedge/LastFoundQuadEdgeLocator.cpp
index 04fac9a..33e7830 100644
--- a/src/triangulate/quadedge/LastFoundQuadEdgeLocator.cpp
+++ b/src/triangulate/quadedge/LastFoundQuadEdgeLocator.cpp
@@ -24,7 +24,7 @@ namespace triangulate { //geos.triangulate
namespace quadedge { //geos.triangulate.quadedge
LastFoundQuadEdgeLocator::LastFoundQuadEdgeLocator(QuadEdgeSubdivision *subdiv) :
- subdiv(subdiv), lastEdge(NULL)
+ subdiv(subdiv), lastEdge(nullptr)
{
}
diff --git a/src/triangulate/quadedge/QuadEdge.cpp b/src/triangulate/quadedge/QuadEdge.cpp
index 82929ff..b5f1ece 100644
--- a/src/triangulate/quadedge/QuadEdge.cpp
+++ b/src/triangulate/quadedge/QuadEdge.cpp
@@ -89,7 +89,7 @@ QuadEdge::swap(QuadEdge &e)
e.setDest(b.dest());
}
-QuadEdge::QuadEdge() : _rot(NULL), vertex(), next(NULL), data(NULL), isAlive(true)
+QuadEdge::QuadEdge() : _rot(nullptr), vertex(), next(nullptr), data(nullptr), isAlive(true)
{ }
QuadEdge::~QuadEdge()
@@ -106,13 +106,13 @@ QuadEdge::free()
if(_rot->_rot->_rot)
{
delete _rot->_rot->_rot;
- _rot->_rot->_rot = NULL;
+ _rot->_rot->_rot = nullptr;
}
delete _rot->_rot;
- _rot->_rot = NULL;
+ _rot->_rot = nullptr;
}
delete _rot;
- _rot = NULL;
+ _rot = nullptr;
}
}
diff --git a/src/triangulate/quadedge/QuadEdgeSubdivision.cpp b/src/triangulate/quadedge/QuadEdgeSubdivision.cpp
index cd227b4..feefda1 100644
--- a/src/triangulate/quadedge/QuadEdgeSubdivision.cpp
+++ b/src/triangulate/quadedge/QuadEdgeSubdivision.cpp
@@ -216,8 +216,8 @@ QuadEdgeSubdivision::locate(const Coordinate &p0, const Coordinate &p1)
{
// find an edge containing one of the points
QuadEdge *e = locator->locate(Vertex(p0));
- if (e == NULL)
- return NULL;
+ if (e == nullptr)
+ return nullptr;
// normalize so that p0 is origin of base edge
QuadEdge *base = e;
@@ -230,7 +230,7 @@ QuadEdgeSubdivision::locate(const Coordinate &p0, const Coordinate &p1)
return locEdge;
locEdge = &locEdge->oNext();
} while (locEdge != base);
- return NULL;
+ return nullptr;
}
QuadEdge&
@@ -368,7 +368,7 @@ QuadEdgeSubdivision::fetchTriangleToVisit(QuadEdge *edge,
} while (curr != edge);
if (isFrame && !includeFrame)
- return NULL;
+ return nullptr;
return triEdges;
}
@@ -438,7 +438,7 @@ QuadEdgeSubdivision::visitTriangles(TriangleVisitor *triVisitor, bool includeFra
if (visitedEdges.find(edge) == visitedEdges.end()) {
QuadEdge **triEdges = fetchTriangleToVisit(edge, edgeStack,
includeFrame, visitedEdges);
- if (triEdges != NULL)
+ if (triEdges != nullptr)
triVisitor->visit(triEdges);
}
}
@@ -454,7 +454,7 @@ QuadEdgeSubdivision::getEdges(const geom::GeometryFactory& geomFact)
for (QuadEdgeSubdivision::QuadEdgeList::iterator it = quadEdges->begin(); it != quadEdges->end(); ++it)
{
QuadEdge *qe = *it;
- CoordinateSequence *coordSeq = coordSeqFact->create((std::vector<geom::Coordinate>*)NULL);;
+ CoordinateSequence *coordSeq = coordSeqFact->create((std::vector<geom::Coordinate>*)nullptr);;
coordSeq->add(qe->orig().getCoordinate());
coordSeq->add(qe->dest().getCoordinate());
@@ -484,7 +484,7 @@ QuadEdgeSubdivision::getTriangles( const GeometryFactory &geomFact)
{
CoordinateSequence *coordSeq = *it;
Polygon *tri = geomFact.createPolygon(
- geomFact.createLinearRing(coordSeq), NULL);
+ geomFact.createLinearRing(coordSeq), nullptr);
tris.push_back(static_cast<Geometry*>(tri));
}
GeometryCollection* ret = geomFact.createGeometryCollection(tris);
@@ -579,7 +579,7 @@ QuadEdgeSubdivision::getVoronoiCellPolygon(QuadEdge* qe ,const geom::GeometryFac
std::unique_ptr<Coordinate::Vect> pts = coordList.toCoordinateArray();
std::unique_ptr<geom::Geometry> cellPoly(
- geomFact.createPolygon(geomFact.createLinearRing(new geom::CoordinateArraySequence(pts.release())),NULL));
+ geomFact.createPolygon(geomFact.createLinearRing(new geom::CoordinateArraySequence(pts.release())),nullptr));
Vertex v = startQE->orig();
Coordinate c(0,0);
diff --git a/src/util/GeometricShapeFactory.cpp b/src/util/GeometricShapeFactory.cpp
index 5d1e67c..a1b5eae 100644
--- a/src/util/GeometricShapeFactory.cpp
+++ b/src/util/GeometricShapeFactory.cpp
@@ -119,7 +119,7 @@ GeometricShapeFactory::createRectangle()
(*vc)[ipt++] = (*vc)[0];
CoordinateSequence *cs = geomFact->getCoordinateSequenceFactory()->create(vc);
LinearRing* ring=geomFact->createLinearRing(cs);
- Polygon* poly=geomFact->createPolygon(ring, NULL);
+ Polygon* poly=geomFact->createPolygon(ring, nullptr);
return poly;
}
@@ -145,7 +145,7 @@ GeometricShapeFactory::createCircle()
(*pts)[iPt++] = (*pts)[0];
CoordinateSequence *cs=geomFact->getCoordinateSequenceFactory()->create(pts);
LinearRing* ring = geomFact->createLinearRing(cs);
- Polygon* poly=geomFact->createPolygon(ring,NULL);
+ Polygon* poly=geomFact->createPolygon(ring,nullptr);
return poly;
}
@@ -207,7 +207,7 @@ GeometricShapeFactory::createArcPolygon(double startAng, double angExtent)
CoordinateSequence *cs = geomFact->getCoordinateSequenceFactory()->create(pts);
LinearRing* ring = geomFact->createLinearRing(cs);
- Polygon* geom = geomFact->createPolygon(ring, 0);
+ Polygon* geom = geomFact->createPolygon(ring, nullptr);
return geom;
}
diff --git a/src/util/Interrupt.cpp b/src/util/Interrupt.cpp
index 10de169..01b0c2c 100644
--- a/src/util/Interrupt.cpp
+++ b/src/util/Interrupt.cpp
@@ -19,7 +19,7 @@ namespace {
/* Could these be portably stored in thread-specific space ? */
bool requested = false;
- geos::util::Interrupt::Callback *callback = 0;
+ geos::util::Interrupt::Callback *callback = nullptr;
}
namespace geos {
diff --git a/tests/bigtest/GeometryTestFactory.cpp b/tests/bigtest/GeometryTestFactory.cpp
index 18ef94a..7989dfc 100644
--- a/tests/bigtest/GeometryTestFactory.cpp
+++ b/tests/bigtest/GeometryTestFactory.cpp
@@ -25,7 +25,7 @@ using namespace geos::geom;
Polygon* GeometryTestFactory::createBox(GeometryFactory *fact,double minx,double miny,int nSide,double segLen) {
CoordinateSequence *pts=createBox(minx, miny, nSide, segLen);
- return fact->createPolygon(fact->createLinearRing(pts),NULL);
+ return fact->createPolygon(fact->createLinearRing(pts),nullptr);
}
CoordinateSequence* GeometryTestFactory::createBox(double minx, double miny,int nSide,double segLen) {
@@ -81,7 +81,7 @@ CoordinateSequence* GeometryTestFactory::createCircle(double basex,double basey,
Polygon* GeometryTestFactory::createCircle(GeometryFactory *fact,double basex,double basey,double size,int nPts) {
CoordinateSequence *pts=createCircle(basex, basey, size, nPts);
- return fact->createPolygon(fact->createLinearRing(pts),NULL);
+ return fact->createPolygon(fact->createLinearRing(pts),nullptr);
}
/**
@@ -128,5 +128,5 @@ CoordinateSequence* GeometryTestFactory::createSineStar(double basex,double base
Polygon* GeometryTestFactory::createSineStar(GeometryFactory *fact,double basex,double basey,double size,double armLen,int nArms,int nPts){
CoordinateSequence *pts=createSineStar(basex, basey, size, armLen, nArms, nPts);
- return fact->createPolygon(fact->createLinearRing(pts),NULL);
+ return fact->createPolygon(fact->createLinearRing(pts),nullptr);
}
diff --git a/tests/unit/algorithm/CGAlgorithms/isCCWTest.cpp b/tests/unit/algorithm/CGAlgorithms/isCCWTest.cpp
index 5ecbd54..8b512d4 100644
--- a/tests/unit/algorithm/CGAlgorithms/isCCWTest.cpp
+++ b/tests/unit/algorithm/CGAlgorithms/isCCWTest.cpp
@@ -35,15 +35,15 @@ namespace tut
geos::io::WKBReader breader_;
test_isccw_data()
- : cs_(0)
+ : cs_(nullptr)
{
- assert(0 == cs_);
+ assert(nullptr == cs_);
}
~test_isccw_data()
{
delete cs_;
- cs_ = 0;
+ cs_ = nullptr;
}
};
diff --git a/tests/unit/algorithm/CGAlgorithms/isPointInRingTest.cpp b/tests/unit/algorithm/CGAlgorithms/isPointInRingTest.cpp
index 4e5ea78..2e62f85 100644
--- a/tests/unit/algorithm/CGAlgorithms/isPointInRingTest.cpp
+++ b/tests/unit/algorithm/CGAlgorithms/isPointInRingTest.cpp
@@ -30,15 +30,15 @@ namespace tut
geos::io::WKTReader reader_;
test_ispointinring_data()
- : cs_(0)
+ : cs_(nullptr)
{
- assert(0 == cs_);
+ assert(nullptr == cs_);
}
~test_ispointinring_data()
{
delete cs_;
- cs_ = 0;
+ cs_ = nullptr;
}
};
diff --git a/tests/unit/algorithm/CGAlgorithms/signedAreaTest.cpp b/tests/unit/algorithm/CGAlgorithms/signedAreaTest.cpp
index bbeaf38..c5d1aba 100644
--- a/tests/unit/algorithm/CGAlgorithms/signedAreaTest.cpp
+++ b/tests/unit/algorithm/CGAlgorithms/signedAreaTest.cpp
@@ -34,15 +34,15 @@ namespace tut
geos::io::WKBReader breader_;
test_signedarea_data()
- : cs_(0)
+ : cs_(nullptr)
{
- assert(0 == cs_);
+ assert(nullptr == cs_);
}
~test_signedarea_data()
{
delete cs_;
- cs_ = 0;
+ cs_ = nullptr;
}
};
diff --git a/tests/unit/algorithm/ConvexHullTest.cpp b/tests/unit/algorithm/ConvexHullTest.cpp
index 3ceed5f..ec05784 100644
--- a/tests/unit/algorithm/ConvexHullTest.cpp
+++ b/tests/unit/algorithm/ConvexHullTest.cpp
@@ -42,15 +42,15 @@ namespace tut
geos::io::WKTReader reader_;
test_convexhull_data()
- : geom_(0), pm_(1), factory_(GeometryFactory::create(&pm_, 0)), reader_(factory_.get())
+ : geom_(nullptr), pm_(1), factory_(GeometryFactory::create(&pm_, 0)), reader_(factory_.get())
{
- assert(0 == geom_);
+ assert(nullptr == geom_);
}
~test_convexhull_data()
{
factory_->destroyGeometry(geom_);
- geom_ = 0;
+ geom_ = nullptr;
}
};
@@ -72,11 +72,11 @@ namespace tut
Geometry::Ptr lineGeom(reader_.read("LINESTRING (30 220, 240 220, 240 220)"));
LineString::Ptr line(dynamic_cast<LineString*>(lineGeom.release()));
- ensure(0 != line.get());
+ ensure(nullptr != line.get());
Geometry::Ptr hullGeom(reader_.read("LINESTRING (30 220, 240 220)"));
LineString::Ptr convexHull(dynamic_cast<LineString*>(hullGeom.release()));
- ensure(0 != convexHull.get());
+ ensure(nullptr != convexHull.get());
geom_ = line->convexHull();
ensure( convexHull->equalsExact(geom_) );
@@ -90,11 +90,11 @@ namespace tut
using geos::geom::LineString;
Geometry::Ptr geom(reader_.read("MULTIPOINT (130 240, 130 240, 130 240, 570 240, 570 240, 570 240, 650 240)"));
- ensure(0 != geom.get());
+ ensure(nullptr != geom.get());
Geometry::Ptr hullGeom(reader_.read("LINESTRING (130 240, 650 240)"));
LineString::Ptr convexHull(dynamic_cast<LineString*>(hullGeom.release()));
- ensure(0 != convexHull.get());
+ ensure(nullptr != convexHull.get());
geom_ = geom->convexHull();
ensure( convexHull->equalsExact(geom_) );
@@ -108,11 +108,11 @@ namespace tut
using geos::geom::LineString;
Geometry::Ptr geom(reader_.read("MULTIPOINT (0 0, 0 0, 10 0)"));
- ensure(0 != geom.get());
+ ensure(nullptr != geom.get());
Geometry::Ptr hullGeom(reader_.read("LINESTRING (0 0, 10 0)"));
LineString::Ptr convexHull(dynamic_cast<LineString*>(hullGeom.release()));
- ensure(0 != convexHull.get());
+ ensure(nullptr != convexHull.get());
geom_ = geom->convexHull();
ensure( convexHull->equalsExact(geom_) );
@@ -126,11 +126,11 @@ namespace tut
using geos::geom::LineString;
Geometry::Ptr geom(reader_.read("MULTIPOINT (0 0, 10 0, 10 0)"));
- ensure(0 != geom.get());
+ ensure(nullptr != geom.get());
Geometry::Ptr hullGeom(reader_.read("LINESTRING (0 0, 10 0)"));
LineString::Ptr convexHull(dynamic_cast<LineString*>(hullGeom.release()));
- ensure(0 != convexHull.get());
+ ensure(nullptr != convexHull.get());
geom_ = geom->convexHull();
ensure( convexHull->equalsExact(geom_) );
@@ -144,11 +144,11 @@ namespace tut
using geos::geom::LineString;
Geometry::Ptr geom(reader_.read("MULTIPOINT (0 0, 5 0, 10 0)"));
- ensure(0 != geom.get());
+ ensure(nullptr != geom.get());
Geometry::Ptr hullGeom(reader_.read("LINESTRING (0 0, 10 0)"));
LineString::Ptr convexHull(dynamic_cast<LineString*>(hullGeom.release()));
- ensure(0 != convexHull.get());
+ ensure(nullptr != convexHull.get());
geom_ = geom->convexHull();
ensure( convexHull->equalsExact(geom_) );
@@ -162,13 +162,13 @@ namespace tut
using geos::geom::LineString;
Geometry::Ptr geom(reader_.read("MULTIPOINT (0 0, 5 1, 10 0)"));
- ensure(0 != geom.get());
+ ensure(nullptr != geom.get());
Geometry::Ptr hullGeom(geom->convexHull());
- ensure(0 != hullGeom.get());
+ ensure(nullptr != hullGeom.get());
Geometry::Ptr expectedHull(reader_.read("POLYGON ((0 0, 5 1, 10 0, 0 0))"));
- ensure(0 != expectedHull.get());
+ ensure(nullptr != expectedHull.get());
ensure_equals( hullGeom->toString(), expectedHull->toString() );
}
@@ -181,11 +181,11 @@ namespace tut
using geos::geom::LineString;
Geometry::Ptr geom(reader_.read("MULTIPOINT (0 0, 0 0, 5 0, 5 0, 10 0, 10 0)"));
- ensure(0 != geom.get());
+ ensure(nullptr != geom.get());
Geometry::Ptr hullGeom(reader_.read("LINESTRING (0 0, 10 0)"));
LineString::Ptr convexHull(dynamic_cast<LineString*>(hullGeom.release()));
- ensure(0 != convexHull.get());
+ ensure(nullptr != convexHull.get());
geom_ = geom->convexHull();
ensure( convexHull->equalsExact(geom_) );
diff --git a/tests/unit/algorithm/MinimumDiameterTest.cpp b/tests/unit/algorithm/MinimumDiameterTest.cpp
index 9be920a..a38df9e 100644
--- a/tests/unit/algorithm/MinimumDiameterTest.cpp
+++ b/tests/unit/algorithm/MinimumDiameterTest.cpp
@@ -64,14 +64,14 @@ namespace tut
void object::test<1>()
{
GeomPtr geom(reader.read("POLYGON ((0 0, 0 20, 20 20, 20 0, 0 0))"));
- ensure(0 != geom.get());
+ ensure(nullptr != geom.get());
geos::algorithm::MinimumDiameter m(geom.get());
GeomPtr minRect( m.getMinimumRectangle() );
- ensure(0 != minRect.get());
+ ensure(nullptr != minRect.get());
GeomPtr expectedGeom(reader.read("POLYGON ((0 0, 20 0, 20 20, 0 20, 0 0))"));
- ensure(0 != expectedGeom.get());
+ ensure(nullptr != expectedGeom.get());
ensure( minRect.get()->equalsExact(expectedGeom.get()) );
}
@@ -82,14 +82,14 @@ namespace tut
void object::test<2>()
{
GeomPtr geom(reader.read("POLYGON ((0 5, 5 10, 10 5, 5 0, 0 5))"));
- ensure(0 != geom.get());
+ ensure(nullptr != geom.get());
geos::algorithm::MinimumDiameter m(geom.get());
GeomPtr minRect( m.getMinimumRectangle() );
- ensure(0 != minRect.get());
+ ensure(nullptr != minRect.get());
GeomPtr expectedGeom(reader.read("POLYGON ((5 0, 10 5, 5 10, 0 5, 5 0))"));
- ensure(0 != expectedGeom.get());
+ ensure(nullptr != expectedGeom.get());
ensure( minRect.get()->equalsExact(expectedGeom.get()) );
}
@@ -100,14 +100,14 @@ namespace tut
void object::test<3>()
{
GeomPtr geom(reader.read("POLYGON EMPTY"));
- ensure(0 != geom.get());
+ ensure(nullptr != geom.get());
geos::algorithm::MinimumDiameter m(geom.get());
GeomPtr minRect( m.getMinimumRectangle() );
- ensure(0 != minRect.get());
+ ensure(nullptr != minRect.get());
GeomPtr expectedGeom(reader.read("POLYGON EMPTY"));
- ensure(0 != expectedGeom.get());
+ ensure(nullptr != expectedGeom.get());
ensure( minRect.get()->equalsExact(expectedGeom.get()) );
}
@@ -118,14 +118,14 @@ namespace tut
void object::test<4>()
{
GeomPtr geom(reader.read("Point(1 2)"));
- ensure(0 != geom.get());
+ ensure(nullptr != geom.get());
geos::algorithm::MinimumDiameter m(geom.get());
GeomPtr minRect( m.getMinimumRectangle() );
- ensure(0 != minRect.get());
+ ensure(nullptr != minRect.get());
GeomPtr expectedGeom(reader.read("Point(1 2)"));
- ensure(0 != expectedGeom.get());
+ ensure(nullptr != expectedGeom.get());
ensure( minRect.get()->equalsExact(expectedGeom.get()) );
}
@@ -136,14 +136,14 @@ namespace tut
void object::test<5>()
{
GeomPtr geom(reader.read("LineString(1 2, 2 4)"));
- ensure(0 != geom.get());
+ ensure(nullptr != geom.get());
geos::algorithm::MinimumDiameter m(geom.get());
GeomPtr minRect( m.getMinimumRectangle() );
- ensure(0 != minRect.get());
+ ensure(nullptr != minRect.get());
GeomPtr expectedGeom(reader.read("LineString(1 2, 2 4)"));
- ensure(0 != expectedGeom.get());
+ ensure(nullptr != expectedGeom.get());
ensure( minRect.get()->equalsExact(expectedGeom.get()) );
}
@@ -154,13 +154,13 @@ namespace tut
void object::test<6>()
{
GeomPtr geom(reader.read("POINT (0 240)"));
- ensure(0 != geom.get());
+ ensure(nullptr != geom.get());
GeomPtr minDiameter( geos::algorithm::MinimumDiameter::getMinimumDiameter( geom.get() ) );
- ensure(0 != minDiameter.get());
+ ensure(nullptr != minDiameter.get());
GeomPtr expectedGeom(reader.read("LineString (0 240, 0 240)"));
- ensure(0 != expectedGeom.get());
+ ensure(nullptr != expectedGeom.get());
ensure( minDiameter.get()->equalsExact(expectedGeom.get()) );
}
@@ -171,13 +171,13 @@ namespace tut
void object::test<7>()
{
GeomPtr geom(reader.read("LINESTRING (0 240, 220 240)"));
- ensure(0 != geom.get());
+ ensure(nullptr != geom.get());
GeomPtr minDiameter( geos::algorithm::MinimumDiameter::getMinimumDiameter( geom.get() ) );
- ensure(0 != minDiameter.get());
+ ensure(nullptr != minDiameter.get());
GeomPtr expectedGeom(reader.read("LINESTRING (0 240, 0 240)"));
- ensure(0 != expectedGeom.get());
+ ensure(nullptr != expectedGeom.get());
ensure( minDiameter.get()->equalsExact(expectedGeom.get()) );
}
@@ -188,13 +188,13 @@ namespace tut
void object::test<8>()
{
GeomPtr geom(reader.read("POLYGON ((0 240, 220 240, 220 0, 0 0, 0 240))"));
- ensure(0 != geom.get());
+ ensure(nullptr != geom.get());
GeomPtr minDiameter( geos::algorithm::MinimumDiameter::getMinimumDiameter( geom.get() ) );
- ensure(0 != minDiameter.get());
+ ensure(nullptr != minDiameter.get());
GeomPtr expectedGeom(reader.read("LINESTRING (0 0, 220 0)"));
- ensure(0 != expectedGeom.get());
+ ensure(nullptr != expectedGeom.get());
ensure( minDiameter.get()->equalsExact(expectedGeom.get()) );
}
@@ -205,13 +205,13 @@ namespace tut
void object::test<9>()
{
GeomPtr geom(reader.read("POLYGON ((0 240, 160 140, 220 0, 0 0, 0 240))"));
- ensure(0 != geom.get());
+ ensure(nullptr != geom.get());
GeomPtr minDiameter( geos::algorithm::MinimumDiameter::getMinimumDiameter( geom.get() ) );
- ensure(0 != minDiameter.get());
+ ensure(nullptr != minDiameter.get());
GeomPtr expectedGeom(reader.read("LINESTRING (185.86206896551724 79.65517241379311, 0 0)"));
- ensure(0 != expectedGeom.get());
+ ensure(nullptr != expectedGeom.get());
ensure( minDiameter.get()->equalsExact(expectedGeom.get(), 0.00000000001) );
}
@@ -222,13 +222,13 @@ namespace tut
void object::test<10>()
{
GeomPtr geom(reader.read("LINESTRING ( 39 119, 162 197, 135 70, 95 35, 33 66, 111 82, 97 131, 48 160, -4 182, 57 195, 94 202, 90 174, 75 134, 47 114, 0 100, 59 81, 123 60, 136 43, 163 75, 145 114, 93 136, 92 159, 105 175 )"));
- ensure(0 != geom.get());
+ ensure(nullptr != geom.get());
GeomPtr minDiameter( geos::algorithm::MinimumDiameter::getMinimumDiameter( geom.get() ) );
- ensure(0 != minDiameter.get());
+ ensure(nullptr != minDiameter.get());
GeomPtr expectedGeom(reader.read("LINESTRING (64.46262341325811 196.41184767277855, 95 35)"));
- ensure(0 != expectedGeom.get());
+ ensure(nullptr != expectedGeom.get());
ensure( minDiameter.get()->equalsExact(expectedGeom.get(), 0.00000000001) );
}
diff --git a/tests/unit/algorithm/RobustLineIntersectionTest.cpp b/tests/unit/algorithm/RobustLineIntersectionTest.cpp
index 0937818..e398274 100644
--- a/tests/unit/algorithm/RobustLineIntersectionTest.cpp
+++ b/tests/unit/algorithm/RobustLineIntersectionTest.cpp
@@ -122,8 +122,8 @@ namespace tut
LineString* l1ptr = dynamic_cast<LineString*>(g1.get());
LineString* l2ptr = dynamic_cast<LineString*>(g2.get());
- ensure(0 != l1ptr);
- ensure(0 != l2ptr);
+ ensure(nullptr != l1ptr);
+ ensure(nullptr != l2ptr);
LineString& l1 = *l1ptr;
LineString& l2 = *l2ptr;
@@ -159,8 +159,8 @@ namespace tut
LineString* l1ptr = dynamic_cast<LineString*>(g1.get());
LineString* l2ptr = dynamic_cast<LineString*>(g2.get());
- ensure(0 != l1ptr);
- ensure(0 != l2ptr);
+ ensure(nullptr != l1ptr);
+ ensure(nullptr != l2ptr);
LineString& l1 = *l1ptr;
LineString& l2 = *l2ptr;
@@ -185,8 +185,8 @@ namespace tut
LineString* l1ptr = dynamic_cast<LineString*>(g1.get());
LineString* l2ptr = dynamic_cast<LineString*>(g2.get());
- ensure(0 != l1ptr);
- ensure(0 != l2ptr);
+ ensure(nullptr != l1ptr);
+ ensure(nullptr != l2ptr);
LineString& l1 = *l1ptr;
LineString& l2 = *l2ptr;
@@ -209,8 +209,8 @@ namespace tut
LineString* l1ptr = dynamic_cast<LineString*>(g1.get());
LineString* l2ptr = dynamic_cast<LineString*>(g2.get());
- ensure(0 != l1ptr);
- ensure(0 != l2ptr);
+ ensure(nullptr != l1ptr);
+ ensure(nullptr != l2ptr);
LineString& l1 = *l1ptr;
LineString& l2 = *l2ptr;
diff --git a/tests/unit/capi/GEOSBufferTest.cpp b/tests/unit/capi/GEOSBufferTest.cpp
index e5a743c..2dd8e3c 100644
--- a/tests/unit/capi/GEOSBufferTest.cpp
+++ b/tests/unit/capi/GEOSBufferTest.cpp
@@ -39,7 +39,7 @@ namespace tut
}
test_capigeosbuffer_data()
- : geom1_(0), geom2_(0), wkt_(0), bp_(0)
+ : geom1_(nullptr), geom2_(nullptr), wkt_(nullptr), bp_(nullptr)
{
initGEOS(notice, notice);
wktw_ = GEOSWKTWriter_create();
@@ -53,9 +53,9 @@ namespace tut
GEOSWKTWriter_destroy(wktw_);
GEOSBufferParams_destroy(bp_);
GEOSFree(wkt_);
- geom1_ = 0;
- geom2_ = 0;
- wkt_ = 0;
+ geom1_ = nullptr;
+ geom2_ = nullptr;
+ wkt_ = nullptr;
finishGEOS();
}
@@ -78,14 +78,14 @@ namespace tut
{
geom1_ = GEOSGeomFromWKT("POINT EMPTY");
- ensure( 0 != geom1_ );
+ ensure( nullptr != geom1_ );
geom2_ = GEOSBufferWithStyle(geom1_, 1, 8,
GEOSBUF_CAP_ROUND,
GEOSBUF_JOIN_BEVEL,
5.0);
- ensure( 0 != geom2_ );
+ ensure( nullptr != geom2_ );
wkt_ = GEOSGeomToWKT(geom2_);
@@ -99,14 +99,14 @@ namespace tut
{
geom1_ = GEOSGeomFromWKT("LINESTRING EMPTY");
- ensure( 0 != geom1_ );
+ ensure( nullptr != geom1_ );
geom2_ = GEOSBufferWithStyle(geom1_, 1, 8,
GEOSBUF_CAP_ROUND,
GEOSBUF_JOIN_BEVEL,
5.0);
- ensure( 0 != geom2_ );
+ ensure( nullptr != geom2_ );
wkt_ = GEOSGeomToWKT(geom2_);
@@ -120,14 +120,14 @@ namespace tut
{
geom1_ = GEOSGeomFromWKT("POLYGON EMPTY");
- ensure( 0 != geom1_ );
+ ensure( nullptr != geom1_ );
geom2_ = GEOSBufferWithStyle(geom1_, 1, 8,
GEOSBUF_CAP_ROUND,
GEOSBUF_JOIN_BEVEL,
5.0);
- ensure( 0 != geom2_ );
+ ensure( nullptr != geom2_ );
wkt_ = GEOSGeomToWKT(geom2_);
@@ -141,11 +141,11 @@ namespace tut
{
geom1_ = GEOSGeomFromWKT("LINESTRING(5 10, 10 20)");
- ensure( 0 != geom1_ );
+ ensure( nullptr != geom1_ );
geom2_ = GEOSBuffer(geom1_, 5, 1);
- ensure( 0 != geom2_ );
+ ensure( nullptr != geom2_ );
wkt_ = GEOSGeomToWKT(geom2_);
@@ -163,11 +163,11 @@ namespace tut
{
geom1_ = GEOSGeomFromWKT("LINESTRING(5 10, 10 20)");
- ensure( 0 != geom1_ );
+ ensure( nullptr != geom1_ );
geom2_ = GEOSBuffer(geom1_, 5, 2);
- ensure( 0 != geom2_ );
+ ensure( nullptr != geom2_ );
wkt_ = GEOSGeomToWKT(geom2_);
@@ -184,12 +184,12 @@ namespace tut
{
geom1_ = GEOSGeomFromWKT("LINESTRING(5 10, 10 20)");
- ensure( 0 != geom1_ );
+ ensure( nullptr != geom1_ );
geom2_ = GEOSBufferWithStyle(geom1_, 5, 20, GEOSBUF_CAP_SQUARE,
GEOSBUF_JOIN_ROUND, 5.0);
- ensure( 0 != geom2_ );
+ ensure( nullptr != geom2_ );
wkt_ = GEOSGeomToWKT(geom2_);
@@ -207,12 +207,12 @@ namespace tut
{
geom1_ = GEOSGeomFromWKT("LINESTRING(5 10, 10 20)");
- ensure( 0 != geom1_ );
+ ensure( nullptr != geom1_ );
geom2_ = GEOSBufferWithStyle(geom1_, 5, 20, GEOSBUF_CAP_FLAT,
GEOSBUF_JOIN_ROUND, 5.0);
- ensure( 0 != geom2_ );
+ ensure( nullptr != geom2_ );
wkt_ = GEOSGeomToWKT(geom2_);
@@ -229,12 +229,12 @@ namespace tut
{
geom1_ = GEOSGeomFromWKT("LINESTRING(5 10, 10 10)");
- ensure( 0 != geom1_ );
+ ensure( nullptr != geom1_ );
geom2_ = GEOSBufferWithStyle(geom1_, 5, 20, GEOSBUF_CAP_FLAT,
GEOSBUF_JOIN_ROUND, 5.0);
- ensure( 0 != geom2_ );
+ ensure( nullptr != geom2_ );
wkt_ = GEOSGeomToWKT(geom2_);
@@ -255,12 +255,12 @@ namespace tut
{
geom1_ = GEOSGeomFromWKT("LINESTRING(5 10, 10 10)");
- ensure( 0 != geom1_ );
+ ensure( nullptr != geom1_ );
geom2_ = GEOSBufferWithStyle(geom1_, 5, 20, GEOSBUF_CAP_SQUARE,
GEOSBUF_JOIN_ROUND, 5.0);
- ensure( 0 != geom2_ );
+ ensure( nullptr != geom2_ );
wkt_ = GEOSGeomToWKT(geom2_);
@@ -282,12 +282,12 @@ namespace tut
{
geom1_ = GEOSGeomFromWKT("LINESTRING(5 10, 10 10, 10 20)");
- ensure( 0 != geom1_ );
+ ensure( nullptr != geom1_ );
geom2_ = GEOSBufferWithStyle(geom1_, 5, 20, GEOSBUF_CAP_SQUARE,
GEOSBUF_JOIN_ROUND, 5.0);
- ensure( 0 != geom2_ );
+ ensure( nullptr != geom2_ );
wkt_ = GEOSGeomToWKT(geom2_);
@@ -306,12 +306,12 @@ namespace tut
{
geom1_ = GEOSGeomFromWKT("LINESTRING(5 10, 10 10, 10 20)");
- ensure( 0 != geom1_ );
+ ensure( nullptr != geom1_ );
geom2_ = GEOSBufferWithStyle(geom1_, 5, 20, GEOSBUF_CAP_SQUARE,
GEOSBUF_JOIN_MITRE, 5.0);
- ensure( 0 != geom2_ );
+ ensure( nullptr != geom2_ );
wkt_ = GEOSGeomToWKT(geom2_);
@@ -333,12 +333,12 @@ namespace tut
{
geom1_ = GEOSGeomFromWKT("LINESTRING(5 10, 10 10, 10 20)");
- ensure( 0 != geom1_ );
+ ensure( nullptr != geom1_ );
geom2_ = GEOSBufferWithStyle(geom1_, 5, 20, GEOSBUF_CAP_SQUARE,
GEOSBUF_JOIN_BEVEL, 5.0);
- ensure( 0 != geom2_ );
+ ensure( nullptr != geom2_ );
wkt_ = GEOSGeomToWKT(geom2_);
@@ -361,12 +361,12 @@ namespace tut
{
geom1_ = GEOSGeomFromWKT("LINESTRING(5 10, 10 10, 10 20)");
- ensure( 0 != geom1_ );
+ ensure( nullptr != geom1_ );
geom2_ = GEOSBufferWithStyle(geom1_, 5, 200, GEOSBUF_CAP_SQUARE,
GEOSBUF_JOIN_BEVEL, 10.0);
- ensure( 0 != geom2_ );
+ ensure( nullptr != geom2_ );
wkt_ = GEOSGeomToWKT(geom2_);
@@ -387,12 +387,12 @@ namespace tut
{
geom1_ = GEOSGeomFromWKT("POLYGON((0 0, 10 0, 10 10, 0 0))");
- ensure( 0 != geom1_ );
+ ensure( nullptr != geom1_ );
geom2_ = GEOSBufferWithStyle(geom1_, 2, 200, GEOSBUF_CAP_FLAT,
GEOSBUF_JOIN_MITRE, 1);
- ensure( 0 != geom2_ );
+ ensure( nullptr != geom2_ );
wkt_ = GEOSGeomToWKT(geom2_);
@@ -410,12 +410,12 @@ namespace tut
{
geom1_ = GEOSGeomFromWKT("POLYGON((0 0, 10 0, 10 10, 0 0))");
- ensure( 0 != geom1_ );
+ ensure( nullptr != geom1_ );
geom2_ = GEOSBufferWithStyle(geom1_, 2, 200, GEOSBUF_CAP_FLAT,
GEOSBUF_JOIN_MITRE, 2);
- ensure( 0 != geom2_ );
+ ensure( nullptr != geom2_ );
wkt_ = GEOSGeomToWKT(geom2_);
@@ -433,12 +433,12 @@ namespace tut
{
geom1_ = GEOSGeomFromWKT("POLYGON((0 0, 10 0, 10 10, 0 0))");
- ensure( 0 != geom1_ );
+ ensure( nullptr != geom1_ );
geom2_ = GEOSBufferWithStyle(geom1_, 2, 200, GEOSBUF_CAP_FLAT,
GEOSBUF_JOIN_MITRE, 3);
- ensure( 0 != geom2_ );
+ ensure( nullptr != geom2_ );
wkt_ = GEOSGeomToWKT(geom2_);
@@ -457,14 +457,14 @@ namespace tut
{
geom1_ = GEOSGeomFromWKT("LINESTRING(5 10, 10 10)");
- ensure( 0 != geom1_ );
+ ensure( nullptr != geom1_ );
bp_ = GEOSBufferParams_create();
GEOSBufferParams_setEndCapStyle(bp_, GEOSBUF_CAP_SQUARE);
geom2_ = GEOSBufferWithParams(geom1_, bp_, 2);
- ensure( 0 != geom2_ );
+ ensure( nullptr != geom2_ );
wkt_ = GEOSWKTWriter_write(wktw_, geom2_);
@@ -482,7 +482,7 @@ namespace tut
{
geom1_ = GEOSGeomFromWKT("LINESTRING(5 10, 10 10)");
- ensure( 0 != geom1_ );
+ ensure( nullptr != geom1_ );
bp_ = GEOSBufferParams_create();
@@ -490,7 +490,7 @@ namespace tut
GEOSBufferParams_setSingleSided(bp_, 1);
geom2_ = GEOSBufferWithParams(geom1_, bp_, 2);
- ensure( 0 != geom2_ );
+ ensure( nullptr != geom2_ );
wkt_ = GEOSWKTWriter_write(wktw_, geom2_);
@@ -508,7 +508,7 @@ namespace tut
{
geom1_ = GEOSGeomFromWKT("LINESTRING(5 10, 10 10)");
- ensure( 0 != geom1_ );
+ ensure( nullptr != geom1_ );
bp_ = GEOSBufferParams_create();
@@ -516,7 +516,7 @@ namespace tut
GEOSBufferParams_setSingleSided(bp_, 1);
geom2_ = GEOSBufferWithParams(geom1_, bp_, -2);
- ensure( 0 != geom2_ );
+ ensure( nullptr != geom2_ );
wkt_ = GEOSWKTWriter_write(wktw_, geom2_);
@@ -533,11 +533,11 @@ namespace tut
{
geom1_ = GEOSGeomFromWKT("LINESTRING(0 0, 10 0, 10 10)', -10)");
- ensure( 0 != geom1_ );
+ ensure( nullptr != geom1_ );
geom2_ = GEOSSingleSidedBuffer(geom1_, 10, 8, GEOSBUF_JOIN_BEVEL, 0, 0);
- ensure( 0 != geom2_ );
+ ensure( nullptr != geom2_ );
wkt_ = GEOSGeomToWKT(geom2_);
diff --git a/tests/unit/capi/GEOSClipByRectTest.cpp b/tests/unit/capi/GEOSClipByRectTest.cpp
index b5d4c60..b0eb02f 100644
--- a/tests/unit/capi/GEOSClipByRectTest.cpp
+++ b/tests/unit/capi/GEOSClipByRectTest.cpp
@@ -50,7 +50,7 @@ namespace tut
}
test_capigeosclipbyrect_data()
- : geom1_(0), geom2_(0), geom3_(0), w_(0)
+ : geom1_(nullptr), geom2_(nullptr), geom3_(nullptr), w_(nullptr)
{
initGEOS(notice, notice);
w_ = GEOSWKTWriter_create();
@@ -64,9 +64,9 @@ namespace tut
GEOSGeom_destroy(geom2_);
GEOSGeom_destroy(geom3_);
GEOSWKTWriter_destroy(w_);
- geom1_ = 0;
- geom2_ = 0;
- geom3_ = 0;
+ geom1_ = nullptr;
+ geom2_ = nullptr;
+ geom3_ = nullptr;
finishGEOS();
}
diff --git a/tests/unit/capi/GEOSContainsTest.cpp b/tests/unit/capi/GEOSContainsTest.cpp
index 591cfb4..aa98ece 100644
--- a/tests/unit/capi/GEOSContainsTest.cpp
+++ b/tests/unit/capi/GEOSContainsTest.cpp
@@ -36,7 +36,7 @@ namespace tut
}
test_capigeoscontains_data()
- : geom1_(0), geom2_(0)
+ : geom1_(nullptr), geom2_(nullptr)
{
initGEOS(notice, notice);
}
@@ -45,8 +45,8 @@ namespace tut
{
GEOSGeom_destroy(geom1_);
GEOSGeom_destroy(geom2_);
- geom1_ = 0;
- geom2_ = 0;
+ geom1_ = nullptr;
+ geom2_ = nullptr;
finishGEOS();
}
@@ -68,8 +68,8 @@ namespace tut
geom1_ = GEOSGeomFromWKT("POLYGON EMPTY");
geom2_ = GEOSGeomFromWKT("POLYGON EMPTY");
- ensure( 0 != geom1_ );
- ensure( 0 != geom2_ );
+ ensure( nullptr != geom1_ );
+ ensure( nullptr != geom2_ );
char const r1 = GEOSContains(geom1_, geom2_);
@@ -87,8 +87,8 @@ namespace tut
geom1_ = GEOSGeomFromWKT("POLYGON((1 1,1 5,5 5,5 1,1 1))");
geom2_ = GEOSGeomFromWKT("POINT(2 2)");
- ensure( 0 != geom1_ );
- ensure( 0 != geom2_ );
+ ensure( nullptr != geom1_ );
+ ensure( nullptr != geom2_ );
char const r1 = GEOSContains(geom1_, geom2_);
@@ -106,8 +106,8 @@ namespace tut
geom1_ = GEOSGeomFromWKT("MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)))");
geom2_ = GEOSGeomFromWKT("POLYGON((1 1,1 2,2 2,2 1,1 1))");
- ensure( 0 != geom1_ );
- ensure( 0 != geom2_ );
+ ensure( nullptr != geom1_ );
+ ensure( nullptr != geom2_ );
char const r1 = GEOSContains(geom1_, geom2_);
@@ -139,8 +139,8 @@ namespace tut
geom1_ = reinterpret_cast<GEOSGeometry*>(reader.readHEX(sOuter));
std::istringstream sInner(inner);
geom2_ = reinterpret_cast<GEOSGeometry*>(reader.readHEX(sInner));
- ensure(0 != geom1_);
- ensure(0 != geom2_);
+ ensure(nullptr != geom1_);
+ ensure(nullptr != geom2_);
int ret = GEOSContains(geom1_, geom2_);
ensure_equals(ret, 1);
@@ -158,8 +158,8 @@ namespace tut
geom1_ = reinterpret_cast<GEOSGeometry*>(reader.readHEX(sOuter));
std::istringstream sInner(inner);
geom2_ = reinterpret_cast<GEOSGeometry*>(reader.readHEX(sInner));
- ensure(0 != geom1_);
- ensure(0 != geom2_);
+ ensure(nullptr != geom1_);
+ ensure(nullptr != geom2_);
int ret = GEOSContains(geom1_, geom2_);
ensure_equals(ret, 0);
@@ -192,8 +192,8 @@ namespace tut
geom1_ = reinterpret_cast<GEOSGeometry*>(reader.readHEX(sOuter));
std::istringstream sInner(inner);
geom2_ = reinterpret_cast<GEOSGeometry*>(reader.readHEX(sInner));
- ensure(0 != geom1_);
- ensure(0 != geom2_);
+ ensure(nullptr != geom1_);
+ ensure(nullptr != geom2_);
int ret = GEOSContains(geom1_, geom2_);
ensure_equals(ret, 1);
@@ -211,8 +211,8 @@ namespace tut
geom1_ = reinterpret_cast<GEOSGeometry*>(reader.readHEX(sOuter));
std::istringstream sInner(inner);
geom2_ = reinterpret_cast<GEOSGeometry*>(reader.readHEX(sInner));
- ensure(0 != geom1_);
- ensure(0 != geom2_);
+ ensure(nullptr != geom1_);
+ ensure(nullptr != geom2_);
int ret = GEOSContains(geom1_, geom2_);
ensure_equals(ret, 1);
diff --git a/tests/unit/capi/GEOSConvexHullTest.cpp b/tests/unit/capi/GEOSConvexHullTest.cpp
index d20f65d..d557ead 100644
--- a/tests/unit/capi/GEOSConvexHullTest.cpp
+++ b/tests/unit/capi/GEOSConvexHullTest.cpp
@@ -34,7 +34,7 @@ namespace tut
}
test_capigeosconvexhull_data()
- : input_(0), expected_(0)
+ : input_(nullptr), expected_(nullptr)
{
initGEOS(notice, notice);
}
@@ -43,8 +43,8 @@ namespace tut
{
GEOSGeom_destroy(input_);
GEOSGeom_destroy(expected_);
- input_ = 0;
- expected_ = 0;
+ input_ = nullptr;
+ expected_ = nullptr;
finishGEOS();
}
@@ -64,13 +64,13 @@ namespace tut
void object::test<1>()
{
input_ = GEOSGeomFromWKT("MULTIPOINT (130 240, 130 240, 130 240, 570 240, 570 240, 570 240, 650 240)");
- ensure( 0 != input_ );
+ ensure( nullptr != input_ );
expected_ = GEOSGeomFromWKT("LINESTRING (130 240, 650 240, 130 240)");
- ensure( 0 != expected_ );
+ ensure( nullptr != expected_ );
GEOSGeometry* output = GEOSConvexHull(input_);
- ensure( 0 != output );
+ ensure( nullptr != output );
ensure( 0 == GEOSisEmpty(output) );
// TODO
//ensure( 0 != GEOSEquals(output, expected_));
diff --git a/tests/unit/capi/GEOSCoordSeqTest.cpp b/tests/unit/capi/GEOSCoordSeqTest.cpp
index 3c81adf..d4889e5 100644
--- a/tests/unit/capi/GEOSCoordSeqTest.cpp
+++ b/tests/unit/capi/GEOSCoordSeqTest.cpp
@@ -34,7 +34,7 @@ namespace tut
std::fprintf(stdout, "\n");
}
- test_capigeoscoordseq_data() : cs_(0)
+ test_capigeoscoordseq_data() : cs_(nullptr)
{
initGEOS(notice, notice);
}
@@ -42,7 +42,7 @@ namespace tut
~test_capigeoscoordseq_data()
{
GEOSCoordSeq_destroy(cs_);
- cs_ = 0;
+ cs_ = nullptr;
finishGEOS();
}
diff --git a/tests/unit/capi/GEOSDelaunayTriangulationTest.cpp b/tests/unit/capi/GEOSDelaunayTriangulationTest.cpp
index a57a4cd..d9ea416 100644
--- a/tests/unit/capi/GEOSDelaunayTriangulationTest.cpp
+++ b/tests/unit/capi/GEOSDelaunayTriangulationTest.cpp
@@ -36,7 +36,7 @@ namespace tut
}
test_capigeosdelaunaytriangulation_data()
- : geom1_(0), geom2_(0)
+ : geom1_(nullptr), geom2_(nullptr)
{
initGEOS(notice, notice);
w_ = GEOSWKTWriter_create();
@@ -57,8 +57,8 @@ namespace tut
GEOSGeom_destroy(geom1_);
GEOSGeom_destroy(geom2_);
GEOSWKTWriter_destroy(w_);
- geom1_ = 0;
- geom2_ = 0;
+ geom1_ = nullptr;
+ geom2_ = nullptr;
finishGEOS();
}
@@ -138,7 +138,7 @@ namespace tut
geom1_ = GEOSGeomFromWKT("MULTIPOINT(0 0, 5 0, 10 10)");
geom2_ = GEOSDelaunayTriangulation(geom1_, 0, 0);
- ensure(geom2_ != 0);
+ ensure(geom2_ != nullptr);
ensure_equals_wkt(geom2_,
"GEOMETRYCOLLECTION (POLYGON ((0 0, 10 10, 5 0, 0 0)))"
);
@@ -158,7 +158,7 @@ namespace tut
geom1_ = GEOSGeomFromWKT("POLYGON((0 0, 8.5 1, 10 10, 0.5 9, 0 0),(2 2, 3 8, 7 8, 8 2, 2 2)))");
geom2_ = GEOSDelaunayTriangulation(geom1_, 0, 0);
- ensure(geom2_ != 0);
+ ensure(geom2_ != nullptr);
ensure_equals_wkt(geom2_,
"GEOMETRYCOLLECTION (POLYGON ((8 2, 10 10, 8.5 1, 8 2)), POLYGON ((7 8, 10 10, 8 2, 7 8)), POLYGON ((3 8, 10 10, 7 8, 3 8)), POLYGON ((2 2, 8 2, 8.5 1, 2 2)), POLYGON ((2 2, 7 8, 8 2, 2 2)), POLYGON ((2 2, 3 8, 7 8, 2 2)), POLYGON ((0.5 9, 10 10, 3 8, 0.5 9)), POLYGON ((0.5 9, 3 8, 2 2, 0.5 9)), POLYGON ((0 0, 2 2, 8.5 1, 0 0)), POLYGON ((0 0, 0.5 9, 2 2, 0 0)))"
);
diff --git a/tests/unit/capi/GEOSDistanceTest.cpp b/tests/unit/capi/GEOSDistanceTest.cpp
index fa6408e..ef3307f 100644
--- a/tests/unit/capi/GEOSDistanceTest.cpp
+++ b/tests/unit/capi/GEOSDistanceTest.cpp
@@ -41,7 +41,7 @@ namespace tut
}
test_capigeosdistance_data()
- : geom1_(0), geom2_(0), geom3_(0), w_(0)
+ : geom1_(nullptr), geom2_(nullptr), geom3_(nullptr), w_(nullptr)
{
initGEOS(notice, notice);
w_ = GEOSWKTWriter_create();
@@ -54,9 +54,9 @@ namespace tut
GEOSGeom_destroy(geom2_);
GEOSGeom_destroy(geom3_);
GEOSWKTWriter_destroy(w_);
- geom1_ = 0;
- geom2_ = 0;
- geom3_ = 0;
+ geom1_ = nullptr;
+ geom2_ = nullptr;
+ geom3_ = nullptr;
finishGEOS();
}
@@ -108,7 +108,7 @@ namespace tut
GEOSCoordSeq_setY(seq_1, i, y + radius[idx] * sin(angle[idx]));
}
- return GEOSGeom_createPolygon(GEOSGeom_createLinearRing(seq_1), NULL, 0);
+ return GEOSGeom_createPolygon(GEOSGeom_createLinearRing(seq_1), nullptr, 0);
}
/* Generate two complex polygons and verify that GEOSDistance and GEOSDistanceIndexed
diff --git a/tests/unit/capi/GEOSEqualsTest.cpp b/tests/unit/capi/GEOSEqualsTest.cpp
index 172b78d..d10a3d3 100644
--- a/tests/unit/capi/GEOSEqualsTest.cpp
+++ b/tests/unit/capi/GEOSEqualsTest.cpp
@@ -35,7 +35,7 @@ namespace tut
}
test_capigeosequals_data()
- : geom1_(0), geom2_(0)
+ : geom1_(nullptr), geom2_(nullptr)
{
initGEOS(notice, notice);
}
@@ -44,8 +44,8 @@ namespace tut
{
GEOSGeom_destroy(geom1_);
GEOSGeom_destroy(geom2_);
- geom1_ = 0;
- geom2_ = 0;
+ geom1_ = nullptr;
+ geom2_ = nullptr;
finishGEOS();
}
@@ -67,8 +67,8 @@ namespace tut
geom1_ = GEOSGeomFromWKT("POLYGON EMPTY");
geom2_ = GEOSGeomFromWKT("POLYGON EMPTY");
- ensure( 0 != geom1_ );
- ensure( 0 != geom2_ );
+ ensure( nullptr != geom1_ );
+ ensure( nullptr != geom2_ );
char const r1 = GEOSEquals(geom1_, geom2_);
@@ -86,8 +86,8 @@ namespace tut
geom1_ = GEOSGeomFromWKT("POINT(2 3)");
geom2_ = GEOSGeomFromWKT("POINT(2 2)");
- ensure( 0 != geom1_ );
- ensure( 0 != geom2_ );
+ ensure( nullptr != geom1_ );
+ ensure( nullptr != geom2_ );
char const r1 = GEOSEquals(geom1_, geom2_);
@@ -105,8 +105,8 @@ namespace tut
geom1_ = GEOSGeomFromWKT("MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)))");
geom2_ = GEOSGeomFromWKT("POLYGON((0 0,0 10,10 10,10 0,0 0))");
- ensure( 0 != geom1_ );
- ensure( 0 != geom2_ );
+ ensure( nullptr != geom1_ );
+ ensure( nullptr != geom2_ );
char const r1 = GEOSEquals(geom1_, geom2_);
@@ -133,7 +133,7 @@ namespace tut
GEOSCoordSeq_setX(cs, 4, 1); GEOSCoordSeq_setY(cs, 4, 1);
geom1_ = GEOSGeom_createPolygon(GEOSGeom_createLinearRing(cs),
- NULL, 0);
+ nullptr, 0);
char const r1 = GEOSEquals(geom1_, geom1_);
@@ -150,7 +150,7 @@ namespace tut
geom1_ = GEOSGeomFromHEX_buf((unsigned char*)hex, std::strlen(hex));
- ensure( 0 != geom1_ );
+ ensure( nullptr != geom1_ );
char const r1 = GEOSEquals(geom1_, geom1_);
diff --git a/tests/unit/capi/GEOSFrechetDistanceTest.cpp b/tests/unit/capi/GEOSFrechetDistanceTest.cpp
index 32dd859..7df0c65 100644
--- a/tests/unit/capi/GEOSFrechetDistanceTest.cpp
+++ b/tests/unit/capi/GEOSFrechetDistanceTest.cpp
@@ -38,7 +38,7 @@ namespace tut
}
test_capigeosfrechetdistance_data()
- : geom1_(0), geom2_(0), geom3_(0), w_(0)
+ : geom1_(nullptr), geom2_(nullptr), geom3_(nullptr), w_(nullptr)
{
initGEOS(notice, notice);
w_ = GEOSWKTWriter_create();
@@ -51,9 +51,9 @@ namespace tut
GEOSGeom_destroy(geom2_);
GEOSGeom_destroy(geom3_);
GEOSWKTWriter_destroy(w_);
- geom1_ = 0;
- geom2_ = 0;
- geom3_ = 0;
+ geom1_ = nullptr;
+ geom2_ = nullptr;
+ geom3_ = nullptr;
finishGEOS();
}
diff --git a/tests/unit/capi/GEOSGeomFromWKBTest.cpp b/tests/unit/capi/GEOSGeomFromWKBTest.cpp
index 2c6708c..4accac6 100644
--- a/tests/unit/capi/GEOSGeomFromWKBTest.cpp
+++ b/tests/unit/capi/GEOSGeomFromWKBTest.cpp
@@ -38,7 +38,7 @@ namespace tut
}
test_capigeosgeomfromwkb_data()
- : geom1_(0), geom2_(0), reader_(0)
+ : geom1_(nullptr), geom2_(nullptr), reader_(nullptr)
{
initGEOS(notice, notice);
reader_ = GEOSWKTReader_create();
@@ -47,11 +47,11 @@ namespace tut
~test_capigeosgeomfromwkb_data()
{
GEOSGeom_destroy(geom2_);
- geom2_ = 0;
+ geom2_ = nullptr;
GEOSGeom_destroy(geom1_);
- geom1_ = 0;
+ geom1_ = nullptr;
GEOSWKTReader_destroy(reader_);
- reader_ = 0;
+ reader_ = nullptr;
finishGEOS();
}
@@ -61,7 +61,7 @@ namespace tut
wkb_hex_decoder::decode(wkbhex, wkb);
geom1_ = GEOSGeomFromWKB_buf(&wkb[0], wkb.size());
- ensure("GEOSGeomFromWKB_buf failed to create geometry", 0 != geom1_ );
+ ensure("GEOSGeomFromWKB_buf failed to create geometry", nullptr != geom1_ );
// TODO: Update test to compare with WKT-based geometry
(void)wkt;
diff --git a/tests/unit/capi/GEOSGeomToWKTTest.cpp b/tests/unit/capi/GEOSGeomToWKTTest.cpp
index 97684a2..82c4bc4 100644
--- a/tests/unit/capi/GEOSGeomToWKTTest.cpp
+++ b/tests/unit/capi/GEOSGeomToWKTTest.cpp
@@ -35,7 +35,7 @@ namespace tut
}
test_capigeosgeomtowkt_data()
- : geom1_(0)
+ : geom1_(nullptr)
{
initGEOS(notice, notice);
}
@@ -43,14 +43,14 @@ namespace tut
~test_capigeosgeomtowkt_data()
{
GEOSGeom_destroy(geom1_);
- geom1_ = 0;
+ geom1_ = nullptr;
finishGEOS();
}
void test_wkt(std::string const& wkt)
{
geom1_ = GEOSGeomFromWKT(wkt.c_str());
- ensure ( 0 != geom1_ );
+ ensure ( nullptr != geom1_ );
char* wkt_c = GEOSGeomToWKT(geom1_);
std::string out(wkt_c);
@@ -62,7 +62,7 @@ namespace tut
void test_wkt(std::string const& wkt, std::string::size_type n)
{
geom1_ = GEOSGeomFromWKT(wkt.c_str());
- ensure ( 0 != geom1_ );
+ ensure ( nullptr != geom1_ );
char* wkt_c = GEOSGeomToWKT(geom1_);
std::string out(wkt_c);
@@ -74,7 +74,7 @@ namespace tut
void test_writer_wkt(GEOSWKTWriter *writer, std::string const& wkt)
{
geom1_ = GEOSGeomFromWKT(wkt.c_str());
- ensure ( 0 != geom1_ );
+ ensure ( nullptr != geom1_ );
char* wkt_c = GEOSWKTWriter_write(writer,geom1_);
std::string out(wkt_c);
diff --git a/tests/unit/capi/GEOSGeom_create.cpp b/tests/unit/capi/GEOSGeom_create.cpp
index 506c137..b8cb4af 100644
--- a/tests/unit/capi/GEOSGeom_create.cpp
+++ b/tests/unit/capi/GEOSGeom_create.cpp
@@ -36,13 +36,13 @@ namespace tut
}
test_capigeosgeom_create_data()
- : geom1_(0), handle_(initGEOS_r(notice, notice))
+ : geom1_(nullptr), handle_(initGEOS_r(notice, notice))
{
}
~test_capigeosgeom_create_data()
{
- GEOSGeom_destroy(geom1_); geom1_ = 0;
+ GEOSGeom_destroy(geom1_); geom1_ = nullptr;
finishGEOS_r(handle_);
}
@@ -65,7 +65,7 @@ namespace tut
geom1_ = GEOSGeom_createEmptyPoint_r(handle_);
ensure(0 != GEOSisEmpty_r(handle_, geom1_));
ensure_equals(GEOSGeomTypeId_r(handle_, geom1_), GEOS_POINT);
- GEOSGeom_destroy(geom1_); geom1_=0;
+ GEOSGeom_destroy(geom1_); geom1_=nullptr;
}
// EMPTY linestring
@@ -76,7 +76,7 @@ namespace tut
geom1_ = GEOSGeom_createEmptyLineString_r(handle_);
ensure(0 != GEOSisEmpty_r(handle_, geom1_));
ensure_equals(GEOSGeomTypeId_r(handle_, geom1_), GEOS_LINESTRING);
- GEOSGeom_destroy(geom1_); geom1_=0;
+ GEOSGeom_destroy(geom1_); geom1_=nullptr;
}
@@ -88,7 +88,7 @@ namespace tut
geom1_ = GEOSGeom_createEmptyPolygon_r(handle_);
ensure(0 != GEOSisEmpty_r(handle_, geom1_));
ensure_equals(GEOSGeomTypeId_r(handle_, geom1_), GEOS_POLYGON);
- GEOSGeom_destroy(geom1_); geom1_=0;
+ GEOSGeom_destroy(geom1_); geom1_=nullptr;
}
// EMPTY multipoint
@@ -99,7 +99,7 @@ namespace tut
geom1_ = GEOSGeom_createEmptyCollection_r(handle_, GEOS_MULTIPOINT);
ensure(0 != GEOSisEmpty_r(handle_, geom1_));
ensure_equals(GEOSGeomTypeId_r(handle_, geom1_), GEOS_MULTIPOINT);
- GEOSGeom_destroy(geom1_); geom1_=0;
+ GEOSGeom_destroy(geom1_); geom1_=nullptr;
}
// EMPTY multilinestring
@@ -110,7 +110,7 @@ namespace tut
geom1_ = GEOSGeom_createEmptyCollection_r(handle_, GEOS_MULTILINESTRING);
ensure(0 != GEOSisEmpty_r(handle_, geom1_));
ensure_equals(GEOSGeomTypeId_r(handle_, geom1_), GEOS_MULTILINESTRING);
- GEOSGeom_destroy(geom1_); geom1_=0;
+ GEOSGeom_destroy(geom1_); geom1_=nullptr;
}
// EMPTY multipolygon
@@ -121,7 +121,7 @@ namespace tut
geom1_ = GEOSGeom_createEmptyCollection_r(handle_, GEOS_MULTIPOLYGON);
ensure(0 != GEOSisEmpty_r(handle_, geom1_));
ensure_equals(GEOSGeomTypeId_r(handle_, geom1_), GEOS_MULTIPOLYGON);
- GEOSGeom_destroy(geom1_); geom1_=0;
+ GEOSGeom_destroy(geom1_); geom1_=nullptr;
}
// EMPTY collection
@@ -132,7 +132,7 @@ namespace tut
geom1_ = GEOSGeom_createEmptyCollection_r(handle_, GEOS_GEOMETRYCOLLECTION);
ensure(0 != GEOSisEmpty_r(handle_, geom1_));
ensure_equals(GEOSGeomTypeId_r(handle_, geom1_), GEOS_GEOMETRYCOLLECTION);
- GEOSGeom_destroy(geom1_); geom1_=0;
+ GEOSGeom_destroy(geom1_); geom1_=nullptr;
}
diff --git a/tests/unit/capi/GEOSGeom_createCollection.cpp b/tests/unit/capi/GEOSGeom_createCollection.cpp
index 76b8ec2..ade4aab 100644
--- a/tests/unit/capi/GEOSGeom_createCollection.cpp
+++ b/tests/unit/capi/GEOSGeom_createCollection.cpp
@@ -41,13 +41,13 @@ namespace tut
}
test_capigeosgeom_createcollection_data()
- : handle_(initGEOS_r(notice, notice)), geom_(0)
+ : handle_(initGEOS_r(notice, notice)), geom_(nullptr)
{
}
~test_capigeosgeom_createcollection_data()
{
- GEOSGeom_destroy(geom_); geom_ = 0;
+ GEOSGeom_destroy(geom_); geom_ = nullptr;
finishGEOS_r(handle_);
}
};
diff --git a/tests/unit/capi/GEOSGeom_extractUniquePointsTest.cpp b/tests/unit/capi/GEOSGeom_extractUniquePointsTest.cpp
index 5a3a08f..2777cdb 100644
--- a/tests/unit/capi/GEOSGeom_extractUniquePointsTest.cpp
+++ b/tests/unit/capi/GEOSGeom_extractUniquePointsTest.cpp
@@ -36,7 +36,7 @@ namespace tut
}
test_capigeosextractuniquepoints_data()
- : geom1_(0), geom2_(0), geom3_(0)
+ : geom1_(nullptr), geom2_(nullptr), geom3_(nullptr)
{
handle_ = initGEOS_r(notice, notice);
}
@@ -48,9 +48,9 @@ namespace tut
if( geom3_ )
GEOSGeom_destroy_r(handle_, geom3_);
- geom1_ = 0;
- geom2_ = 0;
- geom3_ = 0;
+ geom1_ = nullptr;
+ geom2_ = nullptr;
+ geom3_ = nullptr;
finishGEOS_r(handle_);
}
diff --git a/tests/unit/capi/GEOSGeom_setPrecisionTest.cpp b/tests/unit/capi/GEOSGeom_setPrecisionTest.cpp
index 8a7a2b4..8b7a0a7 100644
--- a/tests/unit/capi/GEOSGeom_setPrecisionTest.cpp
+++ b/tests/unit/capi/GEOSGeom_setPrecisionTest.cpp
@@ -50,7 +50,7 @@ namespace tut
}
test_capigeosgeomsetprecision_data()
- : geom1_(0), geom2_(0), geom3_(0)
+ : geom1_(nullptr), geom2_(nullptr), geom3_(nullptr)
{
initGEOS(notice, notice);
wktw_ = GEOSWKTWriter_create();
@@ -67,9 +67,9 @@ namespace tut
GEOSGeom_destroy(geom3_);
GEOSWKTWriter_destroy(wktw_);
- geom1_ = 0;
- geom2_ = 0;
- geom3_ = 0;
+ geom1_ = nullptr;
+ geom2_ = nullptr;
+ geom3_ = nullptr;
finishGEOS();
}
diff --git a/tests/unit/capi/GEOSGetCentroidTest.cpp b/tests/unit/capi/GEOSGetCentroidTest.cpp
index f7454cf..9dd2cd9 100644
--- a/tests/unit/capi/GEOSGetCentroidTest.cpp
+++ b/tests/unit/capi/GEOSGetCentroidTest.cpp
@@ -39,7 +39,7 @@ namespace tut
}
test_capicentroid_data()
- : geom1_(0), geom2_(0), wkt_(0)
+ : geom1_(nullptr), geom2_(nullptr), wkt_(nullptr)
{
initGEOS(notice, notice);
wktw_ = GEOSWKTWriter_create();
@@ -53,9 +53,9 @@ namespace tut
GEOSGeom_destroy(geom2_);
GEOSWKTWriter_destroy(wktw_);
GEOSFree(wkt_);
- geom1_ = 0;
- geom2_ = 0;
- wkt_ = 0;
+ geom1_ = nullptr;
+ geom2_ = nullptr;
+ wkt_ = nullptr;
finishGEOS();
}
@@ -77,11 +77,11 @@ namespace tut
{
geom1_ = GEOSGeomFromWKT("POINT(10 0)");
- ensure( 0 != geom1_ );
+ ensure( nullptr != geom1_ );
geom2_ = GEOSGetCentroid(geom1_);
- ensure( 0 != geom2_ );
+ ensure( nullptr != geom2_ );
wkt_ = GEOSWKTWriter_write(wktw_, geom2_);
@@ -96,11 +96,11 @@ namespace tut
{
geom1_ = GEOSGeomFromWKT("LINESTRING(0 0, 10 0)");
- ensure( 0 != geom1_ );
+ ensure( nullptr != geom1_ );
geom2_ = GEOSGetCentroid(geom1_);
- ensure( 0 != geom2_ );
+ ensure( nullptr != geom2_ );
wkt_ = GEOSWKTWriter_write(wktw_, geom2_);
@@ -115,11 +115,11 @@ namespace tut
{
geom1_ = GEOSGeomFromWKT("POLYGON((0 0, 10 0, 10 10, 0 10, 0 0))");
- ensure( 0 != geom1_ );
+ ensure( nullptr != geom1_ );
geom2_ = GEOSGetCentroid(geom1_);
- ensure( 0 != geom2_ );
+ ensure( nullptr != geom2_ );
wkt_ = GEOSWKTWriter_write(wktw_, geom2_);
@@ -139,11 +139,11 @@ namespace tut
56.528833333300 25.2103333333, \
56.528666666700 25.2101666667))");
- ensure( 0 != geom1_ );
+ ensure( nullptr != geom1_ );
geom2_ = GEOSGetCentroid(geom1_);
- ensure( 0 != geom2_ );
+ ensure( nullptr != geom2_ );
wkt_ = GEOSWKTWriter_write(wktw_, geom2_);
@@ -158,11 +158,11 @@ namespace tut
{
geom1_ = GEOSGeomFromWKT("LINESTRING EMPTY");
- ensure( 0 != geom1_ );
+ ensure( nullptr != geom1_ );
geom2_ = GEOSGetCentroid(geom1_);
- ensure( 0 != geom2_ );
+ ensure( nullptr != geom2_ );
wkt_ = GEOSWKTWriter_write(wktw_, geom2_);
diff --git a/tests/unit/capi/GEOSHausdorffDistanceTest.cpp b/tests/unit/capi/GEOSHausdorffDistanceTest.cpp
index 63396c7..fbc9bd9 100644
--- a/tests/unit/capi/GEOSHausdorffDistanceTest.cpp
+++ b/tests/unit/capi/GEOSHausdorffDistanceTest.cpp
@@ -38,7 +38,7 @@ namespace tut
}
test_capigeoshausdorffdistance_data()
- : geom1_(0), geom2_(0), geom3_(0), w_(0)
+ : geom1_(nullptr), geom2_(nullptr), geom3_(nullptr), w_(nullptr)
{
initGEOS(notice, notice);
w_ = GEOSWKTWriter_create();
@@ -51,9 +51,9 @@ namespace tut
GEOSGeom_destroy(geom2_);
GEOSGeom_destroy(geom3_);
GEOSWKTWriter_destroy(w_);
- geom1_ = 0;
- geom2_ = 0;
- geom3_ = 0;
+ geom1_ = nullptr;
+ geom2_ = nullptr;
+ geom3_ = nullptr;
finishGEOS();
}
diff --git a/tests/unit/capi/GEOSInterruptTest.cpp b/tests/unit/capi/GEOSInterruptTest.cpp
index fb9eba6..d6af7f3 100644
--- a/tests/unit/capi/GEOSInterruptTest.cpp
+++ b/tests/unit/capi/GEOSInterruptTest.cpp
@@ -56,7 +56,7 @@ namespace tut
};
int test_capiinterrupt_data::numcalls = 0;
- GEOSInterruptCallback* test_capiinterrupt_data::nextcb = 0;
+ GEOSInterruptCallback* test_capiinterrupt_data::nextcb = nullptr;
typedef test_group<test_capiinterrupt_data> group;
typedef group::object object;
@@ -82,18 +82,18 @@ namespace tut
GEOSGeometry *geom1 = GEOSGeomFromWKT("LINESTRING(0 0, 1 0)");
- ensure("GEOSGeomFromWKT failed", 0 != geom1);
+ ensure("GEOSGeomFromWKT failed", nullptr != geom1);
GEOSGeometry *geom2 = GEOSBuffer(geom1, 1, 8);
- ensure("GEOSBufferWithStyle failed", 0 != geom2);
+ ensure("GEOSBufferWithStyle failed", nullptr != geom2);
ensure("interrupt callback never called", numcalls > 0);
GEOSGeom_destroy(geom1);
GEOSGeom_destroy(geom2);
- GEOS_interruptRegisterCallback(0); /* unregister */
+ GEOS_interruptRegisterCallback(nullptr); /* unregister */
finishGEOS();
@@ -114,18 +114,18 @@ namespace tut
GEOSGeometry *geom1 = GEOSGeomFromWKT("LINESTRING(0 0, 1 0)");
- ensure("GEOSGeomFromWKT failed", 0 != geom1);
+ ensure("GEOSGeomFromWKT failed", nullptr != geom1);
GEOSGeometry *geom2 = GEOSBuffer(geom1, 1, 8);
- ensure("GEOSBufferWithStyle failed", 0 != geom2);
+ ensure("GEOSBufferWithStyle failed", nullptr != geom2);
ensure("interrupt callback never called", numcalls > 0);
GEOSGeom_destroy(geom1);
GEOSGeom_destroy(geom2);
- GEOS_interruptRegisterCallback(0);
+ GEOS_interruptRegisterCallback(nullptr);
finishGEOS();
}
@@ -139,12 +139,12 @@ namespace tut
GEOSGeometry *geom1 = GEOSGeomFromWKT("LINESTRING(0 0, 1 0)");
- ensure("GEOSGeomFromWKT failed", 0 != geom1);
+ ensure("GEOSGeomFromWKT failed", nullptr != geom1);
GEOS_interruptRegisterCallback(interruptNow);
GEOSGeometry *geom2 = GEOSBuffer(geom1, 1, 8);
- ensure("GEOSBuffer wasn't interrupted", 0 == geom2);
- GEOS_interruptRegisterCallback(0); /* unregister */
+ ensure("GEOSBuffer wasn't interrupted", nullptr == geom2);
+ GEOS_interruptRegisterCallback(nullptr); /* unregister */
// TODO: check the actual exception ? (sent to notice() callback)
@@ -164,15 +164,15 @@ namespace tut
GEOSGeometry *geom1 = GEOSGeomFromWKT("LINESTRING(0 0, 1 0)");
- ensure("GEOSGeomFromWKT failed", 0 != geom1);
+ ensure("GEOSGeomFromWKT failed", nullptr != geom1);
GEOS_interruptRegisterCallback(interruptNow);
nextcb = GEOS_interruptRegisterCallback(countCalls);
GEOSGeometry *geom2 = GEOSBuffer(geom1, 1, 8);
- ensure("GEOSBuffer wasn't interrupted", 0 == geom2);
+ ensure("GEOSBuffer wasn't interrupted", nullptr == geom2);
ensure_equals(numcalls, 1);
- GEOS_interruptRegisterCallback(0); /* unregister */
- nextcb = 0;
+ GEOS_interruptRegisterCallback(nullptr); /* unregister */
+ nextcb = nullptr;
GEOSGeom_destroy(geom1);
diff --git a/tests/unit/capi/GEOSIntersectionTest.cpp b/tests/unit/capi/GEOSIntersectionTest.cpp
index f48e93f..3d4a83e 100644
--- a/tests/unit/capi/GEOSIntersectionTest.cpp
+++ b/tests/unit/capi/GEOSIntersectionTest.cpp
@@ -36,7 +36,7 @@ namespace tut
}
test_capigeosintersection_data()
- : geom1_(0), geom2_(0), geom3_(0)
+ : geom1_(nullptr), geom2_(nullptr), geom3_(nullptr)
{
initGEOS(notice, notice);
wktw_ = GEOSWKTWriter_create();
@@ -58,9 +58,9 @@ namespace tut
GEOSGeom_destroy(geom1_);
GEOSGeom_destroy(geom2_);
GEOSGeom_destroy(geom3_);
- geom1_ = 0;
- geom2_ = 0;
- geom3_ = 0;
+ geom1_ = nullptr;
+ geom2_ = nullptr;
+ geom3_ = nullptr;
finishGEOS();
}
@@ -82,11 +82,11 @@ namespace tut
geom1_ = GEOSGeomFromWKT("POLYGON EMPTY");
geom2_ = GEOSGeomFromWKT("POLYGON EMPTY");
- ensure(0 != geom1_);
- ensure(0 != geom2_);
+ ensure(nullptr != geom1_);
+ ensure(nullptr != geom2_);
geom3_ = GEOSIntersection(geom1_, geom2_);
- ensure(0 != geom3_);
+ ensure(nullptr != geom3_);
ensure_equals(toWKT(geom3_), std::string("GEOMETRYCOLLECTION EMPTY"));
}
@@ -97,11 +97,11 @@ namespace tut
geom1_ = GEOSGeomFromWKT("POLYGON((1 1,1 5,5 5,5 1,1 1))");
geom2_ = GEOSGeomFromWKT("POINT(2 2)");
- ensure(0 != geom1_);
- ensure(0 != geom2_);
+ ensure(nullptr != geom1_);
+ ensure(nullptr != geom2_);
geom3_ = GEOSIntersection(geom1_, geom2_);
- ensure(0 != geom3_);
+ ensure(nullptr != geom3_);
ensure_equals(toWKT(geom3_), std::string("POINT (2 2)"));
}
@@ -112,12 +112,12 @@ namespace tut
geom1_ = GEOSGeomFromWKT("MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)))");
geom2_ = GEOSGeomFromWKT("POLYGON((-1 1,-1 2,2 2,2 1,-1 1))");
- ensure(0 != geom1_);
- ensure(0 != geom2_);
+ ensure(nullptr != geom1_);
+ ensure(nullptr != geom2_);
geom3_ = GEOSIntersection(geom1_, geom2_);
- ensure(0 != geom3_);
+ ensure(nullptr != geom3_);
ensure_equals(toWKT(geom3_), std::string("POLYGON ((0 1, 0 2, 2 2, 2 1, 0 1))"));
}
@@ -129,12 +129,12 @@ namespace tut
geom1_ = GEOSGeomFromWKT("MULTIPOLYGON(((0 0,5 10,10 0,0 0),(1 1,1 2,2 2,2 1,1 1),(100 100,100 102,102 102,102 100,100 100)))");
geom2_ = GEOSGeomFromWKT("POLYGON((0 1,0 2,10 2,10 1,0 1))");
- ensure(0 != geom1_);
- ensure(0 != geom2_);
+ ensure(nullptr != geom1_);
+ ensure(nullptr != geom2_);
geom3_ = GEOSIntersection(geom1_, geom2_);
- ensure(0 != geom3_);
+ ensure(nullptr != geom3_);
ensure_equals(toWKT(geom3_), std::string("GEOMETRYCOLLECTION (LINESTRING (1 2, 2 2), LINESTRING (2 1, 1 1), POLYGON ((0.5 1, 1 2, 1 1, 0.5 1)), POLYGON ((9 2, 9.5 1, 2 1, 2 2, 9 2)))"));
}
diff --git a/tests/unit/capi/GEOSIntersectsTest.cpp b/tests/unit/capi/GEOSIntersectsTest.cpp
index 0752dad..1bb8ab4 100644
--- a/tests/unit/capi/GEOSIntersectsTest.cpp
+++ b/tests/unit/capi/GEOSIntersectsTest.cpp
@@ -35,7 +35,7 @@ namespace tut
}
test_capigeosintersects_data()
- : geom1_(0), geom2_(0)
+ : geom1_(nullptr), geom2_(nullptr)
{
initGEOS(notice, notice);
}
@@ -44,8 +44,8 @@ namespace tut
{
GEOSGeom_destroy(geom1_);
GEOSGeom_destroy(geom2_);
- geom1_ = 0;
- geom2_ = 0;
+ geom1_ = nullptr;
+ geom2_ = nullptr;
finishGEOS();
}
@@ -67,8 +67,8 @@ namespace tut
geom1_ = GEOSGeomFromWKT("POLYGON EMPTY");
geom2_ = GEOSGeomFromWKT("POLYGON EMPTY");
- ensure( 0 != geom1_ );
- ensure( 0 != geom2_ );
+ ensure( nullptr != geom1_ );
+ ensure( nullptr != geom2_ );
char const r1 = GEOSIntersects(geom1_, geom2_);
@@ -86,8 +86,8 @@ namespace tut
geom1_ = GEOSGeomFromWKT("POLYGON((1 1,1 5,5 5,5 1,1 1))");
geom2_ = GEOSGeomFromWKT("POINT(2 2)");
- ensure( 0 != geom1_ );
- ensure( 0 != geom2_ );
+ ensure( nullptr != geom1_ );
+ ensure( nullptr != geom2_ );
char const r1 = GEOSIntersects(geom1_, geom2_);
@@ -105,8 +105,8 @@ namespace tut
geom1_ = GEOSGeomFromWKT("MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)))");
geom2_ = GEOSGeomFromWKT("POLYGON((1 1,1 2,2 2,2 1,1 1))");
- ensure( 0 != geom1_ );
- ensure( 0 != geom2_ );
+ ensure( nullptr != geom1_ );
+ ensure( nullptr != geom2_ );
char const r1 = GEOSIntersects(geom1_, geom2_);
@@ -133,7 +133,7 @@ namespace tut
GEOSCoordSeq_setX(cs, 4, 1); GEOSCoordSeq_setY(cs, 4, 1);
geom1_ = GEOSGeom_createPolygon(GEOSGeom_createLinearRing(cs),
- NULL, 0);
+ nullptr, 0);
char const r1 = GEOSIntersects(geom1_, geom1_);
@@ -150,7 +150,7 @@ namespace tut
geom1_ = GEOSGeomFromHEX_buf((unsigned char*)hex, std::strlen(hex));
- ensure( 0 != geom1_ );
+ ensure( nullptr != geom1_ );
char const r1 = GEOSIntersects(geom1_, geom1_);
diff --git a/tests/unit/capi/GEOSLineString_PointTest.cpp b/tests/unit/capi/GEOSLineString_PointTest.cpp
index f84853a..1bc2572 100644
--- a/tests/unit/capi/GEOSLineString_PointTest.cpp
+++ b/tests/unit/capi/GEOSLineString_PointTest.cpp
@@ -32,7 +32,7 @@ namespace tut
}
test_capilinestringpoint_data()
- : geom1_(0)
+ : geom1_(nullptr)
{
initGEOS(notice, notice);
}
@@ -40,7 +40,7 @@ namespace tut
~test_capilinestringpoint_data()
{
GEOSGeom_destroy(geom1_);
- geom1_ = 0;
+ geom1_ = nullptr;
finishGEOS();
}
@@ -62,7 +62,7 @@ namespace tut
geom1_ = GEOSGeomFromWKT("LINESTRING(0 0, 5 5, 10 10)");
GEOSGeometry *geom2;
double x, y;
- ensure( 0 != geom1_ );
+ ensure( nullptr != geom1_ );
char const r1 = GEOSisClosed(geom1_);
@@ -102,7 +102,7 @@ namespace tut
{
geom1_ = GEOSGeomFromWKT("LINESTRING(0 0, 5 5, 10 10)");
double length;
- ensure( 0 != geom1_ );
+ ensure( nullptr != geom1_ );
GEOSGeomGetLength(geom1_, &length);
ensure(length != 0.0);
@@ -114,7 +114,7 @@ namespace tut
{
geom1_ = GEOSGeomFromWKT("LINESTRING(0 0, 5 5, 10 10)");
int points;
- ensure( 0 != geom1_ );
+ ensure( nullptr != geom1_ );
points = GEOSGeomGetNumPoints(geom1_);
ensure_equals(points, 3);
diff --git a/tests/unit/capi/GEOSMinimumClearanceTest.cpp b/tests/unit/capi/GEOSMinimumClearanceTest.cpp
index 3815bd4..2696b75 100644
--- a/tests/unit/capi/GEOSMinimumClearanceTest.cpp
+++ b/tests/unit/capi/GEOSMinimumClearanceTest.cpp
@@ -66,7 +66,7 @@ namespace tut
}
GEOSGeometry* result = GEOSMinimumClearanceLine(input);
- ensure(result != NULL);
+ ensure(result != nullptr);
ensure_equals(1, GEOSEquals(result, expected_result));
GEOSGeom_destroy(input);
diff --git a/tests/unit/capi/GEOSMinimumRectangleTest.cpp b/tests/unit/capi/GEOSMinimumRectangleTest.cpp
index d5a3d91..53843e8 100644
--- a/tests/unit/capi/GEOSMinimumRectangleTest.cpp
+++ b/tests/unit/capi/GEOSMinimumRectangleTest.cpp
@@ -35,7 +35,7 @@ namespace tut
}
test_capigeosminimumrectangle_data()
- : input_(0), wkt_(0)
+ : input_(nullptr), wkt_(nullptr)
{
initGEOS(notice, notice);
wktw_ = GEOSWKTWriter_create();
@@ -46,10 +46,10 @@ namespace tut
~test_capigeosminimumrectangle_data()
{
GEOSGeom_destroy(input_);
- input_ = 0;
+ input_ = nullptr;
GEOSWKTWriter_destroy(wktw_);
GEOSFree(wkt_);
- wkt_ = 0;
+ wkt_ = nullptr;
finishGEOS();
}
@@ -69,10 +69,10 @@ namespace tut
void object::test<1>()
{
input_ = GEOSGeomFromWKT("POLYGON ((1 6, 6 11, 11 6, 6 1, 1 6))");
- ensure( 0 != input_ );
+ ensure( nullptr != input_ );
GEOSGeometry* output = GEOSMinimumRotatedRectangle(input_);
- ensure( 0 != output );
+ ensure( nullptr != output );
ensure( 0 == GEOSisEmpty(output) );
wkt_ = GEOSWKTWriter_write(wktw_, output);
diff --git a/tests/unit/capi/GEOSMinimumWidthTest.cpp b/tests/unit/capi/GEOSMinimumWidthTest.cpp
index 9055812..0cea2bb 100644
--- a/tests/unit/capi/GEOSMinimumWidthTest.cpp
+++ b/tests/unit/capi/GEOSMinimumWidthTest.cpp
@@ -34,7 +34,7 @@ namespace tut
}
test_capigeosminimumwidth_data()
- : input_(0), wkt_(0)
+ : input_(nullptr), wkt_(nullptr)
{
initGEOS(notice, notice);
wktw_ = GEOSWKTWriter_create();
@@ -45,10 +45,10 @@ namespace tut
~test_capigeosminimumwidth_data()
{
GEOSGeom_destroy(input_);
- input_ = 0;
+ input_ = nullptr;
GEOSWKTWriter_destroy(wktw_);
GEOSFree(wkt_);
- wkt_ = 0;
+ wkt_ = nullptr;
finishGEOS();
}
@@ -68,10 +68,10 @@ namespace tut
void object::test<1>()
{
input_ = GEOSGeomFromWKT("POLYGON ((0 0, 0 15, 5 10, 5 0, 0 0))");
- ensure( 0 != input_ );
+ ensure( nullptr != input_ );
GEOSGeometry* output = GEOSMinimumWidth(input_);
- ensure( 0 != output );
+ ensure( nullptr != output );
ensure( 0 == GEOSisEmpty(output) );
wkt_ = GEOSWKTWriter_write(wktw_, output);
@@ -85,10 +85,10 @@ namespace tut
void object::test<2>()
{
input_ = GEOSGeomFromWKT("LINESTRING (0 0,0 10, 10 10)");
- ensure( 0 != input_ );
+ ensure( nullptr != input_ );
GEOSGeometry* output = GEOSMinimumWidth(input_);
- ensure( 0 != output );
+ ensure( nullptr != output );
ensure( 0 == GEOSisEmpty(output) );
wkt_ = GEOSWKTWriter_write(wktw_, output);
diff --git a/tests/unit/capi/GEOSNearestPointsTest.cpp b/tests/unit/capi/GEOSNearestPointsTest.cpp
index 0d179dd..8f4777c 100644
--- a/tests/unit/capi/GEOSNearestPointsTest.cpp
+++ b/tests/unit/capi/GEOSNearestPointsTest.cpp
@@ -35,7 +35,7 @@ namespace tut
}
test_capigeosnearestpoints_data()
- : geom1_(0), geom2_(0)
+ : geom1_(nullptr), geom2_(nullptr)
{
initGEOS(notice, notice);
}
@@ -44,8 +44,8 @@ namespace tut
{
GEOSGeom_destroy(geom1_);
GEOSGeom_destroy(geom2_);
- geom1_ = 0;
- geom2_ = 0;
+ geom1_ = nullptr;
+ geom2_ = nullptr;
finishGEOS();
}
@@ -67,13 +67,13 @@ namespace tut
geom1_ = GEOSGeomFromWKT("POLYGON EMPTY");
geom2_ = GEOSGeomFromWKT("POLYGON EMPTY");
- ensure( 0 != geom1_ );
- ensure( 0 != geom2_ );
+ ensure( nullptr != geom1_ );
+ ensure( nullptr != geom2_ );
GEOSCoordSequence *coords_;
coords_ = GEOSNearestPoints(geom1_, geom2_);
- ensure( 0 == coords_ );
+ ensure( nullptr == coords_ );
}
template<>
@@ -84,13 +84,13 @@ namespace tut
// geom2_ = GEOSGeomFromWKT("POINT(8 8)");
geom2_ = GEOSGeomFromWKT("POLYGON((8 8, 9 9, 9 10, 8 8))");
- ensure( 0 != geom1_ );
- ensure( 0 != geom2_ );
+ ensure( nullptr != geom1_ );
+ ensure( nullptr != geom2_ );
GEOSCoordSequence *coords_;
coords_ = GEOSNearestPoints(geom1_, geom2_);
- ensure( 0 != coords_ );
+ ensure( nullptr != coords_ );
unsigned int size;
GEOSCoordSeq_getSize(coords_, &size);
diff --git a/tests/unit/capi/GEOSNodeTest.cpp b/tests/unit/capi/GEOSNodeTest.cpp
index 26f34b2..70c80c1 100644
--- a/tests/unit/capi/GEOSNodeTest.cpp
+++ b/tests/unit/capi/GEOSNodeTest.cpp
@@ -36,7 +36,7 @@ namespace tut
}
test_capigeosnode_data()
- : geom1_(0), geom2_(0), w_(0)
+ : geom1_(nullptr), geom2_(nullptr), w_(nullptr)
{
initGEOS(notice, notice);
w_ = GEOSWKTWriter_create();
@@ -48,8 +48,8 @@ namespace tut
GEOSGeom_destroy(geom1_);
GEOSGeom_destroy(geom2_);
GEOSWKTWriter_destroy(w_);
- geom1_ = 0;
- geom2_ = 0;
+ geom1_ = nullptr;
+ geom2_ = nullptr;
finishGEOS();
}
@@ -71,7 +71,7 @@ namespace tut
{
geom1_ = GEOSGeomFromWKT("LINESTRING(0 0, 10 10, 10 0, 0 10)");
geom2_ = GEOSNode(geom1_);
- ensure(0 != geom2_);
+ ensure(nullptr != geom2_);
GEOSNormalize(geom2_);
char* wkt_c = GEOSWKTWriter_write(w_, geom2_);
@@ -90,7 +90,7 @@ namespace tut
{
geom1_ = GEOSGeomFromWKT("MULTILINESTRING((0 0, 2 0, 4 0),(5 0, 3 0, 1 0))");
geom2_ = GEOSNode(geom1_);
- ensure(0 != geom2_);
+ ensure(nullptr != geom2_);
GEOSNormalize(geom2_);
char* wkt_c = GEOSWKTWriter_write(w_, geom2_);
@@ -109,7 +109,7 @@ namespace tut
{
geom1_ = GEOSGeomFromWKT("MULTILINESTRING((0 0, 2 0, 4 0),(0 0, 2 0, 4 0))");
geom2_ = GEOSNode(geom1_);
- ensure(0 != geom2_);
+ ensure(nullptr != geom2_);
GEOSNormalize(geom2_);
char* wkt_c = GEOSWKTWriter_write(w_, geom2_);
diff --git a/tests/unit/capi/GEOSOffsetCurveTest.cpp b/tests/unit/capi/GEOSOffsetCurveTest.cpp
index 2697132..cd647d4 100644
--- a/tests/unit/capi/GEOSOffsetCurveTest.cpp
+++ b/tests/unit/capi/GEOSOffsetCurveTest.cpp
@@ -38,7 +38,7 @@ namespace tut
}
test_capioffsetcurve_data()
- : geom1_(0), geom2_(0), wkt_(0)
+ : geom1_(nullptr), geom2_(nullptr), wkt_(nullptr)
{
initGEOS(notice, notice);
wktw_ = GEOSWKTWriter_create();
@@ -51,9 +51,9 @@ namespace tut
GEOSGeom_destroy(geom2_);
GEOSWKTWriter_destroy(wktw_);
GEOSFree(wkt_);
- geom1_ = 0;
- geom2_ = 0;
- wkt_ = 0;
+ geom1_ = nullptr;
+ geom2_ = nullptr;
+ wkt_ = nullptr;
finishGEOS();
}
@@ -75,11 +75,11 @@ namespace tut
{
geom1_ = GEOSGeomFromWKT("LINESTRING(0 0, 10 0)");
- ensure( 0 != geom1_ );
+ ensure( nullptr != geom1_ );
geom2_ = GEOSOffsetCurve(geom1_, 2, 0, GEOSBUF_JOIN_ROUND, 2);
- ensure( 0 != geom2_ );
+ ensure( nullptr != geom2_ );
wkt_ = GEOSWKTWriter_write(wktw_, geom2_);
@@ -94,11 +94,11 @@ namespace tut
{
geom1_ = GEOSGeomFromWKT("LINESTRING(0 0, 10 0)");
- ensure( 0 != geom1_ );
+ ensure( nullptr != geom1_ );
geom2_ = GEOSOffsetCurve(geom1_, -2, 0, GEOSBUF_JOIN_ROUND, 2);
- ensure( 0 != geom2_ );
+ ensure( nullptr != geom2_ );
wkt_ = GEOSWKTWriter_write(wktw_, geom2_);
@@ -114,11 +114,11 @@ namespace tut
{
geom1_ = GEOSGeomFromWKT("LINESTRING(0 0, 10 0, 10 10)");
- ensure( 0 != geom1_ );
+ ensure( nullptr != geom1_ );
geom2_ = GEOSOffsetCurve(geom1_, -2, 1, GEOSBUF_JOIN_ROUND, 2);
- ensure( 0 != geom2_ );
+ ensure( nullptr != geom2_ );
wkt_ = GEOSWKTWriter_write(wktw_, geom2_);
@@ -134,11 +134,11 @@ namespace tut
{
geom1_ = GEOSGeomFromWKT("LINESTRING(0 0, 10 0, 10 10)");
- ensure( 0 != geom1_ );
+ ensure( nullptr != geom1_ );
geom2_ = GEOSOffsetCurve(geom1_, 2, 1, GEOSBUF_JOIN_ROUND, 2);
- ensure( 0 != geom2_ );
+ ensure( nullptr != geom2_ );
wkt_ = GEOSWKTWriter_write(wktw_, geom2_);
@@ -154,11 +154,11 @@ namespace tut
{
geom1_ = GEOSGeomFromWKT("LINESTRING(33282908 6005055,33282900 6005050,33282892 6005042,33282876 6005007,33282863 6004982,33282866 6004971,33282876 6004975,33282967 6005018,33282999 6005031)");
- ensure( 0 != geom1_ );
+ ensure( nullptr != geom1_ );
geom2_ = GEOSOffsetCurve(geom1_, 44, 1, GEOSBUF_JOIN_MITRE, 1);
- ensure( 0 != geom2_ );
+ ensure( nullptr != geom2_ );
wkt_ = GEOSWKTWriter_write(wktw_, geom2_);
@@ -175,11 +175,11 @@ namespace tut
{
geom1_ = GEOSGeomFromWKT("LINESTRING(0 0, 10 0)");
- ensure( 0 != geom1_ );
+ ensure( nullptr != geom1_ );
geom2_ = GEOSOffsetCurve(geom1_, 0, 0, GEOSBUF_JOIN_ROUND, 2);
- ensure( 0 != geom2_ );
+ ensure( nullptr != geom2_ );
wkt_ = GEOSWKTWriter_write(wktw_, geom2_);
@@ -202,14 +202,14 @@ namespace tut
"433.8007202148437500 404.6052856445312500)");
geom1_ = GEOSGeomFromWKT(wkt0.c_str());
- ensure( 0 != geom1_ );
+ ensure( nullptr != geom1_ );
double width = 57.164000837203;
// left-sided
{
geom2_ = GEOSOffsetCurve(geom1_, width, 8, GEOSBUF_JOIN_MITRE, 5.57);
- ensure( 0 != geom2_ );
+ ensure( nullptr != geom2_ );
// likely, 5 >= 5
ensure(GEOSGeomGetNumPoints(geom2_) >= GEOSGeomGetNumPoints(geom1_));
wkt_ = GEOSWKTWriter_write(wktw_, geom2_);
@@ -222,7 +222,7 @@ namespace tut
{
width = -width;
geom2_ = GEOSOffsetCurve(geom1_, width, 8, GEOSBUF_JOIN_MITRE, 5.57);
- ensure( 0 != geom2_ );
+ ensure( nullptr != geom2_ );
// likely, 5 >= 7
ensure(GEOSGeomGetNumPoints(geom2_) >= GEOSGeomGetNumPoints(geom1_));
wkt_ = GEOSWKTWriter_write(wktw_, geom2_);
@@ -239,10 +239,10 @@ namespace tut
double width = -1;
geom1_ = GEOSGeomFromWKT("LINESTRING(0 0,0 10,0 10,10 10)");
- ensure( 0 != geom1_ );
+ ensure( nullptr != geom1_ );
geom2_ = GEOSOffsetCurve(geom1_, width, 8, GEOSBUF_JOIN_ROUND, 0);
- ensure( "Unexpected exception", 0 != geom2_ );
+ ensure( "Unexpected exception", nullptr != geom2_ );
wkt_ = GEOSWKTWriter_write(wktw_, geom2_);
ensure_equals(std::string(wkt_), "LINESTRING (10 9, 1 9, 1 0)");
}
@@ -256,10 +256,10 @@ namespace tut
double width = -1;
geom1_ = GEOSGeomFromWKT("LINESTRING(0 0,0 10,0 10)");
- ensure( 0 != geom1_ );
+ ensure( nullptr != geom1_ );
geom2_ = GEOSOffsetCurve(geom1_, width, 8, GEOSBUF_JOIN_ROUND, 0);
- ensure( "Unexpected exception", 0 != geom2_ );
+ ensure( "Unexpected exception", nullptr != geom2_ );
wkt_ = GEOSWKTWriter_write(wktw_, geom2_);
ensure_equals(std::string(wkt_), "LINESTRING (1 10, 1 0)");
}
@@ -273,10 +273,10 @@ namespace tut
double width = -1;
geom1_ = GEOSGeomFromWKT("LINESTRING(0 10,0 10,0 10)");
- ensure( 0 != geom1_ );
+ ensure( nullptr != geom1_ );
geom2_ = GEOSOffsetCurve(geom1_, width, 8, GEOSBUF_JOIN_ROUND, 0);
- ensure( "Missing expected exception", 0 == geom2_ );
+ ensure( "Missing expected exception", nullptr == geom2_ );
}
} // namespace tut
diff --git a/tests/unit/capi/GEOSPointOnSurfaceTest.cpp b/tests/unit/capi/GEOSPointOnSurfaceTest.cpp
index b6d0f9d..a6a0d7b 100644
--- a/tests/unit/capi/GEOSPointOnSurfaceTest.cpp
+++ b/tests/unit/capi/GEOSPointOnSurfaceTest.cpp
@@ -39,7 +39,7 @@ namespace tut
}
test_capipointonsurface_data()
- : geom1_(0), geom2_(0), wkt_(0)
+ : geom1_(nullptr), geom2_(nullptr), wkt_(nullptr)
{
initGEOS(notice, notice);
wktw_ = GEOSWKTWriter_create();
@@ -53,9 +53,9 @@ namespace tut
GEOSGeom_destroy(geom2_);
GEOSWKTWriter_destroy(wktw_);
GEOSFree(wkt_);
- geom1_ = 0;
- geom2_ = 0;
- wkt_ = 0;
+ geom1_ = nullptr;
+ geom2_ = nullptr;
+ wkt_ = nullptr;
finishGEOS();
}
@@ -77,11 +77,11 @@ namespace tut
{
geom1_ = GEOSGeomFromWKT("POINT(10 0)");
- ensure( 0 != geom1_ );
+ ensure( nullptr != geom1_ );
geom2_ = GEOSPointOnSurface(geom1_);
- ensure( 0 != geom2_ );
+ ensure( nullptr != geom2_ );
wkt_ = GEOSWKTWriter_write(wktw_, geom2_);
@@ -96,11 +96,11 @@ namespace tut
{
geom1_ = GEOSGeomFromWKT("LINESTRING(0 0, 5 0, 10 0)");
- ensure( 0 != geom1_ );
+ ensure( nullptr != geom1_ );
geom2_ = GEOSPointOnSurface(geom1_);
- ensure( 0 != geom2_ );
+ ensure( nullptr != geom2_ );
wkt_ = GEOSWKTWriter_write(wktw_, geom2_);
@@ -115,11 +115,11 @@ namespace tut
{
geom1_ = GEOSGeomFromWKT("POLYGON((0 0, 10 0, 10 10, 0 10, 0 0))");
- ensure( 0 != geom1_ );
+ ensure( nullptr != geom1_ );
geom2_ = GEOSPointOnSurface(geom1_);
- ensure( 0 != geom2_ );
+ ensure( nullptr != geom2_ );
wkt_ = GEOSWKTWriter_write(wktw_, geom2_);
@@ -139,11 +139,11 @@ namespace tut
56.528833333300 25.2103333333, \
56.528666666700 25.2101666667))");
- ensure( 0 != geom1_ );
+ ensure( nullptr != geom1_ );
geom2_ = GEOSPointOnSurface(geom1_);
- ensure( 0 != geom2_ );
+ ensure( nullptr != geom2_ );
wkt_ = GEOSWKTWriter_write(wktw_, geom2_);
@@ -158,11 +158,11 @@ namespace tut
{
geom1_ = GEOSGeomFromWKT("LINESTRING EMPTY");
- ensure( 0 != geom1_ );
+ ensure( nullptr != geom1_ );
geom2_ = GEOSPointOnSurface(geom1_);
- ensure( 0 != geom2_ );
+ ensure( nullptr != geom2_ );
wkt_ = GEOSWKTWriter_write(wktw_, geom2_);
@@ -176,11 +176,11 @@ namespace tut
{
geom1_ = GEOSGeomFromWKT("LINESTRING(0 0, 0 0)");
- ensure( 0 != geom1_ );
+ ensure( nullptr != geom1_ );
geom2_ = GEOSPointOnSurface(geom1_);
- ensure( 0 != geom2_ );
+ ensure( nullptr != geom2_ );
wkt_ = GEOSWKTWriter_write(wktw_, geom2_);
@@ -203,9 +203,9 @@ namespace tut
"182096.699289843 141744.892410235,182142.107084301 141773.967727472,"
"182140.268233846 141825.482203511,182123.233970367 141827.369156254,"
"182111.031940953 141935.935903267))");
- ensure(0 != geom1_);
+ ensure(nullptr != geom1_);
geom2_ = GEOSPointOnSurface(geom1_);
- ensure(0 != geom2_);
+ ensure(nullptr != geom2_);
wkt_ = GEOSWKTWriter_write(wktw_, geom2_);
ensure_equals(std::string(wkt_), std::string("POINT (182077.08 141881.65)"));
@@ -219,9 +219,9 @@ namespace tut
"182496.699289843 141744.892410235,182542.107084301 141773.967727472,"
"182540.268233846 141825.482203511,182522.034014178 141825.369229273,"
"182512.231897141 141935.935903267))");
- ensure(0 != geom1_);
+ ensure(nullptr != geom1_);
geom2_ = GEOSPointOnSurface(geom1_);
- ensure(0 != geom2_);
+ ensure(nullptr != geom2_);
wkt_ = GEOSWKTWriter_write(wktw_, geom2_);
ensure_equals(std::string(wkt_), std::string("POINT (182476.76 141880.71)"));
@@ -235,9 +235,9 @@ namespace tut
"182814.953577191 141758.480925126,182766.155358861 141721.682268681,"
"182742.156235092 141744.881421657,182692.558045971 141716.882443927,"
"182635.760119718 141846.477712277))");
- ensure(0 != geom1_);
+ ensure(nullptr != geom1_);
geom2_ = GEOSPointOnSurface(geom1_);
- ensure(0 != geom2_);
+ ensure(nullptr != geom2_);
wkt_ = GEOSWKTWriter_write(wktw_, geom2_);
ensure_equals(std::string(wkt_), std::string("POINT (182755.89 141812.88)"));
diff --git a/tests/unit/capi/GEOSPolygonizer_getCutEdgesTest.cpp b/tests/unit/capi/GEOSPolygonizer_getCutEdgesTest.cpp
index aa777b2..f6bf936 100644
--- a/tests/unit/capi/GEOSPolygonizer_getCutEdgesTest.cpp
+++ b/tests/unit/capi/GEOSPolygonizer_getCutEdgesTest.cpp
@@ -57,14 +57,14 @@ namespace tut
void object::test<1>()
{
const int size = 2;
- GEOSGeometry* geoms[size] = { 0 };
+ GEOSGeometry* geoms[size] = { nullptr };
geoms[0] = GEOSGeomFromWKT("LINESTRING(1 3, 3 3, 3 1, 1 1, 1 3)");
geoms[1] = GEOSGeomFromWKT("LINESTRING(1 3, 3 3, 3 1, 1 1, 1 3)");
GEOSGeometry* g = GEOSPolygonizer_getCutEdges(geoms, size);
- ensure(0 != g);
+ ensure(nullptr != g);
ensure_equals(GEOSGetNumGeometries(g), size);
GEOSGeom_destroy(g);
@@ -77,7 +77,7 @@ namespace tut
void object::test<2>()
{
const int size = 6;
- GEOSGeometry* geoms[size] = { 0 };
+ GEOSGeometry* geoms[size] = { nullptr };
// Example from JTS Developer's Guide, Chapter 6 - Polygonization
geoms[0] = GEOSGeomFromWKT("LINESTRING(0 0, 10 10)"); // isolated edge
@@ -89,14 +89,14 @@ namespace tut
GEOSGeometry* g = GEOSPolygonizer_getCutEdges(geoms, size);
- ensure(0 != g);
+ ensure(nullptr != g);
ensure_equals(GEOSGetNumGeometries(g), 0);
GEOSGeom_destroy(g);
for (int i = 0; i < size; ++i)
{
- if (0 != geoms[i])
+ if (nullptr != geoms[i])
GEOSGeom_destroy(geoms[i]);
}
}
diff --git a/tests/unit/capi/GEOSPreparedGeometryTest.cpp b/tests/unit/capi/GEOSPreparedGeometryTest.cpp
index 2308f7e..8f0b737 100644
--- a/tests/unit/capi/GEOSPreparedGeometryTest.cpp
+++ b/tests/unit/capi/GEOSPreparedGeometryTest.cpp
@@ -42,7 +42,7 @@ namespace tut
}
test_capigeospreparedgeometry_data()
- : geom1_(0), geom2_(0), prepGeom1_(0), prepGeom2_(0)
+ : geom1_(nullptr), geom2_(nullptr), prepGeom1_(nullptr), prepGeom2_(nullptr)
{
initGEOS(notice, notice);
}
@@ -53,10 +53,10 @@ namespace tut
GEOSGeom_destroy(geom2_);
GEOSPreparedGeom_destroy(prepGeom1_);
GEOSPreparedGeom_destroy(prepGeom2_);
- geom1_ = 0;
- geom2_ = 0;
- prepGeom1_ = 0;
- prepGeom2_ = 0;
+ geom1_ = nullptr;
+ geom2_ = nullptr;
+ prepGeom1_ = nullptr;
+ prepGeom2_ = nullptr;
finishGEOS();
}
@@ -79,7 +79,7 @@ namespace tut
geom1_ = GEOSGeomFromWKT("POLYGON EMPTY");
prepGeom1_ = GEOSPrepare(geom1_);
- ensure(0 != prepGeom1_);
+ ensure(nullptr != prepGeom1_);
}
@@ -95,7 +95,7 @@ namespace tut
geom2_ = GEOSGeomFromWKT("POLYGON((2 2, 2 3, 3 3, 3 2, 2 2))");
prepGeom1_ = GEOSPrepare(geom1_);
- ensure(0 != prepGeom1_);
+ ensure(nullptr != prepGeom1_);
int ret = GEOSPreparedContainsProperly(prepGeom1_, geom2_);
ensure_equals(ret, 1);
@@ -114,7 +114,7 @@ namespace tut
geom2_ = GEOSGeomFromWKT("POLYGON((0 0, 0 10, 10 10, 10 0, 0 0))");
prepGeom1_ = GEOSPrepare(geom1_);
- ensure(0 != prepGeom1_);
+ ensure(nullptr != prepGeom1_);
int ret = GEOSPreparedContainsProperly(prepGeom1_, geom2_);
ensure_equals(ret, 0);
@@ -133,7 +133,7 @@ namespace tut
geom2_ = GEOSGeomFromWKT("LINESTRING(0 10, 10 0)");
prepGeom1_ = GEOSPrepare(geom1_);
- ensure(0 != prepGeom1_);
+ ensure(nullptr != prepGeom1_);
int ret = GEOSPreparedIntersects(prepGeom1_, geom2_);
ensure_equals(ret, 1);
@@ -149,7 +149,7 @@ namespace tut
geom2_ = GEOSGeomFromWKT("POLYGON((0 0, 2 0, 2 2, 0 2, 0 0))");
prepGeom1_ = GEOSPrepare(geom1_);
- ensure(0 != prepGeom1_);
+ ensure(nullptr != prepGeom1_);
int ret = GEOSPreparedCovers(prepGeom1_, geom2_);
ensure_equals(ret, 1);
@@ -165,7 +165,7 @@ namespace tut
geom2_ = GEOSGeomFromWKT("POLYGON((0 0, 2 0, 2 2, 0 2, 0 0))");
prepGeom1_ = GEOSPrepare(geom1_);
- ensure(0 != prepGeom1_);
+ ensure(nullptr != prepGeom1_);
int ret = GEOSPreparedContains(prepGeom1_, geom2_);
ensure_equals(ret, 1);
@@ -197,7 +197,7 @@ namespace tut
geom2_ = GEOSGeomFromHEX_buf(reinterpret_cast<const unsigned char*>(point.data()), point.size());
prepGeom1_ = GEOSPrepare(geom1_);
- ensure(0 != prepGeom1_);
+ ensure(nullptr != prepGeom1_);
int ret = GEOSPreparedIntersects(prepGeom1_, geom2_);
ensure_equals(ret, 0);
}
@@ -233,7 +233,7 @@ namespace tut
geom1_ = reinterpret_cast<GEOSGeometry*>(reader.readHEX(sLine));
prepGeom1_ = GEOSPrepare(geom1_);
- ensure(0 != prepGeom1_);
+ ensure(nullptr != prepGeom1_);
int ret = GEOSPreparedIntersects(prepGeom1_, geom2_);
ensure_equals(ret, 1);
}
@@ -251,7 +251,7 @@ namespace tut
geom1_ = GEOSGeomFromHEX_buf(reinterpret_cast<const unsigned char*>(line.data()), line.size());
geom2_ = GEOSGeomFromHEX_buf(reinterpret_cast<const unsigned char*>(point.data()), point.size());
prepGeom1_ = GEOSPrepare(geom1_);
- ensure(0 != prepGeom1_);
+ ensure(nullptr != prepGeom1_);
int ret = GEOSPreparedIntersects(prepGeom1_, geom2_);
ensure_equals(ret, 1);
@@ -278,10 +278,10 @@ namespace tut
geom1_ = reinterpret_cast<GEOSGeometry*>(reader.readHEX(sOuter));
std::istringstream sInner(inner);
geom2_ = reinterpret_cast<GEOSGeometry*>(reader.readHEX(sInner));
- ensure(0 != geom1_);
- ensure(0 != geom2_);
+ ensure(nullptr != geom1_);
+ ensure(nullptr != geom2_);
prepGeom1_ = GEOSPrepare(geom1_);
- ensure(0 != prepGeom1_);
+ ensure(nullptr != prepGeom1_);
int ret = GEOSPreparedContains(prepGeom1_, geom2_);
ensure_equals(ret, 1);
@@ -299,10 +299,10 @@ namespace tut
geom1_ = reinterpret_cast<GEOSGeometry*>(reader.readHEX(sOuter));
std::istringstream sInner(inner);
geom2_ = reinterpret_cast<GEOSGeometry*>(reader.readHEX(sInner));
- ensure(0 != geom1_);
- ensure(0 != geom2_);
+ ensure(nullptr != geom1_);
+ ensure(nullptr != geom2_);
prepGeom1_ = GEOSPrepare(geom1_);
- ensure(0 != prepGeom1_);
+ ensure(nullptr != prepGeom1_);
int ret = GEOSPreparedContains(prepGeom1_, geom2_);
ensure_equals(ret, 0);
@@ -335,10 +335,10 @@ namespace tut
geom1_ = reinterpret_cast<GEOSGeometry*>(reader.readHEX(sOuter));
std::istringstream sInner(inner);
geom2_ = reinterpret_cast<GEOSGeometry*>(reader.readHEX(sInner));
- ensure(0 != geom1_);
- ensure(0 != geom2_);
+ ensure(nullptr != geom1_);
+ ensure(nullptr != geom2_);
prepGeom1_ = GEOSPrepare(geom1_);
- ensure(0 != prepGeom1_);
+ ensure(nullptr != prepGeom1_);
int ret = GEOSPreparedContains(prepGeom1_, geom2_);
ensure_equals(ret, 1);
@@ -356,10 +356,10 @@ namespace tut
geom1_ = reinterpret_cast<GEOSGeometry*>(reader.readHEX(sOuter));
std::istringstream sInner(inner);
geom2_ = reinterpret_cast<GEOSGeometry*>(reader.readHEX(sInner));
- ensure(0 != geom1_);
- ensure(0 != geom2_);
+ ensure(nullptr != geom1_);
+ ensure(nullptr != geom2_);
prepGeom1_ = GEOSPrepare(geom1_);
- ensure(0 != prepGeom1_);
+ ensure(nullptr != prepGeom1_);
int ret = GEOSPreparedContains(prepGeom1_, geom2_);
ensure_equals(ret, 1);
diff --git a/tests/unit/capi/GEOSRelateBoundaryNodeRuleTest.cpp b/tests/unit/capi/GEOSRelateBoundaryNodeRuleTest.cpp
index 79ee677..95ecf35 100644
--- a/tests/unit/capi/GEOSRelateBoundaryNodeRuleTest.cpp
+++ b/tests/unit/capi/GEOSRelateBoundaryNodeRuleTest.cpp
@@ -35,7 +35,7 @@ namespace tut
}
test_capigeosrelateboundarynoderule_data()
- : geom1_(0), geom2_(0), pat_(0)
+ : geom1_(nullptr), geom2_(nullptr), pat_(nullptr)
{
initGEOS(notice, notice);
}
@@ -150,7 +150,7 @@ namespace tut
geom1_ = GEOSGeomFromWKT("MULTILINESTRING((0 0, 10 0),(10 0, 10 10))");
geom2_ = GEOSGeomFromWKT("LINESTRING(10 0, 10 -10)");
pat_ = GEOSRelateBoundaryNodeRule(geom1_, geom2_, 5);
- ensure(0 == pat_);
+ ensure(nullptr == pat_);
}
diff --git a/tests/unit/capi/GEOSSTRtreeTest.cpp b/tests/unit/capi/GEOSSTRtreeTest.cpp
index dd3bb4e..8ecef36 100644
--- a/tests/unit/capi/GEOSSTRtreeTest.cpp
+++ b/tests/unit/capi/GEOSSTRtreeTest.cpp
@@ -123,13 +123,13 @@ namespace tut
for (size_t i = 0; i < ngeoms; i++) {
const GEOSGeometry* nearest = GEOSSTRtree_nearest(tree, queryPoints[i]);
- const GEOSGeometry* nearestBruteForce = NULL;
+ const GEOSGeometry* nearestBruteForce = nullptr;
double nearestBruteForceDistance = std::numeric_limits<double>::max();
for (size_t j = 0; j < ngeoms; j++) {
double distance;
GEOSDistance(queryPoints[i], geoms[j], &distance);
- if (nearestBruteForce == NULL || distance < nearestBruteForceDistance) {
+ if (nearestBruteForce == nullptr || distance < nearestBruteForceDistance) {
nearestBruteForce = geoms[j];
nearestBruteForceDistance = distance;
}
@@ -155,7 +155,7 @@ namespace tut
GEOSGeometry* g1 = GEOSGeomFromWKT("POINT (3 3)");
const GEOSGeometry* g2 = GEOSSTRtree_nearest(tree, g1);
- ensure(g2 == NULL);
+ ensure(g2 == nullptr);
GEOSGeom_destroy(g1);
GEOSSTRtree_destroy(tree);
@@ -178,7 +178,7 @@ namespace tut
GEOSSTRtree_insert(tree, g1, &p1);
GEOSSTRtree_insert(tree, g2, &p2);
- const INTPOINT* p4 = (const INTPOINT*) GEOSSTRtree_nearest_generic(tree, &p3, g3, &INTPOINT_dist, NULL);
+ const INTPOINT* p4 = (const INTPOINT*) GEOSSTRtree_nearest_generic(tree, &p3, g3, &INTPOINT_dist, nullptr);
ensure (p4 == &p2);
@@ -199,7 +199,7 @@ namespace tut
GEOSSTRtree_insert(tree, g1, g1);
const GEOSGeometry* g3 = GEOSSTRtree_nearest(tree, g2);
- ensure(g3 == NULL);
+ ensure(g3 == nullptr);
GEOSGeom_destroy(g1);
GEOSGeom_destroy(g2);
diff --git a/tests/unit/capi/GEOSSharedPathsTest.cpp b/tests/unit/capi/GEOSSharedPathsTest.cpp
index 916a2a9..5662b74 100644
--- a/tests/unit/capi/GEOSSharedPathsTest.cpp
+++ b/tests/unit/capi/GEOSSharedPathsTest.cpp
@@ -37,7 +37,7 @@ namespace tut
}
test_capigeossharedpaths_data()
- : geom1_(0), geom2_(0), geom3_(0), w_(0)
+ : geom1_(nullptr), geom2_(nullptr), geom3_(nullptr), w_(nullptr)
{
initGEOS(notice, notice);
w_ = GEOSWKTWriter_create();
@@ -50,9 +50,9 @@ namespace tut
GEOSGeom_destroy(geom2_);
GEOSGeom_destroy(geom3_);
GEOSWKTWriter_destroy(w_);
- geom1_ = 0;
- geom2_ = 0;
- geom3_ = 0;
+ geom1_ = nullptr;
+ geom2_ = nullptr;
+ geom3_ = nullptr;
finishGEOS();
}
@@ -111,8 +111,8 @@ namespace tut
"POLYGON((-8.1111111 60,-8.16875525879031 59.4147290339516,-8.33947250246614 58.8519497029047,-8.61670226309236 58.3332893009412,-8.98979075644036 57.8786796564404,-9.44440040094119 57.5055911630924,-9.96306080290473 57.2283614024661,-10.5258401339516 57.0576441587903,-11.1111111 57,-11.6963820660484 57.0576441587903,-12.2591613970953 57.2283614024661,-12.7778217990588 57.5055911630924,-13.2324314435596 57.8786796564404,-13.6055199369076 58.3332893009412,-13.8827496975339 58.8519497029047,-14.0534669412097 59.4147290339516,-14.1111111 60,-14.0534669412097 60.5852709660484,-13.8827496975339 61.1480502970953,-13.6055199369076 61.6667106990588,-13.2324314435597 62.1213203435596,-12.7778217990588 62.4944088369076,-12.2591613970953 62.7716385975339,-11.6963820660484 62.9423558412097,-11.1111111 63,-10.5258401339516 62.9423558412097,-9.96306080290474 62.7716385975339,-9.4444004009412 62.4944088369076,-8.98979075644036 62.1213203435596,-8.61670226309237 61.6667106990588,-8.33947250246614 6
1.1480502970953,-8.16875525879031 60.5852709660484,-8.1111111 60))"
);
- ensure(0 != geom1_);
- ensure(0 != geom2_);
+ ensure(nullptr != geom1_);
+ ensure(nullptr != geom2_);
geom3_ = GEOSSharedPaths(geom1_, geom2_);
diff --git a/tests/unit/capi/GEOSSimplifyTest.cpp b/tests/unit/capi/GEOSSimplifyTest.cpp
index d1b57da..b3a22ed 100644
--- a/tests/unit/capi/GEOSSimplifyTest.cpp
+++ b/tests/unit/capi/GEOSSimplifyTest.cpp
@@ -35,7 +35,7 @@ namespace tut
}
test_capigeossimplify_data()
- : geom1_(0), geom2_(0)
+ : geom1_(nullptr), geom2_(nullptr)
{
initGEOS(notice, notice);
}
@@ -44,8 +44,8 @@ namespace tut
{
GEOSGeom_destroy(geom1_);
GEOSGeom_destroy(geom2_);
- geom1_ = 0;
- geom2_ = 0;
+ geom1_ = nullptr;
+ geom2_ = nullptr;
finishGEOS();
}
diff --git a/tests/unit/capi/GEOSSnapTest.cpp b/tests/unit/capi/GEOSSnapTest.cpp
index 778de39..bc46f15 100644
--- a/tests/unit/capi/GEOSSnapTest.cpp
+++ b/tests/unit/capi/GEOSSnapTest.cpp
@@ -37,7 +37,7 @@ namespace tut
}
test_capigeossnap_data()
- : geom1_(0), geom2_(0), geom3_(0), w_(0)
+ : geom1_(nullptr), geom2_(nullptr), geom3_(nullptr), w_(nullptr)
{
initGEOS(notice, notice);
w_ = GEOSWKTWriter_create();
@@ -51,9 +51,9 @@ namespace tut
GEOSGeom_destroy(geom2_);
GEOSGeom_destroy(geom3_);
GEOSWKTWriter_destroy(w_);
- geom1_ = 0;
- geom2_ = 0;
- geom3_ = 0;
+ geom1_ = nullptr;
+ geom2_ = nullptr;
+ geom3_ = nullptr;
finishGEOS();
}
diff --git a/tests/unit/capi/GEOSUnaryUnionTest.cpp b/tests/unit/capi/GEOSUnaryUnionTest.cpp
index c24c72a..b2efa0a 100644
--- a/tests/unit/capi/GEOSUnaryUnionTest.cpp
+++ b/tests/unit/capi/GEOSUnaryUnionTest.cpp
@@ -36,7 +36,7 @@ namespace tut
}
test_capiunaryunion_data()
- : geom1_(0), geom2_(0)
+ : geom1_(nullptr), geom2_(nullptr)
{
initGEOS(notice, notice);
wktw_ = GEOSWKTWriter_create();
@@ -57,8 +57,8 @@ namespace tut
GEOSGeom_destroy(geom1_);
GEOSGeom_destroy(geom2_);
GEOSWKTWriter_destroy(wktw_);
- geom1_ = 0;
- geom2_ = 0;
+ geom1_ = nullptr;
+ geom2_ = nullptr;
finishGEOS();
}
@@ -80,10 +80,10 @@ namespace tut
void object::test<1>()
{
geom1_ = GEOSGeomFromWKT("POINT EMPTY");
- ensure( 0 != geom1_ );
+ ensure( nullptr != geom1_ );
geom2_ = GEOSUnaryUnion(geom1_);
- ensure( 0 != geom2_ );
+ ensure( nullptr != geom2_ );
ensure_equals(toWKT(geom2_), std::string("GEOMETRYCOLLECTION EMPTY"));
}
@@ -94,10 +94,10 @@ namespace tut
void object::test<2>()
{
geom1_ = GEOSGeomFromWKT("POINT (6 3)");
- ensure( 0 != geom1_ );
+ ensure( nullptr != geom1_ );
geom2_ = GEOSUnaryUnion(geom1_);
- ensure( 0 != geom2_ );
+ ensure( nullptr != geom2_ );
ensure_equals(toWKT(geom2_), std::string("POINT (6 3)"));
}
@@ -108,10 +108,10 @@ namespace tut
void object::test<3>()
{
geom1_ = GEOSGeomFromWKT("POINT (4 5 6)");
- ensure( 0 != geom1_ );
+ ensure( nullptr != geom1_ );
geom2_ = GEOSUnaryUnion(geom1_);
- ensure( 0 != geom2_ );
+ ensure( nullptr != geom2_ );
ensure_equals(toWKT(geom2_), std::string("POINT Z (4 5 6)"));
}
@@ -122,10 +122,10 @@ namespace tut
void object::test<4>()
{
geom1_ = GEOSGeomFromWKT("MULTIPOINT (4 5, 6 7, 4 5, 6 5, 6 7)");
- ensure( 0 != geom1_ );
+ ensure( nullptr != geom1_ );
geom2_ = GEOSUnaryUnion(geom1_);
- ensure( 0 != geom2_ );
+ ensure( nullptr != geom2_ );
ensure_equals(toWKT(geom2_), std::string("MULTIPOINT (4 5, 6 5, 6 7)"));
}
@@ -136,10 +136,10 @@ namespace tut
void object::test<5>()
{
geom1_ = GEOSGeomFromWKT("GEOMETRYCOLLECTION (POINT(4 5), MULTIPOINT(6 7, 6 5, 6 7), LINESTRING(0 5, 10 5), LINESTRING(4 -10, 4 10))");
- ensure( 0 != geom1_ );
+ ensure( nullptr != geom1_ );
geom2_ = GEOSUnaryUnion(geom1_);
- ensure( 0 != geom2_ );
+ ensure( nullptr != geom2_ );
ensure_equals(toWKT(geom2_), std::string("GEOMETRYCOLLECTION (POINT (6 7), LINESTRING (4 -10, 4 5), LINESTRING (4 5, 4 10), LINESTRING (0 5, 4 5), LINESTRING (4 5, 10 5))"));
}
@@ -150,10 +150,10 @@ namespace tut
void object::test<6>()
{
geom1_ = GEOSGeomFromWKT("GEOMETRYCOLLECTION (POINT(4 5), MULTIPOINT(6 7, 6 5, 6 7), POLYGON((0 0, 10 0, 10 10, 0 10, 0 0),(5 6, 7 6, 7 8, 5 8, 5 6)))");
- ensure( 0 != geom1_ );
+ ensure( nullptr != geom1_ );
geom2_ = GEOSUnaryUnion(geom1_);
- ensure( 0 != geom2_ );
+ ensure( nullptr != geom2_ );
ensure_equals(toWKT(geom2_), std::string(
"GEOMETRYCOLLECTION (POINT (6 7), POLYGON ((0 0, 10 0, 10 10, 0 10, 0 0), (5 6, 7 6, 7 8, 5 8, 5 6)))"
@@ -166,10 +166,10 @@ namespace tut
void object::test<7>()
{
geom1_ = GEOSGeomFromWKT("GEOMETRYCOLLECTION (MULTILINESTRING((5 7, 12 7), (4 5, 6 5), (5.5 7.5, 6.5 7.5)), POLYGON((0 0, 10 0, 10 10, 0 10, 0 0),(5 6, 7 6, 7 8, 5 8, 5 6)))");
- ensure( 0 != geom1_ );
+ ensure( nullptr != geom1_ );
geom2_ = GEOSUnaryUnion(geom1_);
- ensure( 0 != geom2_ );
+ ensure( nullptr != geom2_ );
ensure_equals(toWKT(geom2_), std::string(
"GEOMETRYCOLLECTION (LINESTRING (5 7, 7 7), LINESTRING (10 7, 12 7), LINESTRING (5.5 7.5, 6.5 7.5), POLYGON ((10 7, 10 0, 0 0, 0 10, 10 10, 10 7), (5 6, 7 6, 7 7, 7 8, 5 8, 5 7, 5 6)))"
@@ -182,10 +182,10 @@ namespace tut
void object::test<8>()
{
geom1_ = GEOSGeomFromWKT("GEOMETRYCOLLECTION (MULTILINESTRING((5 7, 12 7), (4 5, 6 5), (5.5 7.5, 6.5 7.5)), POLYGON((0 0, 10 0, 10 10, 0 10, 0 0),(5 6, 7 6, 7 8, 5 8, 5 6)), MULTIPOINT(6 6.5, 6 1, 12 2, 6 1))");
- ensure( 0 != geom1_ );
+ ensure( nullptr != geom1_ );
geom2_ = GEOSUnaryUnion(geom1_);
- ensure( 0 != geom2_ );
+ ensure( nullptr != geom2_ );
ensure_equals(toWKT(geom2_), std::string(
"GEOMETRYCOLLECTION (POINT (6 6.5), POINT (12 2), LINESTRING (5 7, 7 7), LINESTRING (10 7, 12 7), LINESTRING (5.5 7.5, 6.5 7.5), POLYGON ((10 7, 10 0, 0 0, 0 10, 10 10, 10 7), (5 6, 7 6, 7 7, 7 8, 5 8, 5 7, 5 6)))"
@@ -200,10 +200,10 @@ namespace tut
{
const char* hexwkb = "010200000002000000000000000000F8FF000000000000F8FF0000000000000000000000000000F03F";
geom1_ = GEOSGeomFromHEX_buf((const unsigned char*)hexwkb, std::strlen(hexwkb));
- ensure( 0 != geom1_ );
+ ensure( nullptr != geom1_ );
geom2_ = GEOSUnaryUnion(geom1_);
- ensure( 0 == geom2_ );
+ ensure( nullptr == geom2_ );
}
diff --git a/tests/unit/capi/GEOSUserDataTest.cpp b/tests/unit/capi/GEOSUserDataTest.cpp
index 0daf863..5f0889e 100644
--- a/tests/unit/capi/GEOSUserDataTest.cpp
+++ b/tests/unit/capi/GEOSUserDataTest.cpp
@@ -34,7 +34,7 @@ namespace tut
}
test_capigeouserdata_data()
- : geom_(0)
+ : geom_(nullptr)
{
initGEOS(notice, notice);
}
@@ -42,7 +42,7 @@ namespace tut
~test_capigeouserdata_data()
{
GEOSGeom_destroy(geom_);
- geom_ = 0;
+ geom_ = nullptr;
finishGEOS();
}
diff --git a/tests/unit/capi/GEOSVoronoiDiagramTest.cpp b/tests/unit/capi/GEOSVoronoiDiagramTest.cpp
index 8603427..59d7285 100644
--- a/tests/unit/capi/GEOSVoronoiDiagramTest.cpp
+++ b/tests/unit/capi/GEOSVoronoiDiagramTest.cpp
@@ -36,7 +36,7 @@ namespace tut
}
test_capigeosvoronoidiagram_data()
- : geom1_(0), geom2_(0)
+ : geom1_(nullptr), geom2_(nullptr)
{
initGEOS(notice, notice);
w_ = GEOSWKTWriter_create();
@@ -69,8 +69,8 @@ namespace tut
GEOSGeom_destroy(geom1_);
GEOSGeom_destroy(geom2_);
GEOSWKTWriter_destroy(w_);
- geom1_ = 0;
- geom2_ = 0;
+ geom1_ = nullptr;
+ geom2_ = nullptr;
finishGEOS();
}
@@ -92,12 +92,12 @@ namespace tut
{
geom1_ = GEOSGeomFromWKT("POINT(10 20)");
- geom2_ = GEOSVoronoiDiagram(geom1_, 0, 0, 0);
+ geom2_ = GEOSVoronoiDiagram(geom1_, nullptr, 0, 0);
ensure_equals ( GEOSisEmpty(geom2_), 1 );
ensure_equals ( GEOSGeomTypeId(geom2_), GEOS_GEOMETRYCOLLECTION );
GEOSGeom_destroy(geom2_);
- geom2_ = GEOSVoronoiDiagram(geom1_, 0, 0, 1);
+ geom2_ = GEOSVoronoiDiagram(geom1_, nullptr, 0, 1);
ensure_equals_wkt(geom2_,"MULTILINESTRING EMPTY");
}
@@ -108,11 +108,11 @@ namespace tut
{
geom1_ = GEOSGeomFromWKT("MULTIPOINT ((280 300), (420 330), (380 230), (320 160))");
- geom2_ = GEOSVoronoiDiagram(geom1_, 0, 0, 0);
+ geom2_ = GEOSVoronoiDiagram(geom1_, nullptr, 0, 0);
ensure_equals_wkt(geom2_ ,"GEOMETRYCOLLECTION (POLYGON ((110 175.71428571428572, 110 500, 310.35714285714283 500, 353.515625 298.59375, 306.875 231.96428571428572, 110 175.71428571428572)), POLYGON ((590 204, 590 -10, 589.1666666666666 -10, 306.875 231.96428571428572, 353.515625 298.59375, 590 204)), POLYGON ((110 -10, 110 175.71428571428572, 306.875 231.96428571428572, 589.1666666666666 -10, 110 -10)), POLYGON ((310.35714285714283 500, 590 500, 590 204, 353.515625 298.59375, 310.35714285714283 500)))" );
GEOSGeom_destroy(geom2_);
- geom2_ = GEOSVoronoiDiagram(geom1_, 0, 0, 1);
+ geom2_ = GEOSVoronoiDiagram(geom1_, nullptr, 0, 1);
ensure_equals_wkt(geom2_, "MULTILINESTRING ((310.3571428571428 500, 353.515625 298.59375), (353.515625 298.59375, 306.875 231.9642857142857), (306.875 231.9642857142857, 110 175.7142857142857), (589.1666666666666 -10, 306.875 231.9642857142857), (353.515625 298.59375, 590 204))");
}
//Larger number of points:
@@ -122,11 +122,11 @@ namespace tut
{
geom1_ = GEOSGeomFromWKT("MULTIPOINT ((170 270), (270 270), (230 310), (180 330), (250 340), (315 318), (330 260), (240 170), (220 220), (270 220))");
- geom2_ = GEOSVoronoiDiagram(geom1_, 0, 0, 0);
+ geom2_ = GEOSVoronoiDiagram(geom1_, nullptr, 0, 0);
ensure_equals_wkt(geom2_,"GEOMETRYCOLLECTION (POLYGON ((0 329.1666666666667, 0 510, 190 510, 213.94736842105263 342.36842105263156, 195.625 296.5625, 0 329.1666666666667)), POLYGON ((0 76.50000000000001, 0 329.1666666666667, 195.625 296.5625, 216 266, 88.33333333333333 138.33333333333334, 0 76.50000000000001)), POLYGON ((216 266, 195.625 296.5625, 213.94736842105263 342.36842105263156, 267 307, 225 265, 216 266)), POLYGON ((245 245, 225 265, 267 307, 275.9160583941606 309.54744525547443, 303.1666666666667 284, 296.6666666666667 245, 245 245)), POLYGON ((225 265, 245 245, 245 201, 88.33333333333333 138.33333333333334, 216 266, 225 265)), POLYGON ((0 0, 0 76.50000000000001, 88.33333333333333 138.33333333333334, 245 201, 380 120, 500 0, 0 0)), POLYGON ((190 510, 343.76153846153846 510, 275.9160583941606 309.54744525547443, 267 307, 213.94736842105263 342.36842105263156, 190 510)), POLYGON ((245 201, 245 245, 296.6666666666667 245, 380 120, 245 201)), POLYGON ((343.76153846153846 5
10, 500 510, 500 334.9051724137931, 303.1666666666667 284, 275.9160583941606 309.54744525547443, 343.76153846153846 510)), POLYGON ((500 334.9051724137931, 500 0, 380 120, 296.6666666666667 245, 303.1666666666667 284, 500 334.9051724137931)))");
GEOSGeom_destroy(geom2_);
- geom2_ = GEOSVoronoiDiagram(geom1_, 0, 0, 1);
+ geom2_ = GEOSVoronoiDiagram(geom1_, nullptr, 0, 1);
ensure_equals_wkt(geom2_,
"MULTILINESTRING ((190 510, 213.9473684210526 342.3684210526316), (213.9473684210526 342.3684210526316, 195.625 296.5625), (195.625 296.5625, 0 329.1666666666667), (195.625 296.5625, 216 266), (216 266, 88.33333333333333 138.3333333333333), (88.33333333333333 138.3333333333333, 0 76.50000000000001), (213.9473684210526 342.3684210526316, 267 307), (267 307, 225 265), (225 265, 216 266), (245 245, 225 265), (267 307, 275.9160583941606 309.5474452554744), (275.9160583941606 309.5474452554744, 303.1666666666667 284), (303.1666666666667 284, 296.6666666666667 245), (296.6666666666667 245, 245 245), (245 245, 245 201), (245 201, 88.33333333333333 138.3333333333333), (245 201, 380 120), (380 120, 500 0), (343.7615384615385 510, 275.9160583941606 309.5474452554744), (296.6666666666667 245, 380 120), (500 334.9051724137931, 303.1666666666667 284))"
);
@@ -138,11 +138,11 @@ namespace tut
{
geom1_ = GEOSGeomFromWKT("MULTIPOINT ((150 210), (210 270), (150 220), (220 210), (215 269))");
- geom2_ = GEOSVoronoiDiagram(geom1_, 0, 10, 0);
+ geom2_ = GEOSVoronoiDiagram(geom1_, nullptr, 10, 0);
ensure_equals_wkt(geom2_,"GEOMETRYCOLLECTION (POLYGON ((290 252.5, 290 140, 185 140, 185 215, 187.9268292682927 235.4878048780488, 290 252.5)), POLYGON ((80 215, 80 340, 100.83333333333336 340, 187.9268292682927 235.4878048780488, 185 215, 80 215)), POLYGON ((80 140, 80 215, 185 215, 185 140, 80 140)), POLYGON ((100.83333333333336 340, 290 340, 290 252.5, 187.9268292682927 235.4878048780488, 100.83333333333336 340)))");
GEOSGeom_destroy(geom2_);
- geom2_ = GEOSVoronoiDiagram(geom1_, 0, 10, 1);
+ geom2_ = GEOSVoronoiDiagram(geom1_, nullptr, 10, 1);
ensure_equals_wkt(geom2_,
"MULTILINESTRING ((185 215, 187.9268292682927 235.4878048780488), (187.9268292682927 235.4878048780488, 290 252.5), (185 140, 185 215), (185 215, 80 215), (100.8333333333334 340, 187.9268292682927 235.4878048780488))"
);
@@ -153,11 +153,11 @@ namespace tut
{
geom1_ = GEOSGeomFromWKT("MULTIPOINT ((40 420), (50 420), (210 290), (300 360), (350 150), (170 70), (134 135) ,(305 359), (351 145), (175 71))");
- geom2_ = GEOSVoronoiDiagram(geom1_, 0, 10, 0);
+ geom2_ = GEOSVoronoiDiagram(geom1_, nullptr, 10, 0);
ensure_equals_wkt(geom2_, "GEOMETRYCOLLECTION (POLYGON ((-310 146.559649122807, -310 770, 45 770, 45 263.64736842105265, -310 146.559649122807)), POLYGON ((-310 -153.37692307692305, -310 146.559649122807, 45 263.64736842105265, 59.16911764705881 267.8235294117647, 239.43506493506493 179.43506493506493, 241.34156378600824 151.98148148148147, -310 -153.37692307692305)), POLYGON ((45 770, 266.20000000000005 770, 181.94323144104806 418.9301310043668, 59.16911764705881 267.8235294117647, 45 263.64736842105265, 45 770)), POLYGON ((59.16911764705881 267.8235294117647, 181.94323144104806 418.9301310043668, 311.875 251.875, 239.43506493506493 179.43506493506493, 59.16911764705881 267.8235294117647)), POLYGON ((-310 -280, -310 -153.37692307692305, 241.34156378600824 151.98148148148147, 433.3333333333333 -280, -310 -280)), POLYGON ((266.20000000000005 770, 701 770, 701 344.5238095238096, 311.875 251.875, 181.94323144104806 418.9301310043668, 266.20000000000005 770)), POLYGON ((701 344.523
8095238096, 701 -280, 433.3333333333333 -280, 241.34156378600824 151.98148148148147, 239.43506493506493 179.43506493506493, 311.875 251.875, 701 344.5238095238096)))");
GEOSGeom_destroy(geom2_);
- geom2_ = GEOSVoronoiDiagram(geom1_, 0, 10, 1);
+ geom2_ = GEOSVoronoiDiagram(geom1_, nullptr, 10, 1);
ensure_equals_wkt(geom2_,
"MULTILINESTRING ((45 770, 45 263.6473684210526), (45 263.6473684210526, -310 146.559649122807), (45 263.6473684210526, 59.16911764705881 267.8235294117647), (59.16911764705881 267.8235294117647, 239.4350649350649 179.4350649350649), (239.4350649350649 179.4350649350649, 241.3415637860082 151.9814814814815), (241.3415637860082 151.9814814814815, -310 -153.376923076923), (266.2 770, 181.9432314410481 418.9301310043668), (181.9432314410481 418.9301310043668, 59.16911764705881 267.8235294117647), (181.9432314410481 418.9301310043668, 311.875 251.875), (311.875 251.875, 239.4350649350649 179.4350649350649), (241.3415637860082 151.9814814814815, 433.3333333333333 -280), (701 344.5238095238096, 311.875 251.875))"
);
@@ -167,7 +167,7 @@ namespace tut
void object::test<6>()
{
geom1_ = GEOSGeomFromWKT("MULTIPOINT ((123 245), (165 313), (240 310), (260 260), (180 210), (240 210))");
- geom2_ = GEOSVoronoiDiagram(geom1_, 0, 0, 1);
+ geom2_ = GEOSVoronoiDiagram(geom1_, nullptr, 0, 1);
ensure_equals_wkt(geom2_,
"MULTILINESTRING ((-14 376.5882352941176, 172.3651328095773 261.4803591470258), (172.3651328095773 261.4803591470258, 56.63157894736844 73), (172.3651328095773 261.4803591470258, 200.6640625 265.6015625), (200.6640625 265.6015625, 201 265.4), (201 265.4, 210 251), (210 251, 210 73), (208.04 450, 200.6640625 265.6015625), (397 343.8, 201 265.4), (210 251, 397 176.2))"
);
diff --git a/tests/unit/capi/GEOSWithinTest.cpp b/tests/unit/capi/GEOSWithinTest.cpp
index 5a7e38c..15f41ad 100644
--- a/tests/unit/capi/GEOSWithinTest.cpp
+++ b/tests/unit/capi/GEOSWithinTest.cpp
@@ -34,7 +34,7 @@ namespace tut
}
test_capigeoswithin_data()
- : geom1_(0), geom2_(0)
+ : geom1_(nullptr), geom2_(nullptr)
{
initGEOS(notice, notice);
}
@@ -43,8 +43,8 @@ namespace tut
{
GEOSGeom_destroy(geom1_);
GEOSGeom_destroy(geom2_);
- geom1_ = 0;
- geom2_ = 0;
+ geom1_ = nullptr;
+ geom2_ = nullptr;
finishGEOS();
}
@@ -66,8 +66,8 @@ namespace tut
geom1_ = GEOSGeomFromWKT("POLYGON EMPTY");
geom2_ = GEOSGeomFromWKT("POLYGON EMPTY");
- ensure( 0 != geom1_ );
- ensure( 0 != geom2_ );
+ ensure( nullptr != geom1_ );
+ ensure( nullptr != geom2_ );
char const r1 = GEOSWithin(geom1_, geom2_);
@@ -85,8 +85,8 @@ namespace tut
geom1_ = GEOSGeomFromWKT("POLYGON((1 1,1 5,5 5,5 1,1 1))");
geom2_ = GEOSGeomFromWKT("POINT(2 2)");
- ensure( 0 != geom1_ );
- ensure( 0 != geom2_ );
+ ensure( nullptr != geom1_ );
+ ensure( nullptr != geom2_ );
char const r1 = GEOSWithin(geom1_, geom2_);
@@ -104,8 +104,8 @@ namespace tut
geom1_ = GEOSGeomFromWKT("MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)))");
geom2_ = GEOSGeomFromWKT("POLYGON((1 1,1 2,2 2,2 1,1 1))");
- ensure( 0 != geom1_ );
- ensure( 0 != geom2_ );
+ ensure( nullptr != geom1_ );
+ ensure( nullptr != geom2_ );
char const r1 = GEOSWithin(geom1_, geom2_);
diff --git a/tests/unit/capi/GEOSisClosedTest.cpp b/tests/unit/capi/GEOSisClosedTest.cpp
index 6865cdb..9338688 100644
--- a/tests/unit/capi/GEOSisClosedTest.cpp
+++ b/tests/unit/capi/GEOSisClosedTest.cpp
@@ -34,7 +34,7 @@ namespace tut
std::fprintf(stdout, "\n");
}
- test_capiisclosed_data() : geom_(0)
+ test_capiisclosed_data() : geom_(nullptr)
{
initGEOS(notice, notice);
}
diff --git a/tests/unit/capi/GEOSisValidDetailTest.cpp b/tests/unit/capi/GEOSisValidDetailTest.cpp
index f35be93..a6c9af8 100644
--- a/tests/unit/capi/GEOSisValidDetailTest.cpp
+++ b/tests/unit/capi/GEOSisValidDetailTest.cpp
@@ -38,7 +38,7 @@ namespace tut
}
test_capiisvaliddetail_data()
- : geom_(0), loc_(0), reason_(0)
+ : geom_(nullptr), loc_(nullptr), reason_(nullptr)
{
initGEOS(notice, notice);
wktw_ = GEOSWKTWriter_create();
@@ -102,8 +102,8 @@ namespace tut
geom_ = GEOSGeomFromWKT("LINESTRING(0 0, 10 0, 5 -5, 5 5)");
int r = GEOSisValidDetail(geom_, 0, &reason_, &loc_);
ensure_equals(r, 1); // valid
- ensure_equals(reason_, (void*)0);
- ensure_equals(loc_, (void*)0);
+ ensure_equals(reason_, (void*)nullptr);
+ ensure_equals(loc_, (void*)nullptr);
}
// Invalid coordinate
@@ -112,7 +112,7 @@ namespace tut
void object::test<3>()
{
geom_ = GEOSGeomFromWKT("LINESTRING(0 0, 10 0, NaN -5)");
- ensure(0 != geom_);
+ ensure(nullptr != geom_);
int r = GEOSisValidDetail(geom_, 0, &reason_, &loc_);
std::string wkt = toWKT(loc_);
strToUpper(wkt);
@@ -152,8 +152,8 @@ namespace tut
int r = GEOSisValidDetail(geom_, flags, &reason_, &loc_);
ensure_equals(r, 1); // valid
- ensure_equals(reason_, (void*)0);
- ensure_equals(loc_, (void*)0);
+ ensure_equals(reason_, (void*)nullptr);
+ ensure_equals(loc_, (void*)nullptr);
}
// Check it is possible to not request details
@@ -162,7 +162,7 @@ namespace tut
void object::test<6>()
{
geom_ = GEOSGeomFromWKT("POLYGON((0 1, -10 10, 10 10, 0 1, 4 6, -4 6, 0 1))");
- int r = GEOSisValidDetail(geom_, 0, 0, 0);
+ int r = GEOSisValidDetail(geom_, 0, nullptr, nullptr);
ensure_equals(r, 0); // invalid
}
diff --git a/tests/unit/geom/CoordinateArraySequenceFactoryTest.cpp b/tests/unit/geom/CoordinateArraySequenceFactoryTest.cpp
index 33a355c..69de855 100644
--- a/tests/unit/geom/CoordinateArraySequenceFactoryTest.cpp
+++ b/tests/unit/geom/CoordinateArraySequenceFactoryTest.cpp
@@ -44,14 +44,14 @@ namespace tut
try
{
CoordinateFactoryCPtr base = geos::geom::CoordinateArraySequenceFactory::instance();
- ensure( 0 != base );
+ ensure( nullptr != base );
ensure(typeid(base).name(), typeid(base) == typeid(CoordinateFactoryCPtr) );
ensure(typeid(base).name(), typeid(base) != typeid(CoordinateArrayFactoryCPtr) );
CoordinateArrayFactoryCPtr derived;
derived = dynamic_cast<CoordinateArrayFactoryCPtr>(base);
- ensure( 0 != derived );
+ ensure( nullptr != derived );
ensure(typeid(derived).name(), typeid(derived) == typeid(CoordinateArrayFactoryCPtr) );
}
catch (std::exception& e)
@@ -72,16 +72,16 @@ namespace tut
{
CoordinateFactoryCPtr factory = geos::geom::CoordinateArraySequenceFactory::instance();
- ensure( 0 != factory );
+ ensure( nullptr != factory );
std::vector<Coordinate>* col = new std::vector<Coordinate>();
- ensure( 0 != col);
+ ensure( nullptr != col);
const size_t size0 = 0;
CoordinateSequencePtr sequence = factory->create(col);
- ensure( 0 != sequence);
+ ensure( nullptr != sequence);
ensure( sequence->isEmpty() );
ensure_equals( sequence->size(), size0 );
@@ -104,11 +104,11 @@ namespace tut
try
{
CoordinateFactoryCPtr factory = geos::geom::CoordinateArraySequenceFactory::instance();
- ensure( 0 != factory );
+ ensure( nullptr != factory );
std::vector<Coordinate>* col = new std::vector<Coordinate>();
- ensure( 0 != col);
+ ensure( nullptr != col);
col->push_back(Coordinate(1, 2, 3));
col->push_back(Coordinate(5, 10, 15));
@@ -116,7 +116,7 @@ namespace tut
const size_t size2 = 2;
CoordinateSequencePtr sequence = factory->create(col);
- ensure( 0 != sequence);
+ ensure( nullptr != sequence);
ensure( !sequence->isEmpty() );
ensure_equals( sequence->size(), size2 );
ensure( sequence->getAt(0) != sequence->getAt(1) );
@@ -141,12 +141,12 @@ namespace tut
{
CoordinateFactoryCPtr factory = geos::geom::CoordinateArraySequenceFactory::instance();
- ensure( 0 != factory );
+ ensure( nullptr != factory );
const size_t size1000 = 1000;
CoordinateSequencePtr sequence = factory->create(size1000, 3);
- ensure( 0 != sequence);
+ ensure( nullptr != sequence);
ensure( !sequence->isEmpty() );
ensure_equals( sequence->size(), size1000 );
ensure( sequence->hasRepeatedPoints() );
@@ -173,12 +173,12 @@ namespace tut
{
CoordinateFactoryCPtr factory = geos::geom::CoordinateArraySequenceFactory::instance();
- ensure( 0 != factory );
+ ensure( nullptr != factory );
const size_t size0 = 0;
CoordinateSequencePtr sequence = factory->create();
- ensure( 0 != sequence);
+ ensure( nullptr != sequence);
ensure( sequence->isEmpty() );
ensure_equals( sequence->size(), size0 );
diff --git a/tests/unit/geom/DimensionTest.cpp b/tests/unit/geom/DimensionTest.cpp
index 4d5ecb7..e30112b 100644
--- a/tests/unit/geom/DimensionTest.cpp
+++ b/tests/unit/geom/DimensionTest.cpp
@@ -93,7 +93,7 @@ namespace tut
catch ( geos::util::IllegalArgumentException const& e )
{
const char* msg = e.what(); // ok
- ensure( msg != 0 );
+ ensure( msg != nullptr );
}
}
@@ -138,7 +138,7 @@ namespace tut
catch ( geos::util::IllegalArgumentException const& e )
{
const char* msg = e.what(); // ok
- ensure( msg != 0 );
+ ensure( msg != nullptr );
}
}
diff --git a/tests/unit/geom/Geometry/isRectangleTest.cpp b/tests/unit/geom/Geometry/isRectangleTest.cpp
index 21e97ef..5cdb9fd 100644
--- a/tests/unit/geom/Geometry/isRectangleTest.cpp
+++ b/tests/unit/geom/Geometry/isRectangleTest.cpp
@@ -42,7 +42,7 @@ namespace tut
geos::geom::Geometry* g = reader.read(wkt);
geos::geom::Polygon* poly = dynamic_cast<geos::geom::Polygon*>(g);
- ensure( "Geometry is not a Polygon: " + wkt, poly != 0 );
+ ensure( "Geometry is not a Polygon: " + wkt, poly != nullptr );
ensure( poly->isRectangle() );
delete g;
@@ -57,7 +57,7 @@ namespace tut
geos::geom::Geometry* g = reader.read(wkt);
geos::geom::Polygon* poly = dynamic_cast<geos::geom::Polygon*>(g);
- ensure( "Geometry is not a Polygon: " + wkt, poly != 0 );
+ ensure( "Geometry is not a Polygon: " + wkt, poly != nullptr );
ensure( poly->isRectangle() );
delete g;
@@ -73,7 +73,7 @@ namespace tut
geos::geom::Geometry* g = reader.read(wkt);
geos::geom::Polygon* poly = dynamic_cast<geos::geom::Polygon*>(g);
- ensure( "Geometry is not a Polygon: " + wkt, poly != 0 );
+ ensure( "Geometry is not a Polygon: " + wkt, poly != nullptr );
ensure( !poly->isRectangle() );
delete g;
@@ -88,7 +88,7 @@ namespace tut
geos::geom::Geometry* g = reader.read(wkt);
geos::geom::Polygon* poly = dynamic_cast<geos::geom::Polygon*>(g);
- ensure( "Geometry is not a Polygon: " + wkt, poly != 0 );
+ ensure( "Geometry is not a Polygon: " + wkt, poly != nullptr );
ensure( !poly->isRectangle() );
delete g;
@@ -103,7 +103,7 @@ namespace tut
geos::geom::Geometry* g = reader.read(wkt);
geos::geom::Polygon* poly = dynamic_cast<geos::geom::Polygon*>(g);
- ensure( "Geometry is not a Polygon: " + wkt, poly != 0 );
+ ensure( "Geometry is not a Polygon: " + wkt, poly != nullptr );
ensure( !poly->isRectangle() );
delete g;
@@ -118,7 +118,7 @@ namespace tut
geos::geom::Geometry* g = reader.read(wkt);
geos::geom::Polygon* poly = dynamic_cast<geos::geom::Polygon*>(g);
- ensure( "Geometry is not a Polygon: " + wkt, poly != 0 );
+ ensure( "Geometry is not a Polygon: " + wkt, poly != nullptr );
ensure( !poly->isRectangle() );
delete g;
@@ -133,7 +133,7 @@ namespace tut
geos::geom::Geometry* g = reader.read(wkt);
geos::geom::Polygon* poly = dynamic_cast<geos::geom::Polygon*>(g);
- ensure( "Geometry is not a Polygon: " + wkt, poly != 0 );
+ ensure( "Geometry is not a Polygon: " + wkt, poly != nullptr );
ensure( !poly->isRectangle() );
delete g;
diff --git a/tests/unit/geom/GeometryFactoryTest.cpp b/tests/unit/geom/GeometryFactoryTest.cpp
index 1127a79..b69a723 100644
--- a/tests/unit/geom/GeometryFactoryTest.cpp
+++ b/tests/unit/geom/GeometryFactoryTest.cpp
@@ -89,7 +89,7 @@ reader_(factory_.get())
ensure_equals( gf->getPrecisionModel()->getType(), geos::geom::PrecisionModel::FLOATING );
geos::geom::Geometry* geo = gf->createEmptyGeometry();
- ensure( "createEmptyGeometry() returned null pointer.", geo != 0 );
+ ensure( "createEmptyGeometry() returned null pointer.", geo != nullptr );
ensure_equals( geo->getSRID() , gf->getSRID() );
ensure_equals( geo->getPrecisionModel()->getType(), geos::geom::PrecisionModel::FLOATING );
@@ -118,7 +118,7 @@ reader_(factory_.get())
ensure_equals( &csf, gf->getCoordinateSequenceFactory() );
GeometryPtr geo = gf->createEmptyGeometry();
- ensure( "createEmptyGeometry() returned null pointer.", geo != 0 );
+ ensure( "createEmptyGeometry() returned null pointer.", geo != nullptr );
ensure_equals( geo->getSRID() , gf->getSRID() );
ensure_equals( geo->getPrecisionModel()->getType(), geos::geom::PrecisionModel::FIXED );
@@ -146,7 +146,7 @@ reader_(factory_.get())
ensure_equals( gf->getPrecisionModel()->getType(), geos::geom::PrecisionModel::FLOATING );
GeometryPtr geo = gf->createEmptyGeometry();
- ensure( "createEmptyGeometry() returned null pointer.", geo != 0 );
+ ensure( "createEmptyGeometry() returned null pointer.", geo != nullptr );
ensure_equals( geo->getSRID() , gf->getSRID() );
ensure_equals( geo->getPrecisionModel()->getType(), geos::geom::PrecisionModel::FLOATING );
@@ -171,7 +171,7 @@ reader_(factory_.get())
ensure_equals( gf->getPrecisionModel()->getType(), PrecisionModel::FIXED );
GeometryPtr geo = gf->createEmptyGeometry();
- ensure( "createEmptyGeometry() returned null pointer.", geo != 0 );
+ ensure( "createEmptyGeometry() returned null pointer.", geo != nullptr );
ensure_equals( geo->getSRID() , gf->getSRID() );
ensure_equals( geo->getPrecisionModel()->getType(), PrecisionModel::FIXED );
@@ -194,7 +194,7 @@ reader_(factory_.get())
ensure_equals( gf->getPrecisionModel()->getType(), PrecisionModel::FIXED );
GeometryPtr geo = gf->createEmptyGeometry();
- ensure( "createEmptyGeometry() returned null pointer.", geo != 0 );
+ ensure( "createEmptyGeometry() returned null pointer.", geo != nullptr );
ensure_equals( geo->getSRID() , gf->getSRID() );
ensure_equals( geo->getPrecisionModel()->getType(), PrecisionModel::FIXED );
@@ -221,7 +221,7 @@ reader_(factory_.get())
{
GeometryPtr geo = factory_->createEmptyGeometry();
- ensure( "createEmptyGeometry() returned null pointer.", geo != 0 );
+ ensure( "createEmptyGeometry() returned null pointer.", geo != nullptr );
ensure( "createEmptyGeometry() returned non-empty geometry.", geo->isEmpty() );
// TODO - mloskot
@@ -245,26 +245,26 @@ reader_(factory_.get())
{
PointPtr pt = factory_->createPoint();
- ensure( "createPoint() returned null pointer.", pt != 0 );
+ ensure( "createPoint() returned null pointer.", pt != nullptr );
ensure( "createPoint() returned non-empty point.", pt->isEmpty() );
ensure( pt->isSimple() );
ensure( pt->isValid() );
- ensure( pt->getCentroid() == 0 );
- ensure( pt->getCoordinate() == 0 );
+ ensure( pt->getCentroid() == nullptr );
+ ensure( pt->getCoordinate() == nullptr );
- GeometryPtr geo = 0;
+ GeometryPtr geo = nullptr;
geo = pt->getEnvelope();
- ensure( geo != 0 );
+ ensure( geo != nullptr );
ensure( geo->isEmpty() );
factory_->destroyGeometry(geo);
geo = pt->getBoundary();
- ensure( geo != 0 );
+ ensure( geo != nullptr );
ensure( geo->isEmpty() );
factory_->destroyGeometry(geo);
geo = pt->convexHull();
- ensure( geo != 0 );
+ ensure( geo != nullptr );
ensure( geo->isEmpty() );
factory_->destroyGeometry(geo);
@@ -288,36 +288,36 @@ reader_(factory_.get())
PointPtr pt = factory_->createPoint(coord);
- ensure( "createPoint() returned null pointer.", pt != 0 );
+ ensure( "createPoint() returned null pointer.", pt != nullptr );
ensure( "createPoint() returned empty point.", !pt->isEmpty() );
ensure( pt->isSimple() );
ensure( pt->isValid() );
- ensure( pt->getCoordinate() != 0 );
+ ensure( pt->getCoordinate() != nullptr );
CoordinateCPtr pcoord = pt->getCoordinate();
- ensure( pcoord != 0 );
+ ensure( pcoord != nullptr );
ensure_equals( pcoord->x, x_ );
ensure_equals( pcoord->y, y_ );
ensure_equals( pcoord->z, z_ );
- GeometryPtr geo = 0;
+ GeometryPtr geo = nullptr;
geo = pt->getEnvelope();
- ensure( geo != 0 );
+ ensure( geo != nullptr );
ensure( !geo->isEmpty() );
factory_->destroyGeometry(geo);
geo = pt->getCentroid();
- ensure( geo != 0 );
+ ensure( geo != nullptr );
ensure( !geo->isEmpty() );
factory_->destroyGeometry(geo);
geo = pt->getBoundary();
- ensure( geo != 0 );
+ ensure( geo != nullptr );
ensure( geo->isEmpty() );
factory_->destroyGeometry(geo);
geo = pt->convexHull();
- ensure( geo != 0 );
+ ensure( geo != nullptr );
ensure( !geo->isEmpty() );
factory_->destroyGeometry(geo);
@@ -341,41 +341,41 @@ reader_(factory_.get())
CoordArrayPtr sequence = new geos::geom::CoordinateArraySequence();
- ensure( "sequence is null pointer.", sequence != 0 );
+ ensure( "sequence is null pointer.", sequence != nullptr );
sequence->add(coord);
PointPtr pt = factory_->createPoint(sequence);
- ensure( "createPoint() returned null pointer.", pt != 0 );
+ ensure( "createPoint() returned null pointer.", pt != nullptr );
ensure( "createPoint() returned empty point.", !pt->isEmpty() );
ensure( pt->isSimple() );
ensure( pt->isValid() );
- ensure( pt->getCoordinate() != 0 );
+ ensure( pt->getCoordinate() != nullptr );
CoordinateCPtr pcoord = pt->getCoordinate();
- ensure( pcoord != 0 );
+ ensure( pcoord != nullptr );
ensure_equals( pcoord->x, x_ );
ensure_equals( pcoord->y, y_ );
ensure_equals( pcoord->z, z_ );
- GeometryPtr geo = 0;
+ GeometryPtr geo = nullptr;
geo = pt->getEnvelope();
- ensure( geo != 0 );
+ ensure( geo != nullptr );
ensure( !geo->isEmpty() );
factory_->destroyGeometry(geo);
geo = pt->getCentroid();
- ensure( geo != 0 );
+ ensure( geo != nullptr );
ensure( !geo->isEmpty() );
factory_->destroyGeometry(geo);
geo = pt->getBoundary();
- ensure( geo != 0 );
+ ensure( geo != nullptr );
ensure( geo->isEmpty() );
factory_->destroyGeometry(geo);
geo = pt->convexHull();
- ensure( geo != 0 );
+ ensure( geo != nullptr );
ensure( !geo->isEmpty() );
factory_->destroyGeometry(geo);
@@ -402,36 +402,36 @@ reader_(factory_.get())
PointPtr pt = factory_->createPoint(sequence);
- ensure( "createPoint() returned null pointer.", pt != 0 );
+ ensure( "createPoint() returned null pointer.", pt != nullptr );
ensure( "createPoint() returned empty point.", !pt->isEmpty() );
ensure( pt->isSimple() );
ensure( pt->isValid() );
- ensure( pt->getCoordinate() != 0 );
+ ensure( pt->getCoordinate() != nullptr );
CoordinateCPtr pcoord = pt->getCoordinate();
- ensure( pcoord != 0 );
+ ensure( pcoord != nullptr );
ensure_equals( pcoord->x, x_ );
ensure_equals( pcoord->y, y_ );
ensure_equals( pcoord->z, z_ );
- GeometryPtr geo = 0;
+ GeometryPtr geo = nullptr;
geo = pt->getEnvelope();
- ensure( geo != 0 );
+ ensure( geo != nullptr );
ensure( !geo->isEmpty() );
factory_->destroyGeometry(geo);
geo = pt->getCentroid();
- ensure( geo != 0 );
+ ensure( geo != nullptr );
ensure( !geo->isEmpty() );
factory_->destroyGeometry(geo);
geo = pt->getBoundary();
- ensure( geo != 0 );
+ ensure( geo != nullptr );
ensure( geo->isEmpty() );
factory_->destroyGeometry(geo);
geo = pt->convexHull();
- ensure( geo != 0 );
+ ensure( geo != nullptr );
ensure( !geo->isEmpty() );
factory_->destroyGeometry(geo);
@@ -453,12 +453,12 @@ reader_(factory_.get())
{
LinearRingPtr lr = factory_->createLinearRing();
- ensure( "createLinearRing() returned null pointer.", lr != 0 );
+ ensure( "createLinearRing() returned null pointer.", lr != nullptr );
ensure( "createLinearRing() returned non-empty point.", lr->isEmpty() );
ensure( lr->isEmpty() );
ensure( lr->isSimple() );
ensure( lr->isValid() );
- ensure( lr->getCoordinate() == 0 );
+ ensure( lr->getCoordinate() == nullptr );
// TODO - mloskot
//http://geos.osgeo.org/pipermail/geos-devel/2006-March/001961.html
@@ -486,14 +486,14 @@ reader_(factory_.get())
{
const std::size_t size = 5;
CoordArrayPtr coords = new geos::geom::CoordinateArraySequence(size);
- ensure( coords != 0 );
+ ensure( coords != nullptr );
ensure_equals( coords->getSize(), size );
LinearRingPtr lr = factory_->createLinearRing(coords);
- ensure( "createLinearRing() returned null pointer.", lr != 0 );
+ ensure( "createLinearRing() returned null pointer.", lr != nullptr );
ensure( "createLinearRing() returned empty point.", !lr->isEmpty() );
ensure( lr->isSimple() );
- ensure( lr->getCoordinate() != 0 );
+ ensure( lr->getCoordinate() != nullptr );
// TODO - mloskot - is this correct?
//ensure( !lr->isValid() );
@@ -522,7 +522,7 @@ reader_(factory_.get())
ensure( "createLinearRing() returned empty point.", !lr->isEmpty() );
ensure_equals( lr->getNumPoints(), size );
ensure( lr->isSimple() );
- ensure( lr->getCoordinate() != 0 );
+ ensure( lr->getCoordinate() != nullptr );
ensure_equals( lr->getGeometryTypeId(), geos::geom::GEOS_LINEARRING );
ensure_equals( lr->getDimension(), geos::geom::Dimension::L );
@@ -542,29 +542,29 @@ reader_(factory_.get())
{
LineStringPtr line = factory_->createLineString();
- ensure( "createLineString() returned null pointer.", line != 0 );
+ ensure( "createLineString() returned null pointer.", line != nullptr );
ensure( "createLineString() returned non-empty point.", line->isEmpty() );
ensure( line->isSimple() );
ensure( line->isValid() );
- ensure( line->getCentroid() == 0 );
+ ensure( line->getCentroid() == nullptr );
// TODO - mloskot - waiting for some decision
// http://geos.osgeo.org/pipermail/geos-devel/2006-March/002006.html
//ensure( line->getCoordinate() == 0 );
- GeometryPtr geo = 0;
+ GeometryPtr geo = nullptr;
geo = line->getEnvelope();
- ensure( geo != 0 );
+ ensure( geo != nullptr );
ensure( geo->isEmpty() );
factory_->destroyGeometry(geo);
geo = line->getBoundary();
- ensure( geo != 0 );
+ ensure( geo != nullptr );
ensure( geo->isEmpty() );
factory_->destroyGeometry(geo);
geo = line->convexHull();
- ensure( geo != 0 );
+ ensure( geo != nullptr );
ensure( geo->isEmpty() );
factory_->destroyGeometry(geo);
@@ -586,14 +586,14 @@ reader_(factory_.get())
{
const std::size_t size = 5;
CoordArrayPtr coords = new geos::geom::CoordinateArraySequence(size);
- ensure( coords != 0 );
+ ensure( coords != nullptr );
ensure_equals( coords->getSize(), size );
LineStringPtr line = factory_->createLineString(coords);
- ensure( "createLineString() returned null pointer.", line != 0 );
+ ensure( "createLineString() returned null pointer.", line != nullptr );
ensure( "createLineString() returned empty point.", !line->isEmpty() );
ensure( line->isSimple() );
- ensure( line->getCoordinate() != 0 );
+ ensure( line->getCoordinate() != nullptr );
// TODO - mloskot - is this correct?
//ensure( line->isValid() );
@@ -622,7 +622,7 @@ reader_(factory_.get())
ensure( "createLineString() returned empty point.", !line->isEmpty() );
ensure_equals( line->getNumPoints(), size );
ensure( line->isSimple() );
- ensure( line->getCoordinate() != 0 );
+ ensure( line->getCoordinate() != nullptr );
ensure_equals( line->getGeometryTypeId(), geos::geom::GEOS_LINESTRING );
ensure_equals( line->getDimension(), geos::geom::Dimension::L );
@@ -641,17 +641,17 @@ reader_(factory_.get())
{
PolygonPtr poly = factory_->createPolygon();
- ensure( "createPolygon() returned null pointer.", poly != 0 );
+ ensure( "createPolygon() returned null pointer.", poly != nullptr );
ensure( "createPolygon() returned non-empty point.", poly->isEmpty() );
ensure( poly->isSimple() );
ensure( poly->isValid() );
- ensure( poly->getCentroid() == 0 );
+ ensure( poly->getCentroid() == nullptr );
// TODO - mloskot - waiting for some decision
// http://geos.osgeo.org/pipermail/geos-devel/2006-March/002006.html
//ensure( poly->getCoordinate() == 0 );
- GeometryPtr geo = 0;
+ GeometryPtr geo = nullptr;
// TODO - mloskot - waiting for resolution
// http://geos.osgeo.org/pipermail/geos-devel/2006-March/002011.html
//geo = poly->getEnvelope();
@@ -660,12 +660,12 @@ reader_(factory_.get())
//factory_->destroyGeometry(geo);
geo = poly->getBoundary();
- ensure( geo != 0 );
+ ensure( geo != nullptr );
ensure( geo->isEmpty() );
factory_->destroyGeometry(geo);
geo = poly->convexHull();
- ensure( geo != 0 );
+ ensure( geo != nullptr );
ensure( geo->isEmpty() );
factory_->destroyGeometry(geo);
@@ -690,7 +690,7 @@ reader_(factory_.get())
// Create sequence of coordiantes
CoordArrayPtr coords = new geos::geom::CoordinateArraySequence(size);
- ensure( coords != 0 );
+ ensure( coords != nullptr );
coords->setAt(Coordinate(0, 10), 0);
coords->setAt(Coordinate(5, 5), 1);
coords->setAt(Coordinate(10, 5), 2);
@@ -702,7 +702,7 @@ reader_(factory_.get())
// Create exterior ring
LinearRingPtr exterior = factory_->createLinearRing(coords);
- ensure( "createLinearRing returned null pointer.", exterior != 0 );
+ ensure( "createLinearRing returned null pointer.", exterior != nullptr );
ensure( "createLinearRing() returned empty point.", !exterior->isEmpty() );
ensure( exterior->isSimple() );
ensure_equals( exterior->getGeometryTypeId(), geos::geom::GEOS_LINEARRING );
@@ -713,8 +713,8 @@ reader_(factory_.get())
ensure( exterior->getLength() != 0.0 );
// Create polygon
- PolygonPtr poly = factory_->createPolygon(exterior, 0);
- ensure( "createPolygon returned null pointer.", poly != 0 );
+ PolygonPtr poly = factory_->createPolygon(exterior, nullptr);
+ ensure( "createPolygon returned null pointer.", poly != nullptr );
ensure( "createPolygon() returned empty point.", !poly->isEmpty() );
ensure( poly->isSimple() );
ensure_equals( poly->getGeometryTypeId(), geos::geom::GEOS_POLYGON );
@@ -739,7 +739,7 @@ reader_(factory_.get())
// Create sequence of coordiantes
CoordArrayPtr coords = new geos::geom::CoordinateArraySequence(exteriorSize);
- ensure( coords != 0 );
+ ensure( coords != nullptr );
coords->setAt(Coordinate(0, 10), 0);
coords->setAt(Coordinate(5, 5), 1);
coords->setAt(Coordinate(10, 5), 2);
@@ -751,7 +751,7 @@ reader_(factory_.get())
// Create exterior ring
LinearRingPtr exterior = factory_->createLinearRing(coords);
- ensure( "createLinearRing returned null pointer.", exterior != 0 );
+ ensure( "createLinearRing returned null pointer.", exterior != nullptr );
ensure( "createLinearRing() returned empty point.", !exterior->isEmpty() );
ensure( exterior->isSimple() );
ensure_equals( exterior->getGeometryTypeId(), geos::geom::GEOS_LINEARRING );
@@ -763,10 +763,10 @@ reader_(factory_.get())
// Create collection of holes
GeometryPtr geo = reader_.read(("LINEARRING(7 7, 12 7, 12 12, 7 12, 7 7)"));
- ensure( geo != 0 );
+ ensure( geo != nullptr );
LinearRingPtr hole = dynamic_cast<LinearRingPtr>(geo);
- ensure( hole != 0 );
+ ensure( hole != nullptr );
ensure( hole->isRing() );
ensure_equals( hole->getNumPoints(), interiorSize );
@@ -776,7 +776,7 @@ reader_(factory_.get())
// Create polygon using copy ctor
PolygonPtr poly = factory_->createPolygon((*exterior), holes);
- ensure( "createPolygon returned null pointer.", poly != 0 );
+ ensure( "createPolygon returned null pointer.", poly != nullptr );
ensure( "createPolygon() returned empty point.", !poly->isEmpty() );
ensure( poly->isSimple() );
ensure_equals( poly->getGeometryTypeId(), geos::geom::GEOS_POLYGON );
@@ -808,7 +808,7 @@ reader_(factory_.get())
{
GeometryColPtr col = factory_->createGeometryCollection();
- ensure( "createGeometryCollection() returned null pointer.", col != 0 );
+ ensure( "createGeometryCollection() returned null pointer.", col != nullptr );
ensure( col->isEmpty() );
ensure( col->isValid() );
@@ -820,10 +820,10 @@ reader_(factory_.get())
catch ( geos::util::IllegalArgumentException const& e )
{
const char* msg = e.what(); // ok
- ensure( msg != 0 );
+ ensure( msg != nullptr );
}
- ensure( col->getCentroid() == 0 );
+ ensure( col->getCentroid() == nullptr );
ensure_equals( col->getGeometryTypeId(), geos::geom::GEOS_GEOMETRYCOLLECTION );
ensure_equals( col->getDimension(), geos::geom::Dimension::False );
ensure_equals( col->getBoundaryDimension(), geos::geom::Dimension::False );
@@ -848,12 +848,12 @@ reader_(factory_.get())
// Add single point
Coordinate coord(x_, y_, z_);
GeometryPtr point = factory_->createPoint(coord);
- ensure( point != 0 );
+ ensure( point != nullptr );
vec->push_back(point);
// Add single LineString
CoordArrayPtr coords = new geos::geom::CoordinateArraySequence(3);
- ensure( coords != 0 );
+ ensure( coords != nullptr );
coords->setAt(Coordinate(0, 0), 0);
coords->setAt(Coordinate(5, 5), 1);
coords->setAt(Coordinate(10, 5), 2);
@@ -863,7 +863,7 @@ reader_(factory_.get())
// Create geometry collection
GeometryColPtr col = factory_->createGeometryCollection(vec);
- ensure( coords != 0 );
+ ensure( coords != nullptr );
ensure_equals( col->getGeometryTypeId(), geos::geom::GEOS_GEOMETRYCOLLECTION );
ensure_equals( col->getNumGeometries(), 2u );
@@ -881,7 +881,7 @@ reader_(factory_.get())
std::vector<GeometryPtr> vec;
- GeometryPtr geo = 0;
+ GeometryPtr geo = nullptr;
geo = factory_->createPoint(coord);
vec.push_back(geo);
@@ -899,7 +899,7 @@ reader_(factory_.get())
// Factory creates copy of the vec collection
GeometryColPtr col = factory_->createGeometryCollection(vec);
- ensure( col != 0 );
+ ensure( col != nullptr );
ensure_equals( col->getGeometryTypeId() , geos::geom::GEOS_GEOMETRYCOLLECTION );
ensure_equals( col->getNumGeometries() , size );
@@ -919,13 +919,13 @@ reader_(factory_.get())
{
MultiPointPtr mp = factory_->createMultiPoint();
- ensure( "createMultiPoint() returned null pointer.", mp != 0 );
+ ensure( "createMultiPoint() returned null pointer.", mp != nullptr );
ensure( "createMultiPoint() returned non-empty point.", mp->isEmpty() );
ensure( mp->isSimple() );
ensure( mp->isValid() );
- ensure( mp->getCentroid() == 0 );
+ ensure( mp->getCentroid() == nullptr );
- GeometryPtr geo = 0;
+ GeometryPtr geo = nullptr;
// TODO - mloskot - waiting for resolution
// http://geos.osgeo.org/pipermail/geos-devel/2006-March/002011.html
@@ -935,12 +935,12 @@ reader_(factory_.get())
//factory_->destroyGeometry(geo);
geo = mp->getBoundary();
- ensure( geo != 0 );
+ ensure( geo != nullptr );
ensure( geo->isEmpty() );
factory_->destroyGeometry(geo);
geo = mp->convexHull();
- ensure( geo != 0 );
+ ensure( geo != nullptr );
ensure( geo->isEmpty() );
factory_->destroyGeometry(geo);
@@ -965,28 +965,28 @@ reader_(factory_.get())
std::vector<GeometryPtr>* vec = new std::vector<GeometryPtr>();
- GeometryPtr geo = 0;
+ GeometryPtr geo = nullptr;
geo = factory_->createPoint(coord);
- ensure( geo != 0 );
+ ensure( geo != nullptr );
vec->push_back(geo);
coord.x *= 2;
coord.y *= 2;
coord.z *= 2;
geo = factory_->createPoint(coord);
- ensure( geo != 0 );
+ ensure( geo != nullptr );
vec->push_back(geo);
coord.x *= 3;
coord.y *= 3;
coord.z *= 3;
geo = factory_->createPoint(coord);
- ensure( geo != 0 );
+ ensure( geo != nullptr );
vec->push_back(geo);
// Factory creates copy of the vec collection
MultiPointPtr mp = factory_->createMultiPoint(vec);
- ensure( mp != 0 );
+ ensure( mp != nullptr );
ensure( mp->isValid() );
ensure( mp->isSimple() );
ensure_equals( mp->getNumGeometries(), size );
@@ -1006,7 +1006,7 @@ reader_(factory_.get())
std::vector<GeometryPtr> vec;
- GeometryPtr geo = 0;
+ GeometryPtr geo = nullptr;
geo = factory_->createPoint(coord);
vec.push_back(geo);
@@ -1024,7 +1024,7 @@ reader_(factory_.get())
// Factory creates copy of the vec collection
MultiPointPtr mp = factory_->createMultiPoint(vec);
- ensure( mp != 0 );
+ ensure( mp != nullptr );
ensure( mp->isValid() );
ensure( mp->isSimple() );
ensure_equals( mp->getNumGeometries(), size );
@@ -1055,7 +1055,7 @@ reader_(factory_.get())
ensure_equals( coords.getSize(), size );
MultiPointPtr mp = factory_->createMultiPoint(coords);
- ensure( mp != 0 );
+ ensure( mp != nullptr );
ensure( mp->isValid() );
ensure( mp->isSimple() );
ensure_equals( mp->getNumGeometries(), size );
@@ -1072,13 +1072,13 @@ reader_(factory_.get())
{
MultiLineStringPtr mls = factory_->createMultiLineString();
- ensure( "createMultiLineString() returned null pointer.", mls != 0 );
+ ensure( "createMultiLineString() returned null pointer.", mls != nullptr );
ensure( "createMultiLineString() returned non-empty point.", mls->isEmpty() );
ensure( mls->isSimple() );
ensure( mls->isValid() );
- ensure( mls->getCentroid() == 0 );
+ ensure( mls->getCentroid() == nullptr );
- GeometryPtr geo = 0;
+ GeometryPtr geo = nullptr;
// TODO - mloskot - waiting for resolution
// http://geos.osgeo.org/pipermail/geos-devel/2006-March/002011.html
@@ -1088,12 +1088,12 @@ reader_(factory_.get())
//factory_->destroyGeometry(geo);
geo = mls->getBoundary();
- ensure( geo != 0 );
+ ensure( geo != nullptr );
ensure( geo->isEmpty() );
factory_->destroyGeometry(geo);
geo = mls->convexHull();
- ensure( geo != 0 );
+ ensure( geo != nullptr );
ensure( geo->isEmpty() );
factory_->destroyGeometry(geo);
@@ -1124,7 +1124,7 @@ reader_(factory_.get())
{
const std::size_t factor = i * i;
CoordArrayPtr coords = new geos::geom::CoordinateArraySequence(lineSize);
- ensure( coords != 0 );
+ ensure( coords != nullptr );
coords->setAt(Coordinate(0. + factor, 0. + factor), 0);
coords->setAt(Coordinate(5. + factor, 5. + factor), 1);
ensure_equals( coords->getSize(), lineSize );
@@ -1133,14 +1133,14 @@ reader_(factory_.get())
ensure( "createLineString() returned empty point.", !line->isEmpty() );
ensure_equals( line->getNumPoints(), lineSize );
ensure( line->isSimple() );
- ensure( line->getCoordinate() != 0 );
+ ensure( line->getCoordinate() != nullptr );
ensure_equals( line->getGeometryTypeId(), geos::geom::GEOS_LINESTRING );
lines->push_back(line);
}
MultiLineStringPtr mls = factory_->createMultiLineString(lines);
- ensure( mls != 0 );
+ ensure( mls != nullptr );
// TODO - mloskot - why isValid() returns false?
//ensure( mls->isValid() );
ensure_equals( mls->getNumGeometries(), size );
@@ -1166,7 +1166,7 @@ reader_(factory_.get())
{
const std::size_t factor = i * i;
CoordArrayPtr coords = new geos::geom::CoordinateArraySequence(lineSize);
- ensure( coords != 0 );
+ ensure( coords != nullptr );
coords->setAt(Coordinate(0. + factor, 0. + factor), 0);
coords->setAt(Coordinate(5. + factor, 5. + factor), 1);
ensure_equals( coords->getSize(), lineSize );
@@ -1175,14 +1175,14 @@ reader_(factory_.get())
ensure( "createLineString() returned empty point.", !line->isEmpty() );
ensure_equals( line->getNumPoints(), lineSize );
ensure( line->isSimple() );
- ensure( line->getCoordinate() != 0 );
+ ensure( line->getCoordinate() != nullptr );
ensure_equals( line->getGeometryTypeId(), geos::geom::GEOS_LINESTRING );
lines.push_back(line);
}
MultiLineStringPtr mls = factory_->createMultiLineString(lines);
- ensure( mls != 0 );
+ ensure( mls != nullptr );
// TODO - mloskot - why isValid() returns false?
//ensure( mls->isValid() );
ensure_equals( mls->getNumGeometries(), size );
@@ -1256,7 +1256,7 @@ reader_(factory_.get())
PointVect vec;
- PointPtr geo = 0;
+ PointPtr geo = nullptr;
geo = factory_->createPoint(coord);
vec.push_back(geo);
@@ -1274,7 +1274,7 @@ reader_(factory_.get())
// Factory creates copy of the vec collection
GeometryAutoPtr g = factory_->buildGeometry(vec.begin(), vec.end());
- ensure( g.get() != 0 );
+ ensure( g.get() != nullptr );
ensure_equals( g->getGeometryTypeId(), geos::geom::GEOS_MULTIPOINT );
ensure_equals( g->getNumGeometries(), size );
diff --git a/tests/unit/geom/IntersectionMatrixTest.cpp b/tests/unit/geom/IntersectionMatrixTest.cpp
index b1ea7f0..5cec018 100644
--- a/tests/unit/geom/IntersectionMatrixTest.cpp
+++ b/tests/unit/geom/IntersectionMatrixTest.cpp
@@ -489,7 +489,7 @@ namespace tut
// transpose() returns 'this' pointer to transposed object
MatrixCPtr output = transposed.transpose();
- ensure( output != 0 );
+ ensure( output != nullptr );
// TODO - mloskot - waiting for equality operators
//ensure_equals( (*output), input );
diff --git a/tests/unit/geom/LineStringTest.cpp b/tests/unit/geom/LineStringTest.cpp
index 6e13b4a..af3cfd9 100644
--- a/tests/unit/geom/LineStringTest.cpp
+++ b/tests/unit/geom/LineStringTest.cpp
@@ -44,13 +44,13 @@ namespace tut
, reader_(factory_.get())
, empty_line_(factory_->createLineString(new geos::geom::CoordinateArraySequence()))
{
- assert(0 != empty_line_);
+ assert(nullptr != empty_line_);
}
~test_linestring_data()
{
factory_->destroyGeometry(empty_line_);
- empty_line_ = 0;
+ empty_line_ = nullptr;
}
};
@@ -72,7 +72,7 @@ namespace tut
// Empty sequence of coordiantes
CoordArrayPtr pseq = new geos::geom::CoordinateArraySequence();
- ensure( "sequence is null pointer.", pseq != 0 );
+ ensure( "sequence is null pointer.", pseq != nullptr );
// Create empty linstring instance
LineStringAutoPtr ls(factory_->createLineString(pseq));
@@ -93,7 +93,7 @@ namespace tut
const size_t size3 = 3;
CoordArrayPtr pseq = new geos::geom::CoordinateArraySequence();
- ensure( "sequence is null pointer.", pseq != 0 );
+ ensure( "sequence is null pointer.", pseq != nullptr );
pseq->add(Coordinate(0, 0, 0));
pseq->add(Coordinate(5, 5, 5));
@@ -111,19 +111,19 @@ namespace tut
ensure( !ls->isClosed() );
ensure( !ls->isRing() );
- GeometryPtr geo = 0;
+ GeometryPtr geo = nullptr;
geo = ls->getEnvelope();
- ensure( geo != 0 );
+ ensure( geo != nullptr );
ensure( !geo->isEmpty() );
factory_->destroyGeometry(geo);
geo = ls->getBoundary();
- ensure( geo != 0 );
+ ensure( geo != nullptr );
ensure( !geo->isEmpty() );
factory_->destroyGeometry(geo);
geo = ls->convexHull();
- ensure( geo != 0 );
+ ensure( geo != nullptr );
ensure( !geo->isEmpty() );
factory_->destroyGeometry(geo);
@@ -142,11 +142,11 @@ namespace tut
void object::test<3>()
{
// Single-element sequence of coordiantes
- CoordArrayPtr pseq = 0;
+ CoordArrayPtr pseq = nullptr;
try
{
pseq = new geos::geom::CoordinateArraySequence();
- ensure( "sequence is null pointer.", pseq != 0 );
+ ensure( "sequence is null pointer.", pseq != nullptr );
pseq->add(geos::geom::Coordinate(0, 0, 0));
ensure_equals( pseq->size(), 1u );
@@ -161,7 +161,7 @@ namespace tut
//delete pseq;
const char* msg = e.what(); // OK
- ensure( msg != 0 );
+ ensure( msg != nullptr );
}
}
@@ -176,7 +176,7 @@ namespace tut
const size_t size = 3;
CoordArrayPtr pseq = new geos::geom::CoordinateArraySequence();
- ensure( "sequence is null pointer.", pseq != 0 );
+ ensure( "sequence is null pointer.", pseq != nullptr );
pseq->add(Coordinate(0, 0, 0));
pseq->add(Coordinate(5, 5, 5));
@@ -190,7 +190,7 @@ namespace tut
// Create copy
LineStringAutoPtr copy(dynamic_cast<geos::geom::LineString*>(examplar->clone()));
- ensure( 0 != copy.get() );
+ ensure( nullptr != copy.get() );
ensure( !copy->isEmpty() );
ensure( copy->isSimple() );
@@ -199,19 +199,19 @@ namespace tut
ensure( !copy->isClosed() );
ensure( !copy->isRing() );
- GeometryPtr geo = 0;
+ GeometryPtr geo = nullptr;
geo = copy->getEnvelope();
- ensure( geo != 0 );
+ ensure( geo != nullptr );
ensure( !geo->isEmpty() );
factory_->destroyGeometry(geo);
geo = copy->getBoundary();
- ensure( geo != 0 );
+ ensure( geo != nullptr );
ensure( !geo->isEmpty() );
factory_->destroyGeometry(geo);
geo = copy->convexHull();
- ensure( geo != 0 );
+ ensure( geo != nullptr );
ensure( !geo->isEmpty() );
factory_->destroyGeometry(geo);
@@ -237,9 +237,9 @@ namespace tut
template<>
void object::test<6>()
{
- GeometryPtr geo = 0;
+ GeometryPtr geo = nullptr;
geo = empty_line_->getEnvelope();
- ensure( geo != 0 );
+ ensure( geo != nullptr );
ensure( geo->isEmpty() );
factory_->destroyGeometry(geo);
}
@@ -249,9 +249,9 @@ namespace tut
template<>
void object::test<7>()
{
- GeometryPtr geo = 0;
+ GeometryPtr geo = nullptr;
geo = empty_line_->getBoundary();
- ensure( geo != 0 );
+ ensure( geo != nullptr );
ensure( geo->isEmpty() );
factory_->destroyGeometry(geo);
}
@@ -261,9 +261,9 @@ namespace tut
template<>
void object::test<8>()
{
- GeometryPtr geo = 0;
+ GeometryPtr geo = nullptr;
geo = empty_line_->convexHull();
- ensure( geo != 0 );
+ ensure( geo != nullptr );
ensure( geo->isEmpty() );
factory_->destroyGeometry(geo);
}
@@ -322,10 +322,10 @@ namespace tut
void object::test<15>()
{
GeometryPtr geo = reader_.read("LINESTRING (0 0, 5 5, 10 5, 10 10)");
- ensure( geo != 0 );
+ ensure( geo != nullptr );
LineStringPtr line = dynamic_cast<LineStringPtr>(geo);
- ensure(line != 0);
+ ensure(line != nullptr);
ensure( !line->isEmpty() );
ensure( !line->isClosed() );
@@ -342,13 +342,13 @@ namespace tut
void object::test<16>()
{
GeometryPtr geo = reader_.read("LINESTRING (0 0, 5 5, 10 5, 10 10)");
- ensure( geo != 0 );
+ ensure( geo != nullptr );
LineStringPtr line = dynamic_cast<LineStringPtr>(geo);
- ensure(line != 0);
+ ensure(line != nullptr);
GeometryPtr envelope = line->getEnvelope();
- ensure( envelope != 0 );
+ ensure( envelope != nullptr );
ensure( !envelope->isEmpty() );
ensure_equals( envelope->getDimension(), geos::geom::Dimension::A );
@@ -364,13 +364,13 @@ namespace tut
void object::test<17>()
{
GeometryPtr geo = reader_.read("LINESTRING (0 0, 5 5, 10 5, 10 10)");
- ensure( geo != 0 );
+ ensure( geo != nullptr );
LineStringPtr line = dynamic_cast<LineStringPtr>(geo);
- ensure(line != 0);
+ ensure(line != nullptr);
GeometryPtr boundary = line->getBoundary();
- ensure( boundary != 0 );
+ ensure( boundary != nullptr );
ensure( !boundary->isEmpty() );
ensure_equals( boundary->getGeometryTypeId(), geos::geom::GEOS_MULTIPOINT );
ensure_equals( boundary->getDimension(), geos::geom::Dimension::P );
@@ -386,13 +386,13 @@ namespace tut
void object::test<18>()
{
GeometryPtr geo = reader_.read("LINESTRING (0 0, 5 5, 10 5, 10 10)");
- ensure( geo != 0 );
+ ensure( geo != nullptr );
LineStringPtr line = dynamic_cast<LineStringPtr>(geo);
- ensure(line != 0);
+ ensure(line != nullptr);
GeometryPtr hull = line->convexHull();
- ensure( hull != 0 );
+ ensure( hull != nullptr );
ensure( !hull->isEmpty() );
ensure_equals( hull->getGeometryTypeId(), geos::geom::GEOS_POLYGON );
ensure_equals( hull->getDimension(), geos::geom::Dimension::A );
@@ -408,7 +408,7 @@ namespace tut
void object::test<19>()
{
GeometryPtr geo = reader_.read("LINESTRING (0 0, 5 5, 10 5, 10 10)");
- ensure( geo != 0 );
+ ensure( geo != nullptr );
ensure_equals( geo->getGeometryTypeId(), geos::geom::GEOS_LINESTRING );
@@ -422,7 +422,7 @@ namespace tut
void object::test<20>()
{
GeometryPtr geo = reader_.read("LINESTRING (0 0, 5 5, 10 5, 10 10)");
- ensure( geo != 0 );
+ ensure( geo != nullptr );
ensure_equals( geo->getDimension(), geos::geom::Dimension::L );
@@ -436,7 +436,7 @@ namespace tut
void object::test<21>()
{
GeometryPtr geo = reader_.read("LINESTRING (0 0, 5 5, 10 5, 10 10)");
- ensure( geo != 0 );
+ ensure( geo != nullptr );
ensure_equals( geo->getBoundaryDimension(), geos::geom::Dimension::P );
@@ -451,7 +451,7 @@ namespace tut
{
const size_t size = 4;
GeometryPtr geo = reader_.read("LINESTRING (0 0, 5 5, 10 5, 10 10)");
- ensure( geo != 0 );
+ ensure( geo != nullptr );
ensure_equals( geo->getNumPoints(), size );
@@ -467,7 +467,7 @@ namespace tut
const double tolerance = 0.0001;
const double expected = 2 * 14.142135600000000;
GeometryPtr geo = reader_.read("LINESTRING (0 0, 10 10, 20 0)");
- ensure( geo != 0 );
+ ensure( geo != nullptr );
ensure( geo->getLength() != 0.0 );
@@ -484,7 +484,7 @@ namespace tut
void object::test<24>()
{
GeometryPtr geo = reader_.read("LINESTRING (0 0, 10 10, 20 0)");
- ensure( geo != 0 );
+ ensure( geo != nullptr );
ensure_equals( geo->getArea(), 0.0 );
@@ -498,7 +498,7 @@ namespace tut
void object::test<25>()
{
GeometryPtr geo = reader_.read("LINESTRING (0 0, 10 10, 20 0)");
- ensure( geo != 0 );
+ ensure( geo != nullptr );
const std::string type("LineString");
ensure_equals( geo->getGeometryType(), type );
diff --git a/tests/unit/geom/LinearRingTest.cpp b/tests/unit/geom/LinearRingTest.cpp
index 760a11f..7a7b21f 100644
--- a/tests/unit/geom/LinearRingTest.cpp
+++ b/tests/unit/geom/LinearRingTest.cpp
@@ -54,7 +54,7 @@ namespace tut
ring_size_(7)
{
// Create non-empty LinearRing
- GeometryPtr geo = 0;
+ GeometryPtr geo = nullptr;
geo = reader_.read("LINEARRING(0 10, 5 5, 10 5, 15 10, 10 15, 5 15, 0 10)");
ring_ = dynamic_cast<LinearRingPtr>(geo);
}
@@ -89,7 +89,7 @@ namespace tut
// Non-empty sequence of coordiantes
const size_t size7 = 7;
CoordArrayPtr coords = new geos::geom::CoordinateArraySequence();
- ensure( "sequence is null pointer.", coords != 0 );
+ ensure( "sequence is null pointer.", coords != nullptr );
coords->add(Coordinate(0, 10));
coords->add(Coordinate(5, 5));
@@ -175,7 +175,7 @@ namespace tut
void object::test<8>()
{
GeometryPtr envelope = empty_ring_.getEnvelope();
- ensure( envelope != 0 );
+ ensure( envelope != nullptr );
ensure( envelope->isEmpty() );
factory_->destroyGeometry(envelope);
}
@@ -186,7 +186,7 @@ namespace tut
void object::test<9>()
{
GeometryPtr boundary = empty_ring_.getBoundary();
- ensure( boundary != 0 );
+ ensure( boundary != nullptr );
ensure( boundary->isEmpty() );
factory_->destroyGeometry(boundary);
}
@@ -197,7 +197,7 @@ namespace tut
void object::test<10>()
{
GeometryPtr hull = empty_ring_.convexHull();
- ensure( hull != 0 );
+ ensure( hull != nullptr );
ensure( hull->isEmpty() );
factory_->destroyGeometry(hull);
}
@@ -255,7 +255,7 @@ namespace tut
template<>
void object::test<17>()
{
- ensure(ring_ != 0);
+ ensure(ring_ != nullptr);
ensure( !ring_->isEmpty() );
}
@@ -264,7 +264,7 @@ namespace tut
template<>
void object::test<18>()
{
- ensure(ring_ != 0);
+ ensure(ring_ != nullptr);
ensure( ring_->isClosed() );
ensure( ring_->isRing() );
}
@@ -274,10 +274,10 @@ namespace tut
template<>
void object::test<19>()
{
- ensure(ring_ != 0);
+ ensure(ring_ != nullptr);
GeometryPtr envelope = ring_->getEnvelope();
- ensure( envelope != 0 );
+ ensure( envelope != nullptr );
ensure( !envelope->isEmpty() );
ensure_equals( envelope->getDimension(), geos::geom::Dimension::A );
@@ -290,10 +290,10 @@ namespace tut
template<>
void object::test<20>()
{
- ensure(ring_ != 0);
+ ensure(ring_ != nullptr);
GeometryPtr boundary = ring_->getBoundary();
- ensure( boundary != 0 );
+ ensure( boundary != nullptr );
// OGC 05-126, Version: 1.1.0, Chapter 6.1.6 Curve
ensure( "[OGC] The boundary of a closed Curve must be empty.", boundary->isEmpty() );
@@ -307,10 +307,10 @@ namespace tut
template<>
void object::test<21>()
{
- ensure(ring_ != 0);
+ ensure(ring_ != nullptr);
GeometryPtr hull = ring_->convexHull();
- ensure( hull != 0 );
+ ensure( hull != nullptr );
ensure( !hull->isEmpty() );
ensure_equals( hull->getGeometryTypeId(), geos::geom::GEOS_POLYGON );
ensure_equals( hull->getDimension(), geos::geom::Dimension::A );
@@ -324,7 +324,7 @@ namespace tut
template<>
void object::test<22>()
{
- ensure(ring_ != 0);
+ ensure(ring_ != nullptr);
ensure_equals( ring_->getGeometryTypeId(), geos::geom::GEOS_LINEARRING );
}
@@ -333,7 +333,7 @@ namespace tut
template<>
void object::test<23>()
{
- ensure(ring_ != 0);
+ ensure(ring_ != nullptr);
ensure_equals( ring_->getDimension(), geos::geom::Dimension::L );
}
@@ -342,7 +342,7 @@ namespace tut
template<>
void object::test<24>()
{
- ensure(ring_ != 0);
+ ensure(ring_ != nullptr);
ensure_equals( ring_->getBoundaryDimension(), geos::geom::Dimension::False );
}
@@ -351,7 +351,7 @@ namespace tut
template<>
void object::test<25>()
{
- ensure(ring_ != 0);
+ ensure(ring_ != nullptr);
ensure_equals( ring_->getNumPoints(), ring_size_ );
}
@@ -360,7 +360,7 @@ namespace tut
template<>
void object::test<26>()
{
- ensure(ring_ != 0);
+ ensure(ring_ != nullptr);
ensure( ring_->getLength() != 0.0 );
const double tolerance = 0.0001;
@@ -374,7 +374,7 @@ namespace tut
template<>
void object::test<27>()
{
- ensure(ring_ != 0);
+ ensure(ring_ != nullptr);
ensure_equals( ring_->getArea(), 0.0 );
}
@@ -386,7 +386,7 @@ namespace tut
try
{
GeometryPtr geo = reader_.read("LINEARRING(0 0, 5 5, 10 10)");
- ensure(geo != 0);
+ ensure(geo != nullptr);
// FREE TESTED LINEARRING
factory_->destroyGeometry(geo);
@@ -396,7 +396,7 @@ namespace tut
catch (geos::util::IllegalArgumentException const& e)
{
const char* msg = e.what(); // ok
- ensure( msg != 0 );
+ ensure( msg != nullptr );
}
}
@@ -409,10 +409,10 @@ namespace tut
{
// Construct LinearRing self-intersecting in point (5,5)
GeometryPtr geo = reader_.read("LINEARRING(0 0, 5 5, 10 10, 15 5, 5 5, 0 10)");
- ensure(geo != 0);
+ ensure(geo != nullptr);
LinearRingPtr ring = dynamic_cast<LinearRingPtr>(geo);
- ensure(ring != 0);
+ ensure(ring != nullptr);
ensure( !ring->isValid() );
@@ -424,7 +424,7 @@ namespace tut
catch (geos::util::IllegalArgumentException const& e)
{
const char* msg = e.what(); // ok
- ensure( msg != 0 );
+ ensure( msg != nullptr );
}
}
@@ -433,7 +433,7 @@ namespace tut
template<>
void object::test<30>()
{
- ensure( ring_ != 0 );
+ ensure( ring_ != nullptr );
const std::string type("LinearRing");
ensure_equals( ring_->getGeometryType(), type );
diff --git a/tests/unit/geom/LocationTest.cpp b/tests/unit/geom/LocationTest.cpp
index 9bb9be7..05ab483 100644
--- a/tests/unit/geom/LocationTest.cpp
+++ b/tests/unit/geom/LocationTest.cpp
@@ -75,7 +75,7 @@ namespace tut
catch ( geos::util::IllegalArgumentException const& e )
{
const char* msg = e.what(); // ok
- ensure( msg != 0 );
+ ensure( msg != nullptr );
}
}
diff --git a/tests/unit/geom/MultiPointTest.cpp b/tests/unit/geom/MultiPointTest.cpp
index 0f6925a..8f592f2 100644
--- a/tests/unit/geom/MultiPointTest.cpp
+++ b/tests/unit/geom/MultiPointTest.cpp
@@ -42,7 +42,7 @@ namespace tut
, empty_mp_(factory_->createMultiPoint()), mp_size_(5)
{
// Create non-empty MultiPoint
- GeometryPtr geo = 0;
+ GeometryPtr geo = nullptr;
geo = reader_.read("MULTIPOINT(0 0, 5 5, 10 10, 15 15, 20 20)");
mp_ = dynamic_cast<MultiPointPtr>(geo);
}
@@ -78,7 +78,7 @@ namespace tut
ensure( mp->isEmpty() );
ensure( mp->isSimple() );
ensure( mp->isValid() );
- ensure( mp->getCentroid() == 0 );
+ ensure( mp->getCentroid() == nullptr );
ensure_equals( mp->getNumPoints(), size0 );
ensure_equals( mp->getNumGeometries(), size0 );
}
@@ -90,12 +90,12 @@ namespace tut
{
const size_t size0 = 0;
MultiPointAutoPtr copy(dynamic_cast<geos::geom::MultiPoint*>(empty_mp_->clone()));
- ensure( 0 != copy.get() );
+ ensure( nullptr != copy.get() );
ensure( copy->isEmpty() );
ensure( copy->isSimple() );
ensure( copy->isValid() );
- ensure( copy->getCentroid() == 0 );
+ ensure( copy->getCentroid() == nullptr );
ensure_equals( copy->getNumPoints(), size0 );
ensure_equals( copy->getNumGeometries(), size0 );
}
@@ -112,7 +112,7 @@ namespace tut
ensure( mp->isEmpty() );
ensure( mp->isSimple() );
ensure( mp->isValid() );
- ensure( mp->getCentroid() == 0 );
+ ensure( mp->getCentroid() == nullptr );
ensure_equals( mp->getNumPoints(), size0 );
ensure_equals( mp->getNumGeometries(), size0 );
@@ -150,7 +150,7 @@ namespace tut
void object::test<7>()
{
GeometryPtr envelope = empty_mp_->getEnvelope();
- ensure( envelope != 0 );
+ ensure( envelope != nullptr );
ensure( envelope->isEmpty() );
factory_->destroyGeometry(envelope);
}
@@ -161,7 +161,7 @@ namespace tut
void object::test<8>()
{
GeometryPtr boundary = empty_mp_->getBoundary();
- ensure( boundary != 0 );
+ ensure( boundary != nullptr );
ensure( boundary->isEmpty() );
factory_->destroyGeometry(boundary);
}
@@ -172,7 +172,7 @@ namespace tut
void object::test<9>()
{
GeometryPtr hull = empty_mp_->convexHull();
- ensure( hull != 0 );
+ ensure( hull != nullptr );
ensure( hull->isEmpty() );
factory_->destroyGeometry(hull);
}
@@ -239,7 +239,7 @@ namespace tut
template<>
void object::test<17>()
{
- ensure(mp_ != 0);
+ ensure(mp_ != nullptr);
ensure( !mp_->isEmpty() );
}
@@ -248,10 +248,10 @@ namespace tut
template<>
void object::test<18>()
{
- ensure(mp_ != 0);
+ ensure(mp_ != nullptr);
GeometryPtr envelope = mp_->getEnvelope();
- ensure( envelope != 0 );
+ ensure( envelope != nullptr );
ensure( !envelope->isEmpty() );
ensure_equals( envelope->getDimension(), geos::geom::Dimension::A );
@@ -264,10 +264,10 @@ namespace tut
template<>
void object::test<19>()
{
- ensure(mp_ != 0);
+ ensure(mp_ != nullptr);
GeometryPtr boundary = mp_->getBoundary();
- ensure( boundary != 0 );
+ ensure( boundary != nullptr );
// OGC 05-126, Version: 1.1.0, Chapter 6.1.5 MultiPoint
ensure( "[OGC] The boundary of a MultiPoint is the empty set.", boundary->isEmpty() );
@@ -281,10 +281,10 @@ namespace tut
template<>
void object::test<20>()
{
- ensure(mp_ != 0);
+ ensure(mp_ != nullptr);
GeometryPtr hull = mp_->convexHull();
- ensure( hull != 0 );
+ ensure( hull != nullptr );
ensure( !hull->isEmpty() );
ensure_equals( hull->getGeometryTypeId(), geos::geom::GEOS_LINESTRING );
ensure_equals( hull->getDimension(), geos::geom::Dimension::L );
@@ -298,7 +298,7 @@ namespace tut
template<>
void object::test<21>()
{
- ensure(mp_ != 0);
+ ensure(mp_ != nullptr);
ensure_equals( mp_->getGeometryTypeId(), geos::geom::GEOS_MULTIPOINT );
}
@@ -307,7 +307,7 @@ namespace tut
template<>
void object::test<22>()
{
- ensure( mp_ != 0 );
+ ensure( mp_ != nullptr );
const std::string type("MultiPoint");
ensure_equals( mp_->getGeometryType(), type );
@@ -318,7 +318,7 @@ namespace tut
template<>
void object::test<23>()
{
- ensure(mp_ != 0);
+ ensure(mp_ != nullptr);
ensure_equals( mp_->getDimension(), geos::geom::Dimension::P );
}
@@ -327,7 +327,7 @@ namespace tut
template<>
void object::test<24>()
{
- ensure(mp_ != 0);
+ ensure(mp_ != nullptr);
ensure_equals( mp_->getBoundaryDimension(), geos::geom::Dimension::False );
}
@@ -336,7 +336,7 @@ namespace tut
template<>
void object::test<25>()
{
- ensure(mp_ != 0);
+ ensure(mp_ != nullptr);
ensure_equals( mp_->getNumPoints(), mp_size_ );
}
@@ -345,7 +345,7 @@ namespace tut
template<>
void object::test<26>()
{
- ensure(mp_ != 0);
+ ensure(mp_ != nullptr);
ensure_equals( mp_->getLength(), 0.0 );
}
@@ -354,7 +354,7 @@ namespace tut
template<>
void object::test<27>()
{
- ensure(mp_ != 0);
+ ensure(mp_ != nullptr);
ensure_equals( mp_->getArea(), 0.0 );
}
@@ -366,7 +366,7 @@ namespace tut
try
{
GeometryPtr geo = reader_.read("MULTIPOINT(0 0, 5)");
- ensure(geo != 0);
+ ensure(geo != nullptr);
// FREE TESTED LINEARRING
factory_->destroyGeometry(geo);
@@ -376,7 +376,7 @@ namespace tut
catch (geos::io::ParseException const& e)
{
const char* msg = e.what(); // ok
- ensure( msg != 0 );
+ ensure( msg != nullptr );
}
}
diff --git a/tests/unit/geom/PointTest.cpp b/tests/unit/geom/PointTest.cpp
index 8996b0c..c9ab71d 100644
--- a/tests/unit/geom/PointTest.cpp
+++ b/tests/unit/geom/PointTest.cpp
@@ -49,7 +49,7 @@ namespace tut
, reader_(factory_.get()), empty_point_(factory_->createPoint())
{
// Create non-empty Point
- GeometryPtr geo = 0;
+ GeometryPtr geo = nullptr;
geo = reader_.read("POINT(1.234 5.678)");
point_ = dynamic_cast<PointPtr>(geo);
}
@@ -87,7 +87,7 @@ namespace tut
using geos::geom::CoordinateArraySequence;
CoordinateArraySequence* coords = new CoordinateArraySequence();
- ensure( coords != 0 );
+ ensure( coords != nullptr );
coords->add(Coordinate(1.234, 5.678));
PointAutoPtr point(factory_->createPoint(coords));
@@ -107,11 +107,11 @@ namespace tut
using geos::geom::CoordinateArraySequence;
// TODO - mloskot - temporary solution of Bug #89
- CoordinateArraySequence* coords = 0;
+ CoordinateArraySequence* coords = nullptr;
try
{
coords = new CoordinateArraySequence();
- ensure( coords != 0 );
+ ensure( coords != nullptr );
coords->add(Coordinate(1.234, 5.678));
coords->add(Coordinate(4.321, 8.765));
@@ -125,7 +125,7 @@ namespace tut
//delete coords;
const char* msg = e.what(); // ok
- ensure( msg != 0 );
+ ensure( msg != nullptr );
}
}
@@ -168,7 +168,7 @@ namespace tut
void object::test<8>()
{
GeometryPtr envelope = empty_point_->getEnvelope();
- ensure( envelope != 0 );
+ ensure( envelope != nullptr );
ensure( envelope->isEmpty() );
factory_->destroyGeometry(envelope);
}
@@ -179,7 +179,7 @@ namespace tut
void object::test<9>()
{
GeometryPtr boundary = empty_point_->getBoundary();
- ensure( boundary != 0 );
+ ensure( boundary != nullptr );
ensure( boundary->isEmpty() );
factory_->destroyGeometry(boundary);
}
@@ -190,7 +190,7 @@ namespace tut
void object::test<10>()
{
GeometryPtr hull = empty_point_->convexHull();
- ensure( hull != 0 );
+ ensure( hull != nullptr );
ensure( hull->isEmpty() );
factory_->destroyGeometry(hull);
}
@@ -282,7 +282,7 @@ namespace tut
void object::test<21>()
{
GeometryPtr envelope = point_->getEnvelope();
- ensure( envelope != 0 );
+ ensure( envelope != nullptr );
ensure( !envelope->isEmpty() );
factory_->destroyGeometry(envelope);
}
@@ -293,7 +293,7 @@ namespace tut
void object::test<22>()
{
GeometryPtr boundary = point_->getBoundary();
- ensure( boundary != 0 );
+ ensure( boundary != nullptr );
ensure( boundary->isEmpty() );
factory_->destroyGeometry(boundary);
}
@@ -304,7 +304,7 @@ namespace tut
void object::test<23>()
{
GeometryPtr hull = point_->convexHull();
- ensure( hull != 0 );
+ ensure( hull != nullptr );
ensure( !hull->isEmpty() );
factory_->destroyGeometry(hull);
}
diff --git a/tests/unit/geom/PolygonTest.cpp b/tests/unit/geom/PolygonTest.cpp
index 2e6b4ef..62429af 100644
--- a/tests/unit/geom/PolygonTest.cpp
+++ b/tests/unit/geom/PolygonTest.cpp
@@ -50,7 +50,7 @@ namespace tut
, empty_poly_(factory_->createPolygon()), poly_size_(7)
{
// Create non-empty LinearRing
- GeometryPtr geo = 0;
+ GeometryPtr geo = nullptr;
geo = reader_.read("POLYGON((0 10, 5 5, 10 5, 15 10, 10 15, 5 15, 0 10))");
poly_ = dynamic_cast<PolygonPtr>(geo);
}
@@ -86,7 +86,7 @@ namespace tut
// Create non-empty Coordiantes sequence for Exterior LinearRing
const size_t size = 7;
CoordArrayPtr coords = new geos::geom::CoordinateArraySequence();
- ensure( "sequence is null pointer.", coords != 0 );
+ ensure( "sequence is null pointer.", coords != nullptr );
coords->add(Coordinate(0, 10));
coords->add(Coordinate(5, 5));
@@ -113,7 +113,7 @@ namespace tut
// Create non-empty Polygon
//geos::geom::Polygon poly(exterior, 0, &factory_);
- PolygonAutoPtr poly(factory_->createPolygon(exterior, 0));
+ PolygonAutoPtr poly(factory_->createPolygon(exterior, nullptr));
ensure( !poly->isEmpty() );
ensure( poly->isSimple() );
@@ -187,7 +187,7 @@ namespace tut
void object::test<7>()
{
GeometryPtr boundary = empty_poly_->getBoundary();
- ensure( boundary != 0 );
+ ensure( boundary != nullptr );
ensure( boundary->isEmpty() );
factory_->destroyGeometry(boundary);
}
@@ -198,7 +198,7 @@ namespace tut
void object::test<8>()
{
GeometryPtr hull = empty_poly_->convexHull();
- ensure( hull != 0 );
+ ensure( hull != nullptr );
ensure( hull->isEmpty() );
factory_->destroyGeometry(hull);
}
@@ -256,7 +256,7 @@ namespace tut
template<>
void object::test<15>()
{
- ensure( poly_ != 0 );
+ ensure( poly_ != nullptr );
ensure( !poly_->isEmpty() );
}
@@ -265,10 +265,10 @@ namespace tut
template<>
void object::test<17>()
{
- ensure( poly_ != 0 );
+ ensure( poly_ != nullptr );
GeometryPtr envelope = poly_->getEnvelope();
- ensure( envelope != 0 );
+ ensure( envelope != nullptr );
ensure( !envelope->isEmpty() );
ensure_equals( envelope->getDimension(), geos::geom::Dimension::A );
@@ -281,10 +281,10 @@ namespace tut
template<>
void object::test<18>()
{
- ensure( poly_ != 0 );
+ ensure( poly_ != nullptr );
GeometryPtr boundary = poly_->getBoundary();
- ensure( boundary != 0 );
+ ensure( boundary != nullptr );
// OGC 05-126, Version: 1.1.0, Chapter 6.1.10 Surface
ensure( "[OGC] The boundary of Polygin is the set of closed Curves.", !boundary->isEmpty() );
@@ -298,10 +298,10 @@ namespace tut
template<>
void object::test<19>()
{
- ensure( poly_ != 0 );
+ ensure( poly_ != nullptr );
GeometryPtr hull = poly_->convexHull();
- ensure( hull != 0 );
+ ensure( hull != nullptr );
ensure( !hull->isEmpty() );
ensure_equals( hull->getGeometryTypeId(), geos::geom::GEOS_POLYGON );
ensure_equals( hull->getDimension(), geos::geom::Dimension::A );
@@ -315,7 +315,7 @@ namespace tut
template<>
void object::test<20>()
{
- ensure( poly_ != 0 );
+ ensure( poly_ != nullptr );
ensure_equals( poly_->getGeometryTypeId(), geos::geom::GEOS_POLYGON );
}
@@ -324,7 +324,7 @@ namespace tut
template<>
void object::test<21>()
{
- ensure( poly_ != 0 );
+ ensure( poly_ != nullptr );
ensure_equals( poly_->getDimension(), geos::geom::Dimension::A );
}
@@ -333,7 +333,7 @@ namespace tut
template<>
void object::test<22>()
{
- ensure( poly_ != 0 );
+ ensure( poly_ != nullptr );
ensure_equals( poly_->getBoundaryDimension(), geos::geom::Dimension::L );
}
@@ -342,7 +342,7 @@ namespace tut
template<>
void object::test<23>()
{
- ensure( poly_ != 0 );
+ ensure( poly_ != nullptr );
ensure_equals( poly_->getNumPoints(), poly_size_ );
}
@@ -351,7 +351,7 @@ namespace tut
template<>
void object::test<24>()
{
- ensure( poly_ != 0 );
+ ensure( poly_ != nullptr );
ensure( poly_->getLength() != 0.0 );
const double tolerance = 0.0001;
@@ -365,7 +365,7 @@ namespace tut
template<>
void object::test<25>()
{
- ensure( poly_ != 0 );
+ ensure( poly_ != nullptr );
ensure( poly_->getArea() != 0.0 );
}
@@ -374,11 +374,11 @@ namespace tut
template<>
void object::test<26>()
{
- ensure( poly_ != 0 );
+ ensure( poly_ != nullptr );
// Caller takes ownership of 'coords'
CoordSeqPtr coords = poly_->getCoordinates();
- ensure( coords != 0 );
+ ensure( coords != nullptr );
ensure( !coords->isEmpty() );
ensure_equals( coords->getSize(), poly_->getNumPoints() );
@@ -391,10 +391,10 @@ namespace tut
template<>
void object::test<27>()
{
- ensure( poly_ != 0 );
+ ensure( poly_ != nullptr );
GeometryPtr geo = poly_->clone();
- ensure( geo != 0 );
+ ensure( geo != nullptr );
ensure( geo->equals(poly_) );
factory_->destroyGeometry(geo);
@@ -405,10 +405,10 @@ namespace tut
template<>
void object::test<28>()
{
- ensure( poly_ != 0 );
+ ensure( poly_ != nullptr );
LineStringCPtr ring = poly_->getExteriorRing();
- ensure( ring != 0 );
+ ensure( ring != nullptr );
ensure( ring->isRing() );
ensure_equals( ring->getNumPoints(), poly_size_ );
}
@@ -418,7 +418,7 @@ namespace tut
template<>
void object::test<29>()
{
- ensure( poly_ != 0 );
+ ensure( poly_ != nullptr );
ensure_equals( poly_->getNumInteriorRing(), 0u );
}
@@ -429,17 +429,17 @@ namespace tut
{
const size_t holesNum = 1;
- GeometryPtr geo = 0;
+ GeometryPtr geo = nullptr;
geo = reader_.read("POLYGON ((0 0, 100 0, 100 100, 0 100, 0 0), (1 1, 1 10, 10 10, 10 1, 1 1) )");
- ensure( geo != 0 );
+ ensure( geo != nullptr );
ensure_equals( geo->getGeometryTypeId(), geos::geom::GEOS_POLYGON );
PolygonPtr poly = dynamic_cast<PolygonPtr>(geo);
- ensure( poly != 0 );
+ ensure( poly != nullptr );
ensure_equals( poly->getNumInteriorRing(), holesNum );
LineStringCPtr interior = poly->getInteriorRingN(0);
- ensure( interior != 0 );
+ ensure( interior != nullptr );
ensure( interior->isRing() );
ensure_equals( interior->getGeometryTypeId(), geos::geom::GEOS_LINEARRING );
@@ -452,11 +452,11 @@ namespace tut
template<>
void object::test<31>()
{
- ensure( poly_ != 0 );
+ ensure( poly_ != nullptr );
// "POLYGON((0 10, 5 5, 10 5, 15 10, 10 15, 5 15, 0 10))"
CoordinateCPtr coord = poly_->getCoordinate();
- ensure( coord != 0 );
+ ensure( coord != nullptr );
ensure_equals( coord->x, 0 );
ensure_equals( coord->y, 10 );
}
@@ -466,11 +466,11 @@ namespace tut
template<>
void object::test<32>()
{
- ensure( poly_ != 0 );
+ ensure( poly_ != nullptr );
// "POLYGON((0 10, 5 5, 10 5, 15 10, 10 15, 5 15, 0 10))"
CoordSeqPtr coords = poly_->getCoordinates();
- ensure( coords != 0 );
+ ensure( coords != nullptr );
ensure_equals( coords->getSize(), poly_size_ );
// Check first and last coordinates
@@ -491,7 +491,7 @@ namespace tut
template<>
void object::test<33>()
{
- ensure( poly_ != 0 );
+ ensure( poly_ != nullptr );
const std::string type("Polygon");
ensure_equals( poly_->getGeometryType(), type );
@@ -503,7 +503,7 @@ namespace tut
void object::test<34>()
{
PointPtr point = empty_poly_->getCentroid();
- ensure( point == 0 );
+ ensure( point == nullptr );
}
// Test of Geometry::getCentroid(Coordinate& ret) const for empty Polygon
@@ -522,7 +522,7 @@ namespace tut
void object::test<36>()
{
PointPtr point = poly_->getCentroid();
- ensure( point != 0 );
+ ensure( point != nullptr );
ensure( !point->isEmpty() );
ensure_equals( point->getGeometryTypeId(), geos::geom::GEOS_POINT );
@@ -547,12 +547,12 @@ namespace tut
{
// First centroid
PointPtr point = poly_->getCentroid();
- ensure( point != 0 );
+ ensure( point != nullptr );
ensure( !point->isEmpty() );
ensure_equals( point->getGeometryTypeId(), geos::geom::GEOS_POINT );
CoordinateCPtr pointCoord = point->getCoordinate();
- ensure( pointCoord != 0 );
+ ensure( pointCoord != nullptr );
geos::geom::Coordinate pointCentr(*pointCoord);
// FREE MEMORY
factory_->destroyGeometry(point);
diff --git a/tests/unit/geom/prep/PreparedGeometry/touchesTest.cpp b/tests/unit/geom/prep/PreparedGeometry/touchesTest.cpp
index 0fbf991..d6589ed 100644
--- a/tests/unit/geom/prep/PreparedGeometry/touchesTest.cpp
+++ b/tests/unit/geom/prep/PreparedGeometry/touchesTest.cpp
@@ -36,10 +36,10 @@ struct test_preparedgeometrytouches_data
test_preparedgeometrytouches_data()
: factory(GeometryFactory::create())
, reader(factory.get())
- , g1(0)
- , g2(0)
- , pg1(0)
- , pg2(0)
+ , g1(nullptr)
+ , g2(nullptr)
+ , pg1(nullptr)
+ , pg2(nullptr)
{}
~test_preparedgeometrytouches_data()
{
diff --git a/tests/unit/geom/prep/PreparedGeometryFactoryTest.cpp b/tests/unit/geom/prep/PreparedGeometryFactoryTest.cpp
index 170e7c7..8338943 100644
--- a/tests/unit/geom/prep/PreparedGeometryFactoryTest.cpp
+++ b/tests/unit/geom/prep/PreparedGeometryFactoryTest.cpp
@@ -35,12 +35,12 @@ namespace tut
geos::io::WKTReader reader_;
test_preparedgeometryfactory_data()
- : g_(0), pg_(0), pm_(1.0)
+ : g_(nullptr), pg_(nullptr), pm_(1.0)
, factory_(GeometryFactory::create(&pm_))
, reader_(factory_.get())
{
- assert(0 == g_);
- assert(0 == pg_);
+ assert(nullptr == g_);
+ assert(nullptr == pg_);
}
~test_preparedgeometryfactory_data()
@@ -48,8 +48,8 @@ namespace tut
// FREE MEMORY per test case
prep::PreparedGeometryFactory::destroy(pg_);
factory_->destroyGeometry(g_);
- pg_ = 0;
- g_ = 0;
+ pg_ = nullptr;
+ g_ = nullptr;
}
};
@@ -79,7 +79,7 @@ namespace tut
{
try
{
- GeometryPtr nullgeom = 0; // intentionally nullptr
+ GeometryPtr nullgeom = nullptr; // intentionally nullptr
prep::PreparedGeometryFactory::prepare(nullgeom);
@@ -88,7 +88,7 @@ namespace tut
catch (geos::util::IllegalArgumentException const& e)
{
const char* msg = e.what(); // ok
- ensure( msg != 0 );
+ ensure( msg != nullptr );
}
}
@@ -99,7 +99,7 @@ namespace tut
{
try
{
- GeometryPtr nullgeom = 0; // intentionally nullptr
+ GeometryPtr nullgeom = nullptr; // intentionally nullptr
prep::PreparedGeometryFactory pgf;
pgf.create(nullgeom);
@@ -109,7 +109,7 @@ namespace tut
catch (geos::util::IllegalArgumentException const& e)
{
const char* msg = e.what(); // ok
- ensure( msg != 0 );
+ ensure( msg != nullptr );
}
}
@@ -119,10 +119,10 @@ namespace tut
void object::test<4>()
{
g_ = factory_->createEmptyGeometry();
- ensure( 0 != g_ );
+ ensure( nullptr != g_ );
pg_ = prep::PreparedGeometryFactory::prepare(g_);
- ensure( 0 != pg_ );
+ ensure( nullptr != pg_ );
ensure_equals_geometry( g_, pg_ );
}
@@ -133,11 +133,11 @@ namespace tut
void object::test<5>()
{
g_ = factory_->createEmptyGeometry();
- ensure( 0 != g_ );
+ ensure( nullptr != g_ );
prep::PreparedGeometryFactory pgf;
pg_ = pgf.create(g_);
- ensure( 0 != pg_ );
+ ensure( nullptr != pg_ );
ensure_equals_geometry( g_, pg_ );
}
@@ -148,10 +148,10 @@ namespace tut
void object::test<6>()
{
g_ = factory_->createPoint();
- ensure( 0 != g_ );
+ ensure( nullptr != g_ );
pg_ = prep::PreparedGeometryFactory::prepare(g_);
- ensure( 0 != pg_ );
+ ensure( nullptr != pg_ );
ensure_equals_geometry( g_, pg_ );
}
@@ -162,11 +162,11 @@ namespace tut
void object::test<7>()
{
g_ = factory_->createPoint();
- ensure( 0 != g_ );
+ ensure( nullptr != g_ );
prep::PreparedGeometryFactory pgf;
pg_ = pgf.create(g_);
- ensure( 0 != pg_ );
+ ensure( nullptr != pg_ );
ensure_equals_geometry( g_, pg_ );
}
@@ -177,10 +177,10 @@ namespace tut
void object::test<8>()
{
g_ = factory_->createLineString();
- ensure( 0 != g_ );
+ ensure( nullptr != g_ );
pg_ = prep::PreparedGeometryFactory::prepare(g_);
- ensure( 0 != pg_ );
+ ensure( nullptr != pg_ );
ensure_equals_geometry( g_, pg_ );
}
@@ -191,7 +191,7 @@ namespace tut
void object::test<9>()
{
g_ = factory_->createLineString();
- ensure( 0 != g_ );
+ ensure( nullptr != g_ );
prep::PreparedGeometryFactory pgf;
pg_ = pgf.create(g_);
@@ -205,10 +205,10 @@ namespace tut
void object::test<10>()
{
g_ = factory_->createPolygon();
- ensure( 0 != g_ );
+ ensure( nullptr != g_ );
pg_ = prep::PreparedGeometryFactory::prepare(g_);
- ensure( 0 != pg_ );
+ ensure( nullptr != pg_ );
ensure_equals_geometry( g_, pg_ );
}
@@ -219,11 +219,11 @@ namespace tut
void object::test<11>()
{
g_ = factory_->createPolygon();
- ensure( 0 != g_ );
+ ensure( nullptr != g_ );
prep::PreparedGeometryFactory pgf;
pg_ = pgf.create(g_);
- ensure( 0 != pg_ );
+ ensure( nullptr != pg_ );
ensure_equals_geometry( g_, pg_ );
}
@@ -234,10 +234,10 @@ namespace tut
void object::test<12>()
{
g_ = factory_->createMultiPoint();
- ensure( 0 != g_ );
+ ensure( nullptr != g_ );
pg_ = prep::PreparedGeometryFactory::prepare(g_);
- ensure( 0 != pg_ );
+ ensure( nullptr != pg_ );
ensure_equals_geometry( g_, pg_ );
}
@@ -248,11 +248,11 @@ namespace tut
void object::test<13>()
{
g_ = factory_->createMultiPoint();
- ensure( 0 != g_ );
+ ensure( nullptr != g_ );
prep::PreparedGeometryFactory pgf;
pg_ = pgf.create(g_);
- ensure( 0 != pg_ );
+ ensure( nullptr != pg_ );
ensure_equals_geometry( g_, pg_ );
}
@@ -263,10 +263,10 @@ namespace tut
void object::test<14>()
{
g_ = factory_->createMultiLineString();
- ensure( 0 != g_ );
+ ensure( nullptr != g_ );
pg_ = prep::PreparedGeometryFactory::prepare(g_);
- ensure( 0 != pg_ );
+ ensure( nullptr != pg_ );
ensure_equals_geometry( g_, pg_ );
}
@@ -277,11 +277,11 @@ namespace tut
void object::test<15>()
{
g_ = factory_->createMultiLineString();
- ensure( 0 != g_ );
+ ensure( nullptr != g_ );
prep::PreparedGeometryFactory pgf;
pg_ = pgf.create(g_);
- ensure( 0 != pg_ );
+ ensure( nullptr != pg_ );
ensure_equals_geometry( g_, pg_ );
}
@@ -292,10 +292,10 @@ namespace tut
void object::test<16>()
{
g_ = factory_->createMultiPolygon();
- ensure( 0 != g_ );
+ ensure( nullptr != g_ );
pg_ = prep::PreparedGeometryFactory::prepare(g_);
- ensure( 0 != pg_ );
+ ensure( nullptr != pg_ );
ensure_equals_geometry( g_, pg_ );
}
@@ -306,11 +306,11 @@ namespace tut
void object::test<17>()
{
g_ = factory_->createMultiPolygon();
- ensure( 0 != g_ );
+ ensure( nullptr != g_ );
prep::PreparedGeometryFactory pgf;
pg_ = pgf.create(g_);
- ensure( 0 != pg_ );
+ ensure( nullptr != pg_ );
ensure_equals_geometry( g_, pg_ );
}
@@ -321,10 +321,10 @@ namespace tut
void object::test<18>()
{
g_ = reader_.read("POINT(1.234 5.678)");
- ensure( 0 != g_ );
+ ensure( nullptr != g_ );
pg_ = prep::PreparedGeometryFactory::prepare(g_);
- ensure( 0 != pg_ );
+ ensure( nullptr != pg_ );
ensure_equals_geometry( g_, pg_ );
}
@@ -335,11 +335,11 @@ namespace tut
void object::test<19>()
{
g_ = reader_.read("POINT(1.234 5.678)");
- ensure( 0 != g_ );
+ ensure( nullptr != g_ );
prep::PreparedGeometryFactory pgf;
pg_ = pgf.create(g_);
- ensure( 0 != pg_ );
+ ensure( nullptr != pg_ );
ensure_equals_geometry( g_, pg_ );
}
@@ -350,10 +350,10 @@ namespace tut
void object::test<20>()
{
g_ = reader_.read("LINESTRING (0 0, 5 5, 10 5, 10 10)");
- ensure( 0 != g_ );
+ ensure( nullptr != g_ );
pg_ = prep::PreparedGeometryFactory::prepare(g_);
- ensure( 0 != pg_ );
+ ensure( nullptr != pg_ );
ensure_equals_geometry( g_, pg_ );
}
@@ -364,11 +364,11 @@ namespace tut
void object::test<21>()
{
g_ = reader_.read("LINESTRING (0 0, 5 5, 10 5, 10 10)");
- ensure( 0 != g_ );
+ ensure( nullptr != g_ );
prep::PreparedGeometryFactory pgf;
pg_ = pgf.create(g_);
- ensure( 0 != pg_ );
+ ensure( nullptr != pg_ );
ensure_equals_geometry( g_, pg_ );
}
@@ -379,10 +379,10 @@ namespace tut
void object::test<22>()
{
g_ = reader_.read("POLYGON((0 10, 5 5, 10 5, 15 10, 10 15, 5 15, 0 10))");
- ensure( 0 != g_ );
+ ensure( nullptr != g_ );
pg_ = prep::PreparedGeometryFactory::prepare(g_);
- ensure( 0 != pg_ );
+ ensure( nullptr != pg_ );
ensure_equals_geometry( g_, pg_ );
}
@@ -393,11 +393,11 @@ namespace tut
void object::test<23>()
{
g_ = reader_.read("POLYGON((0 10, 5 5, 10 5, 15 10, 10 15, 5 15, 0 10))");
- ensure( 0 != g_ );
+ ensure( nullptr != g_ );
prep::PreparedGeometryFactory pgf;
pg_ = pgf.create(g_);
- ensure( 0 != pg_ );
+ ensure( nullptr != pg_ );
ensure_equals_geometry( g_, pg_ );
}
@@ -408,10 +408,10 @@ namespace tut
void object::test<24>()
{
g_ = reader_.read("MULTIPOINT(0 0, 5 5, 10 10, 15 15, 20 20)");
- ensure( 0 != g_ );
+ ensure( nullptr != g_ );
pg_ = prep::PreparedGeometryFactory::prepare(g_);
- ensure( 0 != pg_ );
+ ensure( nullptr != pg_ );
ensure_equals_geometry( g_, pg_ );
}
@@ -422,11 +422,11 @@ namespace tut
void object::test<25>()
{
g_ = reader_.read("MULTIPOINT(0 0, 5 5, 10 10, 15 15, 20 20)");
- ensure( 0 != g_ );
+ ensure( nullptr != g_ );
prep::PreparedGeometryFactory pgf;
pg_ = pgf.create(g_);
- ensure( 0 != pg_ );
+ ensure( nullptr != pg_ );
ensure_equals_geometry( g_, pg_ );
}
@@ -437,10 +437,10 @@ namespace tut
void object::test<26>()
{
g_ = reader_.read("MULTILINESTRING ((20 120, 120 20), (20 20, 120 120))");
- ensure( 0 != g_ );
+ ensure( nullptr != g_ );
pg_ = prep::PreparedGeometryFactory::prepare(g_);
- ensure( 0 != pg_ );
+ ensure( nullptr != pg_ );
ensure_equals_geometry( g_, pg_ );
}
@@ -451,11 +451,11 @@ namespace tut
void object::test<27>()
{
g_ = reader_.read("MULTILINESTRING ((20 120, 120 20), (20 20, 120 120))");
- ensure( 0 != g_ );
+ ensure( nullptr != g_ );
prep::PreparedGeometryFactory pgf;
pg_ = pgf.create(g_);
- ensure( 0 != pg_ );
+ ensure( nullptr != pg_ );
ensure_equals_geometry( g_, pg_ );
}
@@ -466,10 +466,10 @@ namespace tut
void object::test<28>()
{
g_ = reader_.read("MULTIPOLYGON(((0 0, 10 0, 10 10, 0 10, 0 0),(2 2, 2 6, 6 4, 2 2)),((60 60, 60 50, 70 40, 60 60)))");
- ensure( 0 != g_ );
+ ensure( nullptr != g_ );
pg_ = prep::PreparedGeometryFactory::prepare(g_);
- ensure( 0 != pg_ );
+ ensure( nullptr != pg_ );
ensure_equals_geometry( g_, pg_ );
}
@@ -480,11 +480,11 @@ namespace tut
void object::test<29>()
{
g_ = reader_.read("MULTIPOLYGON(((0 0, 10 0, 10 10, 0 10, 0 0),(2 2, 2 6, 6 4, 2 2)),((60 60, 60 50, 70 40, 60 60)))");
- ensure( 0 != g_ );
+ ensure( nullptr != g_ );
prep::PreparedGeometryFactory pgf;
pg_ = pgf.create(g_);
- ensure( 0 != pg_ );
+ ensure( nullptr != pg_ );
ensure_equals_geometry( g_, pg_ );
}
diff --git a/tests/unit/io/WKBWriterTest.cpp b/tests/unit/io/WKBWriterTest.cpp
index 5b3399d..3d94c60 100644
--- a/tests/unit/io/WKBWriterTest.cpp
+++ b/tests/unit/io/WKBWriterTest.cpp
@@ -64,14 +64,14 @@ namespace tut
wkbwriter.setOutputDimension( 3 );
wkbwriter.write( *geom, result_stream );
delete geom;
- geom = NULL;
+ geom = nullptr;
ensure( result_stream.str().length() == 21 );
result_stream.seekg( 0 );
geom = wkbreader.read( result_stream );
- ensure( geom != NULL );
+ ensure( geom != nullptr );
ensure( geom->getCoordinateDimension() == 2 );
ensure( geom->getCoordinate()->x == -117.0 );
@@ -92,7 +92,7 @@ namespace tut
wkbwriter.setOutputDimension( 3 );
wkbwriter.write( *geom, result_stream );
delete geom;
- geom = NULL;
+ geom = nullptr;
ensure( result_stream.str().length() == 29 );
@@ -118,7 +118,7 @@ namespace tut
wkbwriter.setOutputDimension( 2 );
wkbwriter.write( *geom, result_stream );
delete geom;
- geom = NULL;
+ geom = nullptr;
ensure( result_stream.str().length() == 21 );
diff --git a/tests/unit/noding/BasicSegmentStringTest.cpp b/tests/unit/noding/BasicSegmentStringTest.cpp
index db8e97f..e773514 100644
--- a/tests/unit/noding/BasicSegmentStringTest.cpp
+++ b/tests/unit/noding/BasicSegmentStringTest.cpp
@@ -30,7 +30,7 @@ namespace tut
const geos::geom::CoordinateSequenceFactory* csFactory;
SegmentStringAutoPtr
- makeSegmentString(geos::geom::CoordinateSequence* cs, void *d = 0)
+ makeSegmentString(geos::geom::CoordinateSequence* cs, void *d = nullptr)
{
return SegmentStringAutoPtr(
new geos::noding::BasicSegmentString(cs, d)
@@ -65,7 +65,7 @@ namespace tut
{
CoordinateSequenceAutoPtr cs(csFactory->create((size_t)0, 2));
- ensure(0 != cs.get());
+ ensure(nullptr != cs.get());
geos::geom::Coordinate c0(0, 0);
geos::geom::Coordinate c1(0, 0);
@@ -76,11 +76,11 @@ namespace tut
ensure_equals(cs->size(), 2u);
SegmentStringAutoPtr ss(makeSegmentString(cs.get()));
- ensure(0 != ss.get());
+ ensure(nullptr != ss.get());
ensure_equals(ss->size(), 2u);
- ensure_equals(ss->getData(), (void*)0);
+ ensure_equals(ss->getData(), (void*)nullptr);
ensure_equals(ss->getCoordinates(), cs.get());
@@ -108,7 +108,7 @@ namespace tut
{
CoordinateSequenceAutoPtr cs(csFactory->create((size_t)0, 2));
- ensure(0 != cs.get());
+ ensure(nullptr != cs.get());
geos::geom::Coordinate c0(0, 0);
geos::geom::Coordinate c1(1, 0);
@@ -119,11 +119,11 @@ namespace tut
ensure_equals(cs->size(), 2u);
SegmentStringAutoPtr ss(makeSegmentString(cs.get()));
- ensure(0 != ss.get());
+ ensure(nullptr != ss.get());
ensure_equals(ss->size(), 2u);
- ensure_equals(ss->getData(), (void*)0);
+ ensure_equals(ss->getData(), (void*)nullptr);
ensure_equals(ss->getCoordinates(), cs.get());
@@ -144,7 +144,7 @@ namespace tut
{
CoordinateSequenceAutoPtr cs(csFactory->create((size_t)0, 2));
- ensure(0 != cs.get());
+ ensure(nullptr != cs.get());
geos::geom::Coordinate c0(0, 0);
geos::geom::Coordinate c1(1, 0);
@@ -158,11 +158,11 @@ namespace tut
ensure_equals(cs->size(), 4u);
SegmentStringAutoPtr ss(makeSegmentString(cs.get()));
- ensure(0 != ss.get());
+ ensure(nullptr != ss.get());
ensure_equals(ss->size(), 4u);
- ensure_equals(ss->getData(), (void*)0);
+ ensure_equals(ss->getData(), (void*)nullptr);
ensure_equals(ss->getCoordinates(), cs.get());
diff --git a/tests/unit/noding/NodedSegmentStringTest.cpp b/tests/unit/noding/NodedSegmentStringTest.cpp
index f89f7e1..8c17ce1 100644
--- a/tests/unit/noding/NodedSegmentStringTest.cpp
+++ b/tests/unit/noding/NodedSegmentStringTest.cpp
@@ -30,7 +30,7 @@ namespace tut
const geos::geom::CoordinateSequenceFactory* csFactory;
SegmentStringAutoPtr
- makeSegmentString(geos::geom::CoordinateSequence* cs, void *d = 0)
+ makeSegmentString(geos::geom::CoordinateSequence* cs, void *d = nullptr)
{
return SegmentStringAutoPtr(
new geos::noding::NodedSegmentString(cs, d)
@@ -65,7 +65,7 @@ namespace tut
{
CoordinateSequenceAutoPtr cs(csFactory->create((size_t)0, 2));
- ensure(0 != cs.get());
+ ensure(nullptr != cs.get());
geos::geom::Coordinate c0(0, 0);
geos::geom::Coordinate c1(0, 0);
@@ -76,11 +76,11 @@ namespace tut
ensure_equals(cs->size(), 2u);
SegmentStringAutoPtr ss(makeSegmentString(cs.release()));
- ensure(0 != ss.get());
+ ensure(nullptr != ss.get());
ensure_equals(ss->size(), 2u);
- ensure_equals(ss->getData(), (void*)0);
+ ensure_equals(ss->getData(), (void*)nullptr);
ensure_equals(ss->getCoordinate(0), c0);
@@ -100,7 +100,7 @@ namespace tut
{
CoordinateSequenceAutoPtr cs(csFactory->create((size_t)0, 2));
- ensure(0 != cs.get());
+ ensure(nullptr != cs.get());
geos::geom::Coordinate c0(0, 0);
geos::geom::Coordinate c1(1, 0);
@@ -111,11 +111,11 @@ namespace tut
ensure_equals(cs->size(), 2u);
SegmentStringAutoPtr ss(makeSegmentString(cs.release()));
- ensure(0 != ss.get());
+ ensure(nullptr != ss.get());
ensure_equals(ss->size(), 2u);
- ensure_equals(ss->getData(), (void*)0);
+ ensure_equals(ss->getData(), (void*)nullptr);
ensure_equals(ss->getCoordinate(0), c0);
@@ -135,7 +135,7 @@ namespace tut
{
CoordinateSequenceAutoPtr cs(csFactory->create((size_t)0, 2));
- ensure(0 != cs.get());
+ ensure(nullptr != cs.get());
geos::geom::Coordinate c0(0, 0);
geos::geom::Coordinate c1(1, 0);
@@ -149,11 +149,11 @@ namespace tut
ensure_equals(cs->size(), 4u);
SegmentStringAutoPtr ss(makeSegmentString(cs.release()));
- ensure(0 != ss.get());
+ ensure(nullptr != ss.get());
ensure_equals(ss->size(), 4u);
- ensure_equals(ss->getData(), (void*)0);
+ ensure_equals(ss->getData(), (void*)nullptr);
ensure_equals(ss->getCoordinate(0), c0);
diff --git a/tests/unit/noding/SegmentNodeTest.cpp b/tests/unit/noding/SegmentNodeTest.cpp
index 05712a3..b9a87d8 100644
--- a/tests/unit/noding/SegmentNodeTest.cpp
+++ b/tests/unit/noding/SegmentNodeTest.cpp
@@ -56,7 +56,7 @@ namespace tut
const size_t coords_size = 2;
CoordSeqPtr cs( factory_->create((size_t)0, coords_size) );
- ensure( 0 != cs.get() );
+ ensure( nullptr != cs.get() );
Coordinate c0(0, 0);
Coordinate c1(3, 3);
@@ -67,7 +67,7 @@ namespace tut
// Create SegmentString instance
- NodedSegmentString segment(cs.release(), 0);
+ NodedSegmentString segment(cs.release(), nullptr);
ensure_equals( segment.size(), coords_size );
@@ -104,7 +104,7 @@ namespace tut
const size_t coords_size = 2;
CoordSeqPtr cs( factory_->create((size_t)0, coords_size) );
- ensure( 0 != cs.get() );
+ ensure( nullptr != cs.get() );
Coordinate c0(0, 0);
Coordinate c1(3, 3);
@@ -115,7 +115,7 @@ namespace tut
// Create SegmentString instance
- NodedSegmentString segment(cs.release(), 0);
+ NodedSegmentString segment(cs.release(), nullptr);
ensure_equals( segment.size(), coords_size );
@@ -146,7 +146,7 @@ namespace tut
const size_t coords_size = 2;
CoordSeqPtr cs( factory_->create((size_t)0, coords_size) );
- ensure( 0 != cs.get() );
+ ensure( nullptr != cs.get() );
Coordinate c0(0, 0);
Coordinate c1(3, 3);
@@ -157,7 +157,7 @@ namespace tut
// Create SegmentString instance
- NodedSegmentString segment(cs.release(), 0);
+ NodedSegmentString segment(cs.release(), nullptr);
ensure_equals( segment.size(), coords_size );
@@ -188,7 +188,7 @@ namespace tut
const size_t coords_size = 2;
CoordSeqPtr cs( factory_->create((size_t)0, coords_size) );
- ensure( 0 != cs.get() );
+ ensure( nullptr != cs.get() );
Coordinate c0(0, 0);
Coordinate c1(3, 3);
@@ -199,7 +199,7 @@ namespace tut
// Create SegmentString instance
- NodedSegmentString segment(cs.release(), 0);
+ NodedSegmentString segment(cs.release(), nullptr);
ensure_equals( segment.size(), coords_size );
diff --git a/tests/unit/noding/snapround/MCIndexSnapRounderTest.cpp b/tests/unit/noding/snapround/MCIndexSnapRounderTest.cpp
index ee5af63..6edc913 100644
--- a/tests/unit/noding/snapround/MCIndexSnapRounderTest.cpp
+++ b/tests/unit/noding/snapround/MCIndexSnapRounderTest.cpp
@@ -75,7 +75,7 @@ namespace tut
void getSegmentStrings(const Geometry& g, SegStrVct& vct)
{
CoordSeqPtr s ( g.getCoordinates() );
- vct.push_back( new NodedSegmentString(s.release(), 0) );
+ vct.push_back( new NodedSegmentString(s.release(), nullptr) );
}
GeomPtr readGeometry(const std::string& wkt)
diff --git a/tests/unit/operation/buffer/BufferBuilderTest.cpp b/tests/unit/operation/buffer/BufferBuilderTest.cpp
index 26ee047..6e44d8b 100644
--- a/tests/unit/operation/buffer/BufferBuilderTest.cpp
+++ b/tests/unit/operation/buffer/BufferBuilderTest.cpp
@@ -83,7 +83,7 @@ namespace tut
double const distance = 5;
GeomPtr g0(wktreader.read(wkt0));
- ensure(0 != g0.get());
+ ensure(nullptr != g0.get());
ensure_equals(g0->getNumPoints(), std::size_t(5));
BufferParameters params;
@@ -98,7 +98,7 @@ namespace tut
// left-side
{
GeomPtr gB(builder.bufferLineSingleSided(g0.get(), distance, true));
- ensure(0 != gB.get());
+ ensure(nullptr != gB.get());
ensure_equals(gB->getGeometryTypeId(), geos::geom::GEOS_LINESTRING);
// Left-side offset curve expected with 5+ vertices
ensure(gB->getNumPoints() >= g0->getNumPoints());
@@ -113,7 +113,7 @@ namespace tut
// right-side
{
GeomPtr gB(builder.bufferLineSingleSided(g0.get(), distance, false));
- ensure(0 != gB.get());
+ ensure(nullptr != gB.get());
ensure_equals(gB->getGeometryTypeId(), geos::geom::GEOS_LINESTRING);
// Right-side offset curve expected with 5+ vertices
ensure(gB->getNumPoints() >= g0->getNumPoints());
diff --git a/tests/unit/operation/distance/DistanceOpTest.cpp b/tests/unit/operation/distance/DistanceOpTest.cpp
index 22914a4..0e31553 100644
--- a/tests/unit/operation/distance/DistanceOpTest.cpp
+++ b/tests/unit/operation/distance/DistanceOpTest.cpp
@@ -220,7 +220,7 @@ namespace tut
ensure_equals(dist.distance(), 0);
- ensure_equals(dist.closestPoints(), (void*)0);
+ ensure_equals(dist.closestPoints(), (void*)nullptr);
}
template<>
@@ -398,7 +398,7 @@ namespace tut
ensure_equals(dist.distance(), 0);
- ensure_equals(dist.closestPoints(), (void*)0);
+ ensure_equals(dist.closestPoints(), (void*)nullptr);
}
diff --git a/tests/unit/operation/linemerge/LineMergerTest.cpp b/tests/unit/operation/linemerge/LineMergerTest.cpp
index 707d1ba..8f9169a 100644
--- a/tests/unit/operation/linemerge/LineMergerTest.cpp
+++ b/tests/unit/operation/linemerge/LineMergerTest.cpp
@@ -41,7 +41,7 @@ namespace tut
LineVect* mrgGeoms;
test_linemerger_data()
- : wktreader(), wktwriter(), mrgGeoms(0)
+ : wktreader(), wktwriter(), mrgGeoms(nullptr)
{
wktwriter.setTrim(true);
}
@@ -152,10 +152,10 @@ namespace tut
const char* inpWKT[] = {
"LINESTRING (120 120, 180 140)", "LINESTRING (200 180, 180 140)",
"LINESTRING (200 180, 240 180)",
- NULL };
+ nullptr };
const char* expWKT[] = {
"LINESTRING (120 120, 180 140, 200 180, 240 180)",
- NULL };
+ nullptr };
doTest(inpWKT, expWKT);
}
@@ -172,12 +172,12 @@ namespace tut
"LINESTRING (40 320, 60 320, 80 340)",
"LINESTRING (160 320, 180 340, 200 320)",
"LINESTRING (200 320, 180 300, 160 320)",
- NULL };
+ nullptr };
const char* expWKT[] = {
"LINESTRING (160 320, 180 340, 200 320, 180 300, 160 320)",
"LINESTRING (40 320, 20 340, 0 320, 20 300, 40 320)",
"LINESTRING (40 320, 60 320, 80 340, 120 300, 140 320, 160 320)",
- NULL };
+ nullptr };
doTest(inpWKT, expWKT);
}
@@ -188,10 +188,10 @@ namespace tut
{
const char* inpWKT[] = {
"LINESTRING (0 0, 100 100)", "LINESTRING (0 100, 100 0)",
- NULL };
+ nullptr };
const char* expWKT[] = {
"LINESTRING (0 0, 100 100)", "LINESTRING (0 100, 100 0)",
- NULL };
+ nullptr };
doTest(inpWKT, expWKT);
}
@@ -202,9 +202,9 @@ namespace tut
const char* inpWKT[] = {
"LINESTRING EMPTY",
"LINESTRING EMPTY",
- NULL };
+ nullptr };
const char* expWKT[] = {
- NULL };
+ nullptr };
doTest(inpWKT, expWKT);
}
@@ -214,9 +214,9 @@ namespace tut
void object::test<5>()
{
const char* inpWKT[] = {
- NULL };
+ nullptr };
const char* expWKT[] = {
- NULL };
+ nullptr };
doTest(inpWKT, expWKT);
}
@@ -227,9 +227,9 @@ namespace tut
{
const char* inpWKT[] = {
"LINESTRING (10642 31441, 10642 31441)",
- NULL };
+ nullptr };
const char* expWKT[] = {
- NULL };
+ nullptr };
doTest(inpWKT, expWKT);
}
@@ -243,10 +243,10 @@ namespace tut
"LINESTRING(0 5, 5 5)",
"LINESTRING(5 5, 5 0)",
"LINESTRING(5 0, 0 0)",
- NULL };
+ nullptr };
const char* expWKT[] = {
"LINESTRING(0 0, 0 5, 5 5, 5 0, 0 0)",
- NULL };
+ nullptr };
doTest(inpWKT, expWKT);
}
diff --git a/tests/unit/operation/linemerge/LineSequencerTest.cpp b/tests/unit/operation/linemerge/LineSequencerTest.cpp
index a34ec88..0532540 100644
--- a/tests/unit/operation/linemerge/LineSequencerTest.cpp
+++ b/tests/unit/operation/linemerge/LineSequencerTest.cpp
@@ -123,7 +123,7 @@ namespace tut
"LINESTRING ( 0 0, 0 10 )",
"LINESTRING ( 0 20, 0 30 )",
"LINESTRING ( 0 10, 0 20 )",
- NULL };
+ nullptr };
const char* expWKT =
"MULTILINESTRING ((0 0, 0 10), (0 10, 0 20), (0 20, 0 30))";
@@ -137,7 +137,7 @@ namespace tut
const char* inpWKT[] = {
"LINESTRING ( 0 0, 0 10 )",
"LINESTRING ( 0 10, 0 0 )",
- NULL };
+ nullptr };
const char* expWKT =
"MULTILINESTRING ((0 0, 0 10), (0 10, 0 0))";
runLineSequencer(inpWKT, expWKT);
@@ -152,7 +152,7 @@ namespace tut
"LINESTRING ( 0 20, 0 30 )",
"LINESTRING ( 0 30, 0 00 )",
"LINESTRING ( 0 10, 0 20 )",
- NULL };
+ nullptr };
const char* expWKT =
"MULTILINESTRING ((0 0, 0 10), (0 10, 0 20), (0 20, 0 30), (0 30, 0 0))";
runLineSequencer(inpWKT, expWKT);
@@ -167,7 +167,7 @@ namespace tut
"LINESTRING ( 0 10, 0 0 )",
"LINESTRING ( 0 0, 0 20 )",
"LINESTRING ( 0 20, 0 0 )",
- NULL };
+ nullptr };
const char* expWKT =
"MULTILINESTRING ((0 10, 0 0), (0 0, 0 20), (0 20, 0 0), (0 0, 0 10))";
runLineSequencer(inpWKT, expWKT);
@@ -187,7 +187,7 @@ namespace tut
"LINESTRING ( 0 20, 10 20 )",
"LINESTRING ( 10 20, 30 30 )",
- NULL };
+ nullptr };
const char* expWKT = "";
runLineSequencer(inpWKT, expWKT);
}
@@ -200,7 +200,7 @@ namespace tut
"LINESTRING ( 0 0, 0 10 )",
"LINESTRING ( 0 10, 10 10 )",
"LINESTRING ( 10 10, 10 20, 0 10 )",
- NULL };
+ nullptr };
const char* expWKT =
"MULTILINESTRING ((0 0, 0 10), (0 10, 10 10), (10 10, 10 20, 0 10))";
runLineSequencer(inpWKT, expWKT);
@@ -215,7 +215,7 @@ namespace tut
"LINESTRING ( 0 10, 10 10, 10 20, 0 10 )",
"LINESTRING ( 0 30, 0 20 )",
"LINESTRING ( 0 20, 0 10 )",
- NULL };
+ nullptr };
const char* expWKT =
"MULTILINESTRING ((0 0, 0 10), (0 10, 10 10, 10 20, 0 10), (0 10, 0 20), (0 20, 0 30))";
runLineSequencer(inpWKT, expWKT);
@@ -232,7 +232,7 @@ namespace tut
"LINESTRING ( 0 20, 0 10 )",
"LINESTRING ( 0 60, 0 50 )",
"LINESTRING ( 0 40, 0 50 )",
- NULL };
+ nullptr };
const char* expWKT =
"MULTILINESTRING ((0 0, 0 10), (0 10, 10 10, 10 20, 0 10), (0 10, 0 20), (0 20, 0 30), (0 40, 0 50), (0 50, 0 60))";
runLineSequencer(inpWKT, expWKT);
@@ -250,7 +250,7 @@ namespace tut
"LINESTRING ( 0 20, 0 10 )",
"LINESTRING ( 0 60, 0 50 )",
"LINESTRING ( 0 40, 0 50 )",
- NULL };
+ nullptr };
const char* expWKT =
"MULTILINESTRING ((0 0, 0 10), (0 10, 40 40, 40 20, 0 10), (0 10, 10 10, 10 20, 0 10), (0 10, 0 20), (0 20, 0 30), (0 40, 0 50), (0 50, 0 60))";
diff --git a/tests/unit/operation/polygonize/PolygonizeTest.cpp b/tests/unit/operation/polygonize/PolygonizeTest.cpp
index c10eb39..f22e354 100644
--- a/tests/unit/operation/polygonize/PolygonizeTest.cpp
+++ b/tests/unit/operation/polygonize/PolygonizeTest.cpp
@@ -154,11 +154,11 @@ namespace tut
static char const* const inp[] = {
"LINESTRING EMPTY",
"LINESTRING EMPTY",
- NULL
+ nullptr
};
static char const* const exp[] = {
- NULL
+ nullptr
};
doTest(inp, exp);
@@ -172,13 +172,13 @@ namespace tut
static char const* const inp[] = {
"LINESTRING (100 180, 20 20, 160 20, 100 180)",
"LINESTRING (100 180, 80 60, 120 60, 100 180)",
- NULL
+ nullptr
};
static char const* const exp[] = {
"POLYGON ((100 180, 120 60, 80 60, 100 180))",
"POLYGON ((100 180, 160 20, 20 20, 100 180), (100 180, 80 60, 120 60, 100 180))",
- NULL
+ nullptr
};
doTest(inp, exp);
diff --git a/tests/unit/operation/union/CascadedPolygonUnionTest.cpp b/tests/unit/operation/union/CascadedPolygonUnionTest.cpp
index dadba85..de3a55a 100644
--- a/tests/unit/operation/union/CascadedPolygonUnionTest.cpp
+++ b/tests/unit/operation/union/CascadedPolygonUnionTest.cpp
@@ -105,11 +105,11 @@ namespace tut
"POLYGON ((80 260, 200 260, 200 30, 80 30, 80 260))",
"POLYGON ((30 180, 300 180, 300 110, 30 110, 30 180))",
"POLYGON ((30 280, 30 150, 140 150, 140 280, 30 280))",
- NULL
+ nullptr
};
std::vector<geos::geom::Polygon*> g;
- for (char const* const* p = polygons; *p != NULL; ++p)
+ for (char const* const* p = polygons; *p != nullptr; ++p)
{
std::string wkt(*p);
geos::geom::Polygon* geom =
diff --git a/tests/unit/operation/union/UnaryUnionOpTest.cpp b/tests/unit/operation/union/UnaryUnionOpTest.cpp
index d98e03c..10a537c 100644
--- a/tests/unit/operation/union/UnaryUnionOpTest.cpp
+++ b/tests/unit/operation/union/UnaryUnionOpTest.cpp
@@ -107,7 +107,7 @@ namespace tut
template<>
void object::test<1>()
{
- static char const* const geoms[] = { NULL };
+ static char const* const geoms[] = { nullptr };
doTest(geoms, "GEOMETRYCOLLECTION EMPTY");
}
@@ -117,7 +117,7 @@ namespace tut
{
static char const* const geoms[] = {
"POINT (1 1)", "POINT (2 2)",
- NULL
+ nullptr
};
doTest(geoms, "MULTIPOINT ((1 1), (2 2))");
}
@@ -128,7 +128,7 @@ namespace tut
{
static char const* const geoms[] = {
"GEOMETRYCOLLECTION (POLYGON ((0 0, 0 90, 90 90, 90 0, 0 0)), POLYGON ((120 0, 120 90, 210 90, 210 0, 120 0)), LINESTRING (40 50, 40 140), LINESTRING (160 50, 160 140), POINT (60 50), POINT (60 140), POINT (40 140))",
- NULL
+ nullptr
};
doTest(geoms, "GEOMETRYCOLLECTION (POINT (60 140), LINESTRING (40 90, 40 140), LINESTRING (160 90, 160 140), POLYGON ((0 0, 0 90, 40 90, 90 90, 90 0, 0 0)), POLYGON ((120 0, 120 90, 160 90, 210 90, 210 0, 120 0)))");
}
@@ -145,7 +145,7 @@ namespace tut
"POINT (-5 5)",
"LINESTRING (-10 -10, -10 0, -10 20)",
"LINESTRING (-10 2, 10 2)",
- NULL
+ nullptr
};
doTest(geoms, "GEOMETRYCOLLECTION (POLYGON ((0 0, 0 2, 0 10, 10 10, 10 2, 10 0, 0 0)), POLYGON ((20 0, 20 10, 40 10, 40 0, 20 0)), LINESTRING (-10 -10, -10 0, -10 2), LINESTRING (-10 2, 0 2), LINESTRING (-10 2, -10 20), POINT (-5 5))");
@@ -162,7 +162,7 @@ namespace tut
"POINT (40 60)",
"POINT (100 70)",
"POINT (80 50)",
- NULL
+ nullptr
};
doTest(geoms, "GEOMETRYCOLLECTION (POINT (80 50), POINT (100 70), LINESTRING (40 60, 120 110))");
}
@@ -174,7 +174,7 @@ namespace tut
static char const* const geoms[] =
{
"LINESTRING (0 0, 10 0, 5 -5, 5 5)",
- NULL
+ nullptr
};
doTest(geoms, "MULTILINESTRING ((0 0, 5 0), (5 0, 10 0, 5 -5, 5 0), (5 0, 5 5))");
}
diff --git a/tests/unit/operation/valid/IsValidTest.cpp b/tests/unit/operation/valid/IsValidTest.cpp
index 373fc0c..1cf3204 100644
--- a/tests/unit/operation/valid/IsValidTest.cpp
+++ b/tests/unit/operation/valid/IsValidTest.cpp
@@ -67,7 +67,7 @@ namespace tut
bool valid = isValidOp.isValid();
TopologyValidationError* err = isValidOp.getValidationError();
- ensure(0 != err);
+ ensure(nullptr != err);
const Coordinate& errCoord = err->getCoordinate();
ensure_equals( err->getErrorType(),
diff --git a/tests/unit/operation/valid/ValidClosedRingTest.cpp b/tests/unit/operation/valid/ValidClosedRingTest.cpp
index d924848..6a567e1 100644
--- a/tests/unit/operation/valid/ValidClosedRingTest.cpp
+++ b/tests/unit/operation/valid/ValidClosedRingTest.cpp
@@ -97,7 +97,7 @@ namespace tut
{
GeomPtr geom = fromWKT("LINEARRING (0 0, 0 10, 10 10, 10 0, 0 0)");
LinearRing* ring_chk = dynamic_cast<LinearRing*>(geom.get());
- ensure(0 != ring_chk);
+ ensure(nullptr != ring_chk);
LinearRing& ring = *ring_chk;
//cout << ring.toString() << endl;
updateNonClosedRing(ring);
@@ -121,11 +121,11 @@ namespace tut
{
GeomPtr geom = fromWKT("POLYGON ((0 0, 0 10, 10 10, 10 0, 0 0), (1 1, 2 1, 2 2, 1 2, 1 1) ))");
Polygon* poly = dynamic_cast<Polygon*>(geom.get());
- ensure(0 != poly);
+ ensure(nullptr != poly);
const LineString* ring = poly->getExteriorRing();
const LinearRing* lr = dynamic_cast<const LinearRing*>(ring);
- ensure(0 != lr);
+ ensure(nullptr != lr);
LinearRing* nclr = const_cast<LinearRing*>(lr);
@@ -140,11 +140,11 @@ namespace tut
{
GeomPtr geom = fromWKT("POLYGON ((0 0, 0 10, 10 10, 10 0, 0 0), (1 1, 2 1, 2 2, 1 2, 1 1) ))");
Polygon* poly = dynamic_cast<Polygon*>(geom.get());
- ensure(0 != poly);
+ ensure(nullptr != poly);
const LineString* ring = poly->getInteriorRingN(0);
const LinearRing* lr = dynamic_cast<const LinearRing*>(ring);
- ensure(0 != lr);
+ ensure(nullptr != lr);
LinearRing* nclr = const_cast<LinearRing*>(lr);
diff --git a/tests/unit/tut/tut.hpp b/tests/unit/tut/tut.hpp
index 4679ab8..ccb4d06 100644
--- a/tests/unit/tut/tut.hpp
+++ b/tests/unit/tut/tut.hpp
@@ -188,7 +188,7 @@ class test_group : public group_base, public test_group_posix
public:
safe_holder()
- : p_(0),
+ : p_(nullptr),
permit_throw_in_dtor(false)
{
}
@@ -276,7 +276,7 @@ class test_group : public group_base, public test_group_posix
{
#endif
T* p = p_;
- p_ = 0;
+ p_ = nullptr;
delete p;
#if defined(TUT_USE_SEH)
}
@@ -470,7 +470,7 @@ public:
__try
{
#endif
- if (obj.get() == 0)
+ if (obj.get() == nullptr)
{
reset_holder_(obj);
}
diff --git a/tests/unit/tut/tut_runner.hpp b/tests/unit/tut/tut_runner.hpp
index 3803046..1852535 100644
--- a/tests/unit/tut/tut_runner.hpp
+++ b/tests/unit/tut/tut_runner.hpp
@@ -131,7 +131,7 @@ public:
*/
void register_group(const std::string& name, group_base* gr)
{
- if (gr == 0)
+ if (gr == nullptr)
{
throw tut_error("group shall be non-null");
}
@@ -161,7 +161,7 @@ public:
*/
void insert_callback(callback* cb)
{
- if(cb != NULL)
+ if(cb != nullptr)
{
callbacks_.insert(cb);
}
diff --git a/tests/unit/utility.h b/tests/unit/utility.h
index 4a58d7a..07f7076 100644
--- a/tests/unit/utility.h
+++ b/tests/unit/utility.h
@@ -79,14 +79,14 @@ typedef geos::geom::prep::PreparedGeometry const* PreparedGeometryPtr;
template<typename Type, typename InstanceType>
inline bool isInstanceOf(InstanceType const* instance)
{
- assert(0 != instance);
- return (0 != dynamic_cast<Type const*>(instance) );
+ assert(nullptr != instance);
+ return (nullptr != dynamic_cast<Type const*>(instance) );
}
template<typename Type, typename InstanceType>
inline Type const* instanceOf(InstanceType const* instance)
{
- assert(0 != instance);
+ assert(nullptr != instance);
return dynamic_cast<Type const*>(instance);
}
@@ -106,8 +106,8 @@ inline void ensure_equals_geometry(T1 const* lhs, T2 const* rhs)
template <typename T>
inline void ensure_equals_geometry(T const* lhs, T const* rhs)
{
- assert(0 != lhs);
- assert(0 != rhs);
+ assert(nullptr != lhs);
+ assert(nullptr != rhs);
using geos::geom::Polygon;
using geos::geom::GeometryCollection;
@@ -161,8 +161,8 @@ template <>
inline void ensure_equals_geometry(geos::geom::Polygon const* lhs,
geos::geom::Polygon const* rhs)
{
- assert(0 != lhs);
- assert(0 != rhs);
+ assert(nullptr != lhs);
+ assert(nullptr != rhs);
ensure_equals("number of interior ring do not match",
lhs->getNumInteriorRing(), rhs->getNumInteriorRing());
@@ -172,8 +172,8 @@ template <>
inline void ensure_equals_geometry(geos::geom::GeometryCollection const* lhs,
geos::geom::GeometryCollection const* rhs)
{
- assert(0 != lhs);
- assert(0 != rhs);
+ assert(nullptr != lhs);
+ assert(nullptr != rhs);
using geos::geom::Geometry;
@@ -192,8 +192,8 @@ template <>
inline void ensure_equals_geometry(geos::geom::Geometry const* lhs,
geos::geom::prep::PreparedGeometry const* rhs)
{
- assert(0 != lhs);
- assert(0 != rhs);
+ assert(nullptr != lhs);
+ assert(nullptr != rhs);
geos::geom::Geometry const& pg = rhs->getGeometry();
ensure_equals_geometry(lhs, &pg);
diff --git a/tests/xmltester/XMLTester.cpp b/tests/xmltester/XMLTester.cpp
index 901f6e8..2307ae1 100644
--- a/tests/xmltester/XMLTester.cpp
+++ b/tests/xmltester/XMLTester.cpp
@@ -177,7 +177,7 @@ void dump_to_stdout( const TiXmlNode * pParent, unsigned int indent = 0 )
const TiXmlNode * pChild;
- for ( pChild = pParent->FirstChild(); pChild != 0; pChild = pChild->NextSibling())
+ for ( pChild = pParent->FirstChild(); pChild != nullptr; pChild = pChild->NextSibling())
{
dump_to_stdout( pChild, indent+2 );
}
@@ -319,7 +319,7 @@ XMLTester::XMLTester()
testCount(0),
testFileCount(0),
totalTestCount(0),
- curr_file(NULL),
+ curr_file(nullptr),
testValidOutput(false),
testValidInput(false),
sqlOutput(false),
@@ -651,8 +651,8 @@ XMLTester::parseCase(const TiXmlNode* node)
std::string geomBin;
std::string thrownException;
- gA=NULL;
- gB=NULL;
+ gA=nullptr;
+ gB=nullptr;
//dump_to_stdout(node);
@@ -673,7 +673,7 @@ XMLTester::parseCase(const TiXmlNode* node)
geomAin = trimBlanks(geomAin);
gA = parseGeometry(geomAin, "Geometry A");
- if ( 0 != (el = node->FirstChild("b")) )
+ if ( nullptr != (el = node->FirstChild("b")) )
{
geomBin = el->FirstChild()->Value();
geomBin = trimBlanks(geomBin);
diff --git a/tests/xmltester/tinyxml/tinystr.h b/tests/xmltester/tinyxml/tinystr.h
index 3c2aa9d..c9f311b 100644
--- a/tests/xmltester/tinyxml/tinystr.h
+++ b/tests/xmltester/tinyxml/tinystr.h
@@ -80,21 +80,21 @@ class TiXmlString
}
// TiXmlString copy constructor
- TiXmlString ( const TiXmlString & copy) : rep_(0)
+ TiXmlString ( const TiXmlString & copy) : rep_(nullptr)
{
init(copy.length());
memcpy(start(), copy.data(), length());
}
// TiXmlString constructor, based on a string
- TIXML_EXPLICIT TiXmlString ( const char * copy) : rep_(0)
+ TIXML_EXPLICIT TiXmlString ( const char * copy) : rep_(nullptr)
{
init( static_cast<size_type>( strlen(copy) ));
memcpy(start(), copy, length());
}
// TiXmlString constructor, based on a string
- TIXML_EXPLICIT TiXmlString ( const char * str, size_type len) : rep_(0)
+ TIXML_EXPLICIT TiXmlString ( const char * str, size_type len) : rep_(nullptr)
{
init(len);
memcpy(start(), str, len);
diff --git a/tests/xmltester/tinyxml/tinyxml.cpp b/tests/xmltester/tinyxml/tinyxml.cpp
index 93b69ca..41e0c70 100644
--- a/tests/xmltester/tinyxml/tinyxml.cpp
+++ b/tests/xmltester/tinyxml/tinyxml.cpp
@@ -134,19 +134,19 @@ void TiXmlBase::EncodeString( const TIXML_STRING& str, TIXML_STRING* outString )
TiXmlNode::TiXmlNode( NodeType _type ) : TiXmlBase()
{
- parent = 0;
+ parent = nullptr;
type = _type;
- firstChild = 0;
- lastChild = 0;
- prev = 0;
- next = 0;
+ firstChild = nullptr;
+ lastChild = nullptr;
+ prev = nullptr;
+ next = nullptr;
}
TiXmlNode::~TiXmlNode()
{
TiXmlNode* node = firstChild;
- TiXmlNode* temp = 0;
+ TiXmlNode* temp = nullptr;
while ( node )
{
@@ -167,7 +167,7 @@ void TiXmlNode::CopyTo( TiXmlNode* target ) const
void TiXmlNode::Clear()
{
TiXmlNode* node = firstChild;
- TiXmlNode* temp = 0;
+ TiXmlNode* temp = nullptr;
while ( node )
{
@@ -176,27 +176,27 @@ void TiXmlNode::Clear()
delete temp;
}
- firstChild = 0;
- lastChild = 0;
+ firstChild = nullptr;
+ lastChild = nullptr;
}
TiXmlNode* TiXmlNode::LinkEndChild( TiXmlNode* node )
{
- assert( node->parent == 0 || node->parent == this );
- assert( node->GetDocument() == 0 || node->GetDocument() == this->GetDocument() );
+ assert( node->parent == nullptr || node->parent == this );
+ assert( node->GetDocument() == nullptr || node->GetDocument() == this->GetDocument() );
if ( node->Type() == TiXmlNode::DOCUMENT )
{
delete node;
- if ( GetDocument() ) GetDocument()->SetError( TIXML_ERROR_DOCUMENT_TOP_ONLY, 0, 0, TIXML_ENCODING_UNKNOWN );
- return 0;
+ if ( GetDocument() ) GetDocument()->SetError( TIXML_ERROR_DOCUMENT_TOP_ONLY, nullptr, nullptr, TIXML_ENCODING_UNKNOWN );
+ return nullptr;
}
node->parent = this;
node->prev = lastChild;
- node->next = 0;
+ node->next = nullptr;
if ( lastChild )
lastChild->next = node;
@@ -212,12 +212,12 @@ TiXmlNode* TiXmlNode::InsertEndChild( const TiXmlNode& addThis )
{
if ( addThis.Type() == TiXmlNode::DOCUMENT )
{
- if ( GetDocument() ) GetDocument()->SetError( TIXML_ERROR_DOCUMENT_TOP_ONLY, 0, 0, TIXML_ENCODING_UNKNOWN );
- return 0;
+ if ( GetDocument() ) GetDocument()->SetError( TIXML_ERROR_DOCUMENT_TOP_ONLY, nullptr, nullptr, TIXML_ENCODING_UNKNOWN );
+ return nullptr;
}
TiXmlNode* node = addThis.Clone();
if ( !node )
- return 0;
+ return nullptr;
return LinkEndChild( node );
}
@@ -226,17 +226,17 @@ TiXmlNode* TiXmlNode::InsertEndChild( const TiXmlNode& addThis )
TiXmlNode* TiXmlNode::InsertBeforeChild( TiXmlNode* beforeThis, const TiXmlNode& addThis )
{
if ( !beforeThis || beforeThis->parent != this ) {
- return 0;
+ return nullptr;
}
if ( addThis.Type() == TiXmlNode::DOCUMENT )
{
- if ( GetDocument() ) GetDocument()->SetError( TIXML_ERROR_DOCUMENT_TOP_ONLY, 0, 0, TIXML_ENCODING_UNKNOWN );
- return 0;
+ if ( GetDocument() ) GetDocument()->SetError( TIXML_ERROR_DOCUMENT_TOP_ONLY, nullptr, nullptr, TIXML_ENCODING_UNKNOWN );
+ return nullptr;
}
TiXmlNode* node = addThis.Clone();
if ( !node )
- return 0;
+ return nullptr;
node->parent = this;
node->next = beforeThis;
@@ -258,17 +258,17 @@ TiXmlNode* TiXmlNode::InsertBeforeChild( TiXmlNode* beforeThis, const TiXmlNode&
TiXmlNode* TiXmlNode::InsertAfterChild( TiXmlNode* afterThis, const TiXmlNode& addThis )
{
if ( !afterThis || afterThis->parent != this ) {
- return 0;
+ return nullptr;
}
if ( addThis.Type() == TiXmlNode::DOCUMENT )
{
- if ( GetDocument() ) GetDocument()->SetError( TIXML_ERROR_DOCUMENT_TOP_ONLY, 0, 0, TIXML_ENCODING_UNKNOWN );
- return 0;
+ if ( GetDocument() ) GetDocument()->SetError( TIXML_ERROR_DOCUMENT_TOP_ONLY, nullptr, nullptr, TIXML_ENCODING_UNKNOWN );
+ return nullptr;
}
TiXmlNode* node = addThis.Clone();
if ( !node )
- return 0;
+ return nullptr;
node->parent = this;
node->prev = afterThis;
@@ -290,11 +290,11 @@ TiXmlNode* TiXmlNode::InsertAfterChild( TiXmlNode* afterThis, const TiXmlNode& a
TiXmlNode* TiXmlNode::ReplaceChild( TiXmlNode* replaceThis, const TiXmlNode& withThis )
{
if ( replaceThis->parent != this )
- return 0;
+ return nullptr;
TiXmlNode* node = withThis.Clone();
if ( !node )
- return 0;
+ return nullptr;
node->next = replaceThis->next;
node->prev = replaceThis->prev;
@@ -345,7 +345,7 @@ const TiXmlNode* TiXmlNode::FirstChild( const char * _value ) const
if ( strcmp( node->Value(), _value ) == 0 )
return node;
}
- return 0;
+ return nullptr;
}
@@ -357,7 +357,7 @@ const TiXmlNode* TiXmlNode::LastChild( const char * _value ) const
if ( strcmp( node->Value(), _value ) == 0 )
return node;
}
- return 0;
+ return nullptr;
}
@@ -397,7 +397,7 @@ const TiXmlNode* TiXmlNode::NextSibling( const char * _value ) const
if ( strcmp( node->Value(), _value ) == 0 )
return node;
}
- return 0;
+ return nullptr;
}
@@ -409,7 +409,7 @@ const TiXmlNode* TiXmlNode::PreviousSibling( const char * _value ) const
if ( strcmp( node->Value(), _value ) == 0 )
return node;
}
- return 0;
+ return nullptr;
}
@@ -439,7 +439,7 @@ const TiXmlElement* TiXmlNode::FirstChildElement() const
if ( node->ToElement() )
return node->ToElement();
}
- return 0;
+ return nullptr;
}
@@ -454,7 +454,7 @@ const TiXmlElement* TiXmlNode::FirstChildElement( const char * _value ) const
if ( node->ToElement() )
return node->ToElement();
}
- return 0;
+ return nullptr;
}
@@ -469,7 +469,7 @@ const TiXmlElement* TiXmlNode::NextSiblingElement() const
if ( node->ToElement() )
return node->ToElement();
}
- return 0;
+ return nullptr;
}
@@ -484,7 +484,7 @@ const TiXmlElement* TiXmlNode::NextSiblingElement( const char * _value ) const
if ( node->ToElement() )
return node->ToElement();
}
- return 0;
+ return nullptr;
}
@@ -497,14 +497,14 @@ const TiXmlDocument* TiXmlNode::GetDocument() const
if ( node->ToDocument() )
return node->ToDocument();
}
- return 0;
+ return nullptr;
}
TiXmlElement::TiXmlElement (const char * _value)
: TiXmlNode( TiXmlNode::ELEMENT )
{
- firstChild = lastChild = 0;
+ firstChild = lastChild = nullptr;
value = _value;
}
@@ -522,7 +522,7 @@ TiXmlElement::TiXmlElement( const std::string& _value )
TiXmlElement::TiXmlElement( const TiXmlElement& copy)
: TiXmlNode( TiXmlNode::ELEMENT )
{
- firstChild = lastChild = 0;
+ firstChild = lastChild = nullptr;
copy.CopyTo( this );
}
@@ -557,7 +557,7 @@ const char* TiXmlElement::Attribute( const char* name ) const
const TiXmlAttribute* node = attributeSet.Find( name );
if ( node )
return node->Value();
- return 0;
+ return nullptr;
}
@@ -739,7 +739,7 @@ void TiXmlElement::SetAttribute( const char * cname, const char * cvalue )
else
{
TiXmlDocument* document = GetDocument();
- if ( document ) document->SetError( TIXML_ERROR_OUT_OF_MEMORY, 0, 0, TIXML_ENCODING_UNKNOWN );
+ if ( document ) document->SetError( TIXML_ERROR_OUT_OF_MEMORY, nullptr, nullptr, TIXML_ENCODING_UNKNOWN );
}
}
@@ -828,7 +828,7 @@ void TiXmlElement::CopyTo( TiXmlElement* target ) const
// Element class:
// Clone the attributes, then clone the children.
- const TiXmlAttribute* attribute = 0;
+ const TiXmlAttribute* attribute = nullptr;
for( attribute = attributeSet.First();
attribute;
attribute = attribute->Next() )
@@ -836,7 +836,7 @@ void TiXmlElement::CopyTo( TiXmlElement* target ) const
target->SetAttribute( attribute->Name(), attribute->Value() );
}
- TiXmlNode* node = 0;
+ TiXmlNode* node = nullptr;
for ( node = firstChild; node; node = node->NextSibling() )
{
target->LinkEndChild( node->Clone() );
@@ -861,7 +861,7 @@ TiXmlNode* TiXmlElement::Clone() const
{
TiXmlElement* clone = new TiXmlElement( Value() );
if ( !clone )
- return 0;
+ return nullptr;
CopyTo( clone );
return clone;
@@ -877,7 +877,7 @@ const char* TiXmlElement::GetText() const
return childText->Value();
}
}
- return 0;
+ return nullptr;
}
@@ -965,7 +965,7 @@ bool TiXmlDocument::LoadFile( const char* _filename, TiXmlEncoding encoding )
}
else
{
- SetError( TIXML_ERROR_OPENING_FILE, 0, 0, TIXML_ENCODING_UNKNOWN );
+ SetError( TIXML_ERROR_OPENING_FILE, nullptr, nullptr, TIXML_ENCODING_UNKNOWN );
return false;
}
}
@@ -974,7 +974,7 @@ bool TiXmlDocument::LoadFile( FILE* file, TiXmlEncoding encoding )
{
if ( !file )
{
- SetError( TIXML_ERROR_OPENING_FILE, 0, 0, TIXML_ENCODING_UNKNOWN );
+ SetError( TIXML_ERROR_OPENING_FILE, nullptr, nullptr, TIXML_ENCODING_UNKNOWN );
return false;
}
@@ -991,7 +991,7 @@ bool TiXmlDocument::LoadFile( FILE* file, TiXmlEncoding encoding )
// Strange case, but good to handle up front.
if ( length <= 0 )
{
- SetError( TIXML_ERROR_DOCUMENT_EMPTY, 0, 0, TIXML_ENCODING_UNKNOWN );
+ SetError( TIXML_ERROR_DOCUMENT_EMPTY, nullptr, nullptr, TIXML_ENCODING_UNKNOWN );
return false;
}
@@ -1026,7 +1026,7 @@ bool TiXmlDocument::LoadFile( FILE* file, TiXmlEncoding encoding )
if ( fread( buf, length, 1, file ) != 1 ) {
delete [] buf;
- SetError( TIXML_ERROR_OPENING_FILE, 0, 0, TIXML_ENCODING_UNKNOWN );
+ SetError( TIXML_ERROR_OPENING_FILE, nullptr, nullptr, TIXML_ENCODING_UNKNOWN );
return false;
}
@@ -1074,9 +1074,9 @@ bool TiXmlDocument::LoadFile( FILE* file, TiXmlEncoding encoding )
data.append( lastPos, p-lastPos );
}
delete [] buf;
- buf = 0;
+ buf = nullptr;
- Parse( data.c_str(), 0, encoding );
+ Parse( data.c_str(), nullptr, encoding );
if ( Error() )
return false;
@@ -1127,7 +1127,7 @@ void TiXmlDocument::CopyTo( TiXmlDocument* target ) const
target->errorLocation = errorLocation;
target->useMicrosoftBOM = useMicrosoftBOM;
- TiXmlNode* node = 0;
+ TiXmlNode* node = nullptr;
for ( node = firstChild; node; node = node->NextSibling() )
{
target->LinkEndChild( node->Clone() );
@@ -1139,7 +1139,7 @@ TiXmlNode* TiXmlDocument::Clone() const
{
TiXmlDocument* clone = new TiXmlDocument();
if ( !clone )
- return 0;
+ return nullptr;
CopyTo( clone );
return clone;
@@ -1176,7 +1176,7 @@ const TiXmlAttribute* TiXmlAttribute::Next() const
// We are using knowledge of the sentinel. The sentinel
// have a value or name.
if ( next->value.empty() && next->name.empty() )
- return 0;
+ return nullptr;
return next;
}
@@ -1196,7 +1196,7 @@ const TiXmlAttribute* TiXmlAttribute::Previous() const
// We are using knowledge of the sentinel. The sentinel
// have a value or name.
if ( prev->value.empty() && prev->name.empty() )
- return 0;
+ return nullptr;
return prev;
}
@@ -1325,7 +1325,7 @@ TiXmlNode* TiXmlComment::Clone() const
TiXmlComment* clone = new TiXmlComment();
if ( !clone )
- return 0;
+ return nullptr;
CopyTo( clone );
return clone;
@@ -1368,11 +1368,11 @@ bool TiXmlText::Accept( TiXmlVisitor* visitor ) const
TiXmlNode* TiXmlText::Clone() const
{
- TiXmlText* clone = 0;
+ TiXmlText* clone = nullptr;
clone = new TiXmlText( "" );
if ( !clone )
- return 0;
+ return nullptr;
CopyTo( clone );
return clone;
@@ -1460,7 +1460,7 @@ TiXmlNode* TiXmlDeclaration::Clone() const
TiXmlDeclaration* clone = new TiXmlDeclaration();
if ( !clone )
- return 0;
+ return nullptr;
CopyTo( clone );
return clone;
@@ -1492,7 +1492,7 @@ TiXmlNode* TiXmlUnknown::Clone() const
TiXmlUnknown* clone = new TiXmlUnknown();
if ( !clone )
- return 0;
+ return nullptr;
CopyTo( clone );
return clone;
@@ -1538,8 +1538,8 @@ void TiXmlAttributeSet::Remove( TiXmlAttribute* removeMe )
{
node->prev->next = node->next;
node->next->prev = node->prev;
- node->next = 0;
- node->prev = 0;
+ node->next = nullptr;
+ node->prev = nullptr;
return;
}
}
@@ -1579,7 +1579,7 @@ const TiXmlAttribute* TiXmlAttributeSet::Find( const char* name ) const
if ( strcmp( node->name.c_str(), name ) == 0 )
return node;
}
- return 0;
+ return nullptr;
}
/*
@@ -1639,7 +1639,7 @@ TiXmlHandle TiXmlHandle::FirstChild() const
if ( child )
return TiXmlHandle( child );
}
- return TiXmlHandle( 0 );
+ return TiXmlHandle( nullptr );
}
@@ -1651,7 +1651,7 @@ TiXmlHandle TiXmlHandle::FirstChild( const char * value ) const
if ( child )
return TiXmlHandle( child );
}
- return TiXmlHandle( 0 );
+ return TiXmlHandle( nullptr );
}
@@ -1663,7 +1663,7 @@ TiXmlHandle TiXmlHandle::FirstChildElement() const
if ( child )
return TiXmlHandle( child );
}
- return TiXmlHandle( 0 );
+ return TiXmlHandle( nullptr );
}
@@ -1675,7 +1675,7 @@ TiXmlHandle TiXmlHandle::FirstChildElement( const char * value ) const
if ( child )
return TiXmlHandle( child );
}
- return TiXmlHandle( 0 );
+ return TiXmlHandle( nullptr );
}
@@ -1694,7 +1694,7 @@ TiXmlHandle TiXmlHandle::Child( int count ) const
if ( child )
return TiXmlHandle( child );
}
- return TiXmlHandle( 0 );
+ return TiXmlHandle( nullptr );
}
@@ -1713,7 +1713,7 @@ TiXmlHandle TiXmlHandle::Child( const char* value, int count ) const
if ( child )
return TiXmlHandle( child );
}
- return TiXmlHandle( 0 );
+ return TiXmlHandle( nullptr );
}
@@ -1732,7 +1732,7 @@ TiXmlHandle TiXmlHandle::ChildElement( int count ) const
if ( child )
return TiXmlHandle( child );
}
- return TiXmlHandle( 0 );
+ return TiXmlHandle( nullptr );
}
@@ -1751,7 +1751,7 @@ TiXmlHandle TiXmlHandle::ChildElement( const char* value, int count ) const
if ( child )
return TiXmlHandle( child );
}
- return TiXmlHandle( 0 );
+ return TiXmlHandle( nullptr );
}
@@ -1774,7 +1774,7 @@ bool TiXmlPrinter::VisitEnter( const TiXmlElement& element, const TiXmlAttribute
for( const TiXmlAttribute* attrib = firstAttribute; attrib; attrib = attrib->Next() )
{
buffer += " ";
- attrib->Print( 0, 0, &buffer );
+ attrib->Print( nullptr, 0, &buffer );
}
if ( !element.FirstChild() )
@@ -1859,7 +1859,7 @@ bool TiXmlPrinter::Visit( const TiXmlText& text )
bool TiXmlPrinter::Visit( const TiXmlDeclaration& declaration )
{
DoIndent();
- declaration.Print( 0, 0, &buffer );
+ declaration.Print( nullptr, 0, &buffer );
DoLineBreak();
return true;
}
diff --git a/tests/xmltester/tinyxml/tinyxml.h b/tests/xmltester/tinyxml/tinyxml.h
index c6f40cc..92b4264 100644
--- a/tests/xmltester/tinyxml/tinyxml.h
+++ b/tests/xmltester/tinyxml/tinyxml.h
@@ -199,7 +199,7 @@ class TiXmlBase
friend class TiXmlDocument;
public:
- TiXmlBase() : userData(0) {}
+ TiXmlBase() : userData(nullptr) {}
virtual ~TiXmlBase() {}
/** All TinyXml classes can print themselves to a filestream
@@ -357,7 +357,7 @@ protected:
else
{
// Not valid text.
- return 0;
+ return nullptr;
}
}
@@ -695,19 +695,19 @@ public:
/// Returns true if this node has no children.
bool NoChildren() const { return !firstChild; }
- virtual const TiXmlDocument* ToDocument() const { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type.
- virtual const TiXmlElement* ToElement() const { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type.
- virtual const TiXmlComment* ToComment() const { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type.
- virtual const TiXmlUnknown* ToUnknown() const { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type.
- virtual const TiXmlText* ToText() const { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type.
- virtual const TiXmlDeclaration* ToDeclaration() const { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type.
+ virtual const TiXmlDocument* ToDocument() const { return nullptr; } ///< Cast to a more defined type. Will return null if not of the requested type.
+ virtual const TiXmlElement* ToElement() const { return nullptr; } ///< Cast to a more defined type. Will return null if not of the requested type.
+ virtual const TiXmlComment* ToComment() const { return nullptr; } ///< Cast to a more defined type. Will return null if not of the requested type.
+ virtual const TiXmlUnknown* ToUnknown() const { return nullptr; } ///< Cast to a more defined type. Will return null if not of the requested type.
+ virtual const TiXmlText* ToText() const { return nullptr; } ///< Cast to a more defined type. Will return null if not of the requested type.
+ virtual const TiXmlDeclaration* ToDeclaration() const { return nullptr; } ///< Cast to a more defined type. Will return null if not of the requested type.
- virtual TiXmlDocument* ToDocument() { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type.
- virtual TiXmlElement* ToElement() { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type.
- virtual TiXmlComment* ToComment() { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type.
- virtual TiXmlUnknown* ToUnknown() { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type.
- virtual TiXmlText* ToText() { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type.
- virtual TiXmlDeclaration* ToDeclaration() { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type.
+ virtual TiXmlDocument* ToDocument() { return nullptr; } ///< Cast to a more defined type. Will return null if not of the requested type.
+ virtual TiXmlElement* ToElement() { return nullptr; } ///< Cast to a more defined type. Will return null if not of the requested type.
+ virtual TiXmlComment* ToComment() { return nullptr; } ///< Cast to a more defined type. Will return null if not of the requested type.
+ virtual TiXmlUnknown* ToUnknown() { return nullptr; } ///< Cast to a more defined type. Will return null if not of the requested type.
+ virtual TiXmlText* ToText() { return nullptr; } ///< Cast to a more defined type. Will return null if not of the requested type.
+ virtual TiXmlDeclaration* ToDeclaration() { return nullptr; } ///< Cast to a more defined type. Will return null if not of the requested type.
/** Create an exact duplicate of this node and return it. The memory must be deleted
by the caller.
@@ -785,8 +785,8 @@ public:
/// Construct an empty attribute.
TiXmlAttribute() : TiXmlBase()
{
- document = 0;
- prev = next = 0;
+ document = nullptr;
+ prev = next = nullptr;
}
#ifdef TIXML_USE_STL
@@ -805,8 +805,8 @@ public:
{
name = _name;
value = _value;
- document = 0;
- prev = next = 0;
+ document = nullptr;
+ prev = next = nullptr;
}
const char* Name() const { return name.c_str(); } ///< Return the name of this attribute.
@@ -869,7 +869,7 @@ public:
// Prints this Attribute to a FILE stream.
virtual void Print( FILE* cfile, int depth ) const {
- Print( cfile, depth, 0 );
+ Print( cfile, depth, nullptr );
}
void Print( FILE* cfile, int depth, TIXML_STRING* str ) const;
@@ -910,10 +910,10 @@ public:
void Add( TiXmlAttribute* attribute );
void Remove( TiXmlAttribute* attribute );
- const TiXmlAttribute* First() const { return ( sentinel.next == &sentinel ) ? 0 : sentinel.next; }
- TiXmlAttribute* First() { return ( sentinel.next == &sentinel ) ? 0 : sentinel.next; }
- const TiXmlAttribute* Last() const { return ( sentinel.prev == &sentinel ) ? 0 : sentinel.prev; }
- TiXmlAttribute* Last() { return ( sentinel.prev == &sentinel ) ? 0 : sentinel.prev; }
+ const TiXmlAttribute* First() const { return ( sentinel.next == &sentinel ) ? nullptr : sentinel.next; }
+ TiXmlAttribute* First() { return ( sentinel.next == &sentinel ) ? nullptr : sentinel.next; }
+ const TiXmlAttribute* Last() const { return ( sentinel.prev == &sentinel ) ? nullptr : sentinel.prev; }
+ TiXmlAttribute* Last() { return ( sentinel.prev == &sentinel ) ? nullptr : sentinel.prev; }
const TiXmlAttribute* Find( const char* _name ) const;
TiXmlAttribute* Find( const char* _name ) {
@@ -1309,7 +1309,7 @@ public:
// Print this declaration to a FILE stream.
virtual void Print( FILE* cfile, int depth, TIXML_STRING* str ) const;
virtual void Print( FILE* cfile, int depth ) const {
- Print( cfile, depth, 0 );
+ Print( cfile, depth, nullptr );
}
virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding );
@@ -1439,7 +1439,7 @@ public:
method (either TIXML_ENCODING_LEGACY or TIXML_ENCODING_UTF8 will force TinyXml
to use that encoding, regardless of what TinyXml might otherwise try to detect.
*/
- virtual const char* Parse( const char* p, TiXmlParsingData* data = 0, TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING );
+ virtual const char* Parse( const char* p, TiXmlParsingData* data = nullptr, TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING );
/** Get the root element -- the only top level element -- of the document.
In well formed XML, there should only be one. TinyXml is tolerant of
@@ -1681,13 +1681,13 @@ public:
TiXmlNode* ToNode() const { return node; }
/** Return the handle as a TiXmlElement. This may return null.
*/
- TiXmlElement* ToElement() const { return ( ( node && node->ToElement() ) ? node->ToElement() : 0 ); }
+ TiXmlElement* ToElement() const { return ( ( node && node->ToElement() ) ? node->ToElement() : nullptr ); }
/** Return the handle as a TiXmlText. This may return null.
*/
- TiXmlText* ToText() const { return ( ( node && node->ToText() ) ? node->ToText() : 0 ); }
+ TiXmlText* ToText() const { return ( ( node && node->ToText() ) ? node->ToText() : nullptr ); }
/** Return the handle as a TiXmlUnknown. This may return null.
*/
- TiXmlUnknown* ToUnknown() const { return ( ( node && node->ToUnknown() ) ? node->ToUnknown() : 0 ); }
+ TiXmlUnknown* ToUnknown() const { return ( ( node && node->ToUnknown() ) ? node->ToUnknown() : nullptr ); }
/** @deprecated use ToNode.
Return the handle as a TiXmlNode. This may return null.
diff --git a/tests/xmltester/tinyxml/tinyxmlparser.cpp b/tests/xmltester/tinyxml/tinyxmlparser.cpp
index 9328749..84db49e 100644
--- a/tests/xmltester/tinyxml/tinyxmlparser.cpp
+++ b/tests/xmltester/tinyxml/tinyxmlparser.cpp
@@ -315,7 +315,7 @@ const char* TiXmlBase::SkipWhiteSpace( const char* p, TiXmlEncoding encoding )
{
if ( !p || !*p )
{
- return 0;
+ return nullptr;
}
if ( encoding == TIXML_ENCODING_UTF8 )
{
@@ -432,7 +432,7 @@ const char* TiXmlBase::ReadName( const char* p, TIXML_STRING * name, TiXmlEncodi
}
return p;
}
- return 0;
+ return nullptr;
}
const char* TiXmlBase::GetEntity( const char* p, char* value, int* length, TiXmlEncoding encoding )
@@ -451,12 +451,12 @@ const char* TiXmlBase::GetEntity( const char* p, char* value, int* length, TiXml
if ( *(p+2) == 'x' )
{
// Hexadecimal.
- if ( !*(p+3) ) return 0;
+ if ( !*(p+3) ) return nullptr;
const char* q = p+3;
q = strchr( q, ';' );
- if ( !q || !*q ) return 0;
+ if ( !q || !*q ) return nullptr;
delta = q-p;
--q;
@@ -470,7 +470,7 @@ const char* TiXmlBase::GetEntity( const char* p, char* value, int* length, TiXml
else if ( *q >= 'A' && *q <= 'F' )
ucs += mult * (*q - 'A' + 10 );
else
- return 0;
+ return nullptr;
mult *= 16;
--q;
}
@@ -478,12 +478,12 @@ const char* TiXmlBase::GetEntity( const char* p, char* value, int* length, TiXml
else
{
// Decimal.
- if ( !*(p+2) ) return 0;
+ if ( !*(p+2) ) return nullptr;
const char* q = p+2;
q = strchr( q, ';' );
- if ( !q || !*q ) return 0;
+ if ( !q || !*q ) return nullptr;
delta = q-p;
--q;
@@ -493,7 +493,7 @@ const char* TiXmlBase::GetEntity( const char* p, char* value, int* length, TiXml
if ( *q >= '0' && *q <= '9' )
ucs += mult * (*q - '0');
else
- return 0;
+ return nullptr;
mult *= 10;
--q;
}
@@ -710,8 +710,8 @@ const char* TiXmlDocument::Parse( const char* p, TiXmlParsingData* prevData, TiX
// here is skipping white space.
if ( !p || !*p )
{
- SetError( TIXML_ERROR_DOCUMENT_EMPTY, 0, 0, TIXML_ENCODING_UNKNOWN );
- return 0;
+ SetError( TIXML_ERROR_DOCUMENT_EMPTY, nullptr, nullptr, TIXML_ENCODING_UNKNOWN );
+ return nullptr;
}
// Note that, for a document, this needs to come
@@ -747,8 +747,8 @@ const char* TiXmlDocument::Parse( const char* p, TiXmlParsingData* prevData, TiX
p = SkipWhiteSpace( p, encoding );
if ( !p )
{
- SetError( TIXML_ERROR_DOCUMENT_EMPTY, 0, 0, TIXML_ENCODING_UNKNOWN );
- return 0;
+ SetError( TIXML_ERROR_DOCUMENT_EMPTY, nullptr, nullptr, TIXML_ENCODING_UNKNOWN );
+ return nullptr;
}
while ( p && *p )
@@ -787,8 +787,8 @@ const char* TiXmlDocument::Parse( const char* p, TiXmlParsingData* prevData, TiX
// Was this empty?
if ( !firstChild ) {
- SetError( TIXML_ERROR_DOCUMENT_EMPTY, 0, 0, encoding );
- return 0;
+ SetError( TIXML_ERROR_DOCUMENT_EMPTY, nullptr, nullptr, encoding );
+ return nullptr;
}
// All is well.
@@ -817,12 +817,12 @@ void TiXmlDocument::SetError( int err, const char* pError, TiXmlParsingData* dat
TiXmlNode* TiXmlNode::Identify( const char* p, TiXmlEncoding encoding )
{
- TiXmlNode* returnNode = 0;
+ TiXmlNode* returnNode = nullptr;
p = SkipWhiteSpace( p, encoding );
if( !p || !*p || *p != '<' )
{
- return 0;
+ return nullptr;
}
TiXmlDocument* doc = GetDocument();
@@ -830,7 +830,7 @@ TiXmlNode* TiXmlNode::Identify( const char* p, TiXmlEncoding encoding )
if ( !p || !*p )
{
- return 0;
+ return nullptr;
}
// What is this thing?
@@ -899,7 +899,7 @@ TiXmlNode* TiXmlNode::Identify( const char* p, TiXmlEncoding encoding )
else
{
if ( doc )
- doc->SetError( TIXML_ERROR_OUT_OF_MEMORY, 0, 0, TIXML_ENCODING_UNKNOWN );
+ doc->SetError( TIXML_ERROR_OUT_OF_MEMORY, nullptr, nullptr, TIXML_ENCODING_UNKNOWN );
}
return returnNode;
}
@@ -1053,8 +1053,8 @@ const char* TiXmlElement::Parse( const char* p, TiXmlParsingData* data, TiXmlEnc
if ( !p || !*p )
{
- if ( document ) document->SetError( TIXML_ERROR_PARSING_ELEMENT, 0, 0, encoding );
- return 0;
+ if ( document ) document->SetError( TIXML_ERROR_PARSING_ELEMENT, nullptr, nullptr, encoding );
+ return nullptr;
}
if ( data )
@@ -1066,7 +1066,7 @@ const char* TiXmlElement::Parse( const char* p, TiXmlParsingData* data, TiXmlEnc
if ( *p != '<' )
{
if ( document ) document->SetError( TIXML_ERROR_PARSING_ELEMENT, p, data, encoding );
- return 0;
+ return nullptr;
}
p = SkipWhiteSpace( p+1, encoding );
@@ -1078,7 +1078,7 @@ const char* TiXmlElement::Parse( const char* p, TiXmlParsingData* data, TiXmlEnc
if ( !p || !*p )
{
if ( document ) document->SetError( TIXML_ERROR_FAILED_TO_READ_ELEMENT_NAME, pErr, data, encoding );
- return 0;
+ return nullptr;
}
TIXML_STRING endTag ("</");
@@ -1094,7 +1094,7 @@ const char* TiXmlElement::Parse( const char* p, TiXmlParsingData* data, TiXmlEnc
if ( !p || !*p )
{
if ( document ) document->SetError( TIXML_ERROR_READING_ATTRIBUTES, pErr, data, encoding );
- return 0;
+ return nullptr;
}
if ( *p == '/' )
{
@@ -1103,7 +1103,7 @@ const char* TiXmlElement::Parse( const char* p, TiXmlParsingData* data, TiXmlEnc
if ( *p != '>' )
{
if ( document ) document->SetError( TIXML_ERROR_PARSING_EMPTY, p, data, encoding );
- return 0;
+ return nullptr;
}
return (p+1);
}
@@ -1118,7 +1118,7 @@ const char* TiXmlElement::Parse( const char* p, TiXmlParsingData* data, TiXmlEnc
// We were looking for the end tag, but found nothing.
// Fix for [ 1663758 ] Failure to report error on bad XML
if ( document ) document->SetError( TIXML_ERROR_READING_END_TAG, p, data, encoding );
- return 0;
+ return nullptr;
}
// We should find the end tag now
@@ -1130,7 +1130,7 @@ const char* TiXmlElement::Parse( const char* p, TiXmlParsingData* data, TiXmlEnc
else
{
if ( document ) document->SetError( TIXML_ERROR_READING_END_TAG, p, data, encoding );
- return 0;
+ return nullptr;
}
}
else
@@ -1140,7 +1140,7 @@ const char* TiXmlElement::Parse( const char* p, TiXmlParsingData* data, TiXmlEnc
if ( !attrib )
{
if ( document ) document->SetError( TIXML_ERROR_OUT_OF_MEMORY, pErr, data, encoding );
- return 0;
+ return nullptr;
}
attrib->SetDocument( document );
@@ -1151,7 +1151,7 @@ const char* TiXmlElement::Parse( const char* p, TiXmlParsingData* data, TiXmlEnc
{
if ( document ) document->SetError( TIXML_ERROR_PARSING_ELEMENT, pErr, data, encoding );
delete attrib;
- return 0;
+ return nullptr;
}
// Handle the strange case of double attributes:
@@ -1164,7 +1164,7 @@ const char* TiXmlElement::Parse( const char* p, TiXmlParsingData* data, TiXmlEnc
{
node->SetValue( attrib->Value() );
delete attrib;
- return 0;
+ return nullptr;
}
attributeSet.Add( attrib );
@@ -1191,8 +1191,8 @@ const char* TiXmlElement::ReadValue( const char* p, TiXmlParsingData* data, TiXm
if ( !textNode )
{
- if ( document ) document->SetError( TIXML_ERROR_OUT_OF_MEMORY, 0, 0, encoding );
- return 0;
+ if ( document ) document->SetError( TIXML_ERROR_OUT_OF_MEMORY, nullptr, nullptr, encoding );
+ return nullptr;
}
if ( TiXmlBase::IsWhiteSpaceCondensed() )
@@ -1230,7 +1230,7 @@ const char* TiXmlElement::ReadValue( const char* p, TiXmlParsingData* data, TiXm
}
else
{
- return 0;
+ return nullptr;
}
}
}
@@ -1240,7 +1240,7 @@ const char* TiXmlElement::ReadValue( const char* p, TiXmlParsingData* data, TiXm
if ( !p )
{
- if ( document ) document->SetError( TIXML_ERROR_READING_ELEMENT_VALUE, 0, 0, encoding );
+ if ( document ) document->SetError( TIXML_ERROR_READING_ELEMENT_VALUE, nullptr, nullptr, encoding );
}
return p;
}
@@ -1284,7 +1284,7 @@ const char* TiXmlUnknown::Parse( const char* p, TiXmlParsingData* data, TiXmlEnc
if ( !p || !*p || *p != '<' )
{
if ( document ) document->SetError( TIXML_ERROR_PARSING_UNKNOWN, p, data, encoding );
- return 0;
+ return nullptr;
}
++p;
value = "";
@@ -1297,7 +1297,7 @@ const char* TiXmlUnknown::Parse( const char* p, TiXmlParsingData* data, TiXmlEnc
if ( !p )
{
- if ( document ) document->SetError( TIXML_ERROR_PARSING_UNKNOWN, 0, 0, encoding );
+ if ( document ) document->SetError( TIXML_ERROR_PARSING_UNKNOWN, nullptr, nullptr, encoding );
}
if ( *p == '>' )
return p+1;
@@ -1350,7 +1350,7 @@ const char* TiXmlComment::Parse( const char* p, TiXmlParsingData* data, TiXmlEnc
if ( !StringEqual( p, startTag, false, encoding ) )
{
document->SetError( TIXML_ERROR_PARSING_COMMENT, p, data, encoding );
- return 0;
+ return nullptr;
}
p += strlen( startTag );
@@ -1389,7 +1389,7 @@ const char* TiXmlComment::Parse( const char* p, TiXmlParsingData* data, TiXmlEnc
const char* TiXmlAttribute::Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding )
{
p = SkipWhiteSpace( p, encoding );
- if ( !p || !*p ) return 0;
+ if ( !p || !*p ) return nullptr;
// int tabsize = 4;
// if ( document )
@@ -1406,13 +1406,13 @@ const char* TiXmlAttribute::Parse( const char* p, TiXmlParsingData* data, TiXmlE
if ( !p || !*p )
{
if ( document ) document->SetError( TIXML_ERROR_READING_ATTRIBUTES, pErr, data, encoding );
- return 0;
+ return nullptr;
}
p = SkipWhiteSpace( p, encoding );
if ( !p || !*p || *p != '=' )
{
if ( document ) document->SetError( TIXML_ERROR_READING_ATTRIBUTES, p, data, encoding );
- return 0;
+ return nullptr;
}
++p; // skip '='
@@ -1420,7 +1420,7 @@ const char* TiXmlAttribute::Parse( const char* p, TiXmlParsingData* data, TiXmlE
if ( !p || !*p )
{
if ( document ) document->SetError( TIXML_ERROR_READING_ATTRIBUTES, p, data, encoding );
- return 0;
+ return nullptr;
}
const char* end;
@@ -1454,7 +1454,7 @@ const char* TiXmlAttribute::Parse( const char* p, TiXmlParsingData* data, TiXmlE
// We did not have an opening quote but seem to have a
// closing one. Give up and throw an error.
if ( document ) document->SetError( TIXML_ERROR_READING_ATTRIBUTES, p, data, encoding );
- return 0;
+ return nullptr;
}
value += *p;
++p;
@@ -1516,7 +1516,7 @@ const char* TiXmlText::Parse( const char* p, TiXmlParsingData* data, TiXmlEncodi
if ( !StringEqual( p, startTag, false, encoding ) )
{
document->SetError( TIXML_ERROR_PARSING_CDATA, p, data, encoding );
- return 0;
+ return nullptr;
}
p += strlen( startTag );
@@ -1541,7 +1541,7 @@ const char* TiXmlText::Parse( const char* p, TiXmlParsingData* data, TiXmlEncodi
p = ReadText( p, &value, ignoreWhite, end, false, encoding );
if ( p )
return p-1; // don't truncate the '<'
- return 0;
+ return nullptr;
}
}
@@ -1577,8 +1577,8 @@ const char* TiXmlDeclaration::Parse( const char* p, TiXmlParsingData* data, TiXm
TiXmlDocument* document = GetDocument();
if ( !p || !*p || !StringEqual( p, "<?xml", true, _encoding ) )
{
- if ( document ) document->SetError( TIXML_ERROR_PARSING_DECLARATION, 0, 0, _encoding );
- return 0;
+ if ( document ) document->SetError( TIXML_ERROR_PARSING_DECLARATION, nullptr, nullptr, _encoding );
+ return nullptr;
}
if ( data )
{
@@ -1625,7 +1625,7 @@ const char* TiXmlDeclaration::Parse( const char* p, TiXmlParsingData* data, TiXm
++p;
}
}
- return 0;
+ return nullptr;
}
bool TiXmlText::Blank() const
-----------------------------------------------------------------------
Summary of changes:
include/geos/algorithm/LineIntersector.h | 2 +-
include/geos/geom/Lineal.h | 2 +-
include/geos/geom/Polygonal.h | 2 +-
include/geos/geom/Puntal.h | 2 +-
include/geos/geom/prep/PreparedLineString.h | 2 +-
include/geos/geomgraph/DirectedEdgeStar.h | 2 +-
include/geos/geomgraph/GeometryGraph.h | 10 +-
include/geos/geomgraph/index/SweepLineEvent.h | 4 +-
include/geos/index/chain/MonotoneChainBuilder.h | 2 +-
include/geos/index/sweepline/SweepLineInterval.h | 2 +-
include/geos/io/ByteOrderDataInStream.h | 2 +-
include/geos/noding/FastNodingValidator.h | 2 +-
include/geos/noding/IntersectionAdder.h | 2 +-
include/geos/noding/MCIndexNoder.h | 4 +-
include/geos/noding/SegmentIntersectionDetector.h | 4 +-
include/geos/noding/SegmentSetMutualIntersector.h | 2 +-
include/geos/noding/SimpleNoder.h | 2 +-
include/geos/noding/SinglePassNoder.h | 2 +-
.../geos/noding/snapround/MCIndexPointSnapper.h | 2 +-
include/geos/operation/buffer/BufferBuilder.h | 10 +-
include/geos/operation/buffer/BufferOp.h | 4 +-
.../geos/operation/buffer/OffsetSegmentString.h | 6 +-
include/geos/operation/linemerge/LineSequencer.h | 2 +-
include/geos/operation/overlay/OverlayOp.h | 4 +-
include/geos/operation/overlay/PointBuilder.h | 2 +-
.../geos/operation/union/CascadedPolygonUnion.h | 2 +-
include/geos/operation/union/CascadedUnion.h | 2 +-
include/geos/operation/union/GeometryListHolder.h | 2 +-
include/geos/operation/union/UnaryUnionOp.h | 2 +-
include/geos/operation/valid/IsValidOp.h | 2 +-
.../geos/operation/valid/SimpleNestedRingTester.h | 2 +-
.../operation/valid/SweeplineNestedRingTester.h | 2 +-
include/geos/precision/GeometryPrecisionReducer.h | 2 +-
include/geos/profiler.h | 4 +-
src/algorithm/ConvexHull.cpp | 6 +-
src/algorithm/LineIntersector.cpp | 2 +-
src/algorithm/MCPointInRing.cpp | 4 +-
src/algorithm/MinimumDiameter.cpp | 20 +-
src/algorithm/SIRtreePointInRing.cpp | 2 +-
src/geom/CoordinateSequence.cpp | 10 +-
src/geom/Geometry.cpp | 28 +--
src/geom/GeometryCollection.cpp | 2 +-
src/geom/GeometryFactory.cpp | 40 ++--
src/geom/LineString.cpp | 10 +-
src/geom/MultiLineString.cpp | 2 +-
src/geom/Point.cpp | 6 +-
src/geom/Polygon.cpp | 12 +-
src/geom/prep/PreparedGeometryFactory.cpp | 4 +-
src/geom/prep/PreparedPolygon.cpp | 2 +-
src/geom/util/GeometryCombiner.cpp | 10 +-
src/geom/util/GeometryEditor.cpp | 10 +-
src/geom/util/GeometryTransformer.cpp | 34 ++--
src/geom/util/SineStarFactory.cpp | 2 +-
src/geomgraph/DirectedEdge.cpp | 10 +-
src/geomgraph/DirectedEdgeStar.cpp | 30 +--
src/geomgraph/Edge.cpp | 12 +-
src/geomgraph/EdgeEnd.cpp | 10 +-
src/geomgraph/EdgeEndStar.cpp | 2 +-
src/geomgraph/EdgeList.cpp | 2 +-
src/geomgraph/EdgeRing.cpp | 16 +-
src/geomgraph/GeometryGraph.cpp | 6 +-
src/geomgraph/NodeFactory.cpp | 2 +-
src/geomgraph/NodeMap.cpp | 6 +-
src/geomgraph/PlanarGraph.cpp | 8 +-
.../index/SimpleMCSweepLineIntersector.cpp | 6 +-
src/geomgraph/index/SimpleSweepLineIntersector.cpp | 6 +-
src/geomgraph/index/SweepLineEvent.cpp | 2 +-
src/index/bintree/Bintree.cpp | 6 +-
src/index/bintree/Key.cpp | 2 +-
src/index/bintree/Node.cpp | 10 +-
src/index/bintree/NodeBase.cpp | 18 +-
src/index/bintree/Root.cpp | 2 +-
src/index/chain/MonotoneChain.cpp | 4 +-
.../intervalrtree/SortedPackedIntervalRTree.cpp | 8 +-
src/index/quadtree/Node.cpp | 4 +-
src/index/quadtree/NodeBase.cpp | 28 +--
src/index/quadtree/Root.cpp | 4 +-
src/index/strtree/AbstractNode.cpp | 6 +-
src/index/strtree/AbstractSTRtree.cpp | 16 +-
src/index/strtree/BoundablePair.cpp | 2 +-
src/index/strtree/SIRtree.cpp | 4 +-
src/index/strtree/STRtree.cpp | 6 +-
src/index/sweepline/SweepLineEvent.cpp | 6 +-
src/index/sweepline/SweepLineIndex.cpp | 2 +-
src/io/CLocalizer.cpp | 4 +-
src/io/WKBReader.cpp | 4 +-
src/io/WKBWriter.cpp | 2 +-
src/io/WKTReader.cpp | 32 +--
src/io/WKTWriter.cpp | 4 +-
src/linearref/ExtractLineByLocation.cpp | 2 +-
src/linearref/LinearGeometryBuilder.cpp | 8 +-
src/linearref/LinearIterator.cpp | 2 +-
src/linearref/LocationIndexOfPoint.cpp | 2 +-
src/noding/GeometryNoder.cpp | 4 +-
src/noding/IteratedNoder.cpp | 2 +-
src/noding/snapround/HotPixel.cpp | 2 +-
src/operation/IsSimpleOp.cpp | 6 +-
src/operation/buffer/BufferBuilder.cpp | 16 +-
src/operation/buffer/BufferOp.cpp | 4 +-
src/operation/buffer/BufferSubgraph.cpp | 10 +-
src/operation/buffer/RightmostEdgeFinder.cpp | 4 +-
src/operation/buffer/SubgraphDepthLocater.cpp | 2 +-
src/operation/distance/DistanceOp.cpp | 32 +--
src/operation/intersection/Rectangle.cpp | 2 +-
.../intersection/RectangleIntersection.cpp | 22 +--
.../intersection/RectangleIntersectionBuilder.cpp | 8 +-
src/operation/linemerge/EdgeString.cpp | 4 +-
src/operation/linemerge/LineMergeDirectedEdge.cpp | 2 +-
src/operation/linemerge/LineMergeGraph.cpp | 2 +-
src/operation/linemerge/LineMerger.cpp | 12 +-
src/operation/linemerge/LineSequencer.cpp | 30 +--
src/operation/overlay/MaximalEdgeRing.cpp | 4 +-
src/operation/overlay/OverlayOp.cpp | 10 +-
src/operation/overlay/PolygonBuilder.cpp | 20 +-
.../overlay/validate/FuzzyPointLocator.cpp | 2 +-
.../overlay/validate/OffsetPointGenerator.cpp | 2 +-
src/operation/polygonize/EdgeRing.cpp | 28 +--
.../polygonize/PolygonizeDirectedEdge.cpp | 6 +-
src/operation/polygonize/PolygonizeGraph.cpp | 46 ++---
src/operation/polygonize/Polygonizer.cpp | 14 +-
src/operation/predicate/RectangleIntersects.cpp | 2 +-
src/operation/relate/EdgeEndBuilder.cpp | 16 +-
src/operation/union/CascadedPolygonUnion.cpp | 12 +-
src/operation/union/CascadedUnion.cpp | 12 +-
src/operation/valid/ConnectedInteriorTester.cpp | 8 +-
src/operation/valid/IndexedNestedRingTester.cpp | 2 +-
src/operation/valid/IndexedNestedRingTester.h | 4 +-
src/operation/valid/IsValidOp.cpp | 68 +++----
src/operation/valid/QuadtreeNestedRingTester.cpp | 6 +-
src/operation/valid/SimpleNestedRingTester.cpp | 2 +-
src/operation/valid/SweeplineNestedRingTester.cpp | 2 +-
src/planargraph/Edge.cpp | 4 +-
src/planargraph/NodeMap.cpp | 2 +-
src/planargraph/PlanarGraph.cpp | 6 +-
src/precision/MinimumClearance.cpp | 2 +-
.../PrecisionReducerCoordinateOperation.cpp | 6 +-
src/precision/SimpleGeometryPrecisionReducer.cpp | 6 +-
src/simplify/TaggedLineSegment.cpp | 2 +-
src/simplify/TaggedLineStringSimplifier.cpp | 4 +-
src/triangulate/DelaunayTriangulationBuilder.cpp | 4 +-
src/triangulate/VoronoiDiagramBuilder.cpp | 2 +-
.../quadedge/LastFoundQuadEdgeLocator.cpp | 2 +-
src/triangulate/quadedge/QuadEdge.cpp | 8 +-
src/triangulate/quadedge/QuadEdgeSubdivision.cpp | 16 +-
src/util/GeometricShapeFactory.cpp | 6 +-
src/util/Interrupt.cpp | 2 +-
tests/bigtest/GeometryTestFactory.cpp | 6 +-
tests/unit/algorithm/CGAlgorithms/isCCWTest.cpp | 6 +-
.../algorithm/CGAlgorithms/isPointInRingTest.cpp | 6 +-
.../unit/algorithm/CGAlgorithms/signedAreaTest.cpp | 6 +-
tests/unit/algorithm/ConvexHullTest.cpp | 36 ++--
tests/unit/algorithm/MinimumDiameterTest.cpp | 60 +++---
.../unit/algorithm/RobustLineIntersectionTest.cpp | 16 +-
tests/unit/capi/GEOSBufferTest.cpp | 88 ++++-----
tests/unit/capi/GEOSClipByRectTest.cpp | 8 +-
tests/unit/capi/GEOSContainsTest.cpp | 34 ++--
tests/unit/capi/GEOSConvexHullTest.cpp | 12 +-
tests/unit/capi/GEOSCoordSeqTest.cpp | 4 +-
tests/unit/capi/GEOSDelaunayTriangulationTest.cpp | 10 +-
tests/unit/capi/GEOSDistanceTest.cpp | 10 +-
tests/unit/capi/GEOSEqualsTest.cpp | 22 +--
tests/unit/capi/GEOSFrechetDistanceTest.cpp | 8 +-
tests/unit/capi/GEOSGeomFromWKBTest.cpp | 10 +-
tests/unit/capi/GEOSGeomToWKTTest.cpp | 10 +-
tests/unit/capi/GEOSGeom_create.cpp | 18 +-
tests/unit/capi/GEOSGeom_createCollection.cpp | 4 +-
.../unit/capi/GEOSGeom_extractUniquePointsTest.cpp | 8 +-
tests/unit/capi/GEOSGeom_setPrecisionTest.cpp | 8 +-
tests/unit/capi/GEOSGetCentroidTest.cpp | 28 +--
tests/unit/capi/GEOSHausdorffDistanceTest.cpp | 8 +-
tests/unit/capi/GEOSInterruptTest.cpp | 28 +--
tests/unit/capi/GEOSIntersectionTest.cpp | 32 +--
tests/unit/capi/GEOSIntersectsTest.cpp | 22 +--
tests/unit/capi/GEOSLineString_PointTest.cpp | 10 +-
tests/unit/capi/GEOSMinimumClearanceTest.cpp | 2 +-
tests/unit/capi/GEOSMinimumRectangleTest.cpp | 10 +-
tests/unit/capi/GEOSMinimumWidthTest.cpp | 14 +-
tests/unit/capi/GEOSNearestPointsTest.cpp | 18 +-
tests/unit/capi/GEOSNodeTest.cpp | 12 +-
tests/unit/capi/GEOSOffsetCurveTest.cpp | 50 ++---
tests/unit/capi/GEOSPointOnSurfaceTest.cpp | 44 ++---
.../unit/capi/GEOSPolygonizer_getCutEdgesTest.cpp | 10 +-
tests/unit/capi/GEOSPreparedGeometryTest.cpp | 52 ++---
tests/unit/capi/GEOSRelateBoundaryNodeRuleTest.cpp | 4 +-
tests/unit/capi/GEOSSTRtreeTest.cpp | 10 +-
tests/unit/capi/GEOSSharedPathsTest.cpp | 12 +-
tests/unit/capi/GEOSSimplifyTest.cpp | 6 +-
tests/unit/capi/GEOSSnapTest.cpp | 8 +-
tests/unit/capi/GEOSUnaryUnionTest.cpp | 42 ++--
tests/unit/capi/GEOSUserDataTest.cpp | 4 +-
tests/unit/capi/GEOSVoronoiDiagramTest.cpp | 28 +--
tests/unit/capi/GEOSWithinTest.cpp | 18 +-
tests/unit/capi/GEOSisClosedTest.cpp | 2 +-
tests/unit/capi/GEOSisValidDetailTest.cpp | 14 +-
.../geom/CoordinateArraySequenceFactoryTest.cpp | 24 +--
tests/unit/geom/DimensionTest.cpp | 4 +-
tests/unit/geom/Geometry/isRectangleTest.cpp | 14 +-
tests/unit/geom/GeometryFactoryTest.cpp | 204 ++++++++++----------
tests/unit/geom/IntersectionMatrixTest.cpp | 2 +-
tests/unit/geom/LineStringTest.cpp | 82 ++++----
tests/unit/geom/LinearRingTest.cpp | 50 ++---
tests/unit/geom/LocationTest.cpp | 2 +-
tests/unit/geom/MultiPointTest.cpp | 48 ++---
tests/unit/geom/PointTest.cpp | 22 +--
tests/unit/geom/PolygonTest.cpp | 76 ++++----
.../geom/prep/PreparedGeometry/touchesTest.cpp | 8 +-
.../unit/geom/prep/PreparedGeometryFactoryTest.cpp | 120 ++++++------
tests/unit/io/WKBWriterTest.cpp | 8 +-
tests/unit/noding/BasicSegmentStringTest.cpp | 20 +-
tests/unit/noding/NodedSegmentStringTest.cpp | 20 +-
tests/unit/noding/SegmentNodeTest.cpp | 16 +-
.../noding/snapround/MCIndexSnapRounderTest.cpp | 2 +-
tests/unit/operation/buffer/BufferBuilderTest.cpp | 6 +-
tests/unit/operation/distance/DistanceOpTest.cpp | 4 +-
tests/unit/operation/linemerge/LineMergerTest.cpp | 30 +--
.../unit/operation/linemerge/LineSequencerTest.cpp | 18 +-
tests/unit/operation/polygonize/PolygonizeTest.cpp | 8 +-
.../operation/union/CascadedPolygonUnionTest.cpp | 4 +-
tests/unit/operation/union/UnaryUnionOpTest.cpp | 12 +-
tests/unit/operation/valid/IsValidTest.cpp | 2 +-
tests/unit/operation/valid/ValidClosedRingTest.cpp | 10 +-
tests/unit/tut/tut.hpp | 6 +-
tests/unit/tut/tut_runner.hpp | 4 +-
tests/unit/utility.h | 22 +--
tests/xmltester/XMLTester.cpp | 10 +-
tests/xmltester/tinyxml/tinystr.h | 6 +-
tests/xmltester/tinyxml/tinyxml.cpp | 144 +++++++-------
tests/xmltester/tinyxml/tinyxml.h | 56 +++---
tests/xmltester/tinyxml/tinyxmlparser.cpp | 92 ++++-----
229 files changed, 1574 insertions(+), 1574 deletions(-)
hooks/post-receive
--
geos
More information about the geos-commits
mailing list