Skip to content

Commit 3c5d105

Browse files
committed
Don't use __tostring as function name
Because names with two underscores are reserved in C++.
1 parent 95508e2 commit 3c5d105

File tree

6 files changed

+12
-12
lines changed

6 files changed

+12
-12
lines changed

src/flex-lua-expire-output.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ create_expire_output(lua_State *lua_state, std::string const &default_schema,
6565
return new_expire_output;
6666
}
6767

68-
TRAMPOLINE_WRAPPED_OBJECT(expire_output, __tostring)
68+
TRAMPOLINE_WRAPPED_OBJECT(expire_output, tostring)
6969
TRAMPOLINE_WRAPPED_OBJECT(expire_output, filename)
7070
TRAMPOLINE_WRAPPED_OBJECT(expire_output, maxzoom)
7171
TRAMPOLINE_WRAPPED_OBJECT(expire_output, minzoom)
@@ -112,7 +112,7 @@ void lua_wrapper_expire_output::init(lua_State *lua_state)
112112
lua_pushvalue(lua_state, -1);
113113
lua_setfield(lua_state, -2, "__index");
114114
luaX_add_table_func(lua_state, "__tostring",
115-
lua_trampoline_expire_output___tostring);
115+
lua_trampoline_expire_output_tostring);
116116
luaX_add_table_func(lua_state, "filename",
117117
lua_trampoline_expire_output_filename);
118118
luaX_add_table_func(lua_state, "maxzoom",
@@ -126,7 +126,7 @@ void lua_wrapper_expire_output::init(lua_State *lua_state)
126126
lua_pop(lua_state, 2);
127127
}
128128

129-
int lua_wrapper_expire_output::__tostring() const
129+
int lua_wrapper_expire_output::tostring() const
130130
{
131131
std::string const str =
132132
fmt::format("osm2pgsql.ExpireOutput[minzoom={},maxzoom={},filename={},"

src/flex-lua-expire-output.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class lua_wrapper_expire_output : public lua_wrapper_base<expire_output_t>
3636
{
3737
}
3838

39-
int __tostring() const;
39+
int tostring() const;
4040
int filename() const;
4141
int maxzoom() const;
4242
int minzoom() const;

src/flex-lua-locator.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ locator_t &create_locator(lua_State *lua_state,
3636
return new_locator;
3737
}
3838

39-
TRAMPOLINE_WRAPPED_OBJECT(locator, __tostring)
39+
TRAMPOLINE_WRAPPED_OBJECT(locator, tostring)
4040
TRAMPOLINE_WRAPPED_OBJECT(locator, name)
4141
TRAMPOLINE_WRAPPED_OBJECT(locator, add_bbox)
4242
TRAMPOLINE_WRAPPED_OBJECT(locator, add_from_db)
@@ -83,7 +83,7 @@ void lua_wrapper_locator::init(lua_State *lua_state,
8383
lua_pushvalue(lua_state, -1);
8484
lua_setfield(lua_state, -2, "__index");
8585
luaX_add_table_func(lua_state, "__tostring",
86-
lua_trampoline_locator___tostring);
86+
lua_trampoline_locator_tostring);
8787
luaX_add_table_func(lua_state, "name", lua_trampoline_locator_name);
8888
luaX_add_table_func(lua_state, "add_bbox", lua_trampoline_locator_add_bbox);
8989
luaX_add_table_func(lua_state, "add_from_db",
@@ -96,7 +96,7 @@ void lua_wrapper_locator::init(lua_State *lua_state,
9696
lua_pop(lua_state, 2);
9797
}
9898

99-
int lua_wrapper_locator::__tostring() const
99+
int lua_wrapper_locator::tostring() const
100100
{
101101
std::string const str{fmt::format("osm2pgsql.Locator[name={},size={}]",
102102
self().name(), self().size())};

src/flex-lua-locator.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class lua_wrapper_locator : public lua_wrapper_base<locator_t>
3838
{
3939
}
4040

41-
int __tostring() const;
41+
int tostring() const;
4242
int name() const;
4343
int add_bbox();
4444
int add_from_db();

src/flex-lua-table.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ void setup_flex_table_indexes(lua_State *lua_state, flex_table_t *table,
418418
lua_pop(lua_state, 1); // "indexes"
419419
}
420420

421-
TRAMPOLINE_WRAPPED_OBJECT(table, __tostring)
421+
TRAMPOLINE_WRAPPED_OBJECT(table, tostring)
422422
TRAMPOLINE_WRAPPED_OBJECT(table, cluster)
423423
TRAMPOLINE_WRAPPED_OBJECT(table, columns)
424424
TRAMPOLINE_WRAPPED_OBJECT(table, name)
@@ -469,7 +469,7 @@ void lua_wrapper_table::init(lua_State *lua_state)
469469
lua_pushvalue(lua_state, -1);
470470
lua_setfield(lua_state, -2, "__index");
471471
luaX_add_table_func(lua_state, "__tostring",
472-
lua_trampoline_table___tostring);
472+
lua_trampoline_table_tostring);
473473
luaX_add_table_func(lua_state, "insert", lua_trampoline_table_insert);
474474
luaX_add_table_func(lua_state, "name", lua_trampoline_table_name);
475475
luaX_add_table_func(lua_state, "schema", lua_trampoline_table_schema);
@@ -479,7 +479,7 @@ void lua_wrapper_table::init(lua_State *lua_state)
479479
lua_pop(lua_state, 2);
480480
}
481481

482-
int lua_wrapper_table::__tostring() const
482+
int lua_wrapper_table::tostring() const
483483
{
484484
std::string const str{fmt::format("osm2pgsql.Table[{}]", self().name())};
485485
luaX_pushstring(lua_state(), str);

src/flex-lua-table.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class lua_wrapper_table : public lua_wrapper_base<flex_table_t>
3636
{
3737
}
3838

39-
int __tostring() const;
39+
int tostring() const;
4040
int cluster() const;
4141
int columns() const;
4242
int name() const;

0 commit comments

Comments
 (0)