Skip to content

Commit

Permalink
Fix a couple of Woverloaded-virtual warnings under gcc 4.7.2
Browse files Browse the repository at this point in the history
  • Loading branch information
dichlofos committed Apr 1, 2014
1 parent 2d2b98b commit e8f6672
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 16 deletions.
2 changes: 2 additions & 0 deletions include/geos/geom/BinaryOp.h
Expand Up @@ -188,6 +188,8 @@ fix_self_intersections(std::auto_ptr<Geometry> g, const std::string& label)
::geos::ignore_unused_variable_warning(label);
#ifdef GEOS_DEBUG_BINARYOP
std::cerr << label << " fix_self_intersection (UnaryUnion)" << std::endl;
#else
(void)(label);

This comment has been minimized.

Copy link
@strk

strk Jun 20, 2014

the ::geos::ignore_unused_variable_warning(label) is supposedly there specifically to avoid that warning, maybe the issue should be fixed there ?

#endif

// Only multi-components can be fixed by UnaryUnion
Expand Down
14 changes: 7 additions & 7 deletions include/geos/geom/prep/PreparedPoint.h
Expand Up @@ -7,7 +7,7 @@
*
* This is free software; you can redistribute and/or modify it under
* the terms of the GNU Lesser General Public Licence as published
* by the Free Software Foundation.
* by the Free Software Foundation.
* See the COPYING file for more information.
*
*
Expand All @@ -29,26 +29,26 @@ namespace prep { // geos::geom::prep
/**
* \brief
* A prepared version of {@link Point} or {@link MultiPoint} geometries.
*
*
* @author Martin Davis
*
*/
class PreparedPoint: public BasicPreparedGeometry
class PreparedPoint: public BasicPreparedGeometry
{
private:
protected:
public:
PreparedPoint(const Geometry * geom)
: BasicPreparedGeometry( geom)
PreparedPoint(const Geometry * geom)
: BasicPreparedGeometry( geom)
{ }

/**
* Tests whether this point intersects a {@link Geometry}.
*
*
* The optimization here is that computing topology for the test
* geometry is avoided. This can be significant for large geometries.
*/
bool intersects(const geom::Geometry* g);
bool intersects(const geom::Geometry* g) const;

};

Expand Down
6 changes: 3 additions & 3 deletions include/geos/noding/MCIndexNoder.h
Expand Up @@ -7,7 +7,7 @@
*
* This is free software; you can redistribute and/or modify it under
* the terms of the GNU Lesser General Public Licence as published
* by the Free Software Foundation.
* by the Free Software Foundation.
* See the COPYING file for more information.
*
**********************************************************************
Expand Down Expand Up @@ -102,7 +102,7 @@ class GEOS_DLL MCIndexNoder : public SinglePassNoder {
index::chain::MonotoneChainOverlapAction(),
si(newSi)
{}

using index::chain::MonotoneChainOverlapAction::overlap;
void overlap(index::chain::MonotoneChain& mc1, std::size_t start1,
index::chain::MonotoneChain& mc2, std::size_t start2);
private:
Expand All @@ -112,7 +112,7 @@ class GEOS_DLL MCIndexNoder : public SinglePassNoder {
SegmentOverlapAction(const SegmentOverlapAction& other);
SegmentOverlapAction& operator=(const SegmentOverlapAction& rhs);
};

};

} // namespace geos.noding
Expand Down
1 change: 1 addition & 0 deletions include/geos/noding/MCIndexSegmentSetMutualIntersector.h
Expand Up @@ -88,6 +88,7 @@ class MCIndexSegmentSetMutualIntersector : public SegmentSetMutualIntersector
SegmentOverlapAction& operator=(const SegmentOverlapAction& rhs);

public:
using index::chain::MonotoneChainOverlapAction::overlap;
SegmentOverlapAction(SegmentIntersector & si) :
index::chain::MonotoneChainOverlapAction(), si(si)
{}
Expand Down
2 changes: 1 addition & 1 deletion include/geos/noding/SegmentIntersectionDetector.h
Expand Up @@ -122,7 +122,7 @@ class SegmentIntersectionDetector : public SegmentIntersector
*
* @return the coordinate for the intersection location
*/
const geom::Coordinate * const getIntersection() const
const geom::Coordinate * getIntersection() const
{
return intPt;
}
Expand Down
3 changes: 3 additions & 0 deletions include/geos/triangulate/quadedge/Vertex.h
Expand Up @@ -79,6 +79,9 @@ class GEOS_DLL Vertex {

Vertex();

virtual ~Vertex() {
}

inline double getX() const {
return p.x;
}
Expand Down
2 changes: 1 addition & 1 deletion src/geom/prep/PreparedPoint.cpp
Expand Up @@ -24,7 +24,7 @@ namespace geom { // geos.geom
namespace prep { // geos.geom.prep

bool
PreparedPoint::intersects(const geom::Geometry* g)
PreparedPoint::intersects(const geom::Geometry* g) const
{
if (! envelopesIntersect( g)) return false;

Expand Down
12 changes: 8 additions & 4 deletions src/linearref/LinearLocation.cpp
Expand Up @@ -88,7 +88,8 @@ LinearLocation::normalize()
{
segmentFraction = 1.0;
}

// componentIndex has type unsigned int, so it cannot be negative
#if 0
if (componentIndex < 0)
{
componentIndex = 0;
Expand All @@ -100,6 +101,7 @@ LinearLocation::normalize()
segmentIndex = 0;
segmentFraction = 0.0;
}
#endif
if (segmentFraction == 1.0)
{
segmentFraction = 0.0;
Expand Down Expand Up @@ -204,7 +206,7 @@ LinearLocation::getCoordinate(const Geometry* linearGeom) const
const LineString* lineComp = dynamic_cast<const LineString *> (linearGeom->getGeometryN(componentIndex));
if ( ! lineComp ) {
throw util::IllegalArgumentException("LinearLocation::getCoordinate only works with LineString geometries");
}
}
Coordinate p0 = lineComp->getCoordinateN(segmentIndex);
if (segmentIndex >= lineComp->getNumPoints() - 1)
return p0;
Expand Down Expand Up @@ -232,11 +234,13 @@ LinearLocation::getSegment(const Geometry* linearGeom) const
bool
LinearLocation::isValid(const Geometry* linearGeom) const
{
if (componentIndex < 0 || componentIndex >= linearGeom->getNumGeometries())
// componentIndex is unsigned
if (/*componentIndex < 0 || */componentIndex >= linearGeom->getNumGeometries())
return false;

const LineString* lineComp = dynamic_cast<const LineString*> (linearGeom->getGeometryN(componentIndex));
if (segmentIndex < 0 || segmentIndex > lineComp->getNumPoints())
// segmentIndex is unsigned
if (/*segmentIndex < 0 || */segmentIndex > lineComp->getNumPoints())
return false;
if (segmentIndex == lineComp->getNumPoints() && segmentFraction != 0.0)
return false;
Expand Down

0 comments on commit e8f6672

Please sign in to comment.