@@ -120,7 +120,7 @@ prepared_lua_function_t::prepared_lua_function_t(lua_State *lua_state,
120120
121121namespace {
122122
123- std::string_view const osm2pgsql_object_metatable = " osm2pgsql.OSMObject" ;
123+ char const * const OSM2PGSQL_OSMOBJECT_CLASS = " osm2pgsql.OSMObject" ;
124124
125125void push_osm_object_to_lua_stack (lua_State *lua_state,
126126 osmium::OSMObject const &object)
@@ -188,7 +188,7 @@ void push_osm_object_to_lua_stack(lua_State *lua_state,
188188 lua_rawset (lua_state, -3 );
189189
190190 // Set the metatable of this object
191- luaX_pushstring (lua_state, osm2pgsql_object_metatable );
191+ lua_pushstring (lua_state, OSM2PGSQL_OSMOBJECT_CLASS );
192192 lua_gettable (lua_state, LUA_REGISTRYINDEX);
193193 lua_setmetatable (lua_state, -2 );
194194}
@@ -312,7 +312,7 @@ void check_for_object(lua_State *lua_state, char const *const function_name)
312312 }
313313
314314 if (lua_getmetatable (lua_state, 1 )) {
315- luaL_getmetatable (lua_state, osm2pgsql_object_metatable. data () );
315+ luaL_getmetatable (lua_state, OSM2PGSQL_OSMOBJECT_CLASS );
316316 if (lua_rawequal (lua_state, -1 , -2 )) {
317317 lua_pop (lua_state, 2 ); // remove the two metatables
318318 return ;
@@ -608,19 +608,19 @@ int output_flex_t::app_define_expire_output()
608608flex_table_t &output_flex_t ::get_table_from_param()
609609{
610610 return get_from_idx_param (lua_state (), m_tables.get (),
611- osm2pgsql_table_name );
611+ OSM2PGSQL_TABLE_CLASS );
612612}
613613
614614expire_output_t &output_flex_t ::get_expire_output_from_param()
615615{
616616 return get_from_idx_param (lua_state (), m_expire_outputs.get (),
617- osm2pgsql_expire_output_name );
617+ OSM2PGSQL_EXPIRE_OUTPUT_CLASS );
618618}
619619
620620locator_t &output_flex_t ::get_locator_from_param()
621621{
622622 return get_from_idx_param (lua_state (), m_locators.get (),
623- osm2pgsql_locator_name );
623+ OSM2PGSQL_LOCATOR_CLASS );
624624}
625625
626626bool output_flex_t::way_cache_t::init (middle_query_t const &middle, osmid_t id)
@@ -745,7 +745,7 @@ int output_flex_t::table_insert()
745745
746746 // The first parameter is the table object.
747747 auto &table_connection = m_table_connections.at (
748- idx_from_param (lua_state (), osm2pgsql_table_name ));
748+ idx_from_param (lua_state (), OSM2PGSQL_TABLE_CLASS ));
749749
750750 // The second parameter must be a Lua table with the contents for the
751751 // fields.
@@ -1273,7 +1273,7 @@ void output_flex_t::init_lua(std::string const &filename,
12731273
12741274 // Store the methods on OSM objects in its metatable.
12751275 lua_getglobal (lua_state (), " object_metatable" );
1276- luaX_pushstring (lua_state (), osm2pgsql_object_metatable );
1276+ lua_pushstring (lua_state (), OSM2PGSQL_OSMOBJECT_CLASS );
12771277 lua_setfield (lua_state (), -2 , " __name" );
12781278 lua_getfield (lua_state (), -1 , " __index" );
12791279 luaX_add_table_func (lua_state (), " get_bbox" , lua_trampoline_app_get_bbox);
@@ -1296,7 +1296,7 @@ void output_flex_t::init_lua(std::string const &filename,
12961296 // Store the global object "object_metatable" defined in the init.lua
12971297 // script in the registry and then remove the global object. It will
12981298 // later be used as metatable for OSM objects.
1299- luaX_pushstring (lua_state (), osm2pgsql_object_metatable );
1299+ lua_pushstring (lua_state (), OSM2PGSQL_OSMOBJECT_CLASS );
13001300 lua_getglobal (lua_state (), " object_metatable" );
13011301 lua_settable (lua_state (), LUA_REGISTRYINDEX);
13021302 lua_pushnil (lua_state ());
0 commit comments