Skip to content

Commit

Permalink
Revert "Fix build warnings on Travis"
Browse files Browse the repository at this point in the history
Hey clang - how about you don't through warnings if
fixing them breaks the build?

This reverts commit e28a555.
  • Loading branch information
nyalldawson committed Oct 19, 2017
1 parent e28a555 commit ac7e041
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions src/core/geometry/qgsgeos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ std::unique_ptr<QgsAbstractGeometry> QgsGeos::subdivide( int maxNodes, QString *
}
CATCH_GEOS_WITH_ERRMSG( nullptr )

return parts;
return std::move( parts );

This comment has been minimized.

Copy link
@elpaso

elpaso Oct 19, 2017

Contributor

I trust you but I don't understand this: RVO should apply here, or not? See: http://vmpstr.blogspot.it/2015/12/redundant-stdmove.html and http://en.cppreference.com/w/cpp/language/copy_elision

This comment has been minimized.

Copy link
@nyalldawson

nyalldawson Oct 20, 2017

Author Collaborator

Fixed by d6f25b2 - i misread part of the warning

}

QgsAbstractGeometry *QgsGeos::combine( const QgsAbstractGeometry *geom, QString *errorMsg ) const
Expand Down Expand Up @@ -881,7 +881,7 @@ geos::unique_ptr QgsGeos::nodeGeometries( const GEOSGeometry *splitLine, const G
geos::unique_ptr splitLineClone( GEOSGeom_clone_r( geosinit.ctxt, splitLine ) );
geos::unique_ptr unionGeometry( GEOSUnion_r( geosinit.ctxt, splitLineClone.get(), geometryBoundary.get() ) );

return unionGeometry;
return std::move( unionGeometry );
}

int QgsGeos::mergeGeometriesMultiTypeSplit( QVector<GEOSGeometry *> &splitResult ) const
Expand Down Expand Up @@ -984,7 +984,7 @@ geos::unique_ptr QgsGeos::createGeosCollection( int typeId, const QVector<GEOSGe

delete [] geomarr;

return geom;
return std::move( geom );
}

std::unique_ptr<QgsAbstractGeometry> QgsGeos::fromGeos( const GEOSGeometry *geos )
Expand Down Expand Up @@ -1026,7 +1026,7 @@ std::unique_ptr<QgsAbstractGeometry> QgsGeos::fromGeos( const GEOSGeometry *geos
multiPoint->addGeometry( coordSeqPoint( cs, 0, hasZ, hasM ).clone() );
}
}
return multiPoint;
return std::move( multiPoint );
}
case GEOS_MULTILINESTRING:
{
Expand All @@ -1040,7 +1040,7 @@ std::unique_ptr<QgsAbstractGeometry> QgsGeos::fromGeos( const GEOSGeometry *geos
multiLineString->addGeometry( line.release() );
}
}
return multiLineString;
return std::move( multiLineString );
}
case GEOS_MULTIPOLYGON:
{
Expand All @@ -1055,7 +1055,7 @@ std::unique_ptr<QgsAbstractGeometry> QgsGeos::fromGeos( const GEOSGeometry *geos
multiPolygon->addGeometry( poly.release() );
}
}
return multiPolygon;
return std::move( multiPolygon );
}
case GEOS_GEOMETRYCOLLECTION:
{
Expand All @@ -1069,7 +1069,7 @@ std::unique_ptr<QgsAbstractGeometry> QgsGeos::fromGeos( const GEOSGeometry *geos
geomCollection->addGeometry( geom.release() );
}
}
return geomCollection;
return std::move( geomCollection );
}
}
return nullptr;
Expand Down Expand Up @@ -1767,7 +1767,7 @@ geos::unique_ptr QgsGeos::createGeosPointXY( double x, double y, bool hasZ, doub
geosPoint.reset( GEOSGeom_createPoint_r( geosinit.ctxt, coordSeq ) );
}
CATCH_GEOS( nullptr )
return geosPoint;
return std::move( geosPoint );
}

geos::unique_ptr QgsGeos::createGeosLinestring( const QgsAbstractGeometry *curve, double precision )
Expand All @@ -1786,7 +1786,7 @@ geos::unique_ptr QgsGeos::createGeosLinestring( const QgsAbstractGeometry *curve
geosGeom.reset( GEOSGeom_createLineString_r( geosinit.ctxt, coordSeq ) );
}
CATCH_GEOS( nullptr )
return geosGeom;
return std::move( geosGeom );
}

geos::unique_ptr QgsGeos::createGeosPolygon( const QgsAbstractGeometry *poly, double precision )
Expand Down Expand Up @@ -1823,7 +1823,7 @@ geos::unique_ptr QgsGeos::createGeosPolygon( const QgsAbstractGeometry *poly, do
}
CATCH_GEOS( nullptr )

return geosPolygon;
return std::move( geosPolygon );
}

QgsAbstractGeometry *QgsGeos::offsetCurve( double distance, int segments, int joinStyle, double miterLimit, QString *errorMsg ) const
Expand Down Expand Up @@ -2253,7 +2253,7 @@ static geos::unique_ptr _mergeLinestrings( const GEOSGeometry *line1, const GEOS
GEOSGeometry *geoms[2] = { g1.release(), g2.release() };
geos::unique_ptr multiGeom( GEOSGeom_createCollection_r( geosinit.ctxt, GEOS_MULTILINESTRING, geoms, 2 ) );
geos::unique_ptr res( GEOSLineMerge_r( geosinit.ctxt, multiGeom.get() ) );
return res;
return std::move( res );
}
else
return nullptr;
Expand Down Expand Up @@ -2335,7 +2335,7 @@ geos::unique_ptr QgsGeos::reshapeLine( const GEOSGeometry *line, const GEOSGeome
if ( numMergedLines == 1 ) //reshape line is from begin to endpoint. So we keep the reshapeline
{
geos::unique_ptr result( GEOSGeom_clone_r( geosinit.ctxt, reshapeLineGeos ) );
return result;
return std::move( result );
}
else
return nullptr;
Expand Down Expand Up @@ -2469,7 +2469,7 @@ geos::unique_ptr QgsGeos::reshapeLine( const GEOSGeometry *line, const GEOSGeome
return nullptr;
}

return result;
return std::move( result );
}

geos::unique_ptr QgsGeos::reshapePolygon( const GEOSGeometry *polygon, const GEOSGeometry *reshapeLineGeos, double precision )
Expand Down Expand Up @@ -2582,7 +2582,7 @@ geos::unique_ptr QgsGeos::reshapePolygon( const GEOSGeometry *polygon, const GEO
geos::unique_ptr reshapedPolygon( GEOSGeom_createPolygon_r( geosinit.ctxt, newOuterRing, newInnerRings, ringList.size() ) );
delete[] newInnerRings;

return reshapedPolygon;
return std::move( reshapedPolygon );
}

int QgsGeos::lineContainedInLine( const GEOSGeometry *line1, const GEOSGeometry *line2 )
Expand Down

0 comments on commit ac7e041

Please sign in to comment.