From 0d9f29c9ffa783af094810aa73a74ac10ac2a25d Mon Sep 17 00:00:00 2001 From: Jochen Topf Date: Wed, 30 Nov 2022 10:21:12 +0100 Subject: [PATCH] Use east const --- src/geom-output.hpp | 14 +++++++------- src/output-flex.hpp | 2 +- src/output.hpp | 2 +- src/tagtransform-c.cpp | 2 +- src/tile-output.hpp | 2 +- src/wkb.cpp | 2 +- tests/common-import.hpp | 4 ++-- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/geom-output.hpp b/src/geom-output.hpp index f3a2cc419..1553944e0 100644 --- a/src/geom-output.hpp +++ b/src/geom-output.hpp @@ -27,21 +27,21 @@ namespace geom { template std::basic_ostream & -operator<<(std::basic_ostream &out, const nullgeom_t & /*input*/) +operator<<(std::basic_ostream &out, nullgeom_t const & /*input*/) { return out << "NULL"; } template std::basic_ostream & -operator<<(std::basic_ostream &out, const point_t &input) +operator<<(std::basic_ostream &out, point_t const &input) { return out << input.x() << ' ' << input.y(); } template std::basic_ostream & -operator<<(std::basic_ostream &out, const point_list_t &input) +operator<<(std::basic_ostream &out, point_list_t const &input) { if (input.empty()) { return out << "EMPTY"; @@ -56,7 +56,7 @@ operator<<(std::basic_ostream &out, const point_list_t &input) template std::basic_ostream & -operator<<(std::basic_ostream &out, const polygon_t &input) +operator<<(std::basic_ostream &out, polygon_t const &input) { out << '(' << input.outer() << ')'; for (auto const &ring : input.inners()) { @@ -67,7 +67,7 @@ operator<<(std::basic_ostream &out, const polygon_t &input) template std::basic_ostream & -operator<<(std::basic_ostream &out, const collection_t &input) +operator<<(std::basic_ostream &out, collection_t const &input) { if (input.num_geometries() == 0) { return out << "EMPTY"; @@ -83,7 +83,7 @@ operator<<(std::basic_ostream &out, const collection_t &input) template std::basic_ostream & operator<<(std::basic_ostream &out, - const multigeometry_t &input) + multigeometry_t const &input) { if (input.num_geometries() == 0) { return out << "EMPTY"; @@ -98,7 +98,7 @@ operator<<(std::basic_ostream &out, template std::basic_ostream & -operator<<(std::basic_ostream &out, const geometry_t &geom) +operator<<(std::basic_ostream &out, geometry_t const &geom) { out << geometry_type(geom) << '('; geom.visit([&](auto const &input) { out << input; }); diff --git a/src/output-flex.hpp b/src/output-flex.hpp index 88dd8bf7f..6001aaf0d 100644 --- a/src/output-flex.hpp +++ b/src/output-flex.hpp @@ -72,7 +72,7 @@ class prepared_lua_function_t * \param nresults The number of results this function is supposed to have. */ prepared_lua_function_t(lua_State *lua_state, calling_context context, - const char *name, int nresults = 0); + char const *name, int nresults = 0); /// Return the index of the function on the Lua stack. int index() const noexcept { return m_index; } diff --git a/src/output.hpp b/src/output.hpp index 3489aefea..6c3c81a73 100644 --- a/src/output.hpp +++ b/src/output.hpp @@ -129,7 +129,7 @@ class output_t return m_output_requirements; } - const options_t *get_options() const noexcept { return m_options; }; + options_t const *get_options() const noexcept { return m_options; }; private: std::shared_ptr m_mid; diff --git a/src/tagtransform-c.cpp b/src/tagtransform-c.cpp index 61b8b2247..6d2a7b4c6 100644 --- a/src/tagtransform-c.cpp +++ b/src/tagtransform-c.cpp @@ -58,7 +58,7 @@ static void add_z_order(taglist_t *tags, bool *roads) *roads = false; if (highway) { - for (const auto &layer : layers) { + for (auto const &layer : layers) { if (*highway == layer.highway) { z_order += layer.offset; *roads = layer.roads; diff --git a/src/tile-output.hpp b/src/tile-output.hpp index 227624208..6324dc46e 100644 --- a/src/tile-output.hpp +++ b/src/tile-output.hpp @@ -16,7 +16,7 @@ template std::basic_ostream & -operator<<(std::basic_ostream &out, const tile_t &tile) +operator<<(std::basic_ostream &out, tile_t const &tile) { return out << "TILE(" << tile.zoom() << ", " << tile.x() << ", " << tile.y() << ')'; diff --git a/src/wkb.cpp b/src/wkb.cpp index 0914e2b66..239343414 100644 --- a/src/wkb.cpp +++ b/src/wkb.cpp @@ -566,7 +566,7 @@ std::string geom_to_ewkb(geom::geometry_t const &geom, bool ensure_multi) geom::geometry_t ewkb_to_geom(std::string const &wkb) { - const char *const end = wkb.data() + wkb.size(); + char const *const end = wkb.data() + wkb.size(); ewkb::ewkb_parser_t parser{wkb.data(), end}; auto geom = parser(); diff --git a/tests/common-import.hpp b/tests/common-import.hpp index c7fd85924..0c0033fe4 100644 --- a/tests/common-import.hpp +++ b/tests/common-import.hpp @@ -85,13 +85,13 @@ class data_t std::back_inserter(m_objects)); } - void add(std::initializer_list const &objects) + void add(std::initializer_list const &objects) { std::copy(std::begin(objects), std::end(objects), std::back_inserter(m_objects)); } - const char *operator()() + char const *operator()() { std::sort(m_objects.begin(), m_objects.end(), [](std::string const &a, std::string const &b) {