From ab626ac052a0230fbf63bf3c5beb035f2c560bc4 Mon Sep 17 00:00:00 2001 From: Mathis Logemann Date: Fri, 19 Apr 2024 20:56:21 +0200 Subject: [PATCH] update pre-commit and format sources --- .pre-commit-config.yaml | 4 +- demo/viewer/mainwindow.cpp | 2 +- include/mapnik/debug.hpp | 10 +- include/mapnik/enumeration.hpp | 14 +- include/mapnik/feature_factory.hpp | 2 +- include/mapnik/hextree.hpp | 15 +- include/mapnik/offset_converter.hpp | 11 +- include/mapnik/palette.hpp | 2 +- include/mapnik/params.hpp | 8 +- include/mapnik/params_impl.hpp | 5 +- include/mapnik/sse.hpp | 2 +- include/mapnik/svg/svg_renderer_agg.hpp | 10 +- include/mapnik/symbolizer_utils.hpp | 3 +- include/mapnik/util/file_io.hpp | 20 +- include/mapnik/util/singleton.hpp | 5 +- include/mapnik/version.hpp | 2 +- plugins/input/csv/csv_datasource.hpp | 1 - plugins/input/geobuf/geobuf.hpp | 4 +- plugins/input/ogr/ogr_layer_ptr.hpp | 15 +- .../input/pgraster/pgraster_wkb_reader.cpp | 8 +- plugins/input/postgis/connection.hpp | 15 +- plugins/input/shape/shapefile.hpp | 25 +- plugins/input/sqlite/sqlite_connection.hpp | 8 +- plugins/input/sqlite/sqlite_datasource.cpp | 14 +- plugins/input/sqlite/sqlite_utils.hpp | 5 +- src/debug.cpp | 5 +- src/grid/grid_renderer.cpp | 4 +- src/map.cpp | 3 +- src/params.cpp | 9 +- src/proj_transform.cpp | 16 +- src/save_map.cpp | 2 +- src/tiff_reader.hpp | 55 +-- src/xml_tree.cpp | 5 +- test/catch.hpp | 365 +++++++++--------- test/standalone/map_xml_test.cpp | 7 +- test/unit/color/css_color.cpp | 2 +- test/unit/svg/svg_parser_test.cpp | 4 +- utils/ogrindex/ogrindex.cpp | 3 +- utils/shapeindex/shapeindex.cpp | 2 +- 39 files changed, 280 insertions(+), 412 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0df4f091e..e5b33cff8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,7 +2,7 @@ # See https://pre-commit.com/hooks.html for more hooks repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.3.0 + rev: v4.6.0 hooks: - id: trailing-whitespace files: ^.*\.cmake|CMakeLists\.txt$ @@ -10,7 +10,7 @@ repos: files: ^.*\.cmake|CMakeLists\.txt$ - repo: https://github.com/pre-commit/mirrors-clang-format - rev: v14.0.6 + rev: v18.1.3 hooks: - id: clang-format types_or: [c++, c] diff --git a/demo/viewer/mainwindow.cpp b/demo/viewer/mainwindow.cpp index 2b211bca9..908bc1eca 100644 --- a/demo/viewer/mainwindow.cpp +++ b/demo/viewer/mainwindow.cpp @@ -38,7 +38,7 @@ // mapnik #ifndef Q_MOC_RUN // QT moc chokes on BOOST_JOIN -//#include +// #include #include #include #include diff --git a/include/mapnik/debug.hpp b/include/mapnik/debug.hpp index 161bb8298..33f0f1ff1 100644 --- a/include/mapnik/debug.hpp +++ b/include/mapnik/debug.hpp @@ -96,10 +96,7 @@ class MAPNIK_DECL logger : public singleton, } // format - static std::string const& get_format() - { - return format_; - } + static std::string const& get_format() { return format_; } static void set_format(std::string const& format) { @@ -211,10 +208,7 @@ class base_log : public util::noncopyable private: #ifdef MAPNIK_LOG - inline bool check_severity() - { - return Severity >= logger::get_object_severity(object_name_); - } + inline bool check_severity() { return Severity >= logger::get_object_severity(object_name_); } typename output_policy::stream_buffer streambuf_; std::string object_name_; diff --git a/include/mapnik/enumeration.hpp b/include/mapnik/enumeration.hpp index b7614584d..7a27a45e4 100644 --- a/include/mapnik/enumeration.hpp +++ b/include/mapnik/enumeration.hpp @@ -134,13 +134,13 @@ struct MAPNIK_DECL enumeration std::map fnc_name##_lookup() \ { \ std::map val_map; \ - std::transform( \ - fnc_name##_map.begin(), \ - fnc_name##_map.end(), \ - std::inserter(val_map, val_map.end()), \ - [](const mapnik::detail::EnumStringT& val) { \ - return std::pair{std::get<0>(val), std::string{std::get<1>(val).data()}}; \ - }); \ + std::transform(fnc_name##_map.begin(), \ + fnc_name##_map.end(), \ + std::inserter(val_map, val_map.end()), \ + [](const mapnik::detail::EnumStringT& val) { \ + return std::pair{std::get<0>(val), \ + std::string{std::get<1>(val).data()}}; \ + }); \ return val_map; \ } diff --git a/include/mapnik/feature_factory.hpp b/include/mapnik/feature_factory.hpp index 05358d31e..bb2a7dfaf 100644 --- a/include/mapnik/feature_factory.hpp +++ b/include/mapnik/feature_factory.hpp @@ -28,7 +28,7 @@ #include // boost -//#include +// #include namespace mapnik { struct feature_factory diff --git a/include/mapnik/hextree.hpp b/include/mapnik/hextree.hpp index 06aa63f06..7a0f160cc 100644 --- a/include/mapnik/hextree.hpp +++ b/include/mapnik/hextree.hpp @@ -152,10 +152,7 @@ class hextree : private util::noncopyable ~hextree() {} - void setMaxColors(unsigned max_colors) - { - max_colors_ = max_colors; - } + void setMaxColors(unsigned max_colors) { max_colors_ = max_colors; } void setGamma(double g) { @@ -166,15 +163,9 @@ class hextree : private util::noncopyable } } - void setTransMode(unsigned t) - { - trans_mode_ = t; - } + void setTransMode(unsigned t) { trans_mode_ = t; } - transparency_mode_t getTransMode() const - { - return trans_mode_; - } + transparency_mode_t getTransMode() const { return trans_mode_; } // process alpha value based on trans_mode_ std::uint8_t preprocessAlpha(std::uint8_t a) const diff --git a/include/mapnik/offset_converter.hpp b/include/mapnik/offset_converter.hpp index 938f119d3..8712b61a0 100644 --- a/include/mapnik/offset_converter.hpp +++ b/include/mapnik/offset_converter.hpp @@ -561,15 +561,13 @@ struct offset_converter if (bulge_steps == 0) { // inside turn (sharp/obtuse angle) - MAPNIK_LOG_DEBUG(ctrans) << "offset_converter:" - << " Sharp joint [<< inside turn " + MAPNIK_LOG_DEBUG(ctrans) << "offset_converter:" << " Sharp joint [<< inside turn " << static_cast(util::degrees(joint_angle)) << " degrees >>]"; } else { // outside turn (reflex angle) - MAPNIK_LOG_DEBUG(ctrans) << "offset_converter:" - << " Bulge joint >)) outside turn " + MAPNIK_LOG_DEBUG(ctrans) << "offset_converter:" << " Bulge joint >)) outside turn " << static_cast(util::degrees(joint_angle)) << " degrees ((< with " << bulge_steps << " segments"; } @@ -640,10 +638,7 @@ struct offset_converter return cur_.cmd; } - void push_vertex(vertex2d const& v) - { - vertices_.push_back(v); - } + void push_vertex(vertex2d const& v) { vertices_.push_back(v); } Geometry& geom_; double offset_; diff --git a/include/mapnik/palette.hpp b/include/mapnik/palette.hpp index 0a0216041..7eda359c9 100644 --- a/include/mapnik/palette.hpp +++ b/include/mapnik/palette.hpp @@ -46,7 +46,7 @@ MAPNIK_DISABLE_WARNING_POP #include #include -#define U2RED(x) ((x)&0xff) +#define U2RED(x) ((x) & 0xff) #define U2GREEN(x) (((x) >> 8) & 0xff) #define U2BLUE(x) (((x) >> 16) & 0xff) #define U2ALPHA(x) (((x) >> 24) & 0xff) diff --git a/include/mapnik/params.hpp b/include/mapnik/params.hpp index 3c5e99311..f6da507ed 100644 --- a/include/mapnik/params.hpp +++ b/include/mapnik/params.hpp @@ -75,18 +75,18 @@ class MAPNIK_DECL parameters : public param_map #ifdef _MSC_VER template MAPNIK_DECL std::optional parameters::get(std::string const& key) const; template MAPNIK_DECL std::optional parameters::get(std::string const& key, - std::string const& default_opt_value) const; + std::string const& default_opt_value) const; template MAPNIK_DECL std::optional parameters::get(std::string const& key) const; template MAPNIK_DECL std::optional parameters::get(std::string const& key, - value_double const& default_opt_value) const; + value_double const& default_opt_value) const; template MAPNIK_DECL std::optional parameters::get(std::string const& key) const; template MAPNIK_DECL std::optional parameters::get(std::string const& key, - value_integer const& default_opt_value) const; + value_integer const& default_opt_value) const; template MAPNIK_DECL std::optional parameters::get(std::string const& key) const; template MAPNIK_DECL std::optional parameters::get(std::string const& key, - value_bool const& default_opt_value) const; + value_bool const& default_opt_value) const; template MAPNIK_DECL std::optional parameters::get(std::string const& key) const; template MAPNIK_DECL std::optional diff --git a/include/mapnik/params_impl.hpp b/include/mapnik/params_impl.hpp index f49ce1518..9d25a8957 100644 --- a/include/mapnik/params_impl.hpp +++ b/include/mapnik/params_impl.hpp @@ -72,10 +72,7 @@ struct extract_value return std::nullopt; } - static inline std::optional do_extract_from_bool(value_bool const& source) - { - return source; - } + static inline std::optional do_extract_from_bool(value_bool const& source) { return source; } }; template<> diff --git a/include/mapnik/sse.hpp b/include/mapnik/sse.hpp index e2438977d..7cde352ec 100644 --- a/include/mapnik/sse.hpp +++ b/include/mapnik/sse.hpp @@ -26,7 +26,7 @@ #include #include -#define ROUND_DOWN(x, s) ((x) & ~((s)-1)) +#define ROUND_DOWN(x, s) ((x) & ~((s) - 1)) typedef union { __m128i v; diff --git a/include/mapnik/svg/svg_renderer_agg.hpp b/include/mapnik/svg/svg_renderer_agg.hpp index 8afed5c74..91c0fd6f0 100644 --- a/include/mapnik/svg/svg_renderer_agg.hpp +++ b/include/mapnik/svg/svg_renderer_agg.hpp @@ -613,15 +613,9 @@ class renderer_agg : util::noncopyable } #endif - inline VertexSource& source() const - { - return source_; - } + inline VertexSource& source() const { return source_; } - inline group const& svg_group() const - { - return svg_group_; - } + inline group const& svg_group() const { return svg_group_; } private: diff --git a/include/mapnik/symbolizer_utils.hpp b/include/mapnik/symbolizer_utils.hpp index 3b2f15a50..e98c0f42a 100644 --- a/include/mapnik/symbolizer_utils.hpp +++ b/include/mapnik/symbolizer_utils.hpp @@ -464,8 +464,7 @@ struct set_symbolizer_property_impl const auto [result_value, is_evaluated] = pre_evaluate_expression(*val); if (is_evaluated) { - const auto enum_val2 = - detail::enum_traits::from_string(result_value.to_string()); + const auto enum_val2 = detail::enum_traits::from_string(result_value.to_string()); if (enum_val2) { put(sym, key, *enum_val); diff --git a/include/mapnik/util/file_io.hpp b/include/mapnik/util/file_io.hpp index e29cadfa0..3648dcd87 100644 --- a/include/mapnik/util/file_io.hpp +++ b/include/mapnik/util/file_io.hpp @@ -60,25 +60,13 @@ class file : public util::noncopyable } } - inline bool is_open() const - { - return file_ ? true : false; - } + inline bool is_open() const { return file_ ? true : false; } - explicit operator bool() const - { - return this->is_open(); - } + explicit operator bool() const { return this->is_open(); } - inline std::FILE* get() const - { - return file_.get(); - } + inline std::FILE* get() const { return file_.get(); } - inline std::size_t size() const - { - return size_; - } + inline std::size_t size() const { return size_; } inline data_type data() const { diff --git a/include/mapnik/util/singleton.hpp b/include/mapnik/util/singleton.hpp index 897fcee69..bfc86913f 100644 --- a/include/mapnik/util/singleton.hpp +++ b/include/mapnik/util/singleton.hpp @@ -77,10 +77,7 @@ class singleton singleton(const singleton& rhs); singleton& operator=(const singleton&); - static void onDeadReference() - { - throw std::runtime_error("dead reference!"); - } + static void onDeadReference() { throw std::runtime_error("dead reference!"); } static void DestroySingleton() { diff --git a/include/mapnik/version.hpp b/include/mapnik/version.hpp index e0d3085ab..2cb80493a 100644 --- a/include/mapnik/version.hpp +++ b/include/mapnik/version.hpp @@ -37,6 +37,6 @@ #define MAPNIK_VERSION_AT_LEAST(major, minor, patch) (MAPNIK_VERSION >= MAPNIK_VERSION_ENCODE(major, minor, patch)) -#define MAPNIK_VERSION_ENCODE(major, minor, patch) ((major)*100000 + (minor)*100 + (patch)) +#define MAPNIK_VERSION_ENCODE(major, minor, patch) ((major) * 100000 + (minor) * 100 + (patch)) #endif // MAPNIK_VERSION_HPP diff --git a/plugins/input/csv/csv_datasource.hpp b/plugins/input/csv/csv_datasource.hpp index 672219597..e300386ff 100644 --- a/plugins/input/csv/csv_datasource.hpp +++ b/plugins/input/csv/csv_datasource.hpp @@ -47,7 +47,6 @@ MAPNIK_DISABLE_WARNING_POP #include #include - template struct csv_linear : boost::geometry::index::linear {}; diff --git a/plugins/input/geobuf/geobuf.hpp b/plugins/input/geobuf/geobuf.hpp index f3a11bdb3..d4f4dcb33 100644 --- a/plugins/input/geobuf/geobuf.hpp +++ b/plugins/input/geobuf/geobuf.hpp @@ -404,8 +404,8 @@ struct geobuf : util::noncopyable } template - geometry::multi_line_string - read_multi_linestring(T& reader, std::optional> const& lengths) + geometry::multi_line_string read_multi_linestring(T& reader, + std::optional> const& lengths) { geometry::multi_line_string multi_line; multi_line.reserve(!lengths ? 1 : lengths->size()); diff --git a/plugins/input/ogr/ogr_layer_ptr.hpp b/plugins/input/ogr/ogr_layer_ptr.hpp index 950ff7587..15cc94321 100644 --- a/plugins/input/ogr/ogr_layer_ptr.hpp +++ b/plugins/input/ogr/ogr_layer_ptr.hpp @@ -139,20 +139,11 @@ class ogr_layer_ptr #endif } - std::string const& layer_name() const - { - return layer_name_; - } + std::string const& layer_name() const { return layer_name_; } - OGRLayer* layer() const - { - return layer_; - } + OGRLayer* layer() const { return layer_; } - bool is_valid() const - { - return is_valid_; - } + bool is_valid() const { return is_valid_; } private: diff --git a/plugins/input/pgraster/pgraster_wkb_reader.cpp b/plugins/input/pgraster/pgraster_wkb_reader.cpp index 6ef103b7b..490c1a61d 100644 --- a/plugins/input/pgraster/pgraster_wkb_reader.cpp +++ b/plugins/input/pgraster/pgraster_wkb_reader.cpp @@ -160,10 +160,10 @@ typedef enum { #define BANDTYPE_FLAG_RESERVED3 (1 << 4) #define BANDTYPE_PIXTYPE_MASK 0x0F -#define BANDTYPE_PIXTYPE(x) ((x)&BANDTYPE_PIXTYPE_MASK) -#define BANDTYPE_IS_OFFDB(x) ((x)&BANDTYPE_FLAG_OFFDB) -#define BANDTYPE_HAS_NODATA(x) ((x)&BANDTYPE_FLAG_HASNODATA) -#define BANDTYPE_IS_NODATA(x) ((x)&BANDTYPE_FLAG_ISNODATA) +#define BANDTYPE_PIXTYPE(x) ((x) & BANDTYPE_PIXTYPE_MASK) +#define BANDTYPE_IS_OFFDB(x) ((x) & BANDTYPE_FLAG_OFFDB) +#define BANDTYPE_HAS_NODATA(x) ((x) & BANDTYPE_FLAG_HASNODATA) +#define BANDTYPE_IS_NODATA(x) ((x) & BANDTYPE_FLAG_ISNODATA) } // namespace diff --git a/plugins/input/postgis/connection.hpp b/plugins/input/postgis/connection.hpp index 38c505d2c..53df192f4 100644 --- a/plugins/input/postgis/connection.hpp +++ b/plugins/input/postgis/connection.hpp @@ -236,20 +236,11 @@ class Connection return std::make_shared(result); } - std::string client_encoding() const - { - return PQparameterStatus(conn_, "client_encoding"); - } + std::string client_encoding() const { return PQparameterStatus(conn_, "client_encoding"); } - bool isOK() const - { - return (!closed_) && (PQstatus(conn_) != CONNECTION_BAD); - } + bool isOK() const { return (!closed_) && (PQstatus(conn_) != CONNECTION_BAD); } - bool isPending() const - { - return pending_; - } + bool isPending() const { return pending_; } void close() { diff --git a/plugins/input/shape/shapefile.hpp b/plugins/input/shape/shapefile.hpp index 2eac16d92..5798f22ef 100644 --- a/plugins/input/shape/shapefile.hpp +++ b/plugins/input/shape/shapefile.hpp @@ -171,30 +171,15 @@ class shape_file : public mapnik::util::mapped_memory_file file_.read(reinterpret_cast(&envelope), sizeof(envelope)); } - inline void rewind() - { - seek(100); - } + inline void rewind() { seek(100); } - inline void seek(std::streampos pos) - { - file_.seekg(pos, std::ios::beg); - } + inline void seek(std::streampos pos) { file_.seekg(pos, std::ios::beg); } - inline std::streampos pos() - { - return file_.tellg(); - } + inline std::streampos pos() { return file_.tellg(); } - inline bool is_eof() - { - return file_.eof(); - } + inline bool is_eof() { return file_.eof(); } - inline bool is_good() - { - return file_.good(); - } + inline bool is_good() { return file_.good(); } }; #endif // SHAPEFILE_HPP diff --git a/plugins/input/sqlite/sqlite_connection.hpp b/plugins/input/sqlite/sqlite_connection.hpp index 44767a799..107a31b57 100644 --- a/plugins/input/sqlite/sqlite_connection.hpp +++ b/plugins/input/sqlite/sqlite_connection.hpp @@ -115,8 +115,7 @@ class sqlite_connection s << "'" << sqlite3_errmsg(db_) << "'"; else s << "unknown error, lost connection"; - s << " (" << file_ << ")" - << "\nFull sql was: '" << sql << "'"; + s << " (" << file_ << ")" << "\nFull sql was: '" << sql << "'"; throw mapnik::datasource_exception(s.str()); } @@ -160,10 +159,7 @@ class sqlite_connection return rc; } - sqlite3* operator*() - { - return db_; - } + sqlite3* operator*() { return db_; } bool load_extension(std::string const& ext_path) { diff --git a/plugins/input/sqlite/sqlite_datasource.cpp b/plugins/input/sqlite/sqlite_datasource.cpp index a9e9eac58..3295cc1b5 100644 --- a/plugins/input/sqlite/sqlite_datasource.cpp +++ b/plugins/input/sqlite/sqlite_datasource.cpp @@ -260,9 +260,8 @@ sqlite_datasource::sqlite_datasource(parameters const& params) if (geometry_field_.empty()) { std::ostringstream s; - s << "Sqlite Plugin: unable to detect the column " - << "containing a valid geometry on table '" << geometry_table_ << "'. " - << "Please provide a column name by passing the 'geometry_field' option " + s << "Sqlite Plugin: unable to detect the column " << "containing a valid geometry on table '" + << geometry_table_ << "'. " << "Please provide a column name by passing the 'geometry_field' option " << "or indicate a different spatial table to use by passing the 'geometry_table' option"; throw datasource_exception(s.str()); } @@ -316,12 +315,9 @@ sqlite_datasource::sqlite_datasource(parameters const& params) else { std::ostringstream s; - s << "Sqlite Plugin: could not generate spatial index" - << " for table '" << geometry_table_ << "'" - << " as no primary key can be detected." - << " You should either declare an INTEGER PRIMARY KEY" - << " or set the 'key_field' option to force a" - << " given field to be used as the primary key"; + s << "Sqlite Plugin: could not generate spatial index" << " for table '" << geometry_table_ << "'" + << " as no primary key can be detected." << " You should either declare an INTEGER PRIMARY KEY" + << " or set the 'key_field' option to force a" << " given field to be used as the primary key"; throw datasource_exception(s.str()); } } diff --git a/plugins/input/sqlite/sqlite_utils.hpp b/plugins/input/sqlite/sqlite_utils.hpp index 0a2f942dd..be471e786 100644 --- a/plugins/input/sqlite/sqlite_utils.hpp +++ b/plugins/input/sqlite/sqlite_utils.hpp @@ -144,6 +144,7 @@ class sqlite_utils static void get_tables(std::shared_ptr ds, std::vector& tables) { std::ostringstream sql; + // clang-format off // todo handle finding tables from attached db's sql << " SELECT name FROM sqlite_master" << " WHERE type IN ('table','view')" @@ -155,6 +156,7 @@ class sqlite_utils << " SELECT name FROM sqlite_temp_master" << " WHERE type IN ('table','view')" << " ORDER BY 1"; + // clang-format on sqlite3_stmt* stmt = 0; const int rc = sqlite3_prepare_v2(*(*ds), sql.str().c_str(), -1, &stmt, 0); if (rc == SQLITE_OK) @@ -352,8 +354,7 @@ class sqlite_utils { std::ostringstream error_msg; error_msg << "Sqlite Plugin: invalid type for key field '" << rs->column_name(1) - << "' when creating index " - << "type was: " << type_oid << ""; + << "' when creating index " << "type was: " << type_oid << ""; throw mapnik::datasource_exception(error_msg.str()); } const sqlite_int64 pkid = rs->column_integer64(1); diff --git a/src/debug.cpp b/src/debug.cpp index 09287508f..a808f6d4a 100644 --- a/src/debug.cpp +++ b/src/debug.cpp @@ -61,13 +61,12 @@ std::atomic logger::severity_level_ bool logger::severity_env_check_{true}; bool logger::format_env_check_{true}; -logger::severity_type logger::severity_level_ -{ +logger::severity_type logger::severity_level_{ #endif #if MAPNIK_DEFAULT_LOG_SEVERITY == 0 logger::debug #elif MAPNIK_DEFAULT_LOG_SEVERITY == 1 - logger::warn + logger::warn #elif MAPNIK_DEFAULT_LOG_SEVERITY == 2 logger::error #elif MAPNIK_DEFAULT_LOG_SEVERITY == 3 diff --git a/src/grid/grid_renderer.cpp b/src/grid/grid_renderer.cpp index d6f2bc8df..4d7983adc 100644 --- a/src/grid/grid_renderer.cpp +++ b/src/grid/grid_renderer.cpp @@ -215,8 +215,8 @@ struct grid_render_marker_visitor 0.0, 0.0, 1.0, - std::nullopt); // TODO: is 1.0 a valid default here, and do we even care in grid_renderer - // what the image looks like? + std::nullopt); // TODO: is 1.0 a valid default here, and do we even care in + // grid_renderer what the image looks like? pixmap_.set_rectangle(feature_.id(), target, boost::math::iround(pos_.x - cx), diff --git a/src/map.cpp b/src/map.cpp index 04f17e0b4..ce80bd7ab 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -555,8 +555,7 @@ void Map::zoom_all() else { std::ostringstream s; - s << "could not zoom to combined layer extents " - << "using zoom_all because proj4 could not " + s << "could not zoom to combined layer extents " << "using zoom_all because proj4 could not " << "back project any layer extents into the map srs " << "(set map 'maximum-extent' to override layer extents)"; throw std::runtime_error(s.str()); diff --git a/src/params.cpp b/src/params.cpp index 3173222b2..0e357fff8 100644 --- a/src/params.cpp +++ b/src/params.cpp @@ -29,25 +29,24 @@ namespace mapnik { template std::optional parameters::get(std::string const& key) const; -template std::optional parameters::get(std::string const& key, - std::string const& default_opt_value) const; +template std::optional parameters::get(std::string const& key, std::string const& default_opt_value) const; template std::optional parameters::get(std::string const& key) const; template std::optional parameters::get(std::string const& key, - value_double const& default_opt_value) const; + value_double const& default_opt_value) const; template std::optional parameters::get(std::string const& key) const; template std::optional parameters::get(std::string const& key, value_bool const& default_opt_value) const; template std::optional parameters::get(std::string const& key) const; template std::optional parameters::get(std::string const& key, - boolean_type const& default_opt_value) const; + boolean_type const& default_opt_value) const; template std::optional parameters::get(std::string const& key) const; template std::optional parameters::get(std::string const& key, value_null const& default_opt_value) const; template std::optional parameters::get(std::string const& key) const; template std::optional parameters::get(std::string const& key, - value_integer const& default_opt_value) const; + value_integer const& default_opt_value) const; } // namespace mapnik diff --git a/src/proj_transform.cpp b/src/proj_transform.cpp index b09a45d5b..ca42e881a 100644 --- a/src/proj_transform.cpp +++ b/src/proj_transform.cpp @@ -492,14 +492,14 @@ std::string proj_transform::definition() const } else #endif - if (wgs84_to_merc_) - { - return "wgs84 => merc"; - } - else if (merc_to_wgs84_) - { - return "merc => wgs84"; - } + if (wgs84_to_merc_) + { + return "wgs84 => merc"; + } + else if (merc_to_wgs84_) + { + return "merc => wgs84"; + } return "unknown"; } diff --git a/src/save_map.cpp b/src/save_map.cpp index d758d32ee..144ade302 100644 --- a/src/save_map.cpp +++ b/src/save_map.cpp @@ -61,8 +61,8 @@ MAPNIK_DISABLE_WARNING_POP #include namespace mapnik { -using std::optional; using boost::property_tree::ptree; +using std::optional; void serialize_text_placements(ptree& node, text_placements_ptr const& p, bool explicit_defaults) { diff --git a/src/tiff_reader.hpp b/src/tiff_reader.hpp index 0d31f7555..0e305edeb 100644 --- a/src/tiff_reader.hpp +++ b/src/tiff_reader.hpp @@ -95,49 +95,19 @@ class tiff_reader : public image_reader unsigned width() const final; unsigned height() const final; std::optional> bounding_box() const final; - inline bool has_alpha() const final - { - return has_alpha_; - } + inline bool has_alpha() const final { return has_alpha_; } void read(unsigned x, unsigned y, image_rgba8& image) final; image_any read(unsigned x, unsigned y, unsigned width, unsigned height) final; // methods specific to tiff reader - unsigned bits_per_sample() const - { - return bps_; - } - unsigned sample_format() const - { - return sample_format_; - } - unsigned photometric() const - { - return photometric_; - } - bool is_tiled() const - { - return is_tiled_; - } - unsigned tile_width() const - { - return tile_width_; - } - unsigned tile_height() const - { - return tile_height_; - } - unsigned rows_per_strip() const - { - return rows_per_strip_; - } - unsigned planar_config() const - { - return planar_config_; - } - unsigned compression() const - { - return compression_; - } + unsigned bits_per_sample() const { return bps_; } + unsigned sample_format() const { return sample_format_; } + unsigned photometric() const { return photometric_; } + bool is_tiled() const { return is_tiled_; } + unsigned tile_width() const { return tile_width_; } + unsigned tile_height() const { return tile_height_; } + unsigned rows_per_strip() const { return rows_per_strip_; } + unsigned planar_config() const { return planar_config_; } + unsigned compression() const { return compression_; } private: tiff_reader(const tiff_reader&); @@ -718,9 +688,10 @@ void tiff_reader::read_stripped(std::size_t x0, std::size_t y0, ImageData& im const std::size_t end_y = std::min(y0 + height, height_); const std::size_t tx0{x0}; const std::size_t tx1{std::min(width + x0, width_)}; - + std::size_t row = 0; - const bool pick_first_band = (bands_ > 1) && (strip_size / (width_ * rows_per_strip_ * sizeof(pixel_type)) == bands_); + const bool pick_first_band = + (bands_ > 1) && (strip_size / (width_ * rows_per_strip_ * sizeof(pixel_type)) == bands_); for (std::size_t y = start_y; y < end_y; y += rows_per_strip_) { const std::size_t ty0 = std::max(y0, y) - y; diff --git a/src/xml_tree.cpp b/src/xml_tree.cpp index 2a7f9912e..6989efaf0 100644 --- a/src/xml_tree.cpp +++ b/src/xml_tree.cpp @@ -58,7 +58,10 @@ struct name_trait template<> \ struct name_trait \ { \ - static std::string name() { return std::string("type ") + type_name; } \ + static std::string name() \ + { \ + return std::string("type ") + type_name; \ + } \ }; DEFINE_NAME_TRAIT(double, "double") diff --git a/test/catch.hpp b/test/catch.hpp index 2fbb4a76b..b865fd077 100644 --- a/test/catch.hpp +++ b/test/catch.hpp @@ -809,7 +809,7 @@ constexpr auto operator"" _catch_sr(char const* rawChars, std::size_t size) noex struct TypeList \ {}; \ template \ - constexpr auto get_wrapper() noexcept->TypeList \ + constexpr auto get_wrapper() noexcept -> TypeList \ { \ return {}; \ } \ @@ -817,7 +817,7 @@ constexpr auto operator"" _catch_sr(char const* rawChars, std::size_t size) noex struct TemplateTypeList \ {}; \ template class... Cs> \ - constexpr auto get_wrapper() noexcept->TemplateTypeList \ + constexpr auto get_wrapper() noexcept -> TemplateTypeList \ { \ return {}; \ } \ @@ -883,7 +883,7 @@ constexpr auto operator"" _catch_sr(char const* rawChars, std::size_t size) noex struct Nttp \ {}; \ template \ - constexpr auto get_wrapper() noexcept->Nttp<__VA_ARGS__> \ + constexpr auto get_wrapper() noexcept -> Nttp<__VA_ARGS__> \ { \ return {}; \ } \ @@ -891,7 +891,7 @@ constexpr auto operator"" _catch_sr(char const* rawChars, std::size_t size) noex struct NttpTemplateTypeList \ {}; \ template class... Cs> \ - constexpr auto get_wrapper() noexcept->NttpTemplateTypeList \ + constexpr auto get_wrapper() noexcept -> NttpTemplateTypeList \ { \ return {}; \ } \ @@ -1351,9 +1351,8 @@ struct AutoReg : NonCopyable Signature, \ ...) \ namespace { \ - namespace INTERNAL_CATCH_MAKE_NAMESPACE(TestName) \ - { \ - INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD(TestName, ClassName, INTERNAL_CATCH_REMOVE_PARENS(Signature)); \ + namespace INTERNAL_CATCH_MAKE_NAMESPACE(TestName) { \ + INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD(TestName, ClassName, INTERNAL_CATCH_REMOVE_PARENS(Signature)); \ } \ } \ INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD(TestName, INTERNAL_CATCH_REMOVE_PARENS(Signature)) @@ -1508,29 +1507,27 @@ struct AutoReg : NonCopyable CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS \ INTERNAL_CATCH_DECLARE_SIG_TEST(TestFunc, INTERNAL_CATCH_REMOVE_PARENS(Signature)); \ namespace { \ - namespace INTERNAL_CATCH_MAKE_NAMESPACE(TestName) \ + namespace INTERNAL_CATCH_MAKE_NAMESPACE(TestName) { \ + INTERNAL_CATCH_TYPE_GEN \ + INTERNAL_CATCH_NTTP_GEN(INTERNAL_CATCH_REMOVE_PARENS(Signature)) \ + INTERNAL_CATCH_NTTP_REG_GEN(TestFunc, INTERNAL_CATCH_REMOVE_PARENS(Signature)) \ + template \ + struct TestName \ { \ - INTERNAL_CATCH_TYPE_GEN \ - INTERNAL_CATCH_NTTP_GEN(INTERNAL_CATCH_REMOVE_PARENS(Signature)) \ - INTERNAL_CATCH_NTTP_REG_GEN(TestFunc, INTERNAL_CATCH_REMOVE_PARENS(Signature)) \ - template \ - struct TestName \ + TestName() \ { \ - TestName() \ - { \ - int index = 0; \ - constexpr char const* tmpl_types[] = { \ - CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, __VA_ARGS__)}; \ - using expander = int[]; \ - (void)expander{ \ - (reg_test(Types{}, Catch::NameAndTags{Name " - " + std::string(tmpl_types[index]), Tags}), \ - index++)...}; /* NOLINT */ \ - } \ - }; \ - static int INTERNAL_CATCH_UNIQUE_NAME(globalRegistrar) = []() { \ - TestName(); \ - return 0; \ - }(); \ + int index = 0; \ + constexpr char const* tmpl_types[] = { \ + CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, __VA_ARGS__)}; \ + using expander = int[]; \ + (void)expander{(reg_test(Types{}, Catch::NameAndTags{Name " - " + std::string(tmpl_types[index]), Tags}), \ + index++)...}; /* NOLINT */ \ + } \ + }; \ + static int INTERNAL_CATCH_UNIQUE_NAME(globalRegistrar) = []() { \ + TestName(); \ + return 0; \ + }(); \ } \ } \ CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \ @@ -1590,41 +1587,40 @@ struct AutoReg : NonCopyable template \ static void TestFuncName(); \ namespace { \ - namespace INTERNAL_CATCH_MAKE_NAMESPACE(TestName) \ + namespace INTERNAL_CATCH_MAKE_NAMESPACE(TestName) { \ + INTERNAL_CATCH_TYPE_GEN \ + INTERNAL_CATCH_NTTP_GEN(INTERNAL_CATCH_REMOVE_PARENS(Signature)) \ + template \ + struct TestName \ { \ - INTERNAL_CATCH_TYPE_GEN \ - INTERNAL_CATCH_NTTP_GEN(INTERNAL_CATCH_REMOVE_PARENS(Signature)) \ - template \ - struct TestName \ + void reg_tests() \ { \ - void reg_tests() \ - { \ - int index = 0; \ - using expander = int[]; \ - constexpr char const* tmpl_types[] = { \ - CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TmplTypes))}; \ - constexpr char const* types_list[] = { \ - CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TypesList))}; \ - constexpr auto num_types = sizeof(types_list) / sizeof(types_list[0]); \ - (void)expander{ \ - (Catch::AutoReg(Catch::makeTestInvoker(&TestFuncName), \ - CATCH_INTERNAL_LINEINFO, \ - Catch::StringRef(), \ - Catch::NameAndTags{Name " - " + std::string(tmpl_types[index / num_types]) + "<" + \ - std::string(types_list[index % num_types]) + ">", \ - Tags}), \ - index++)...}; /* NOLINT */ \ - } \ - }; \ - static int INTERNAL_CATCH_UNIQUE_NAME(globalRegistrar) = []() { \ - using TestInit = typename create< \ - TestName, \ - decltype(get_wrapper()), \ - TypeList>::type; \ - TestInit t; \ - t.reg_tests(); \ - return 0; \ - }(); \ + int index = 0; \ + using expander = int[]; \ + constexpr char const* tmpl_types[] = { \ + CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TmplTypes))}; \ + constexpr char const* types_list[] = { \ + CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TypesList))}; \ + constexpr auto num_types = sizeof(types_list) / sizeof(types_list[0]); \ + (void)expander{ \ + (Catch::AutoReg(Catch::makeTestInvoker(&TestFuncName), \ + CATCH_INTERNAL_LINEINFO, \ + Catch::StringRef(), \ + Catch::NameAndTags{Name " - " + std::string(tmpl_types[index / num_types]) + "<" + \ + std::string(types_list[index % num_types]) + ">", \ + Tags}), \ + index++)...}; /* NOLINT */ \ + } \ + }; \ + static int INTERNAL_CATCH_UNIQUE_NAME(globalRegistrar) = []() { \ + using TestInit = typename create< \ + TestName, \ + decltype(get_wrapper()), \ + TypeList>::type; \ + TestInit t; \ + t.reg_tests(); \ + return 0; \ + }(); \ } \ } \ CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \ @@ -1678,32 +1674,31 @@ struct AutoReg : NonCopyable template \ static void TestFunc(); \ namespace { \ - namespace INTERNAL_CATCH_MAKE_NAMESPACE(TestName) \ + namespace INTERNAL_CATCH_MAKE_NAMESPACE(TestName) { \ + INTERNAL_CATCH_TYPE_GEN \ + template \ + struct TestName \ { \ - INTERNAL_CATCH_TYPE_GEN \ - template \ - struct TestName \ + void reg_tests() \ { \ - void reg_tests() \ - { \ - int index = 0; \ - using expander = int[]; \ - (void)expander{ \ - (Catch::AutoReg(Catch::makeTestInvoker(&TestFunc), \ - CATCH_INTERNAL_LINEINFO, \ - Catch::StringRef(), \ - Catch::NameAndTags{Name " - " + std::string(INTERNAL_CATCH_STRINGIZE(TmplList)) + \ - " - " + std::to_string(index), \ - Tags}), \ - index++)...}; /* NOLINT */ \ - } \ - }; \ - static int INTERNAL_CATCH_UNIQUE_NAME(globalRegistrar) = []() { \ - using TestInit = typename convert::type; \ - TestInit t; \ - t.reg_tests(); \ - return 0; \ - }(); \ + int index = 0; \ + using expander = int[]; \ + (void)expander{ \ + (Catch::AutoReg(Catch::makeTestInvoker(&TestFunc), \ + CATCH_INTERNAL_LINEINFO, \ + Catch::StringRef(), \ + Catch::NameAndTags{Name " - " + std::string(INTERNAL_CATCH_STRINGIZE(TmplList)) + \ + " - " + std::to_string(index), \ + Tags}), \ + index++)...}; /* NOLINT */ \ + } \ + }; \ + static int INTERNAL_CATCH_UNIQUE_NAME(globalRegistrar) = []() { \ + using TestInit = typename convert::type; \ + TestInit t; \ + t.reg_tests(); \ + return 0; \ + }(); \ } \ } \ CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \ @@ -1724,31 +1719,29 @@ struct AutoReg : NonCopyable CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS \ CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS \ namespace { \ - namespace INTERNAL_CATCH_MAKE_NAMESPACE(TestName) \ + namespace INTERNAL_CATCH_MAKE_NAMESPACE(TestName) { \ + INTERNAL_CATCH_TYPE_GEN \ + INTERNAL_CATCH_NTTP_GEN(INTERNAL_CATCH_REMOVE_PARENS(Signature)) \ + INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD(TestName, ClassName, INTERNAL_CATCH_REMOVE_PARENS(Signature)); \ + INTERNAL_CATCH_NTTP_REG_METHOD_GEN(TestName, INTERNAL_CATCH_REMOVE_PARENS(Signature)) \ + template \ + struct TestNameClass \ { \ - INTERNAL_CATCH_TYPE_GEN \ - INTERNAL_CATCH_NTTP_GEN(INTERNAL_CATCH_REMOVE_PARENS(Signature)) \ - INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD(TestName, ClassName, INTERNAL_CATCH_REMOVE_PARENS(Signature)); \ - INTERNAL_CATCH_NTTP_REG_METHOD_GEN(TestName, INTERNAL_CATCH_REMOVE_PARENS(Signature)) \ - template \ - struct TestNameClass \ + TestNameClass() \ { \ - TestNameClass() \ - { \ - int index = 0; \ - constexpr char const* tmpl_types[] = { \ - CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, __VA_ARGS__)}; \ - using expander = int[]; \ - (void)expander{(reg_test(Types{}, \ - #ClassName, \ - Catch::NameAndTags{Name " - " + std::string(tmpl_types[index]), Tags}), \ - index++)...}; /* NOLINT */ \ - } \ - }; \ - static int INTERNAL_CATCH_UNIQUE_NAME(globalRegistrar) = []() { \ - TestNameClass(); \ - return 0; \ - }(); \ + int index = 0; \ + constexpr char const* tmpl_types[] = { \ + CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, __VA_ARGS__)}; \ + using expander = int[]; \ + (void)expander{ \ + (reg_test(Types{}, #ClassName, Catch::NameAndTags{Name " - " + std::string(tmpl_types[index]), Tags}), \ + index++)...}; /* NOLINT */ \ + } \ + }; \ + static int INTERNAL_CATCH_UNIQUE_NAME(globalRegistrar) = []() { \ + TestNameClass(); \ + return 0; \ + }(); \ } \ } \ CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \ @@ -1816,41 +1809,40 @@ struct AutoReg : NonCopyable void test(); \ }; \ namespace { \ - namespace INTERNAL_CATCH_MAKE_NAMESPACE(TestNameClass) \ + namespace INTERNAL_CATCH_MAKE_NAMESPACE(TestNameClass) { \ + INTERNAL_CATCH_TYPE_GEN \ + INTERNAL_CATCH_NTTP_GEN(INTERNAL_CATCH_REMOVE_PARENS(Signature)) \ + template \ + struct TestNameClass \ { \ - INTERNAL_CATCH_TYPE_GEN \ - INTERNAL_CATCH_NTTP_GEN(INTERNAL_CATCH_REMOVE_PARENS(Signature)) \ - template \ - struct TestNameClass \ + void reg_tests() \ { \ - void reg_tests() \ - { \ - int index = 0; \ - using expander = int[]; \ - constexpr char const* tmpl_types[] = { \ - CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TmplTypes))}; \ - constexpr char const* types_list[] = { \ - CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TypesList))}; \ - constexpr auto num_types = sizeof(types_list) / sizeof(types_list[0]); \ - (void)expander{ \ - (Catch::AutoReg(Catch::makeTestInvoker(&TestName::test), \ - CATCH_INTERNAL_LINEINFO, \ - #ClassName, \ - Catch::NameAndTags{Name " - " + std::string(tmpl_types[index / num_types]) + "<" + \ - std::string(types_list[index % num_types]) + ">", \ - Tags}), \ - index++)...}; /* NOLINT */ \ - } \ - }; \ - static int INTERNAL_CATCH_UNIQUE_NAME(globalRegistrar) = []() { \ - using TestInit = typename create< \ - TestNameClass, \ - decltype(get_wrapper()), \ - TypeList>::type; \ - TestInit t; \ - t.reg_tests(); \ - return 0; \ - }(); \ + int index = 0; \ + using expander = int[]; \ + constexpr char const* tmpl_types[] = { \ + CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TmplTypes))}; \ + constexpr char const* types_list[] = { \ + CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TypesList))}; \ + constexpr auto num_types = sizeof(types_list) / sizeof(types_list[0]); \ + (void)expander{ \ + (Catch::AutoReg(Catch::makeTestInvoker(&TestName::test), \ + CATCH_INTERNAL_LINEINFO, \ + #ClassName, \ + Catch::NameAndTags{Name " - " + std::string(tmpl_types[index / num_types]) + "<" + \ + std::string(types_list[index % num_types]) + ">", \ + Tags}), \ + index++)...}; /* NOLINT */ \ + } \ + }; \ + static int INTERNAL_CATCH_UNIQUE_NAME(globalRegistrar) = []() { \ + using TestInit = typename create< \ + TestNameClass, \ + decltype(get_wrapper()), \ + TypeList>::type; \ + TestInit t; \ + t.reg_tests(); \ + return 0; \ + }(); \ } \ } \ CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \ @@ -1911,32 +1903,31 @@ struct AutoReg : NonCopyable void test(); \ }; \ namespace { \ - namespace INTERNAL_CATCH_MAKE_NAMESPACE(TestName) \ + namespace INTERNAL_CATCH_MAKE_NAMESPACE(TestName) { \ + INTERNAL_CATCH_TYPE_GEN \ + template \ + struct TestNameClass \ { \ - INTERNAL_CATCH_TYPE_GEN \ - template \ - struct TestNameClass \ + void reg_tests() \ { \ - void reg_tests() \ - { \ - int index = 0; \ - using expander = int[]; \ - (void)expander{ \ - (Catch::AutoReg(Catch::makeTestInvoker(&TestName::test), \ - CATCH_INTERNAL_LINEINFO, \ - #ClassName, \ - Catch::NameAndTags{Name " - " + std::string(INTERNAL_CATCH_STRINGIZE(TmplList)) + \ - " - " + std::to_string(index), \ - Tags}), \ - index++)...}; /* NOLINT */ \ - } \ - }; \ - static int INTERNAL_CATCH_UNIQUE_NAME(globalRegistrar) = []() { \ - using TestInit = typename convert::type; \ - TestInit t; \ - t.reg_tests(); \ - return 0; \ - }(); \ + int index = 0; \ + using expander = int[]; \ + (void)expander{ \ + (Catch::AutoReg(Catch::makeTestInvoker(&TestName::test), \ + CATCH_INTERNAL_LINEINFO, \ + #ClassName, \ + Catch::NameAndTags{Name " - " + std::string(INTERNAL_CATCH_STRINGIZE(TmplList)) + \ + " - " + std::to_string(index), \ + Tags}), \ + index++)...}; /* NOLINT */ \ + } \ + }; \ + static int INTERNAL_CATCH_UNIQUE_NAME(globalRegistrar) = []() { \ + using TestInit = typename convert::type; \ + TestInit t; \ + t.reg_tests(); \ + return 0; \ + }(); \ } \ } \ CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \ @@ -3217,8 +3208,8 @@ struct IResultCapture virtual void sectionEnded(SectionEndInfo const& endInfo) = 0; virtual void sectionEndedEarly(SectionEndInfo const& endInfo) = 0; - virtual auto acquireGeneratorTracker(StringRef generatorName, SourceLineInfo const& lineInfo) - -> IGeneratorTracker& = 0; + virtual auto acquireGeneratorTracker(StringRef generatorName, + SourceLineInfo const& lineInfo) -> IGeneratorTracker& = 0; #if defined(CATCH_CONFIG_ENABLE_BENCHMARKING) virtual void benchmarkPreparing(std::string const& name) = 0; @@ -4693,8 +4684,9 @@ using StringMatcher = Matchers::Impl::MatcherBase; void handleExceptionMatchExpr(AssertionHandler& handler, StringMatcher const& matcher, StringRef const& matcherString); template -auto makeMatchExpr(ArgT const& arg, MatcherT const& matcher, StringRef const& matcherString) - -> MatchExpr +auto makeMatchExpr(ArgT const& arg, + MatcherT const& matcher, + StringRef const& matcherString) -> MatchExpr { return MatchExpr(arg, matcher, matcherString); } @@ -5010,8 +5002,9 @@ template // Note: The type after -> is weird, because VS2015 cannot parse // the expression used in the typedef inside, when it is in // return type. Yeah. -auto generate(StringRef generatorName, SourceLineInfo const& lineInfo, L const& generatorExpression) - -> decltype(std::declval().get()) +auto generate(StringRef generatorName, + SourceLineInfo const& lineInfo, + L const& generatorExpression) -> decltype(std::declval().get()) { using UnderlyingType = typename decltype(generatorExpression())::type; @@ -5376,10 +5369,10 @@ class Option : nullableValue(nullptr) {} Option(T const& _value) - : nullableValue(new (storage) T(_value)) + : nullableValue(new(storage) T(_value)) {} Option(Option const& _other) - : nullableValue(_other ? new (storage) T(*_other) : nullptr) + : nullableValue(_other ? new(storage) T(*_other) : nullptr) {} ~Option() { reset(); } @@ -9283,8 +9276,8 @@ class RunContext : public IResultCapture, void sectionEnded(SectionEndInfo const& endInfo) override; void sectionEndedEarly(SectionEndInfo const& endInfo) override; - auto acquireGeneratorTracker(StringRef generatorName, SourceLineInfo const& lineInfo) - -> IGeneratorTracker& override; + auto acquireGeneratorTracker(StringRef generatorName, + SourceLineInfo const& lineInfo) -> IGeneratorTracker& override; #if defined(CATCH_CONFIG_ENABLE_BENCHMARKING) void benchmarkPreparing(std::string const& name) override; @@ -10840,7 +10833,7 @@ struct Help : Opt return ParserResult::ok(ParseResultType::ShortCircuitAll); }) { - static_cast (*this)("display usage information")["-?"]["-h"]["--help"].optional(); + static_cast(*this)("display usage information")["-?"]["-h"]["--help"].optional(); } }; @@ -12362,8 +12355,7 @@ FatalConditionHandler::FatalConditionHandler() { // We do not want to fully error out, because needing // the stack reserve should be rare enough anyway. - Catch::cerr() << "Failed to reserve piece of stack." - << " Stack overflows will not be reported successfully."; + Catch::cerr() << "Failed to reserve piece of stack." << " Stack overflows will not be reported successfully."; } } @@ -14191,10 +14183,7 @@ class RegistryHub : public IRegistryHub, CATCH_INTERNAL_ERROR("Attempted to register active exception under CATCH_CONFIG_DISABLE_EXCEPTIONS!"); #endif } - IMutableEnumValuesRegistry& getMutableEnumValuesRegistry() override - { - return m_enumValuesRegistry; - } + IMutableEnumValuesRegistry& getMutableEnumValuesRegistry() override { return m_enumValuesRegistry; } private: TestRegistry m_testCaseRegistry; @@ -15241,12 +15230,9 @@ void Session::showHelp() const } void Session::libIdentify() { - Catch::cout() << std::left << std::setw(16) << "description: " - << "A Catch2 test executable\n" - << std::left << std::setw(16) << "category: " - << "testframework\n" - << std::left << std::setw(16) << "framework: " - << "Catch Test\n" + Catch::cout() << std::left << std::setw(16) << "description: " << "A Catch2 test executable\n" + << std::left << std::setw(16) << "category: " << "testframework\n" + << std::left << std::setw(16) << "framework: " << "Catch Test\n" << std::left << std::setw(16) << "version: " << libraryVersion() << std::endl; } @@ -19364,8 +19350,7 @@ void JunitReporter::writeAssertion(AssertionStats const& stats) ReusableStringStream rss; if (stats.totals.assertions.total() > 0) { - rss << "FAILED" - << ":\n"; + rss << "FAILED" << ":\n"; if (result.hasExpression()) { rss << " "; diff --git a/test/standalone/map_xml_test.cpp b/test/standalone/map_xml_test.cpp index 35026d5f1..7f07c837a 100644 --- a/test/standalone/map_xml_test.cpp +++ b/test/standalone/map_xml_test.cpp @@ -68,13 +68,12 @@ class tmp_dir } catch (const std::exception& e) { - std::cerr << "Exception caught while trying to remove " - << "temporary directory " << m_path << ": " << e.what() << "\n"; + std::cerr << "Exception caught while trying to remove " << "temporary directory " << m_path << ": " + << e.what() << "\n"; } catch (...) { - std::cerr << "Unknown exception caught while trying to " - << "remove temporary directory " << m_path << "\n"; + std::cerr << "Unknown exception caught while trying to " << "remove temporary directory " << m_path << "\n"; } } diff --git a/test/unit/color/css_color.cpp b/test/unit/color/css_color.cpp index 7bd3e3ef7..ba9018f36 100644 --- a/test/unit/color/css_color.cpp +++ b/test/unit/color/css_color.cpp @@ -73,7 +73,7 @@ TEST_CASE("CSS color") CHECK(c.green() == 0x00); CHECK(c.blue() == 0xff); // rgba (fractional percent) - std::string s2("rgb(50.5%,0.5%,99.5%)"); //#8101fe80 + std::string s2("rgb(50.5%,0.5%,99.5%)"); // #8101fe80 CHECK(boost::spirit::x3::phrase_parse(s2.cbegin(), s2.cend(), color_grammar, space, c)); CHECK(c.alpha() == 0x80); CHECK(c.red() == 0x81); diff --git a/test/unit/svg/svg_parser_test.cpp b/test/unit/svg/svg_parser_test.cpp index 2ff448067..7d6d05779 100644 --- a/test/unit/svg/svg_parser_test.cpp +++ b/test/unit/svg/svg_parser_test.cpp @@ -55,8 +55,8 @@ std::ostream& operator<<(std::ostream& os, mapnik::gradient const& gr) double cx, cy, fx, fy, r; gr.get_control_points(fx, fy, cx, cy, r); - os << "\n"; + os << "\n"; for (auto const& stop : gr.get_stop_array()) { os << " (stop) << "\" color=\"" << std::get<1>(stop) << "\"/>\n"; diff --git a/utils/ogrindex/ogrindex.cpp b/utils/ogrindex/ogrindex.cpp index 5c955837f..f2c03777a 100644 --- a/utils/ogrindex/ogrindex.cpp +++ b/utils/ogrindex/ogrindex.cpp @@ -212,8 +212,7 @@ int main(int argc, char** argv) catch (...) { - std::clog << "unknown exception..." - << "\n"; + std::clog << "unknown exception..." << "\n"; return -1; } } diff --git a/utils/shapeindex/shapeindex.cpp b/utils/shapeindex/shapeindex.cpp index 6602257e1..394e27881 100644 --- a/utils/shapeindex/shapeindex.cpp +++ b/utils/shapeindex/shapeindex.cpp @@ -27,7 +27,7 @@ #include #include #include -//#include +// #include #include #include "shapefile.hpp" #include "shape_io.hpp"