Skip to content

Commit

Permalink
Remove RETURN_UNIQUE_PTR and support for gcc-4.8, closes #589 (#726)
Browse files Browse the repository at this point in the history
  • Loading branch information
pramsey authored Nov 4, 2022
1 parent 0605f02 commit 289ed4e
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 23 deletions.
9 changes: 0 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,6 @@ jobs:
cmake_extra: '-DBUILD_BENCHMARKS=ON'
os: ubuntu-18.04

- cxx_compiler: g++-4.8
c_compiler: gcc-4.8
build_type: Release
cxxstd: 11
arch: 32
packages: 'g++-4.8-multilib gcc-4.8-multilib g++-multilib gcc-multilib'
cmake: 3.13.*
os: ubuntu-18.04

- cxx_compiler: g++-5
c_compiler: gcc-5
build_type: Release
Expand Down
2 changes: 1 addition & 1 deletion include/geos/geom/FixedSizeCoordinateSequence.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ namespace geom {
std::unique_ptr<CoordinateSequence> clone() const final override {
auto seq = detail::make_unique<FixedSizeCoordinateSequence<N>>(dimension);
seq->m_data = m_data;
return RETURN_UNIQUE_PTR(seq);
return seq;
}

const Coordinate& getAt(std::size_t i) const final override {
Expand Down
11 changes: 0 additions & 11 deletions include/geos/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,17 +95,6 @@ template<typename To, typename From> inline To down_cast(From* f)
return static_cast<To>(f);
}

// Avoid "redundant move" warning when calling std::move() to return
// unique_ptr<Derived> from a function with return type unique_ptr<Base>
// The std::move is required for the gcc 4.9 series, which has not addressed
// CWG defect 1579 ("return by converting move constructor")
// http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1579
#if __GNUC__ > 0 && __GNUC__ < 5
#define RETURN_UNIQUE_PTR(x) (std::move(x))
#else
#define RETURN_UNIQUE_PTR(x) (x)
#endif

} // namespace detail
} // namespace geos

Expand Down
2 changes: 1 addition & 1 deletion src/io/WKTReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ WKTReader::getCoordinates(StringTokenizer* tokenizer, OrdinateSet& ordinateFlags
nextToken = getNextCloserOrComma(tokenizer);
}

return RETURN_UNIQUE_PTR(coordinates);
return coordinates;
}

void
Expand Down
2 changes: 1 addition & 1 deletion src/noding/SegmentNodeList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ SegmentNodeList::createSplitEdgePts(const SegmentNode* ei0, const SegmentNode* e
auto pts = detail::make_unique<FixedSizeCoordinateSequence<2>>();
pts->setAt(ei0->coord, 0);
pts->setAt(ei1->coord, 1);
return RETURN_UNIQUE_PTR(pts);
return pts;
}

const Coordinate& lastSegStartPt = edge.getCoordinate(ei1->segmentIndex);
Expand Down

0 comments on commit 289ed4e

Please sign in to comment.