Skip to content

Commit e9d2fde

Browse files
authored
Merge pull request #2388 from joto/cleanup-naming
Cleanup naming and formatting
2 parents 88e973f + 4af1d4f commit e9d2fde

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+123
-139
lines changed

.clang-format

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
---
2-
Language: Cpp
3-
BasedOnStyle: LLVM
2+
Language: Cpp
3+
BasedOnStyle: LLVM
44
AccessModifierOffset: -4
55
BreakBeforeBraces: Mozilla
6-
IndentWidth: 4
6+
IndentWidth: 4
77
ConstructorInitializerIndentWidth: 0
88
ReflowComments: false
99
AlwaysBreakTemplateDeclarations: true
10+
QualifierAlignment: Right

src/command-line-parser.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,8 @@ void check_options(options_t *options)
225225
}
226226
}
227227

228-
void check_options_expire(options_t *options) {
228+
void check_options_expire(options_t *options)
229+
{
229230
// Zoom level 31 is the technical limit because we use 32-bit integers for
230231
// the x and y index of a tile ID.
231232
if (options->expire_tiles_zoom_min > 31) {

src/db-copy-mgr.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ class db_copy_mgr_t
248248
* following the delete_object() are inserted.
249249
*/
250250
template <typename... ARGS>
251-
void delete_object(ARGS &&... args)
251+
void delete_object(ARGS &&...args)
252252
{
253253
assert(m_current);
254254
m_current.add_deletable(std::forward<ARGS>(args)...);

src/db-copy.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ class db_cmd_copy_delete_t : public db_cmd_copy_t
197197
}
198198

199199
template <typename... ARGS>
200-
void add_deletable(ARGS &&... args)
200+
void add_deletable(ARGS &&...args)
201201
{
202202
m_deleter.add(std::forward<ARGS>(args)...);
203203
}

src/expire-tiles.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,8 @@ void expire_tiles::from_line_segment(geom::point_t const &a,
177177
}
178178

179179
double const y_len = tilec_b.y() - tilec_a.y();
180-
double const hyp_len = std::sqrt(x_len * x_len + y_len * y_len); /* Pythagoras */
180+
double const hyp_len =
181+
std::sqrt(x_len * x_len + y_len * y_len); /* Pythagoras */
181182
double const x_step = x_len / hyp_len;
182183
double const y_step = y_len / hyp_len;
183184

src/flex-index.hpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,7 @@ class flex_index_t
5050

5151
std::string const &name() const noexcept { return m_name; }
5252

53-
void set_name(std::string name)
54-
{
55-
m_name = std::move(name);
56-
}
53+
void set_name(std::string name) { m_name = std::move(name); }
5754

5855
std::string const &expression() const noexcept { return m_expression; }
5956

src/flex-lua-locator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ int lua_wrapper_locator::all_intersecting()
140140
auto const names = self().all_intersecting(*geometry);
141141
lua_createtable(lua_state(), (int)names.size(), 0);
142142
int n = 0;
143-
for (auto const& name : names) {
143+
for (auto const &name : names) {
144144
lua_pushinteger(lua_state(), ++n);
145145
luaX_pushstring(lua_state(), name);
146146
lua_rawset(lua_state(), -3);

src/flex-lua-table.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,9 @@ namespace {
2626
void check_tablespace(std::string const &tablespace)
2727
{
2828
if (!has_tablespace(tablespace)) {
29-
throw fmt_error(
30-
"Tablespace '{0}' not available."
31-
" Use 'CREATE TABLESPACE \"{0}\" ...;' to create it.",
32-
tablespace);
29+
throw fmt_error("Tablespace '{0}' not available."
30+
" Use 'CREATE TABLESPACE \"{0}\" ...;' to create it.",
31+
tablespace);
3332
}
3433
}
3534

src/flex-table.hpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,13 @@
3737
* output. This is not a real primary key, because the values are not
3838
* necessarily unique.
3939
*/
40-
enum class flex_table_index_type : uint8_t {
40+
enum class flex_table_index_type : uint8_t
41+
{
4142
no_index,
42-
node, // index by node id
43-
way, // index by way id
44-
relation, // index by relation id
45-
area, // index by way (positive) or relation (negative) id
43+
node, // index by node id
44+
way, // index by way id
45+
relation, // index by relation id
46+
area, // index by way (positive) or relation (negative) id
4647
any_object, // any OSM object, two columns for type and id
4748
tile // index by tile with x and y columns (used for generalized data)
4849
};
@@ -54,12 +55,12 @@ class flex_table_t
5455
{
5556

5657
public:
57-
5858
/**
5959
* Table creation type: interim tables are created as UNLOGGED and with
6060
* autovacuum disabled.
6161
*/
62-
enum class table_type : uint8_t {
62+
enum class table_type : uint8_t
63+
{
6364
interim,
6465
permanent
6566
};

src/geom-area-assembler.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class area_assembler_t : public osmium::area::detail::BasicAssembler
5858
private:
5959
bool make_area();
6060

61-
osmium::memory::Buffer* m_buffer;
61+
osmium::memory::Buffer *m_buffer;
6262

6363
}; // class area_assembler_t
6464

0 commit comments

Comments
 (0)