diff options
Diffstat (limited to 'src/keeper.cpp')
-rw-r--r-- | src/keeper.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/keeper.cpp b/src/keeper.cpp index aab7abe..8f762e5 100644 --- a/src/keeper.cpp +++ b/src/keeper.cpp | |||
@@ -234,10 +234,10 @@ int keeper_push_linda_storage(Universe* U, lua_State* L, void* ptr_, uintptr_t m | |||
234 | { | 234 | { |
235 | keeper_fifo* fifo = prepare_fifo_access(KL, -1); // storage key fifotbl | 235 | keeper_fifo* fifo = prepare_fifo_access(KL, -1); // storage key fifotbl |
236 | lua_pushvalue(KL, -2); // storage key fifotbl key | 236 | lua_pushvalue(KL, -2); // storage key fifotbl key |
237 | luaG_inter_move(U, KL, L, 1, eLM_FromKeeper); // storage key fifotbl // out key | 237 | luaG_inter_move(U, KL, L, 1, LookupMode::FromKeeper); // storage key fifotbl // out key |
238 | STACK_CHECK(L, 2); | 238 | STACK_CHECK(L, 2); |
239 | lua_newtable(L); // out key keyout | 239 | lua_newtable(L); // out key keyout |
240 | luaG_inter_move(U, KL, L, 1, eLM_FromKeeper); // storage key // out key keyout fifotbl | 240 | luaG_inter_move(U, KL, L, 1, LookupMode::FromKeeper); // storage key // out key keyout fifotbl |
241 | lua_pushinteger(L, fifo->first); // out key keyout fifotbl first | 241 | lua_pushinteger(L, fifo->first); // out key keyout fifotbl first |
242 | STACK_CHECK(L, 5); | 242 | STACK_CHECK(L, 5); |
243 | lua_setfield(L, -3, "first"); // out key keyout fifotbl | 243 | lua_setfield(L, -3, "first"); // out key keyout fifotbl |
@@ -703,8 +703,8 @@ void init_keepers(Universe* U, lua_State* L) | |||
703 | lua_getglobal(L, "package"); // "..." keepersUD package | 703 | lua_getglobal(L, "package"); // "..." keepersUD package |
704 | if (!lua_isnil(L, -1)) | 704 | if (!lua_isnil(L, -1)) |
705 | { | 705 | { |
706 | // when copying with mode eLM_ToKeeper, error message is pushed at the top of the stack, not raised immediately | 706 | // when copying with mode LookupMode::ToKeeper, error message is pushed at the top of the stack, not raised immediately |
707 | if (luaG_inter_copy_package(U, L, K, -1, eLM_ToKeeper)) | 707 | if (luaG_inter_copy_package(U, L, K, -1, LookupMode::ToKeeper)) |
708 | { | 708 | { |
709 | // if something went wrong, the error message is at the top of the stack | 709 | // if something went wrong, the error message is at the top of the stack |
710 | lua_remove(L, -2); // error_msg | 710 | lua_remove(L, -2); // error_msg |
@@ -717,7 +717,7 @@ void init_keepers(Universe* U, lua_State* L) | |||
717 | // attempt to call on_state_create(), if we have one and it is a C function | 717 | // attempt to call on_state_create(), if we have one and it is a C function |
718 | // (only support a C function because we can't transfer executable Lua code in keepers) | 718 | // (only support a C function because we can't transfer executable Lua code in keepers) |
719 | // will raise an error in L in case of problem | 719 | // will raise an error in L in case of problem |
720 | call_on_state_create(U, K, L, eLM_ToKeeper); | 720 | call_on_state_create(U, K, L, LookupMode::ToKeeper); |
721 | 721 | ||
722 | // to see VM name in Decoda debugger | 722 | // to see VM name in Decoda debugger |
723 | lua_pushfstring(K, "Keeper #%d", i + 1); // "Keeper #n" | 723 | lua_pushfstring(K, "Keeper #%d", i + 1); // "Keeper #n" |
@@ -785,7 +785,7 @@ void keeper_toggle_nil_sentinels(lua_State* L, int val_i_, LookupMode const mode | |||
785 | int const n{ lua_gettop(L) }; | 785 | int const n{ lua_gettop(L) }; |
786 | for (int i = val_i_; i <= n; ++i) | 786 | for (int i = val_i_; i <= n; ++i) |
787 | { | 787 | { |
788 | if (mode_ == eLM_ToKeeper) | 788 | if (mode_ == LookupMode::ToKeeper) |
789 | { | 789 | { |
790 | if (lua_isnil(L, i)) | 790 | if (lua_isnil(L, i)) |
791 | { | 791 | { |
@@ -827,7 +827,7 @@ int keeper_call(Universe* U, lua_State* K, keeper_api_t func_, lua_State* L, voi | |||
827 | 827 | ||
828 | lua_pushlightuserdata(K, linda); | 828 | lua_pushlightuserdata(K, linda); |
829 | 829 | ||
830 | if ((args == 0) || luaG_inter_copy(U, L, K, args, eLM_ToKeeper) == 0) // L->K | 830 | if ((args == 0) || luaG_inter_copy(U, L, K, args, LookupMode::ToKeeper) == 0) // L->K |
831 | { | 831 | { |
832 | lua_call(K, 1 + args, LUA_MULTRET); | 832 | lua_call(K, 1 + args, LUA_MULTRET); |
833 | 833 | ||
@@ -836,7 +836,7 @@ int keeper_call(Universe* U, lua_State* K, keeper_api_t func_, lua_State* L, voi | |||
836 | // this may interrupt a lane, causing the destruction of the underlying OS thread | 836 | // this may interrupt a lane, causing the destruction of the underlying OS thread |
837 | // after this, another lane making use of this keeper can get an error code from the mutex-locking function | 837 | // after this, another lane making use of this keeper can get an error code from the mutex-locking function |
838 | // when attempting to grab the mutex again (WINVER <= 0x400 does this, but locks just fine, I don't know about pthread) | 838 | // when attempting to grab the mutex again (WINVER <= 0x400 does this, but locks just fine, I don't know about pthread) |
839 | if ((retvals > 0) && luaG_inter_move(U, K, L, retvals, eLM_FromKeeper) != 0) // K->L | 839 | if ((retvals > 0) && luaG_inter_move(U, K, L, retvals, LookupMode::FromKeeper) != 0) // K->L |
840 | { | 840 | { |
841 | retvals = -1; | 841 | retvals = -1; |
842 | } | 842 | } |