Skip to content

Commit

Permalink
clang-tidy: fix const errors generated by clang-tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
lbartoletti committed Dec 15, 2023
1 parent 8249382 commit 9201c4c
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/algorithm/extrude.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ struct NoValidityCheck;
* @ingroup public_api
*/
SFCGAL_API std::unique_ptr<Geometry>
extrude(const Geometry &g, Kernel::FT dx, Kernel::FT dy, Kernel::FT dz);
extrude(const Geometry &g, const Kernel::FT &dx, const Kernel::FT &dy, const Kernel::FT &dz);

/**
* @brief Returns a Geometry equal to the specified Geometry,
Expand All @@ -62,7 +62,7 @@ extrude(const Geometry &g, Kernel::FT dx, Kernel::FT dy, Kernel::FT dz);
* @warning No actual validity check is conducted.
*/
SFCGAL_API std::unique_ptr<Geometry>
extrude(const Geometry &g, Kernel::FT &dx, Kernel::FT &dy, Kernel::FT &dz,
extrude(const Geometry &g, const Kernel::FT &dx, const Kernel::FT &dy, const Kernel::FT &dz,
NoValidityCheck &nvc);

/**
Expand Down
2 changes: 1 addition & 1 deletion src/algorithm/partition_2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ polygons_to_geometry(const std::list<TPolygon_2> &polys)
std::list<TPolygon_2>::const_iterator poly_it;
for (poly_it = polys.begin(); poly_it != polys.end(); ++poly_it) {
auto *poly = new Polygon;
for (const TPoint_2& const p : poly_it->container()) {
for (const TPoint_2& p : poly_it->container()) {
poly->exteriorRing().addPoint(p);
}
poly->exteriorRing().addPoint(*(poly_it->vertices_begin()));
Expand Down
4 changes: 2 additions & 2 deletions src/algorithm/translate.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ translate(Geometry &g, const Kernel::Vector_2 &v);
* @todo unittest
*/
SFCGAL_API void
translate(Geometry &g, const Kernel::FT dx, const Kernel::FT dy,
const Kernel::FT dz);
translate(Geometry &g, const Kernel::FT &dx, const Kernel::FT &dy,
const Kernel::FT &dz);

/**
* @brief translate a geometry from double-coordinates
Expand Down
2 changes: 1 addition & 1 deletion src/detail/generator/disc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ disc(const Point &center, const double &radius,

double const dTheta = M_PI_4 / nQuadrantSegments;

for (size_t i = 0; i < static_cast<unsigned long>(nQuadrantSegments * )4; i++) {
for (size_t i = 0; i < static_cast<unsigned long>(nQuadrantSegments ) * 4; i++) {
Kernel::Vector_2 const p =
center.toVector_2() +
radius * Kernel::Vector_2(cos(i * dTheta), sin(i * dTheta));
Expand Down
4 changes: 2 additions & 2 deletions test/unit/SFCGAL/CoordinateTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,13 @@ BOOST_AUTO_TEST_CASE(testXYZConstructorDouble)
BOOST_AUTO_TEST_CASE(testCopyConstructorEmpty)
{
Coordinate const g;
const Coordinate& const copy(g);
const Coordinate& copy(g);
BOOST_CHECK(copy.isEmpty());
}
BOOST_AUTO_TEST_CASE(testCopyConstructorXY)
{
Coordinate const g(3, 4);
const Coordinate& const copy(g);
const Coordinate& copy(g);
BOOST_CHECK_EQUAL(copy.x(), 3);
BOOST_CHECK_EQUAL(copy.y(), 4);
}
Expand Down

0 comments on commit 9201c4c

Please sign in to comment.