diff options
Diffstat (limited to 'src/lanes.cpp')
-rw-r--r-- | src/lanes.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/lanes.cpp b/src/lanes.cpp index 2a5ebfd..f549359 100644 --- a/src/lanes.cpp +++ b/src/lanes.cpp | |||
@@ -540,7 +540,7 @@ static void selfdestruct_add(Lane* lane_) | |||
540 | if (lane != SELFDESTRUCT_END) | 540 | if (lane != SELFDESTRUCT_END) |
541 | { | 541 | { |
542 | // this causes a leak because we don't call U's destructor (which could be bad if the still running lanes are accessing it) | 542 | // this causes a leak because we don't call U's destructor (which could be bad if the still running lanes are accessing it) |
543 | std::ignore = luaL_error(L, "Zombie thread %s refuses to die!", lane->debug_name); | 543 | std::ignore = luaL_error(L, "Zombie thread %s refuses to die!", lane->debug_name); // doesn't return |
544 | } | 544 | } |
545 | } | 545 | } |
546 | 546 | ||
@@ -1374,13 +1374,12 @@ LUAG_FUNC(lane_new) | |||
1374 | 1374 | ||
1375 | // ################################################################################################# | 1375 | // ################################################################################################# |
1376 | 1376 | ||
1377 | int push_thread_status(lua_State* L, Lane* lane_) | 1377 | void push_thread_status(lua_State* L, Lane* lane_) |
1378 | { | 1378 | { |
1379 | char const* const str{ thread_status_string(lane_) }; | 1379 | char const* const str{ thread_status_string(lane_) }; |
1380 | ASSERT_L(str); | 1380 | ASSERT_L(str); |
1381 | 1381 | ||
1382 | lua_pushstring(L, str); | 1382 | std::ignore = lua_pushstring(L, str); |
1383 | return 1; | ||
1384 | } | 1383 | } |
1385 | 1384 | ||
1386 | // ################################################################################################# | 1385 | // ################################################################################################# |
@@ -1583,11 +1582,12 @@ LUAG_FUNC(thread_index) | |||
1583 | } | 1582 | } |
1584 | if (lua_type(L, KEY) == LUA_TSTRING) | 1583 | if (lua_type(L, KEY) == LUA_TSTRING) |
1585 | { | 1584 | { |
1586 | char const * const keystr = lua_tostring(L, KEY); | 1585 | char const* const keystr{ lua_tostring(L, KEY) }; |
1587 | lua_settop(L, 2); // keep only our original arguments on the stack | 1586 | lua_settop(L, 2); // keep only our original arguments on the stack |
1588 | if (strcmp( keystr, "status") == 0) | 1587 | if (strcmp( keystr, "status") == 0) |
1589 | { | 1588 | { |
1590 | return push_thread_status(L, lane); // push the string representing the status | 1589 | push_thread_status(L, lane); // push the string representing the status |
1590 | return 1; | ||
1591 | } | 1591 | } |
1592 | // return UD.metatable[key] | 1592 | // return UD.metatable[key] |
1593 | lua_getmetatable(L, UD); // UD KEY mt | 1593 | lua_getmetatable(L, UD); // UD KEY mt |
@@ -1634,7 +1634,7 @@ LUAG_FUNC(threads) | |||
1634 | lua_newtable(L); // {} {} | 1634 | lua_newtable(L); // {} {} |
1635 | lua_pushstring(L, lane->debug_name); // {} {} "name" | 1635 | lua_pushstring(L, lane->debug_name); // {} {} "name" |
1636 | lua_setfield(L, -2, "name"); // {} {} | 1636 | lua_setfield(L, -2, "name"); // {} {} |
1637 | std::ignore = push_thread_status(L, lane); // {} {} "status" | 1637 | push_thread_status(L, lane); // {} {} "status" |
1638 | lua_setfield(L, -2, "status"); // {} {} | 1638 | lua_setfield(L, -2, "status"); // {} {} |
1639 | lua_rawseti(L, -2, ++index); // {} | 1639 | lua_rawseti(L, -2, ++index); // {} |
1640 | lane = lane->tracking_next; | 1640 | lane = lane->tracking_next; |