Skip to content

Commit f8c8225

Browse files
authored
Merge pull request #1383 from joto/fixes-clang-tidy
Fixes for stuff found by clang tidy
2 parents 00255b8 + ecf6557 commit f8c8225

File tree

5 files changed

+12
-8
lines changed

5 files changed

+12
-8
lines changed

src/format.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@
1313
#define FMT_HEADER_ONLY
1414
#include <fmt/format.h>
1515

16-
using namespace fmt::literals;
16+
using namespace fmt::literals; // NOLINT(google-global-names-in-headers)
1717

1818
#endif // OSM2PGSQL_FORMAT_HPP

src/middle-ram.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ bool middle_ram_t::way_get(osmid_t id, osmium::memory::Buffer *buffer) const
8383
return false;
8484
}
8585

86+
// NOLINTNEXTLINE(google-build-using-namespace)
8687
using namespace osmium::builder::attr;
8788
osmium::builder::add_way(*buffer, _id(id), _tags(ele->tags),
8889
_nodes(ele->ndids));
@@ -120,6 +121,7 @@ bool middle_ram_t::relation_get(osmid_t id,
120121
return false;
121122
}
122123

124+
// NOLINTNEXTLINE(google-build-using-namespace)
123125
using namespace osmium::builder::attr;
124126
osmium::builder::add_relation(*buffer, _id(id),
125127
_members(ele->members.for_builder()),

src/osmtypes.hpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@ struct member
3838
osmid_t id;
3939
std::string role;
4040

41-
explicit operator osmium::builder::attr::member_type const() const
41+
explicit operator osmium::builder::attr::member_type() const
4242
{
4343
return osmium::builder::attr::member_type(type, id, role.c_str());
4444
}
4545

46-
member(osmium::item_type t, osmid_t i, std::string const &r)
47-
: type(t), id(i), role(r)
46+
member(osmium::item_type t, osmid_t i, std::string r)
47+
: type(t), id(i), role(std::move(r))
4848
{}
4949
};
5050

@@ -73,13 +73,14 @@ struct tag_t
7373
std::string key;
7474
std::string value;
7575

76-
operator std::pair<char const *, char const *> const() const noexcept
76+
operator std::pair<char const *, char const *>() const noexcept
7777
{
7878
return std::pair<char const *, char const *>(key.c_str(),
7979
value.c_str());
8080
}
8181

82-
tag_t(std::string const &k, std::string const &v) : key(k), value(v) {}
82+
tag_t(std::string k, std::string v) : key(std::move(k)), value(std::move(v))
83+
{}
8384
};
8485

8586
/**

src/progress-display.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ static double count_per_second(osmid_t count, uint64_t elapsed) noexcept
2525
return static_cast<double>(count) / elapsed;
2626
}
2727

28-
static std::string cps_display(osmid_t count, uint64_t elapsed) noexcept
28+
static std::string cps_display(osmid_t count, uint64_t elapsed)
2929
{
3030
double const cps = count_per_second(count, elapsed);
3131

src/progress-display.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ class progress_display_t : public osmium::handler::Handler
4141
};
4242

4343
public:
44-
progress_display_t(bool enabled = false) noexcept : m_enabled(enabled)
44+
explicit progress_display_t(bool enabled = false) noexcept
45+
: m_enabled(enabled)
4546
{
4647
m_node.start = std::time(nullptr);
4748
}

0 commit comments

Comments
 (0)