From 55f2a9423288a6e84d2f1ee6bc35644d7fe4924d Mon Sep 17 00:00:00 2001 From: Jochen Topf Date: Wed, 15 Dec 2021 20:27:27 +0100 Subject: [PATCH] Fix various formatting issues --- .../osmium/area/detail/basic_assembler.hpp | 22 +++++++++---------- .../area/detail/basic_assembler_with_tags.hpp | 14 ++++++------ .../osmium/area/detail/node_ref_segment.hpp | 8 +++---- include/osmium/area/detail/segment_list.hpp | 6 ++--- include/osmium/area/problem_reporter_ogr.hpp | 9 +++----- include/osmium/geom/tile.hpp | 6 ++--- include/osmium/index/detail/vector_map.hpp | 5 ++--- .../osmium/index/detail/vector_multimap.hpp | 13 +++++------ include/osmium/index/id_set.hpp | 2 +- include/osmium/index/multimap/hybrid.hpp | 10 ++++----- .../osmium/io/detail/debug_output_format.hpp | 2 +- include/osmium/io/detail/input_format.hpp | 10 ++++----- include/osmium/io/detail/lz4.hpp | 6 ++--- include/osmium/io/detail/o5m_input_format.hpp | 8 +++---- include/osmium/io/detail/opl_input_format.hpp | 2 +- .../osmium/io/detail/opl_parser_functions.hpp | 2 +- include/osmium/io/detail/output_format.hpp | 12 +++++----- include/osmium/io/detail/pbf.hpp | 2 +- include/osmium/io/detail/pbf_input_format.hpp | 2 +- .../osmium/io/detail/pbf_output_format.hpp | 10 ++++----- include/osmium/io/detail/string_util.hpp | 3 +-- include/osmium/io/detail/xml_input_format.hpp | 2 +- .../osmium/io/detail/xml_output_format.hpp | 2 +- include/osmium/io/detail/zlib.hpp | 6 ++--- include/osmium/io/reader.hpp | 7 ++---- include/osmium/io/writer.hpp | 12 +++++----- include/osmium/memory/callback_buffer.hpp | 2 +- include/osmium/osm/box.hpp | 3 +-- include/osmium/osm/crc_zlib.hpp | 2 +- include/osmium/osm/metadata_options.hpp | 2 +- include/osmium/relations/members_database.hpp | 4 ++-- include/osmium/storage/item_stash.hpp | 2 +- include/osmium/visitor.hpp | 6 ++--- 33 files changed, 90 insertions(+), 114 deletions(-) diff --git a/include/osmium/area/detail/basic_assembler.hpp b/include/osmium/area/detail/basic_assembler.hpp index 3972317f1..f9474d51e 100644 --- a/include/osmium/area/detail/basic_assembler.hpp +++ b/include/osmium/area/detail/basic_assembler.hpp @@ -196,7 +196,7 @@ namespace osmium { ++m_stats.wrong_role; if (debug()) { std::cerr << " Segment " << *segment << " from way " << segment->way()->id() << " has role '" << segment->role_name() - << "', but should have role '" << (ring.is_outer() ? "outer" : "inner") << "'\n"; + << "', but should have role '" << (ring.is_outer() ? "outer" : "inner") << "'\n"; } if (m_config.problem_reporter) { if (ring.is_outer()) { @@ -326,7 +326,7 @@ namespace osmium { const int64_t ay = a.y(); const int64_t by = b.y(); const int64_t ly = end_location.y(); - const auto z = (bx - ax)*(ly - ay) - (by - ay)*(lx - ax); + const auto z = (bx - ax) * (ly - ay) - (by - ay) * (lx - ax); if (debug()) { std::cerr << " Segment z=" << z << '\n'; } @@ -353,7 +353,7 @@ namespace osmium { const int64_t ay = a.y(); const int64_t by = b.y(); const int64_t ly = location.y(); - const auto z = (bx - ax)*(ly - ay) - (by - ay)*(lx - ax); + const auto z = (bx - ax) * (ly - ay) - (by - ay) * (lx - ax); if (z >= 0) { nesting += segment->is_reverse() ? -1 : 1; @@ -593,7 +593,7 @@ namespace osmium { } ++m_stats.open_rings; } else { - if (loc == previous_location && (m_split_locations.empty() || m_split_locations.back() != previous_location )) { + if (loc == previous_location && (m_split_locations.empty() || m_split_locations.back() != previous_location)) { m_split_locations.push_back(previous_location); } ++it; @@ -696,7 +696,7 @@ namespace osmium { } bool there_are_open_rings() const noexcept { - return std::any_of(m_rings.cbegin(), m_rings.cend(), [](const ProtoRing& ring){ + return std::any_of(m_rings.cbegin(), m_rings.cend(), [](const ProtoRing& ring) { return !ring.closed(); }); } @@ -907,11 +907,11 @@ namespace osmium { auto count_remaining = m_segment_list.size(); for (const osmium::Location& location : m_split_locations) { const auto locs = make_range(std::equal_range(m_locations.begin(), - m_locations.end(), - slocation{}, - [this, &location](const slocation& lhs, const slocation& rhs) { - return lhs.location(m_segment_list, location) < rhs.location(m_segment_list, location); - })); + m_locations.end(), + slocation{}, + [this, &location](const slocation& lhs, const slocation& rhs) { + return lhs.location(m_segment_list, location) < rhs.location(m_segment_list, location); + })); for (auto& loc : locs) { if (!m_segment_list[loc.item].is_done()) { count_remaining -= add_new_ring_complex(loc); @@ -1152,7 +1152,7 @@ namespace osmium { timer_roles.stop(); } - m_stats.outer_rings = std::count_if(m_rings.cbegin(), m_rings.cend(), [](const ProtoRing& ring){ + m_stats.outer_rings = std::count_if(m_rings.cbegin(), m_rings.cend(), [](const ProtoRing& ring) { return ring.is_outer(); }); m_stats.inner_rings = m_rings.size() - m_stats.outer_rings; diff --git a/include/osmium/area/detail/basic_assembler_with_tags.hpp b/include/osmium/area/detail/basic_assembler_with_tags.hpp index f1c99e56b..f93cf1db9 100644 --- a/include/osmium/area/detail/basic_assembler_with_tags.hpp +++ b/include/osmium/area/detail/basic_assembler_with_tags.hpp @@ -56,13 +56,13 @@ namespace osmium { return false; } return stats().duplicate_nodes || - stats().duplicate_segments || - stats().intersections || - stats().open_rings || - stats().short_ways || - stats().touching_rings || - stats().ways_in_multiple_rings || - stats().wrong_role; + stats().duplicate_segments || + stats().intersections || + stats().open_rings || + stats().short_ways || + stats().touching_rings || + stats().ways_in_multiple_rings || + stats().wrong_role; } static void copy_tags_without_type(osmium::builder::AreaBuilder& builder, const osmium::TagList& tags) { diff --git a/include/osmium/area/detail/node_ref_segment.hpp b/include/osmium/area/detail/node_ref_segment.hpp index c43286600..562e4162e 100644 --- a/include/osmium/area/detail/node_ref_segment.hpp +++ b/include/osmium/area/detail/node_ref_segment.hpp @@ -192,7 +192,7 @@ namespace osmium { } const char* role_name() const noexcept { - static const std::array names = {{ "unknown", "outer", "inner", "empty" }}; + static const std::array names = {{"unknown", "outer", "inner", "empty"}}; return names[int(m_role)]; } @@ -219,7 +219,7 @@ namespace osmium { } inline bool operator!=(const NodeRefSegment& lhs, const NodeRefSegment& rhs) noexcept { - return ! (lhs == rhs); + return !(lhs == rhs); } /** @@ -346,9 +346,9 @@ namespace osmium { }; std::array sl = {{ - {0, s1.first().location() }, + {0, s1.first().location()}, {0, s1.second().location()}, - {1, s2.first().location() }, + {1, s2.first().location()}, {1, s2.second().location()}, }}; diff --git a/include/osmium/area/detail/segment_list.hpp b/include/osmium/area/detail/segment_list.hpp index f5978281b..26b7b088d 100644 --- a/include/osmium/area/detail/segment_list.hpp +++ b/include/osmium/area/detail/segment_list.hpp @@ -296,14 +296,14 @@ namespace osmium { } } - if (it+2 != m_segments.end() && *it == *(it+2)) { + if (it + 2 != m_segments.end() && *it == *(it + 2)) { ++overlapping_segments; if (problem_reporter) { problem_reporter->report_overlapping_segment(it->first(), it->second()); } } - m_segments.erase(it, it+2); + m_segments.erase(it, it + 2); } } @@ -323,7 +323,7 @@ namespace osmium { for (auto it1 = m_segments.cbegin(); it1 != m_segments.cend() - 1; ++it1) { const NodeRefSegment& s1 = *it1; - for (auto it2 = it1+1; it2 != m_segments.end(); ++it2) { + for (auto it2 = it1 + 1; it2 != m_segments.end(); ++it2) { const NodeRefSegment& s2 = *it2; assert(s1 != s2); // erase_duplicate_segments() should have made sure of that diff --git a/include/osmium/area/problem_reporter_ogr.hpp b/include/osmium/area/problem_reporter_ogr.hpp index 50f3be443..69f7f8074 100644 --- a/include/osmium/area/problem_reporter_ogr.hpp +++ b/include/osmium/area/problem_reporter_ogr.hpp @@ -117,8 +117,7 @@ namespace osmium { .add_field("nodes", OFTInteger, 8) .add_field("id1", OFTReal, 12, 1) .add_field("id2", OFTReal, 12, 1) - .add_field("problem", OFTString, 30) - ; + .add_field("problem", OFTString, 30); m_layer_lerror .add_field("obj_type", OFTString, 1) @@ -126,15 +125,13 @@ namespace osmium { .add_field("nodes", OFTInteger, 8) .add_field("id1", OFTReal, 12, 1) .add_field("id2", OFTReal, 12, 1) - .add_field("problem", OFTString, 30) - ; + .add_field("problem", OFTString, 30); m_layer_ways .add_field("obj_type", OFTString, 1) .add_field("obj_id", OFTInteger, 10) .add_field("way_id", OFTInteger, 10) - .add_field("nodes", OFTInteger, 8) - ; + .add_field("nodes", OFTInteger, 8); } void report_duplicate_node(osmium::object_id_type node_id1, osmium::object_id_type node_id2, osmium::Location location) override { diff --git a/include/osmium/geom/tile.hpp b/include/osmium/geom/tile.hpp index a4b7e4286..ea2b40d7b 100644 --- a/include/osmium/geom/tile.hpp +++ b/include/osmium/geom/tile.hpp @@ -77,8 +77,7 @@ namespace osmium { inline constexpr uint32_t mercx_to_tilex(uint32_t zoom, double x) noexcept { return static_cast(detail::clamp( static_cast((x + detail::max_coordinate_epsg3857) / tile_extent_in_zoom(zoom)), - 0, num_tiles_in_zoom(zoom) -1 - )); + 0, num_tiles_in_zoom(zoom) - 1)); } /** @@ -89,8 +88,7 @@ namespace osmium { inline constexpr uint32_t mercy_to_tiley(uint32_t zoom, double y) noexcept { return static_cast(detail::clamp( static_cast((detail::max_coordinate_epsg3857 - y) / tile_extent_in_zoom(zoom)), - 0, num_tiles_in_zoom(zoom) -1 - )); + 0, num_tiles_in_zoom(zoom) - 1)); } /** diff --git a/include/osmium/index/detail/vector_map.hpp b/include/osmium/index/detail/vector_map.hpp index 0097d5d28..afc2954c7 100644 --- a/include/osmium/index/detail/vector_map.hpp +++ b/include/osmium/index/detail/vector_map.hpp @@ -169,10 +169,9 @@ namespace osmium { vector_type m_vector; typename vector_type::const_iterator find_id(const TId id) const noexcept { - const element_type element { + const element_type element{ id, - osmium::index::empty_value() - }; + osmium::index::empty_value()}; return std::lower_bound(m_vector.begin(), m_vector.end(), element, [](const element_type& a, const element_type& b) { return a.first < b.first; }); diff --git a/include/osmium/index/detail/vector_multimap.hpp b/include/osmium/index/detail/vector_multimap.hpp index c69256f52..b452f18e9 100644 --- a/include/osmium/index/detail/vector_multimap.hpp +++ b/include/osmium/index/detail/vector_multimap.hpp @@ -92,20 +92,18 @@ namespace osmium { } std::pair get_all(const TId id) { - const element_type element { + const element_type element{ id, - osmium::index::empty_value() - }; + osmium::index::empty_value()}; return std::equal_range(m_vector.begin(), m_vector.end(), element, [](const element_type& a, const element_type& b) { return a.first < b.first; }); } std::pair get_all(const TId id) const { - const element_type element { + const element_type element{ id, - osmium::index::empty_value() - }; + osmium::index::empty_value()}; return std::equal_range(m_vector.cbegin(), m_vector.cend(), element, [](const element_type& a, const element_type& b) { return a.first < b.first; }); @@ -149,8 +147,7 @@ namespace osmium { void erase_removed() { m_vector.erase( std::remove_if(m_vector.begin(), m_vector.end(), is_removed), - m_vector.end() - ); + m_vector.end()); } void dump_as_list(const int fd) final { diff --git a/include/osmium/index/id_set.hpp b/include/osmium/index/id_set.hpp index 0142f1d86..683e9c1a1 100644 --- a/include/osmium/index/id_set.hpp +++ b/include/osmium/index/id_set.hpp @@ -256,7 +256,7 @@ namespace osmium { IdSet(other), m_size(other.m_size) { m_data.reserve(other.m_data.size()); - for (const auto& ptr: other.m_data) { + for (const auto& ptr : other.m_data) { if (ptr) { m_data.emplace_back(new unsigned char[chunk_size]); ::memcpy(m_data.back().get(), ptr.get(), chunk_size); diff --git a/include/osmium/index/multimap/hybrid.hpp b/include/osmium/index/multimap/hybrid.hpp index e757c0ad7..ce06c3315 100644 --- a/include/osmium/index/multimap/hybrid.hpp +++ b/include/osmium/index/multimap/hybrid.hpp @@ -62,10 +62,10 @@ namespace osmium { public: - HybridIterator(typename main_map_type::iterator begin_main, - typename main_map_type::iterator end_main, - typename extra_map_type::iterator begin_extra, - typename extra_map_type::iterator end_extra) : + HybridIterator(typename main_map_type::iterator begin_main, + typename main_map_type::iterator end_main, + typename extra_map_type::iterator begin_extra, + typename extra_map_type::iterator end_extra) : m_begin_main(begin_main), m_end_main(end_main), m_begin_extra(begin_extra), @@ -100,7 +100,7 @@ namespace osmium { } bool operator!=(const HybridIterator& rhs) const { - return ! operator==(rhs); + return !operator==(rhs); } const element_type& operator*() { diff --git a/include/osmium/io/detail/debug_output_format.hpp b/include/osmium/io/detail/debug_output_format.hpp index d23d26711..8f52876ba 100644 --- a/include/osmium/io/detail/debug_output_format.hpp +++ b/include/osmium/io/detail/debug_output_format.hpp @@ -261,7 +261,7 @@ namespace osmium { } } - void write_tags(const osmium::TagList& tags, const char* padding="") { + void write_tags(const osmium::TagList& tags, const char* padding = "") { if (tags.empty()) { return; } diff --git a/include/osmium/io/detail/input_format.hpp b/include/osmium/io/detail/input_format.hpp index 0b8ac06e4..4a600af1d 100644 --- a/include/osmium/io/detail/input_format.hpp +++ b/include/osmium/io/detail/input_format.hpp @@ -277,11 +277,11 @@ namespace osmium { return func; } throw unsupported_file_format_error{ - std::string{"Can not open file '"} + - file.filename() + - "' with type '" + - as_string(file.format()) + - "'. No support for reading this format in this program."}; + std::string{"Can not open file '"} + + file.filename() + + "' with type '" + + as_string(file.format()) + + "'. No support for reading this format in this program."}; } }; // class ParserFactory diff --git a/include/osmium/io/detail/lz4.hpp b/include/osmium/io/detail/lz4.hpp index ec9d4c1b6..59f15d3ca 100644 --- a/include/osmium/io/detail/lz4.hpp +++ b/include/osmium/io/detail/lz4.hpp @@ -89,8 +89,7 @@ namespace osmium { &*output.begin(), static_cast(input.size()), output_size, - compression_level - ); + compression_level); if (result == 0) { throw io_error{"LZ4 compression failed"}; @@ -119,8 +118,7 @@ namespace osmium { input, &*output.begin(), static_cast(input_size), - static_cast(raw_size) - ); + static_cast(raw_size)); if (result < 0) { throw io_error{"LZ4 decompression failed: invalid block"}; diff --git a/include/osmium/io/detail/o5m_input_format.hpp b/include/osmium/io/detail/o5m_input_format.hpp index 6d58332b6..8af642588 100644 --- a/include/osmium/io/detail/o5m_input_format.hpp +++ b/include/osmium/io/detail/o5m_input_format.hpp @@ -192,7 +192,7 @@ namespace osmium { } void check_header_magic() { - static const unsigned char header_magic[] = { 0xff, 0xe0, 0x04, 'o', '5' }; + static const unsigned char header_magic[] = {0xff, 0xe0, 0x04, 'o', '5'}; if (std::strncmp(reinterpret_cast(header_magic), m_data, sizeof(header_magic)) != 0) { throw o5m_error{"wrong header magic"}; @@ -222,7 +222,7 @@ namespace osmium { } void decode_header() { - if (! ensure_bytes_available(7)) { // overall length of header + if (!ensure_bytes_available(7)) { // overall length of header throw o5m_error{"file too short (incomplete header info)"}; } @@ -550,7 +550,7 @@ namespace osmium { throw o5m_error{"premature end of file"}; } - if (! ensure_bytes_available(length)) { + if (!ensure_bytes_available(length)) { throw o5m_error{"premature end of file"}; } @@ -635,7 +635,7 @@ namespace osmium { file_format::o5m, [](parser_arguments& args) { return std::unique_ptr(new O5mParser{args}); - }); + }); // dummy function to silence the unused variable warning from above inline bool get_registered_o5m_parser() noexcept { diff --git a/include/osmium/io/detail/opl_input_format.hpp b/include/osmium/io/detail/opl_input_format.hpp index fdaa8af29..27dad5a3c 100644 --- a/include/osmium/io/detail/opl_input_format.hpp +++ b/include/osmium/io/detail/opl_input_format.hpp @@ -155,7 +155,7 @@ namespace osmium { file_format::opl, [](parser_arguments& args) { return std::unique_ptr(new OPLParser{args}); - }); + }); // dummy function to silence the unused variable warning from above inline bool get_registered_opl_parser() noexcept { diff --git a/include/osmium/io/detail/opl_parser_functions.hpp b/include/osmium/io/detail/opl_parser_functions.hpp index a28133b0c..c5eb732b0 100644 --- a/include/osmium/io/detail/opl_parser_functions.hpp +++ b/include/osmium/io/detail/opl_parser_functions.hpp @@ -122,7 +122,7 @@ namespace osmium { * Check whether s points to something else than the end of the * string or a space or tab. */ - inline bool opl_non_empty(const char *s) { + inline bool opl_non_empty(const char* s) { return *s != '\0' && *s != ' ' && *s != '\t'; } diff --git a/include/osmium/io/detail/output_format.hpp b/include/osmium/io/detail/output_format.hpp index 50d47b7f0..528485191 100644 --- a/include/osmium/io/detail/output_format.hpp +++ b/include/osmium/io/detail/output_format.hpp @@ -81,7 +81,7 @@ namespace osmium { } char temp[20]; - char *t = temp; + char* t = temp; do { *t++ = static_cast(value % 10) + '0'; // NOLINT(bugprone-narrowing-conversions, cppcoreguidelines-narrowing-conversions) value /= 10; @@ -190,11 +190,11 @@ namespace osmium { } throw unsupported_file_format_error{ - std::string{"Can not open file '"} + - file.filename() + - "' with type '" + - as_string(file.format()) + - "'. No support for writing this format in this program."}; + std::string{"Can not open file '"} + + file.filename() + + "' with type '" + + as_string(file.format()) + + "'. No support for writing this format in this program."}; } }; // class OutputFormatFactory diff --git a/include/osmium/io/detail/pbf.hpp b/include/osmium/io/detail/pbf.hpp index 0d80de600..529aecb90 100644 --- a/include/osmium/io/detail/pbf.hpp +++ b/include/osmium/io/detail/pbf.hpp @@ -79,7 +79,7 @@ namespace osmium { lz4 = 2 }; - inline pbf_compression get_compression_type(const std::string &val) { + inline pbf_compression get_compression_type(const std::string& val) { if (val.empty() || val == "zlib" || val == "true") { return pbf_compression::zlib; } diff --git a/include/osmium/io/detail/pbf_input_format.hpp b/include/osmium/io/detail/pbf_input_format.hpp index a6a667ff4..df5802ddf 100644 --- a/include/osmium/io/detail/pbf_input_format.hpp +++ b/include/osmium/io/detail/pbf_input_format.hpp @@ -171,7 +171,7 @@ namespace osmium { * Decode the BlobHeader. Make sure it contains the expected * type. Return the size of the following Blob. */ - static size_t decode_blob_header(const protozero::data_view &data, const char* expected_type) { + static size_t decode_blob_header(const protozero::data_view& data, const char* expected_type) { protozero::pbf_message pbf_blob_header{data}; protozero::data_view blob_header_type; size_t blob_header_datasize = 0; diff --git a/include/osmium/io/detail/pbf_output_format.hpp b/include/osmium/io/detail/pbf_output_format.hpp index 593c4d915..b1fa95193 100644 --- a/include/osmium/io/detail/pbf_output_format.hpp +++ b/include/osmium/io/detail/pbf_output_format.hpp @@ -188,7 +188,7 @@ namespace osmium { m_user_sids.reserve(max_entities_per_block); } if (m_options->add_visible_flag) { - m_visibles.reserve(max_entities_per_block); + m_visibles.reserve(max_entities_per_block); } m_lats.reserve(max_entities_per_block); m_lons.reserve(max_entities_per_block); @@ -505,8 +505,7 @@ namespace osmium { SerializeBlob{std::move(m_primitive_block), pbf_blob_type::data, m_options.use_compression, - m_options.compression_level} - )); + m_options.compression_level})); } template @@ -589,7 +588,7 @@ namespace osmium { break; } } else { - char *end_ptr = nullptr; + char* end_ptr = nullptr; const auto val = std::strtol(pbl.c_str(), &end_ptr, 10); if (*end_ptr != '\0') { throw std::invalid_argument{"The 'pbf_compression_level' option must be an integer."}; @@ -664,8 +663,7 @@ namespace osmium { SerializeBlob{std::move(data), pbf_blob_type::header, m_options.use_compression, - m_options.compression_level} - )); + m_options.compression_level})); } void write_buffer(osmium::memory::Buffer&& buffer) final { diff --git a/include/osmium/io/detail/string_util.hpp b/include/osmium/io/detail/string_util.hpp index 229f445ce..5a18880f5 100644 --- a/include/osmium/io/detail/string_util.hpp +++ b/include/osmium/io/detail/string_util.hpp @@ -284,8 +284,7 @@ namespace osmium { } template - TOutputIterator append_codepoint_as_utf8(uint32_t cp, TOutputIterator out) - { + TOutputIterator append_codepoint_as_utf8(uint32_t cp, TOutputIterator out) { if (cp < 0x80UL) { *(out++) = static_cast(cp); } else if (cp < 0x800UL) { diff --git a/include/osmium/io/detail/xml_input_format.hpp b/include/osmium/io/detail/xml_input_format.hpp index 52de37529..69d4f8d69 100644 --- a/include/osmium/io/detail/xml_input_format.hpp +++ b/include/osmium/io/detail/xml_input_format.hpp @@ -350,7 +350,7 @@ namespace osmium { void top_level_element(const XML_Char* element, const XML_Char** attrs) { if (!std::strcmp(element, "osm")) { m_context_stack.push_back(context::osm); - } else if (!std::strcmp(element, "osmChange")){ + } else if (!std::strcmp(element, "osmChange")) { m_context_stack.push_back(context::osmChange); m_header.set_has_multiple_object_versions(true); } else { diff --git a/include/osmium/io/detail/xml_output_format.hpp b/include/osmium/io/detail/xml_output_format.hpp index a58653ee2..88eea2495 100644 --- a/include/osmium/io/detail/xml_output_format.hpp +++ b/include/osmium/io/detail/xml_output_format.hpp @@ -116,7 +116,7 @@ namespace osmium { op_delete = 3 }; // enum class operation - operation m_last_op {operation::op_none}; + operation m_last_op{operation::op_none}; xml_output_options m_options; diff --git a/include/osmium/io/detail/zlib.hpp b/include/osmium/io/detail/zlib.hpp index 98574a71f..2003ede37 100644 --- a/include/osmium/io/detail/zlib.hpp +++ b/include/osmium/io/detail/zlib.hpp @@ -86,8 +86,7 @@ namespace osmium { &output_size, reinterpret_cast(input.data()), static_cast(input.size()), // NOLINT(google-runtime-int) - compression_level - ); + compression_level); if (result != Z_OK) { throw io_error{std::string{"failed to compress data: "} + zError(result)}; @@ -116,8 +115,7 @@ namespace osmium { reinterpret_cast(&*output.begin()), &raw_size, reinterpret_cast(input), - input_size - ); + input_size); if (result != Z_OK) { throw io_error{std::string{"failed to uncompress data: "} + zError(result)}; diff --git a/include/osmium/io/reader.hpp b/include/osmium/io/reader.hpp index b4919b636..5c743cca9 100644 --- a/include/osmium/io/reader.hpp +++ b/include/osmium/io/reader.hpp @@ -177,8 +177,7 @@ namespace osmium { read_which_entities, read_metadata, buffers_kind, - want_buffered_pages_removed - }; + want_buffered_pages_removed}; creator(args)->parse(); } @@ -328,9 +327,7 @@ namespace osmium { m_osmdata_queue(detail::get_osmdata_queue_size(), "parser_results"), m_osmdata_queue_wrapper(m_osmdata_queue) { - (void)std::initializer_list{ - (set_option(args), 0)... - }; + (void)std::initializer_list{(set_option(args), 0)...}; if (!m_pool) { m_pool = &thread::Pool::default_instance(); diff --git a/include/osmium/io/writer.hpp b/include/osmium/io/writer.hpp index 8640a5058..5b33f8cb4 100644 --- a/include/osmium/io/writer.hpp +++ b/include/osmium/io/writer.hpp @@ -222,7 +222,7 @@ namespace osmium { void do_close() { if (m_status == status::okay) { - ensure_cleanup([&](){ + ensure_cleanup([&]() { do_write(std::move(m_buffer)); m_output->write_end(); m_status = status::closed; @@ -269,9 +269,7 @@ namespace osmium { assert(!m_file.buffer()); // XXX can't handle pseudo-files options_type options; - (void)std::initializer_list{ - (set_option(options, args), 0)... - }; + (void)std::initializer_list{(set_option(options, args), 0)...}; if (!options.pool) { options.pool = &thread::Pool::default_instance(); @@ -348,7 +346,7 @@ namespace osmium { * @throws Some form of osmium::io_error when there is a problem. */ void flush() { - ensure_cleanup([&](){ + ensure_cleanup([&]() { do_flush(); }); } @@ -362,7 +360,7 @@ namespace osmium { * @throws Some form of osmium::io_error when there is a problem. */ void operator()(osmium::memory::Buffer&& buffer) { - ensure_cleanup([&](){ + ensure_cleanup([&]() { do_flush(); do_write(std::move(buffer)); }); @@ -376,7 +374,7 @@ namespace osmium { * @throws Some form of osmium::io_error when there is a problem. */ void operator()(const osmium::memory::Item& item) { - ensure_cleanup([&](){ + ensure_cleanup([&]() { if (!m_buffer) { m_buffer = osmium::memory::Buffer{m_buffer_size, osmium::memory::Buffer::auto_grow::no}; diff --git a/include/osmium/memory/callback_buffer.hpp b/include/osmium/memory/callback_buffer.hpp index 1e256dac2..c432ed883 100644 --- a/include/osmium/memory/callback_buffer.hpp +++ b/include/osmium/memory/callback_buffer.hpp @@ -81,7 +81,7 @@ namespace osmium { }; enum { - default_max_buffer_size = 800UL * 1024UL + default_max_buffer_size = 800UL * 1024UL }; osmium::memory::Buffer m_buffer; diff --git a/include/osmium/osm/box.hpp b/include/osmium/osm/box.hpp index 27874468e..9dac242f2 100644 --- a/include/osmium/osm/box.hpp +++ b/include/osmium/osm/box.hpp @@ -84,8 +84,7 @@ namespace osmium { m_top_right(top_right) { assert( (!!bottom_left && !!top_right) || - (bottom_left.x() <= top_right.x() && bottom_left.y() <= top_right.y()) - ); + (bottom_left.x() <= top_right.x() && bottom_left.y() <= top_right.y())); } /** diff --git a/include/osmium/osm/crc_zlib.hpp b/include/osmium/osm/crc_zlib.hpp index 5600df903..cac167c60 100644 --- a/include/osmium/osm/crc_zlib.hpp +++ b/include/osmium/osm/crc_zlib.hpp @@ -63,7 +63,7 @@ namespace osmium { } void process_bytes(const void* buffer, std::size_t byte_count) noexcept { - m_crc32 = ::crc32(m_crc32, reinterpret_cast(buffer), static_cast(byte_count)); + m_crc32 = ::crc32(m_crc32, reinterpret_cast(buffer), static_cast(byte_count)); } unsigned long checksum() const noexcept { // NOLINT(google-runtime-int) diff --git a/include/osmium/osm/metadata_options.hpp b/include/osmium/osm/metadata_options.hpp index 6e3d9dd02..6cb04f745 100644 --- a/include/osmium/osm/metadata_options.hpp +++ b/include/osmium/osm/metadata_options.hpp @@ -208,7 +208,7 @@ namespace osmium { } if (user()) { - result += "user+"; + result += "user+"; } // remove last '+' character diff --git a/include/osmium/relations/members_database.hpp b/include/osmium/relations/members_database.hpp index 49f285e09..4985f5432 100644 --- a/include/osmium/relations/members_database.hpp +++ b/include/osmium/relations/members_database.hpp @@ -205,11 +205,11 @@ namespace osmium { */ struct counts { /// The number of members tracked and not found yet. - std::size_t tracked = 0; + std::size_t tracked = 0; /// The number of members tracked and found already. std::size_t available = 0; /// The number of members that were tracked, found and then removed because of a completed relation. - std::size_t removed = 0; + std::size_t removed = 0; }; /** diff --git a/include/osmium/storage/item_stash.hpp b/include/osmium/storage/item_stash.hpp index cd58aeff2..bf56b2ad7 100644 --- a/include/osmium/storage/item_stash.hpp +++ b/include/osmium/storage/item_stash.hpp @@ -184,7 +184,7 @@ namespace osmium { if (m_count_removed < 10UL * 1000UL) { // *1 return false; } - if (m_count_removed > 5UL * 1000UL * 1000UL) { // *2 + if (m_count_removed > 5UL * 1000UL * 1000UL) { // *2 return true; } if (m_count_removed * 5UL < m_count_items) { // *3 diff --git a/include/osmium/visitor.hpp b/include/osmium/visitor.hpp index 68a56d64b..d0229515a 100644 --- a/include/osmium/visitor.hpp +++ b/include/osmium/visitor.hpp @@ -305,15 +305,13 @@ namespace osmium { template inline void apply_item(TItem& item, THandlers&&... handlers) { (void)std::initializer_list{ - (detail::apply_item_impl(item, std::forward(handlers)), 0)... - }; + (detail::apply_item_impl(item, std::forward(handlers)), 0)...}; } template inline void apply_flush(THandlers&&... handlers) { (void)std::initializer_list{ - (std::forward(handlers).flush(), 0)... - }; + (std::forward(handlers).flush(), 0)...}; } template