diff options
author | Benoit Germain <benoit.germain@ubisoft.com> | 2024-06-14 16:01:26 +0200 |
---|---|---|
committer | Benoit Germain <benoit.germain@ubisoft.com> | 2024-06-14 16:01:26 +0200 |
commit | 4d364d3e77667b70bf3261da004f4990ef0c3ada (patch) | |
tree | 5a106ca427ba8704635b3324a352475dd8706ab8 /src/lanes.cpp | |
parent | a925a9ee21c10184a08625e83d2b55850d6cb32f (diff) | |
download | lanes-4d364d3e77667b70bf3261da004f4990ef0c3ada.tar.gz lanes-4d364d3e77667b70bf3261da004f4990ef0c3ada.tar.bz2 lanes-4d364d3e77667b70bf3261da004f4990ef0c3ada.zip |
lua_pushliteral -> luaG_pushstring
Diffstat (limited to 'src/lanes.cpp')
-rw-r--r-- | src/lanes.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/lanes.cpp b/src/lanes.cpp index 7196b72..f1aa873 100644 --- a/src/lanes.cpp +++ b/src/lanes.cpp | |||
@@ -179,7 +179,7 @@ LUAG_FUNC(sleep) | |||
179 | else { | 179 | else { |
180 | lua_pushnumber(L_, lua_tonumber(L_, 1)); // L_: duration? receive() timerLinda duration | 180 | lua_pushnumber(L_, lua_tonumber(L_, 1)); // L_: duration? receive() timerLinda duration |
181 | } | 181 | } |
182 | std::ignore = luaG_pushstring(L_, "ac100de1-a696-4619-b2f0-a26de9d58ab8"); // L_: duration? receive() timerLinda duration key | 182 | luaG_pushstring(L_, "ac100de1-a696-4619-b2f0-a26de9d58ab8"); // L_: duration? receive() timerLinda duration key |
183 | STACK_CHECK(L_, 3); // 3 arguments ready | 183 | STACK_CHECK(L_, 3); // 3 arguments ready |
184 | lua_call(L_, 3, LUA_MULTRET); // timerLinda:receive(duration,key) // L_: duration? result... | 184 | lua_call(L_, 3, LUA_MULTRET); // timerLinda:receive(duration,key) // L_: duration? result... |
185 | return lua_gettop(L_) - 1; | 185 | return lua_gettop(L_) - 1; |
@@ -352,12 +352,12 @@ LUAG_FUNC(lane_new) | |||
352 | if (!_debugName.empty()) | 352 | if (!_debugName.empty()) |
353 | { | 353 | { |
354 | if (_debugName != "auto") { | 354 | if (_debugName != "auto") { |
355 | std::ignore = luaG_pushstring(_L2, _debugName); // L: ... lane L2: "<name>" | 355 | luaG_pushstring(_L2, _debugName); // L: ... lane L2: "<name>" |
356 | } else { | 356 | } else { |
357 | lua_Debug _ar; | 357 | lua_Debug _ar; |
358 | lua_pushvalue(L, 1); // L: ... lane func | 358 | lua_pushvalue(L, 1); // L: ... lane func |
359 | lua_getinfo(L, ">S", &_ar); // L: ... lane | 359 | lua_getinfo(L, ">S", &_ar); // L: ... lane |
360 | std::ignore = luaG_pushstring(_L2, "%s:%d", _ar.short_src, _ar.linedefined); // L: ... lane L2: "<name>" | 360 | luaG_pushstring(_L2, "%s:%d", _ar.short_src, _ar.linedefined); // L: ... lane L2: "<name>" |
361 | } | 361 | } |
362 | lane->changeDebugName(-1); | 362 | lane->changeDebugName(-1); |
363 | lua_pop(_L2, 1); // L: ... lane L2: | 363 | lua_pop(_L2, 1); // L: ... lane L2: |
@@ -440,7 +440,7 @@ LUAG_FUNC(lane_new) | |||
440 | lua_pop(_L2, 1); // L_: [fixed] args... n "modname" L2: | 440 | lua_pop(_L2, 1); // L_: [fixed] args... n "modname" L2: |
441 | raise_luaL_error(L_, "cannot pre-require modules without loading 'package' library first"); | 441 | raise_luaL_error(L_, "cannot pre-require modules without loading 'package' library first"); |
442 | } else { | 442 | } else { |
443 | std::ignore = luaG_pushstring(_L2, _name); // L_: [fixed] args... n "modname" L2: require() name | 443 | luaG_pushstring(_L2, _name); // L_: [fixed] args... n "modname" L2: require() name |
444 | LuaError const _rc{ lua_pcall(_L2, 1, 1, 0) }; // L_: [fixed] args... n "modname" L2: ret/errcode | 444 | LuaError const _rc{ lua_pcall(_L2, 1, 1, 0) }; // L_: [fixed] args... n "modname" L2: ret/errcode |
445 | if (_rc != LuaError::OK) { | 445 | if (_rc != LuaError::OK) { |
446 | // propagate error to main state if any | 446 | // propagate error to main state if any |
@@ -674,7 +674,7 @@ LUAG_FUNC(configure) | |||
674 | 674 | ||
675 | if (_U == nullptr) { | 675 | if (_U == nullptr) { |
676 | // store a hidden reference in the registry to make sure the string is kept around even if a lane decides to manually change the "decoda_name" global... | 676 | // store a hidden reference in the registry to make sure the string is kept around even if a lane decides to manually change the "decoda_name" global... |
677 | kLaneNameRegKey.setValue(L_, [](lua_State* L_) { std::ignore = luaG_pushstring(L_, "main"); }); | 677 | kLaneNameRegKey.setValue(L_, [](lua_State* L_) { luaG_pushstring(L_, "main"); }); |
678 | 678 | ||
679 | // create the universe | 679 | // create the universe |
680 | _U = Universe::Create(L_); // L_: settings universe | 680 | _U = Universe::Create(L_); // L_: settings universe |
@@ -714,7 +714,7 @@ LUAG_FUNC(configure) | |||
714 | lua_pushcclosure(L_, LG_require, 1); // L_: settings M lanes.require | 714 | lua_pushcclosure(L_, LG_require, 1); // L_: settings M lanes.require |
715 | lua_setfield(L_, -2, "require"); // L_: settings M | 715 | lua_setfield(L_, -2, "require"); // L_: settings M |
716 | 716 | ||
717 | std::ignore = luaG_pushstring( | 717 | luaG_pushstring( |
718 | L_, | 718 | L_, |
719 | "%d.%d.%d", | 719 | "%d.%d.%d", |
720 | LANES_VERSION_MAJOR, | 720 | LANES_VERSION_MAJOR, |