Skip to content

Commit 142857d

Browse files
committed
Use UPPERCASE for string constants
1 parent c72a916 commit 142857d

File tree

4 files changed

+19
-19
lines changed

4 files changed

+19
-19
lines changed

src/lua-utils.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,23 +36,23 @@ void *luaX_get_context(lua_State *lua_state) noexcept
3636
namespace {
3737

3838
// Unique key for lua registry
39-
constexpr char const *const osm2pgsql_output_flex = "osm2pgsql_output_flex";
39+
constexpr char const *const OSM2PGSQL_OUTPUT_FLEX = "osm2pgsql_output_flex";
4040

4141
} // anonymous namespace
4242

4343
void luaX_set_context(lua_State *lua_state, void *ptr) noexcept
4444
{
4545
assert(lua_state);
4646
assert(ptr);
47-
lua_pushlightuserdata(lua_state, (void *)osm2pgsql_output_flex);
47+
lua_pushlightuserdata(lua_state, (void *)OSM2PGSQL_OUTPUT_FLEX);
4848
lua_pushlightuserdata(lua_state, ptr);
4949
lua_settable(lua_state, LUA_REGISTRYINDEX);
5050
}
5151

5252
void *luaX_get_context(lua_State *lua_state) noexcept
5353
{
5454
assert(lua_state);
55-
lua_pushlightuserdata(lua_state, (void *)osm2pgsql_output_flex);
55+
lua_pushlightuserdata(lua_state, (void *)OSM2PGSQL_OUTPUT_FLEX);
5656
lua_gettable(lua_state, LUA_REGISTRYINDEX);
5757
auto *const ptr = lua_touserdata(lua_state, -1);
5858
assert(ptr);

src/properties.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,18 @@
1919

2020
namespace {
2121

22-
constexpr char const *const properties_table = "osm2pgsql_properties";
22+
constexpr char const *const PROPERTIES_TABLE = "osm2pgsql_properties";
2323

2424
} // anonymous namespace
2525

2626
properties_t::properties_t(connection_params_t connection_params,
2727
std::string schema)
2828
: m_connection_params(std::move(connection_params)),
2929
m_schema(std::move(schema)),
30-
m_has_properties_table(has_table(m_schema, properties_table))
30+
m_has_properties_table(has_table(m_schema, PROPERTIES_TABLE))
3131
{
3232
assert(!m_schema.empty());
33-
log_debug("Found properties table '{}': {}.", properties_table,
33+
log_debug("Found properties table '{}': {}.", PROPERTIES_TABLE,
3434
m_has_properties_table);
3535
}
3636

@@ -159,5 +159,5 @@ bool properties_t::load()
159159

160160
std::string properties_t::table_name() const
161161
{
162-
return qualified_name(m_schema, properties_table);
162+
return qualified_name(m_schema, PROPERTIES_TABLE);
163163
}

src/tagtransform-lua.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ lua_tagtransform_t::lua_tagtransform_t(std::string const *tag_transform_script,
2424
lua_tostring(lua_state(), -1));
2525
}
2626

27-
check_lua_function_exists(node_func);
28-
check_lua_function_exists(way_func);
29-
check_lua_function_exists(rel_func);
30-
check_lua_function_exists(rel_mem_func);
27+
check_lua_function_exists(NODE_FUNC);
28+
check_lua_function_exists(WAY_FUNC);
29+
check_lua_function_exists(REL_FUNC);
30+
check_lua_function_exists(REL_MEM_FUNC);
3131
}
3232

3333
std::unique_ptr<tagtransform_t> lua_tagtransform_t::clone() const
@@ -86,13 +86,13 @@ bool lua_tagtransform_t::filter_tags(osmium::OSMObject const &o, bool *polygon,
8686
{
8787
switch (o.type()) {
8888
case osmium::item_type::node:
89-
lua_getglobal(lua_state(), node_func);
89+
lua_getglobal(lua_state(), NODE_FUNC);
9090
break;
9191
case osmium::item_type::way:
92-
lua_getglobal(lua_state(), way_func);
92+
lua_getglobal(lua_state(), WAY_FUNC);
9393
break;
9494
case osmium::item_type::relation:
95-
lua_getglobal(lua_state(), rel_func);
95+
lua_getglobal(lua_state(), REL_FUNC);
9696
break;
9797
default:
9898
throw std::runtime_error{"Unknown OSM type."};
@@ -153,7 +153,7 @@ bool lua_tagtransform_t::filter_rel_member_tags(
153153
bool *roads, taglist_t *out_tags)
154154
{
155155
size_t const num_members = member_roles.size();
156-
lua_getglobal(lua_state(), rel_mem_func);
156+
lua_getglobal(lua_state(), REL_MEM_FUNC);
157157

158158
lua_newtable(lua_state()); /* relations key value table */
159159

src/tagtransform-lua.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ class lua_tagtransform_t : public tagtransform_t
3636
bool *roads, taglist_t *out_tags) override;
3737

3838
private:
39-
constexpr static char const *const node_func = "filter_tags_node";
40-
constexpr static char const *const way_func = "filter_tags_way";
41-
constexpr static char const *const rel_func = "filter_basic_tags_rel";
42-
constexpr static char const *const rel_mem_func =
39+
constexpr static char const *const NODE_FUNC = "filter_tags_node";
40+
constexpr static char const *const WAY_FUNC = "filter_tags_way";
41+
constexpr static char const *const REL_FUNC = "filter_basic_tags_rel";
42+
constexpr static char const *const REL_MEM_FUNC =
4343
"filter_tags_relation_member";
4444

4545
void check_lua_function_exists(char const *func_name);

0 commit comments

Comments
 (0)