Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

lua_open() is deprecated, use luaL_newstate() instead.

Following solarus on this one.
  • Loading branch information...
commit 8141840bbcdeda0e70be1415735e6c38b0859302 1 parent 4016708
Yohann Ferreira authored
View
2  src/engine/script/script.cpp
@@ -43,7 +43,7 @@ ScriptEngine::ScriptEngine()
IF_PRINT_DEBUG(SCRIPT_DEBUG) << "ScriptEngine constructor invoked." << std::endl;
// Initialize Lua and LuaBind
- _global_state = lua_open();
+ _global_state = luaL_newstate();
luaL_openlibs(_global_state);
luabind::open(_global_state);
}
View
6 src/luabind/doc/docs.html
@@ -40,7 +40,7 @@
dl {
margin-left: 0.5em ;
- margin-right: 10em
+ margin-right: 10em
}
h3 {
@@ -299,7 +299,7 @@
}
h3 {
- text-transform: uppercase
+ text-transform: uppercase
}
</style>
@@ -2020,7 +2020,7 @@ <h1 class="title">luabind 0.9.1</h1>
{
try
{
- lua_state L = lua_open();
+ lua_state L = luaL_newstate();
/* ... */
}
catch(luabind::error&amp; e)
View
6 src/luabind/examples/any_converter/any_converter.cpp
@@ -69,15 +69,15 @@ int main()
register_any_converter<const char*>();
register_any_converter<std::string>();
- lua_State* L = lua_open();
-#if LUA_VERSION_NUM >= 501
+ lua_State* L = luaL_newstate();
+#if LUA_VERSION_NUM >= 501
luaL_openlibs(L);
#else
lua_baselibopen(L);
#endif
using namespace luabind;
-
+
open(L);
module(L)
[
View
6 src/luabind/examples/cln/cln_test.cpp
@@ -44,7 +44,7 @@ void bind_cln(lua_State* L)
.def(const_self <= other<int>())
.def(const_self < other<int>())
,
-
+
// rational numbers
class_<cl_RA, cl_R>("cl_RA")
.def(constructor<>())
@@ -99,7 +99,7 @@ void bind_cln(lua_State* L)
.def(const_self <= other<int>())
.def(const_self < other<int>())
,
-
+
def("factorial", &cln::factorial),
def("sqrt", (const cl_R(*)(const cl_R&))&cln::sqrt)
];
@@ -107,7 +107,7 @@ void bind_cln(lua_State* L)
int main()
{
- lua_State* L = lua_open();
+ lua_State* L = luaL_newstate();
lua_baselibopen(L);
lua_mathlibopen(L);
luabind::open(L);
View
10 src/luabind/examples/filesystem/filesystem.cpp
@@ -14,7 +14,7 @@ extern "C"
#include "directory_iterator.hpp"
-const boost::filesystem::path&
+const boost::filesystem::path&
identity(const boost::filesystem::path& x)
{
return x;
@@ -26,7 +26,7 @@ void bind_filesystem(lua_State* L)
using namespace boost::filesystem;
namespace fs = boost::filesystem;
-
+
module(L, "filesystem")
[
class_<fs::path>("path")
@@ -78,7 +78,7 @@ void bind_filesystem(lua_State* L)
int main(int argc, const char* argv[])
{
- lua_State* L = lua_open();
+ lua_State* L = luaL_newstate();
luaopen_base(L);
luaopen_string(L);
luaopen_table(L);
@@ -93,13 +93,13 @@ int main(int argc, const char* argv[])
"usage: filesystem filename [args]\n";
return 1;
}
-
+
using namespace luabind;
open(L);
bind_filesystem(L);
-
+
object args = newtable(L);
for (int i = 0; i < argc; ++i)
View
4 src/luabind/examples/glut/glut_bind.cpp
@@ -95,7 +95,7 @@ void bind_glut(lua_State* L)
open(L);
module(L)
- [
+ [
def("glutInitWindowSize", &glutInitWindowSize),
def("glutInitWindowPosition", &glutInitWindowPosition),
def("glutInitDisplayMode", &glutInitDisplayMode),
@@ -167,7 +167,7 @@ void bind_glut(lua_State* L)
int main(int argc, char* argv[])
{
- lua_State* L = lua_open();
+ lua_State* L = luaL_newstate();
lua_baselibopen(L);
lua_mathlibopen(L);
bind_glut(L);
View
8 src/luabind/examples/intrusive_ptr/intrusive_ptr.cpp
@@ -107,11 +107,11 @@ namespace luabind
struct A
{
A()
- : cnt(0)
+ : cnt(0)
{}
~A() { std::cout << "free memory\n"; }
-
+
int cnt;
};
@@ -140,11 +140,11 @@ boost::intrusive_ptr<A> factory()
int main()
{
- lua_State* L = lua_open();
+ lua_State* L = luaL_newstate();
lua_baselibopen(L);
luabind::open(L);
-
+
using namespace luabind;
module(L)
View
10 src/luabind/examples/regexp/regex_wrap.cpp
@@ -1,4 +1,4 @@
-#include <boost/cregex.hpp>
+#include <boost/cregex.hpp>
extern "C"
{
@@ -44,15 +44,15 @@ void wrap_regex(lua_State* L)
int main()
{
- lua_State* L = lua_open();
+ lua_State* L = luaL_newstate();
lua_baselibopen(L);
lua_strlibopen(L);
luabind::open(L);
-
+
wrap_regex(L);
-
+
lua_dofile(L, "regex.lua");
-
+
lua_close(L);
}
View
4 src/luabind/test/benchmark.cpp
@@ -41,9 +41,9 @@ int main()
using namespace luabind;
- lua_State* L = lua_open();
+ lua_State* L = luaL_newstate();
open(L);
-
+
class_<A>(L, "A")
.def(constructor<>());
View
2  src/luabind/test/main.cpp
@@ -50,7 +50,7 @@ struct lua_state
};
lua_state::lua_state()
- : m_state(lua_open())
+ : m_state(luaL_newstate())
{
luaopen_base(m_state);
#if defined(LUA_VERSION_NUM) && LUA_VERSION_NUM >= 501
Please sign in to comment.
Something went wrong with that request. Please try again.