Automatically deduce the type in luax_pushtype, if possible

--HG--
branch : dynamiccore2
This commit is contained in:
Bart van Strien
2016-11-13 17:38:42 +01:00
parent 7dd960619d
commit 5d43c9601a
32 changed files with 121 additions and 106 deletions
+4 -4
View File
@@ -166,7 +166,7 @@ int w_newFile(lua_State *L)
}
}
luax_pushtype(L, File::type, t);
luax_pushtype(L, t);
t->release();
return 1;
}
@@ -246,7 +246,7 @@ int w_newFileData(lua_State *L)
{
return luax_ioError(L, "%s", e.what());
}
luax_pushtype(L, FileData::type, data);
luax_pushtype(L, data);
return 1;
}
else
@@ -260,7 +260,7 @@ int w_newFileData(lua_State *L)
FileData *t = nullptr;
luax_catchexcept(L, [&](){ t = instance()->newFileData(str, length, filename); });
luax_pushtype(L, FileData::type, t);
luax_pushtype(L, t);
t->release();
return 1;
}
@@ -474,7 +474,7 @@ int w_lines(lua_State *L)
return luaL_error(L, "Could not open file.");
}
luax_pushtype(L, File::type, file);
luax_pushtype(L, file);
file->release();
}
else