Skip to content
This repository
Browse code

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

Following solarus on this one.
  • Loading branch information...
commit 8141840bbcdeda0e70be1415735e6c38b0859302 1 parent 4016708
Yohann Ferreira authored
2  src/engine/script/script.cpp
@@ -43,7 +43,7 @@ ScriptEngine::ScriptEngine()
43 43 IF_PRINT_DEBUG(SCRIPT_DEBUG) << "ScriptEngine constructor invoked." << std::endl;
44 44
45 45 // Initialize Lua and LuaBind
46   - _global_state = lua_open();
  46 + _global_state = luaL_newstate();
47 47 luaL_openlibs(_global_state);
48 48 luabind::open(_global_state);
49 49 }
6 src/luabind/doc/docs.html
@@ -40,7 +40,7 @@
40 40
41 41 dl {
42 42 margin-left: 0.5em ;
43   - margin-right: 10em
  43 + margin-right: 10em
44 44 }
45 45
46 46 h3 {
@@ -299,7 +299,7 @@
299 299 }
300 300
301 301 h3 {
302   - text-transform: uppercase
  302 + text-transform: uppercase
303 303 }
304 304
305 305 </style>
@@ -2020,7 +2020,7 @@ <h1 class="title">luabind 0.9.1</h1>
2020 2020 {
2021 2021 try
2022 2022 {
2023   - lua_state L = lua_open();
  2023 + lua_state L = luaL_newstate();
2024 2024 /* ... */
2025 2025 }
2026 2026 catch(luabind::error&amp; e)
6 src/luabind/examples/any_converter/any_converter.cpp
@@ -69,15 +69,15 @@ int main()
69 69 register_any_converter<const char*>();
70 70 register_any_converter<std::string>();
71 71
72   - lua_State* L = lua_open();
73   -#if LUA_VERSION_NUM >= 501
  72 + lua_State* L = luaL_newstate();
  73 +#if LUA_VERSION_NUM >= 501
74 74 luaL_openlibs(L);
75 75 #else
76 76 lua_baselibopen(L);
77 77 #endif
78 78
79 79 using namespace luabind;
80   -
  80 +
81 81 open(L);
82 82 module(L)
83 83 [
6 src/luabind/examples/cln/cln_test.cpp
@@ -44,7 +44,7 @@ void bind_cln(lua_State* L)
44 44 .def(const_self <= other<int>())
45 45 .def(const_self < other<int>())
46 46 ,
47   -
  47 +
48 48 // rational numbers
49 49 class_<cl_RA, cl_R>("cl_RA")
50 50 .def(constructor<>())
@@ -99,7 +99,7 @@ void bind_cln(lua_State* L)
99 99 .def(const_self <= other<int>())
100 100 .def(const_self < other<int>())
101 101 ,
102   -
  102 +
103 103 def("factorial", &cln::factorial),
104 104 def("sqrt", (const cl_R(*)(const cl_R&))&cln::sqrt)
105 105 ];
@@ -107,7 +107,7 @@ void bind_cln(lua_State* L)
107 107
108 108 int main()
109 109 {
110   - lua_State* L = lua_open();
  110 + lua_State* L = luaL_newstate();
111 111 lua_baselibopen(L);
112 112 lua_mathlibopen(L);
113 113 luabind::open(L);
10 src/luabind/examples/filesystem/filesystem.cpp
@@ -14,7 +14,7 @@ extern "C"
14 14
15 15 #include "directory_iterator.hpp"
16 16
17   -const boost::filesystem::path&
  17 +const boost::filesystem::path&
18 18 identity(const boost::filesystem::path& x)
19 19 {
20 20 return x;
@@ -26,7 +26,7 @@ void bind_filesystem(lua_State* L)
26 26 using namespace boost::filesystem;
27 27
28 28 namespace fs = boost::filesystem;
29   -
  29 +
30 30 module(L, "filesystem")
31 31 [
32 32 class_<fs::path>("path")
@@ -78,7 +78,7 @@ void bind_filesystem(lua_State* L)
78 78
79 79 int main(int argc, const char* argv[])
80 80 {
81   - lua_State* L = lua_open();
  81 + lua_State* L = luaL_newstate();
82 82 luaopen_base(L);
83 83 luaopen_string(L);
84 84 luaopen_table(L);
@@ -93,13 +93,13 @@ int main(int argc, const char* argv[])
93 93 "usage: filesystem filename [args]\n";
94 94 return 1;
95 95 }
96   -
  96 +
97 97 using namespace luabind;
98 98
99 99 open(L);
100 100
101 101 bind_filesystem(L);
102   -
  102 +
103 103 object args = newtable(L);
104 104
105 105 for (int i = 0; i < argc; ++i)
4 src/luabind/examples/glut/glut_bind.cpp
@@ -95,7 +95,7 @@ void bind_glut(lua_State* L)
95 95 open(L);
96 96
97 97 module(L)
98   - [
  98 + [
99 99 def("glutInitWindowSize", &glutInitWindowSize),
100 100 def("glutInitWindowPosition", &glutInitWindowPosition),
101 101 def("glutInitDisplayMode", &glutInitDisplayMode),
@@ -167,7 +167,7 @@ void bind_glut(lua_State* L)
167 167
168 168 int main(int argc, char* argv[])
169 169 {
170   - lua_State* L = lua_open();
  170 + lua_State* L = luaL_newstate();
171 171 lua_baselibopen(L);
172 172 lua_mathlibopen(L);
173 173 bind_glut(L);
8 src/luabind/examples/intrusive_ptr/intrusive_ptr.cpp
@@ -107,11 +107,11 @@ namespace luabind
107 107 struct A
108 108 {
109 109 A()
110   - : cnt(0)
  110 + : cnt(0)
111 111 {}
112 112
113 113 ~A() { std::cout << "free memory\n"; }
114   -
  114 +
115 115 int cnt;
116 116 };
117 117
@@ -140,11 +140,11 @@ boost::intrusive_ptr<A> factory()
140 140
141 141 int main()
142 142 {
143   - lua_State* L = lua_open();
  143 + lua_State* L = luaL_newstate();
144 144 lua_baselibopen(L);
145 145
146 146 luabind::open(L);
147   -
  147 +
148 148 using namespace luabind;
149 149
150 150 module(L)
10 src/luabind/examples/regexp/regex_wrap.cpp
... ... @@ -1,4 +1,4 @@
1   -#include <boost/cregex.hpp>
  1 +#include <boost/cregex.hpp>
2 2
3 3 extern "C"
4 4 {
@@ -44,15 +44,15 @@ void wrap_regex(lua_State* L)
44 44
45 45 int main()
46 46 {
47   - lua_State* L = lua_open();
  47 + lua_State* L = luaL_newstate();
48 48 lua_baselibopen(L);
49 49 lua_strlibopen(L);
50 50 luabind::open(L);
51   -
  51 +
52 52 wrap_regex(L);
53   -
  53 +
54 54 lua_dofile(L, "regex.lua");
55   -
  55 +
56 56 lua_close(L);
57 57 }
58 58
4 src/luabind/test/benchmark.cpp
@@ -41,9 +41,9 @@ int main()
41 41
42 42 using namespace luabind;
43 43
44   - lua_State* L = lua_open();
  44 + lua_State* L = luaL_newstate();
45 45 open(L);
46   -
  46 +
47 47 class_<A>(L, "A")
48 48 .def(constructor<>());
49 49
2  src/luabind/test/main.cpp
@@ -50,7 +50,7 @@ struct lua_state
50 50 };
51 51
52 52 lua_state::lua_state()
53   - : m_state(lua_open())
  53 + : m_state(luaL_newstate())
54 54 {
55 55 luaopen_base(m_state);
56 56 #if defined(LUA_VERSION_NUM) && LUA_VERSION_NUM >= 501

0 comments on commit 8141840

Please sign in to comment.
Something went wrong with that request. Please try again.