Skip to content

Commit 55f2a94

Browse files
committed
Fix various formatting issues
1 parent 9b94aa7 commit 55f2a94

33 files changed

+90
-114
lines changed

include/osmium/area/detail/basic_assembler.hpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ namespace osmium {
196196
++m_stats.wrong_role;
197197
if (debug()) {
198198
std::cerr << " Segment " << *segment << " from way " << segment->way()->id() << " has role '" << segment->role_name()
199-
<< "', but should have role '" << (ring.is_outer() ? "outer" : "inner") << "'\n";
199+
<< "', but should have role '" << (ring.is_outer() ? "outer" : "inner") << "'\n";
200200
}
201201
if (m_config.problem_reporter) {
202202
if (ring.is_outer()) {
@@ -326,7 +326,7 @@ namespace osmium {
326326
const int64_t ay = a.y();
327327
const int64_t by = b.y();
328328
const int64_t ly = end_location.y();
329-
const auto z = (bx - ax)*(ly - ay) - (by - ay)*(lx - ax);
329+
const auto z = (bx - ax) * (ly - ay) - (by - ay) * (lx - ax);
330330
if (debug()) {
331331
std::cerr << " Segment z=" << z << '\n';
332332
}
@@ -353,7 +353,7 @@ namespace osmium {
353353
const int64_t ay = a.y();
354354
const int64_t by = b.y();
355355
const int64_t ly = location.y();
356-
const auto z = (bx - ax)*(ly - ay) - (by - ay)*(lx - ax);
356+
const auto z = (bx - ax) * (ly - ay) - (by - ay) * (lx - ax);
357357

358358
if (z >= 0) {
359359
nesting += segment->is_reverse() ? -1 : 1;
@@ -593,7 +593,7 @@ namespace osmium {
593593
}
594594
++m_stats.open_rings;
595595
} else {
596-
if (loc == previous_location && (m_split_locations.empty() || m_split_locations.back() != previous_location )) {
596+
if (loc == previous_location && (m_split_locations.empty() || m_split_locations.back() != previous_location)) {
597597
m_split_locations.push_back(previous_location);
598598
}
599599
++it;
@@ -696,7 +696,7 @@ namespace osmium {
696696
}
697697

698698
bool there_are_open_rings() const noexcept {
699-
return std::any_of(m_rings.cbegin(), m_rings.cend(), [](const ProtoRing& ring){
699+
return std::any_of(m_rings.cbegin(), m_rings.cend(), [](const ProtoRing& ring) {
700700
return !ring.closed();
701701
});
702702
}
@@ -907,11 +907,11 @@ namespace osmium {
907907
auto count_remaining = m_segment_list.size();
908908
for (const osmium::Location& location : m_split_locations) {
909909
const auto locs = make_range(std::equal_range(m_locations.begin(),
910-
m_locations.end(),
911-
slocation{},
912-
[this, &location](const slocation& lhs, const slocation& rhs) {
913-
return lhs.location(m_segment_list, location) < rhs.location(m_segment_list, location);
914-
}));
910+
m_locations.end(),
911+
slocation{},
912+
[this, &location](const slocation& lhs, const slocation& rhs) {
913+
return lhs.location(m_segment_list, location) < rhs.location(m_segment_list, location);
914+
}));
915915
for (auto& loc : locs) {
916916
if (!m_segment_list[loc.item].is_done()) {
917917
count_remaining -= add_new_ring_complex(loc);
@@ -1152,7 +1152,7 @@ namespace osmium {
11521152
timer_roles.stop();
11531153
}
11541154

1155-
m_stats.outer_rings = std::count_if(m_rings.cbegin(), m_rings.cend(), [](const ProtoRing& ring){
1155+
m_stats.outer_rings = std::count_if(m_rings.cbegin(), m_rings.cend(), [](const ProtoRing& ring) {
11561156
return ring.is_outer();
11571157
});
11581158
m_stats.inner_rings = m_rings.size() - m_stats.outer_rings;

include/osmium/area/detail/basic_assembler_with_tags.hpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,13 @@ namespace osmium {
5656
return false;
5757
}
5858
return stats().duplicate_nodes ||
59-
stats().duplicate_segments ||
60-
stats().intersections ||
61-
stats().open_rings ||
62-
stats().short_ways ||
63-
stats().touching_rings ||
64-
stats().ways_in_multiple_rings ||
65-
stats().wrong_role;
59+
stats().duplicate_segments ||
60+
stats().intersections ||
61+
stats().open_rings ||
62+
stats().short_ways ||
63+
stats().touching_rings ||
64+
stats().ways_in_multiple_rings ||
65+
stats().wrong_role;
6666
}
6767

6868
static void copy_tags_without_type(osmium::builder::AreaBuilder& builder, const osmium::TagList& tags) {

include/osmium/area/detail/node_ref_segment.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ namespace osmium {
192192
}
193193

194194
const char* role_name() const noexcept {
195-
static const std::array<const char*, 4> names = {{ "unknown", "outer", "inner", "empty" }};
195+
static const std::array<const char*, 4> names = {{"unknown", "outer", "inner", "empty"}};
196196
return names[int(m_role)];
197197
}
198198

@@ -219,7 +219,7 @@ namespace osmium {
219219
}
220220

221221
inline bool operator!=(const NodeRefSegment& lhs, const NodeRefSegment& rhs) noexcept {
222-
return ! (lhs == rhs);
222+
return !(lhs == rhs);
223223
}
224224

225225
/**
@@ -346,9 +346,9 @@ namespace osmium {
346346
};
347347

348348
std::array<seg_loc, 4> sl = {{
349-
{0, s1.first().location() },
349+
{0, s1.first().location()},
350350
{0, s1.second().location()},
351-
{1, s2.first().location() },
351+
{1, s2.first().location()},
352352
{1, s2.second().location()},
353353
}};
354354

include/osmium/area/detail/segment_list.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -296,14 +296,14 @@ namespace osmium {
296296
}
297297
}
298298

299-
if (it+2 != m_segments.end() && *it == *(it+2)) {
299+
if (it + 2 != m_segments.end() && *it == *(it + 2)) {
300300
++overlapping_segments;
301301
if (problem_reporter) {
302302
problem_reporter->report_overlapping_segment(it->first(), it->second());
303303
}
304304
}
305305

306-
m_segments.erase(it, it+2);
306+
m_segments.erase(it, it + 2);
307307
}
308308
}
309309

@@ -323,7 +323,7 @@ namespace osmium {
323323

324324
for (auto it1 = m_segments.cbegin(); it1 != m_segments.cend() - 1; ++it1) {
325325
const NodeRefSegment& s1 = *it1;
326-
for (auto it2 = it1+1; it2 != m_segments.end(); ++it2) {
326+
for (auto it2 = it1 + 1; it2 != m_segments.end(); ++it2) {
327327
const NodeRefSegment& s2 = *it2;
328328

329329
assert(s1 != s2); // erase_duplicate_segments() should have made sure of that

include/osmium/area/problem_reporter_ogr.hpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -117,24 +117,21 @@ namespace osmium {
117117
.add_field("nodes", OFTInteger, 8)
118118
.add_field("id1", OFTReal, 12, 1)
119119
.add_field("id2", OFTReal, 12, 1)
120-
.add_field("problem", OFTString, 30)
121-
;
120+
.add_field("problem", OFTString, 30);
122121

123122
m_layer_lerror
124123
.add_field("obj_type", OFTString, 1)
125124
.add_field("obj_id", OFTInteger, 10)
126125
.add_field("nodes", OFTInteger, 8)
127126
.add_field("id1", OFTReal, 12, 1)
128127
.add_field("id2", OFTReal, 12, 1)
129-
.add_field("problem", OFTString, 30)
130-
;
128+
.add_field("problem", OFTString, 30);
131129

132130
m_layer_ways
133131
.add_field("obj_type", OFTString, 1)
134132
.add_field("obj_id", OFTInteger, 10)
135133
.add_field("way_id", OFTInteger, 10)
136-
.add_field("nodes", OFTInteger, 8)
137-
;
134+
.add_field("nodes", OFTInteger, 8);
138135
}
139136

140137
void report_duplicate_node(osmium::object_id_type node_id1, osmium::object_id_type node_id2, osmium::Location location) override {

include/osmium/geom/tile.hpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,7 @@ namespace osmium {
7777
inline constexpr uint32_t mercx_to_tilex(uint32_t zoom, double x) noexcept {
7878
return static_cast<uint32_t>(detail::clamp<int32_t>(
7979
static_cast<int32_t>((x + detail::max_coordinate_epsg3857) / tile_extent_in_zoom(zoom)),
80-
0, num_tiles_in_zoom(zoom) -1
81-
));
80+
0, num_tiles_in_zoom(zoom) - 1));
8281
}
8382

8483
/**
@@ -89,8 +88,7 @@ namespace osmium {
8988
inline constexpr uint32_t mercy_to_tiley(uint32_t zoom, double y) noexcept {
9089
return static_cast<uint32_t>(detail::clamp<int32_t>(
9190
static_cast<int32_t>((detail::max_coordinate_epsg3857 - y) / tile_extent_in_zoom(zoom)),
92-
0, num_tiles_in_zoom(zoom) -1
93-
));
91+
0, num_tiles_in_zoom(zoom) - 1));
9492
}
9593

9694
/**

include/osmium/index/detail/vector_map.hpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,9 @@ namespace osmium {
169169
vector_type m_vector;
170170

171171
typename vector_type::const_iterator find_id(const TId id) const noexcept {
172-
const element_type element {
172+
const element_type element{
173173
id,
174-
osmium::index::empty_value<TValue>()
175-
};
174+
osmium::index::empty_value<TValue>()};
176175
return std::lower_bound(m_vector.begin(), m_vector.end(), element, [](const element_type& a, const element_type& b) {
177176
return a.first < b.first;
178177
});

include/osmium/index/detail/vector_multimap.hpp

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -92,20 +92,18 @@ namespace osmium {
9292
}
9393

9494
std::pair<iterator, iterator> get_all(const TId id) {
95-
const element_type element {
95+
const element_type element{
9696
id,
97-
osmium::index::empty_value<TValue>()
98-
};
97+
osmium::index::empty_value<TValue>()};
9998
return std::equal_range(m_vector.begin(), m_vector.end(), element, [](const element_type& a, const element_type& b) {
10099
return a.first < b.first;
101100
});
102101
}
103102

104103
std::pair<const_iterator, const_iterator> get_all(const TId id) const {
105-
const element_type element {
104+
const element_type element{
106105
id,
107-
osmium::index::empty_value<TValue>()
108-
};
106+
osmium::index::empty_value<TValue>()};
109107
return std::equal_range(m_vector.cbegin(), m_vector.cend(), element, [](const element_type& a, const element_type& b) {
110108
return a.first < b.first;
111109
});
@@ -149,8 +147,7 @@ namespace osmium {
149147
void erase_removed() {
150148
m_vector.erase(
151149
std::remove_if(m_vector.begin(), m_vector.end(), is_removed),
152-
m_vector.end()
153-
);
150+
m_vector.end());
154151
}
155152

156153
void dump_as_list(const int fd) final {

include/osmium/index/id_set.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ namespace osmium {
256256
IdSet<T>(other),
257257
m_size(other.m_size) {
258258
m_data.reserve(other.m_data.size());
259-
for (const auto& ptr: other.m_data) {
259+
for (const auto& ptr : other.m_data) {
260260
if (ptr) {
261261
m_data.emplace_back(new unsigned char[chunk_size]);
262262
::memcpy(m_data.back().get(), ptr.get(), chunk_size);

include/osmium/index/multimap/hybrid.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,10 @@ namespace osmium {
6262

6363
public:
6464

65-
HybridIterator(typename main_map_type::iterator begin_main,
66-
typename main_map_type::iterator end_main,
67-
typename extra_map_type::iterator begin_extra,
68-
typename extra_map_type::iterator end_extra) :
65+
HybridIterator(typename main_map_type::iterator begin_main,
66+
typename main_map_type::iterator end_main,
67+
typename extra_map_type::iterator begin_extra,
68+
typename extra_map_type::iterator end_extra) :
6969
m_begin_main(begin_main),
7070
m_end_main(end_main),
7171
m_begin_extra(begin_extra),
@@ -100,7 +100,7 @@ namespace osmium {
100100
}
101101

102102
bool operator!=(const HybridIterator& rhs) const {
103-
return ! operator==(rhs);
103+
return !operator==(rhs);
104104
}
105105

106106
const element_type& operator*() {

0 commit comments

Comments
 (0)