Skip to content

Commit 55d1592

Browse files
authored
Merge pull request #2251 from joto/misc-cleanup
Misc cleanup
2 parents 2d61139 + 48299da commit 55d1592

File tree

12 files changed

+41
-36
lines changed

12 files changed

+41
-36
lines changed

src/expire-config.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@
1010
* For a full list of authors see the git log.
1111
*/
1212

13+
#include <cstdint>
1314
#include <cstdlib>
1415

15-
enum class expire_mode
16+
enum class expire_mode : uint8_t
1617
{
1718
full_area, // Expire all tiles covered by polygon.
1819
boundary_only, // Expire only tiles covered by polygon boundary.

src/flex-table.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include <cassert>
2424
#include <chrono>
2525
#include <cstddef>
26+
#include <cstdint>
2627
#include <future>
2728
#include <limits>
2829
#include <memory>
@@ -35,7 +36,7 @@
3536
* output. This is not a real primary key, because the values are not
3637
* necessarily unique.
3738
*/
38-
enum class flex_table_index_type {
39+
enum class flex_table_index_type : uint8_t {
3940
no_index,
4041
node, // index by node id
4142
way, // index by way id
@@ -57,7 +58,7 @@ class flex_table_t
5758
* Table creation type: interim tables are created as UNLOGGED and with
5859
* autovacuum disabled.
5960
*/
60-
enum class table_type {
61+
enum class table_type : uint8_t {
6162
interim,
6263
permanent
6364
};

src/input.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,9 @@ class data_source_t
122122
using iterator = osmium::memory::Buffer::t_iterator<osmium::OSMObject>;
123123

124124
std::unique_ptr<osmium::io::Reader> m_reader;
125-
osmium::memory::Buffer m_buffer{};
126-
iterator m_it{};
127-
iterator m_end{};
125+
osmium::memory::Buffer m_buffer;
126+
iterator m_it;
127+
iterator m_end;
128128
type_id m_last = {osmium::item_type::node, 0};
129129

130130
}; // class data_source_t

src/input.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ struct type_id
3535

3636
struct file_info
3737
{
38-
osmium::io::Header header{};
39-
osmium::Timestamp last_timestamp{};
38+
osmium::io::Header header;
39+
osmium::Timestamp last_timestamp;
4040
};
4141

4242
/**

src/logging.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@
1818
#include <fmt/color.h>
1919

2020
#include <atomic>
21+
#include <cstdint>
2122
#include <cstdio>
2223
#include <utility>
2324

24-
enum class log_level
25+
enum class log_level : uint8_t
2526
{
2627
debug = 1,
2728
info = 2,

src/middle.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
#include "middle.hpp"
1313
#include "options.hpp"
1414

15+
middle_query_t::~middle_query_t() = default;
16+
17+
middle_t::~middle_t() = default;
18+
1519
std::shared_ptr<middle_t>
1620
create_middle(std::shared_ptr<thread_pool_t> thread_pool,
1721
options_t const &options)

src/middle.hpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include <osmium/memory/buffer.hpp>
1414
#include <osmium/osm/entity_bits.hpp>
1515

16+
#include <cstdint>
1617
#include <memory>
1718

1819
#include "osmtypes.hpp"
@@ -89,8 +90,6 @@ struct middle_query_t : std::enable_shared_from_this<middle_query_t>
8990
osmium::memory::Buffer *buffer) const = 0;
9091
};
9192

92-
inline middle_query_t::~middle_query_t() = default;
93-
9493
/**
9594
* Interface for storing "raw" OSM data in an intermediate object store and
9695
* getting it back.
@@ -173,7 +172,7 @@ class middle_t
173172
}
174173

175174
#ifndef NDEBUG
176-
enum class middle_state
175+
enum class middle_state : uint8_t
177176
{
178177
constructed,
179178
started,
@@ -191,8 +190,6 @@ class middle_t
191190
std::shared_ptr<thread_pool_t> m_thread_pool;
192191
}; // class middle_t
193192

194-
inline middle_t::~middle_t() = default;
195-
196193
/// Factory function: Instantiate the middle based on the command line options.
197194
std::shared_ptr<middle_t>
198195
create_middle(std::shared_ptr<thread_pool_t> thread_pool,

src/options.hpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
class reprojection;
2323

24-
enum class command_t
24+
enum class command_t : uint8_t
2525
{
2626
help,
2727
version,
@@ -53,30 +53,30 @@ struct options_t
5353
bool prefix_is_set = false;
5454

5555
/// Pg Tablespace to store indexes on main tables (no default TABLESPACE)
56-
std::string tblsmain_index{};
56+
std::string tblsmain_index;
5757

5858
/// Pg Tablespace to store indexes on slim tables (no default TABLESPACE)
59-
std::string tblsslim_index{};
59+
std::string tblsslim_index;
6060

6161
/// Pg Tablespace to store main tables (no default TABLESPACE)
62-
std::string tblsmain_data{};
62+
std::string tblsmain_data;
6363

6464
/// Pg Tablespace to store slim tables (no default TABLESPACE)
65-
std::string tblsslim_data{};
65+
std::string tblsslim_data;
6666

6767
/// Default Pg schema.
6868
std::string dbschema{"public"};
6969

7070
/// Pg schema to store middle tables in.
71-
std::string middle_dbschema{};
71+
std::string middle_dbschema;
7272

7373
/// Pg schema to store output tables in.
74-
std::string output_dbschema{};
74+
std::string output_dbschema;
7575

76-
std::string style{}; ///< style file to use
76+
std::string style; ///< style file to use
7777

7878
/// Name of the flat node file used. Empty if flat node file is not enabled.
79-
std::string flat_node_file{};
79+
std::string flat_node_file;
8080

8181
std::string tag_transform_script;
8282

src/output-flex.hpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -298,19 +298,19 @@ class output_flex_t : public output_t
298298

299299
osmium::memory::Buffer m_area_buffer;
300300

301-
prepared_lua_function_t m_process_node{};
302-
prepared_lua_function_t m_process_way{};
303-
prepared_lua_function_t m_process_relation{};
301+
prepared_lua_function_t m_process_node;
302+
prepared_lua_function_t m_process_way;
303+
prepared_lua_function_t m_process_relation;
304304

305-
prepared_lua_function_t m_process_untagged_node{};
306-
prepared_lua_function_t m_process_untagged_way{};
307-
prepared_lua_function_t m_process_untagged_relation{};
305+
prepared_lua_function_t m_process_untagged_node;
306+
prepared_lua_function_t m_process_untagged_way;
307+
prepared_lua_function_t m_process_untagged_relation;
308308

309-
prepared_lua_function_t m_select_relation_members{};
309+
prepared_lua_function_t m_select_relation_members;
310310

311-
prepared_lua_function_t m_after_nodes{};
312-
prepared_lua_function_t m_after_ways{};
313-
prepared_lua_function_t m_after_relations{};
311+
prepared_lua_function_t m_after_nodes;
312+
prepared_lua_function_t m_after_ways;
313+
prepared_lua_function_t m_after_relations;
314314

315315
calling_context m_calling_context = calling_context::main;
316316

src/properties.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ bool properties_t::get_bool(std::string const &property,
8383
property);
8484
}
8585

86-
void properties_t::set_string(std::string property, std::string value)
86+
void properties_t::set_string(std::string const &property,
87+
std::string const &value)
8788
{
8889
m_properties[property] = value;
8990
m_to_update[property] = value;

0 commit comments

Comments
 (0)