Skip to content

Commit 26ea60e

Browse files
committed
Switch functions in outputs vom int to void return types.
The return values are not used. This continues the refactor started in 1e76aff.
1 parent a5f58b8 commit 26ea60e

File tree

9 files changed

+85
-167
lines changed

9 files changed

+85
-167
lines changed

src/output-gazetteer.hpp

Lines changed: 11 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -54,47 +54,29 @@ class output_gazetteer_t : public output_t
5454
{}
5555
int pending_relation(osmid_t, int) override { return 0; }
5656

57-
int node_add(osmium::Node const &node) override
58-
{
59-
return process_node(node);
60-
}
57+
void node_add(osmium::Node const &node) override { process_node(node); }
6158

62-
int way_add(osmium::Way *way) override { return process_way(way); }
59+
void way_add(osmium::Way *way) override { process_way(way); }
6360

64-
int relation_add(osmium::Relation const &rel) override
61+
void relation_add(osmium::Relation const &rel) override
6562
{
66-
return process_relation(rel);
63+
process_relation(rel);
6764
}
6865

69-
int node_modify(osmium::Node const &node) override
70-
{
71-
return process_node(node);
72-
}
66+
void node_modify(osmium::Node const &node) override { process_node(node); }
7367

74-
int way_modify(osmium::Way *way) override { return process_way(way); }
68+
void way_modify(osmium::Way *way) override { process_way(way); }
7569

76-
int relation_modify(osmium::Relation const &rel) override
70+
void relation_modify(osmium::Relation const &rel) override
7771
{
78-
return process_relation(rel);
72+
process_relation(rel);
7973
}
8074

81-
int node_delete(osmid_t id) override
82-
{
83-
m_copy.delete_object('N', id);
84-
return 0;
85-
}
75+
void node_delete(osmid_t id) override { m_copy.delete_object('N', id); }
8676

87-
int way_delete(osmid_t id) override
88-
{
89-
m_copy.delete_object('W', id);
90-
return 0;
91-
}
77+
void way_delete(osmid_t id) override { m_copy.delete_object('W', id); }
9278

93-
int relation_delete(osmid_t id) override
94-
{
95-
m_copy.delete_object('R', id);
96-
return 0;
97-
}
79+
void relation_delete(osmid_t id) override { m_copy.delete_object('R', id); }
9880

9981
private:
10082
enum

src/output-multi.cpp

Lines changed: 15 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -202,99 +202,87 @@ void output_multi_t::stop(osmium::thread::Pool *pool)
202202

203203
void output_multi_t::commit() { m_table->commit(); }
204204

205-
int output_multi_t::node_add(osmium::Node const &node)
205+
void output_multi_t::node_add(osmium::Node const &node)
206206
{
207207
if (m_processor->interests(geometry_processor::interest_node)) {
208-
return process_node(node);
208+
process_node(node);
209209
}
210-
return 0;
211210
}
212211

213-
int output_multi_t::way_add(osmium::Way *way)
212+
void output_multi_t::way_add(osmium::Way *way)
214213
{
215214
if (m_processor->interests(geometry_processor::interest_way) &&
216215
way->nodes().size() > 1) {
217-
return process_way(way);
216+
process_way(way);
218217
}
219-
return 0;
220218
}
221219

222-
int output_multi_t::relation_add(osmium::Relation const &rel)
220+
void output_multi_t::relation_add(osmium::Relation const &rel)
223221
{
224222
if (m_processor->interests(geometry_processor::interest_relation) &&
225223
!rel.members().empty()) {
226-
return process_relation(rel, 0);
224+
process_relation(rel, 0);
227225
}
228-
return 0;
229226
}
230227

231-
int output_multi_t::node_modify(osmium::Node const &node)
228+
void output_multi_t::node_modify(osmium::Node const &node)
232229
{
233230
if (m_processor->interests(geometry_processor::interest_node)) {
234231
// TODO - need to know it's a node?
235232
delete_from_output(node.id());
236233

237234
// TODO: need to mark any ways or relations using it - depends on what
238235
// type of output this is... delegate to the geometry processor??
239-
return process_node(node);
236+
process_node(node);
240237
}
241-
242-
return 0;
243238
}
244239

245-
int output_multi_t::way_modify(osmium::Way *way)
240+
void output_multi_t::way_modify(osmium::Way *way)
246241
{
247242
if (m_processor->interests(geometry_processor::interest_way)) {
248243
// TODO - need to know it's a way?
249244
delete_from_output(way->id());
250245

251246
// TODO: need to mark any relations using it - depends on what
252247
// type of output this is... delegate to the geometry processor??
253-
return process_way(way);
248+
process_way(way);
254249
}
255-
256-
return 0;
257250
}
258251

259-
int output_multi_t::relation_modify(osmium::Relation const &rel)
252+
void output_multi_t::relation_modify(osmium::Relation const &rel)
260253
{
261254
if (m_processor->interests(geometry_processor::interest_relation)) {
262255
// TODO - need to know it's a relation?
263256
delete_from_output(-rel.id());
264257

265258
// TODO: need to mark any other relations using it - depends on what
266259
// type of output this is... delegate to the geometry processor??
267-
return process_relation(rel, false);
260+
process_relation(rel, false);
268261
}
269-
270-
return 0;
271262
}
272263

273-
int output_multi_t::node_delete(osmid_t id)
264+
void output_multi_t::node_delete(osmid_t id)
274265
{
275266
if (m_processor->interests(geometry_processor::interest_node)) {
276267
// TODO - need to know it's a node?
277268
delete_from_output(id);
278269
}
279-
return 0;
280270
}
281271

282-
int output_multi_t::way_delete(osmid_t id)
272+
void output_multi_t::way_delete(osmid_t id)
283273
{
284274
if (m_processor->interests(geometry_processor::interest_way)) {
285275
// TODO - need to know it's a way?
286276
delete_from_output(id);
287277
}
288-
return 0;
289278
}
290279

291-
int output_multi_t::relation_delete(osmid_t id)
280+
void output_multi_t::relation_delete(osmid_t id)
292281
{
293282
if (m_processor->interests(geometry_processor::interest_relation)) {
294283
// TODO - need to know it's a relation?
295284
delete_from_output(-id);
296285
}
297-
return 0;
298286
}
299287

300288
int output_multi_t::process_node(osmium::Node const &node)

src/output-multi.hpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,17 +54,17 @@ class output_multi_t : public output_t
5454
size_t output_id, size_t &added) override;
5555
int pending_relation(osmid_t id, int exists) override;
5656

57-
int node_add(osmium::Node const &node) override;
58-
int way_add(osmium::Way *way) override;
59-
int relation_add(osmium::Relation const &rel) override;
57+
void node_add(osmium::Node const &node) override;
58+
void way_add(osmium::Way *way) override;
59+
void relation_add(osmium::Relation const &rel) override;
6060

61-
int node_modify(osmium::Node const &node) override;
62-
int way_modify(osmium::Way *way) override;
63-
int relation_modify(osmium::Relation const &rel) override;
61+
void node_modify(osmium::Node const &node) override;
62+
void way_modify(osmium::Way *way) override;
63+
void relation_modify(osmium::Relation const &rel) override;
6464

65-
int node_delete(osmid_t id) override;
66-
int way_delete(osmid_t id) override;
67-
int relation_delete(osmid_t id) override;
65+
void node_delete(osmid_t id) override;
66+
void way_delete(osmid_t id) override;
67+
void relation_delete(osmid_t id) override;
6868

6969
size_t pending_count() const override;
7070

src/output-null.cpp

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -20,24 +20,6 @@ void output_null_t::enqueue_relations(pending_queue_t &, osmid_t, size_t,
2020

2121
int output_null_t::pending_relation(osmid_t, int) { return 0; }
2222

23-
int output_null_t::node_add(osmium::Node const &) { return 0; }
24-
25-
int output_null_t::way_add(osmium::Way *) { return 0; }
26-
27-
int output_null_t::relation_add(osmium::Relation const &) { return 0; }
28-
29-
int output_null_t::node_delete(osmid_t) { return 0; }
30-
31-
int output_null_t::way_delete(osmid_t) { return 0; }
32-
33-
int output_null_t::relation_delete(osmid_t) { return 0; }
34-
35-
int output_null_t::node_modify(osmium::Node const &) { return 0; }
36-
37-
int output_null_t::way_modify(osmium::Way *) { return 0; }
38-
39-
int output_null_t::relation_modify(osmium::Relation const &) { return 0; }
40-
4123
std::shared_ptr<output_t>
4224
output_null_t::clone(std::shared_ptr<middle_query_t> const &mid,
4325
std::shared_ptr<db_copy_thread_t> const &) const

src/output-null.hpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,17 @@ class output_null_t : public output_t
3030
size_t output_id, size_t &added) override;
3131
int pending_relation(osmid_t id, int exists) override;
3232

33-
int node_add(osmium::Node const &node) override;
34-
int way_add(osmium::Way *way) override;
35-
int relation_add(osmium::Relation const &rel) override;
33+
void node_add(osmium::Node const &node) override {}
34+
void way_add(osmium::Way *way) override {}
35+
void relation_add(osmium::Relation const &rel) override {}
3636

37-
int node_modify(osmium::Node const &node) override;
38-
int way_modify(osmium::Way *way) override;
39-
int relation_modify(osmium::Relation const &rel) override;
37+
void node_modify(osmium::Node const &node) override {}
38+
void way_modify(osmium::Way *way) override {}
39+
void relation_modify(osmium::Relation const &rel) override {}
4040

41-
int node_delete(osmid_t id) override;
42-
int way_delete(osmid_t id) override;
43-
int relation_delete(osmid_t id) override;
41+
void node_delete(osmid_t id) override {}
42+
void way_delete(osmid_t id) override {}
43+
void relation_delete(osmid_t id) override {}
4444
};
4545

4646
#endif // OSM2PGSQL_OUTPUT_NULL_HPP

0 commit comments

Comments
 (0)