1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

C++11 patchset 2: remove util/cpp11.h and util/cpp11_container.h (#5821)

This commit is contained in:
Loïc Blot 2017-06-04 21:00:04 +02:00 committed by GitHub
parent 2362d3f926
commit a98baef5e4
59 changed files with 223 additions and 298 deletions

View file

@ -132,7 +132,7 @@ void push_item_definition(lua_State *L, const ItemDefinition &i)
void push_item_definition_full(lua_State *L, const ItemDefinition &i)
{
std::string type(es_ItemType[(int)i.type].str);
lua_newtable(L);
lua_pushstring(L, i.name.c_str());
lua_setfield(L, -2, "name");
@ -721,9 +721,9 @@ void push_content_features(lua_State *L, const ContentFeatures &c)
std::string paramtype2(ScriptApiNode::es_ContentParamType2[(int)c.param_type_2].str);
std::string drawtype(ScriptApiNode::es_DrawType[(int)c.drawtype].str);
std::string liquid_type(ScriptApiNode::es_LiquidType[(int)c.liquid_type].str);
/* Missing "tiles" because I don't see a usecase (at least not yet). */
lua_newtable(L);
lua_pushboolean(L, c.has_on_construct);
lua_setfield(L, -2, "has_on_construct");
@ -756,10 +756,10 @@ void push_content_features(lua_State *L, const ContentFeatures &c)
if (!c.palette_name.empty()) {
push_ARGB8(L, c.color);
lua_setfield(L, -2, "color");
lua_pushstring(L, c.palette_name.c_str());
lua_setfield(L, -2, "palette_name");
push_palette(L, c.palette);
lua_setfield(L, -2, "palette");
}
@ -767,7 +767,7 @@ void push_content_features(lua_State *L, const ContentFeatures &c)
lua_setfield(L, -2, "waving");
lua_pushnumber(L, c.connect_sides);
lua_setfield(L, -2, "connect_sides");
lua_newtable(L);
u16 i = 1;
for (std::vector<std::string>::const_iterator it = c.connects_to.begin();
@ -776,7 +776,7 @@ void push_content_features(lua_State *L, const ContentFeatures &c)
lua_rawseti(L, -2, i);
}
lua_setfield(L, -2, "connects_to");
push_ARGB8(L, c.post_effect_color);
lua_setfield(L, -2, "post_effect_color");
lua_pushnumber(L, c.leveled);
@ -1171,7 +1171,7 @@ void push_tool_capabilities(lua_State *L,
const ToolGroupCap &groupcap = i->second;
// Create subtable "times"
lua_newtable(L);
for (UNORDERED_MAP<int, float>::const_iterator
for (std::unordered_map<int, float>::const_iterator
i = groupcap.times.begin(); i != groupcap.times.end(); ++i) {
lua_pushinteger(L, i->first);
lua_pushnumber(L, i->second);

View file

@ -28,7 +28,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#define C_CONVERTER_H_
#include <vector>
#include "util/cpp11_container.h"
#include <unordered_map>
#include "irrlichttypes_bloated.h"
#include "common/c_types.h"
@ -60,7 +60,7 @@ bool getintfield(lua_State *L, int table,
bool getintfield(lua_State *L, int table,
const char *fieldname, u32 &result);
void read_groups(lua_State *L, int index,
UNORDERED_MAP<std::string, int> &result);
std::unordered_map<std::string, int> &result);
bool getboolfield(lua_State *L, int table,
const char *fieldname, bool &result);
bool getfloatfield(lua_State *L, int table,