Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/expire-output.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,16 @@ class expire_output_t
public:
expire_output_t() = default;

std::string filename() const noexcept { return m_filename; }
std::string const &filename() const noexcept { return m_filename; }

void set_filename(std::string filename)
{
m_filename = std::move(filename);
}

std::string schema() const noexcept { return m_schema; }
std::string const &schema() const noexcept { return m_schema; }

std::string table() const noexcept { return m_table; }
std::string const &table() const noexcept { return m_table; }

void set_schema_and_table(std::string schema, std::string table)
{
Expand Down
10 changes: 5 additions & 5 deletions src/flex-lua-expire-output.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,31 +138,31 @@ int lua_wrapper_expire_output::tostring() const
return 1;
}

int lua_wrapper_expire_output::filename() const
int lua_wrapper_expire_output::filename() const noexcept
{
luaX_pushstring(lua_state(), self().filename());
return 1;
}

int lua_wrapper_expire_output::maxzoom() const
int lua_wrapper_expire_output::maxzoom() const noexcept
{
lua_pushinteger(lua_state(), self().maxzoom());
return 1;
}

int lua_wrapper_expire_output::minzoom() const
int lua_wrapper_expire_output::minzoom() const noexcept
{
lua_pushinteger(lua_state(), self().minzoom());
return 1;
}

int lua_wrapper_expire_output::schema() const
int lua_wrapper_expire_output::schema() const noexcept
{
luaX_pushstring(lua_state(), self().schema());
return 1;
}

int lua_wrapper_expire_output::table() const
int lua_wrapper_expire_output::table() const noexcept
{
luaX_pushstring(lua_state(), self().table());
return 1;
Expand Down
10 changes: 5 additions & 5 deletions src/flex-lua-expire-output.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ class lua_wrapper_expire_output : public lua_wrapper_base<expire_output_t>
}

int tostring() const;
int filename() const;
int maxzoom() const;
int minzoom() const;
int schema() const;
int table() const;
int filename() const noexcept;
int maxzoom() const noexcept;
int minzoom() const noexcept;
int schema() const noexcept;
int table() const noexcept;

}; // class lua_wrapper_expire_output

Expand Down
6 changes: 3 additions & 3 deletions src/flex-lua-locator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ int lua_wrapper_locator::tostring() const
return 1;
}

int lua_wrapper_locator::name() const
int lua_wrapper_locator::name() const noexcept
{
luaX_pushstring(lua_state(), self().name());
return 1;
Expand Down Expand Up @@ -158,7 +158,7 @@ int lua_wrapper_locator::all_intersecting()
int n = 0;
for (auto const& name : names) {
lua_pushinteger(lua_state(), ++n);
lua_pushstring(lua_state(), name.c_str());
luaX_pushstring(lua_state(), name);
lua_rawset(lua_state(), -3);
}

Expand All @@ -182,7 +182,7 @@ int lua_wrapper_locator::first_intersecting()
return 0;
}

lua_pushstring(lua_state(), name.c_str());
luaX_pushstring(lua_state(), name);

return 1;
}
2 changes: 1 addition & 1 deletion src/flex-lua-locator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class lua_wrapper_locator : public lua_wrapper_base<locator_t>
}

int tostring() const;
int name() const;
int name() const noexcept;
int add_bbox();
int add_from_db();
int all_intersecting();
Expand Down
15 changes: 7 additions & 8 deletions src/flex-lua-table.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ int lua_wrapper_table::tostring() const
return 1;
}

int lua_wrapper_table::cluster() const
int lua_wrapper_table::cluster() const noexcept
{
lua_pushboolean(lua_state(), self().cluster_by_geom());
return 1;
Expand All @@ -503,12 +503,11 @@ int lua_wrapper_table::columns() const
lua_pushinteger(lua_state(), ++n);
lua_newtable(lua_state());

luaX_add_table_str(lua_state(), "name", column.name().c_str());
luaX_add_table_str(lua_state(), "type", column.type_name().c_str());
luaX_add_table_str(lua_state(), "sql_type",
column.sql_type_name().c_str());
luaX_add_table_str(lua_state(), "name", column.name());
luaX_add_table_str(lua_state(), "type", column.type_name());
luaX_add_table_str(lua_state(), "sql_type", column.sql_type_name());
luaX_add_table_str(lua_state(), "sql_modifiers",
column.sql_modifiers().c_str());
column.sql_modifiers());
luaX_add_table_bool(lua_state(), "not_null", column.not_null());
luaX_add_table_bool(lua_state(), "create_only", column.create_only());

Expand All @@ -518,13 +517,13 @@ int lua_wrapper_table::columns() const
return 1;
}

int lua_wrapper_table::name() const
int lua_wrapper_table::name() const noexcept
{
luaX_pushstring(lua_state(), self().name());
return 1;
}

int lua_wrapper_table::schema() const
int lua_wrapper_table::schema() const noexcept
{
luaX_pushstring(lua_state(), self().schema());
return 1;
Expand Down
6 changes: 3 additions & 3 deletions src/flex-lua-table.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ class lua_wrapper_table : public lua_wrapper_base<flex_table_t>
}

int tostring() const;
int cluster() const;
int cluster() const noexcept;
int columns() const;
int name() const;
int schema() const;
int name() const noexcept;
int schema() const noexcept;

}; // class lua_wrapper_table

Expand Down
2 changes: 1 addition & 1 deletion src/lua-setup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ void setup_lua_environment(lua_State *lua_state, std::string const &filename,
if (!dir_path.empty()) {
dir_path += std::filesystem::path::preferred_separator;
}
luaX_add_table_str(lua_state, "config_dir", dir_path.c_str());
luaX_add_table_str(lua_state, "config_dir", dir_path);

luaX_add_table_str(lua_state, "mode", append_mode ? "append" : "create");
}
4 changes: 2 additions & 2 deletions src/lua-utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@ void luaX_add_table_str(lua_State *lua_state, char const *key,
}

void luaX_add_table_str(lua_State *lua_state, char const *key,
char const *value, std::size_t size) noexcept
std::string_view value) noexcept
{
lua_pushstring(lua_state, key);
lua_pushlstring(lua_state, value, size);
luaX_pushstring(lua_state, value);
lua_rawset(lua_state, -3);
}

Expand Down
2 changes: 1 addition & 1 deletion src/lua-utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ void luaX_pushstring(lua_State *lua_state, std::string_view str) noexcept;
void luaX_add_table_str(lua_State *lua_state, char const *key,
char const *value) noexcept;
void luaX_add_table_str(lua_State *lua_state, char const *key,
char const *value, std::size_t size) noexcept;
std::string_view value) noexcept;
void luaX_add_table_int(lua_State *lua_state, char const *key,
int64_t value) noexcept;
void luaX_add_table_num(lua_State *lua_state, char const *key,
Expand Down
2 changes: 1 addition & 1 deletion src/output-flex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1281,7 +1281,7 @@ void output_flex_t::init_lua(std::string const &filename,
lua_createtable(lua_state(), 0, (int)properties.size());
for (auto const &property : properties) {
luaX_add_table_str(lua_state(), property.first.c_str(),
property.second.c_str());
property.second);
}
lua_rawset(lua_state(), -3);

Expand Down
8 changes: 4 additions & 4 deletions src/tagtransform-lua.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ bool lua_tagtransform_t::filter_tags(osmium::OSMObject const &o, bool *polygon,
taglist_t tags;
tags.add_attributes(o);
for (auto const &t : tags) {
lua_pushstring(lua_state(), t.key.c_str());
lua_pushstring(lua_state(), t.value.c_str());
luaX_pushstring(lua_state(), t.key);
luaX_pushstring(lua_state(), t.value);
lua_rawset(lua_state(), -3);
++sz;
}
Expand Down Expand Up @@ -158,8 +158,8 @@ bool lua_tagtransform_t::filter_rel_member_tags(
lua_newtable(lua_state()); /* relations key value table */

for (auto const &rel_tag : rel_tags) {
lua_pushstring(lua_state(), rel_tag.key.c_str());
lua_pushstring(lua_state(), rel_tag.value.c_str());
luaX_pushstring(lua_state(), rel_tag.key);
luaX_pushstring(lua_state(), rel_tag.value);
lua_rawset(lua_state(), -3);
}

Expand Down