aboutsummaryrefslogtreecommitdiff
path: root/src/cancel.cpp
diff options
context:
space:
mode:
authorBenoit Germain <benoit.germain@ubisoft.com>2024-06-11 17:33:36 +0200
committerBenoit Germain <benoit.germain@ubisoft.com>2024-06-11 17:33:36 +0200
commit6073478ce424b3e50e639b3f37e876a9cacc8a73 (patch)
treec6aca3eec331a198f0bc9082818387bd914f9c70 /src/cancel.cpp
parent740b820e429cf7c856f2f305b6fc5b6fd969f3b3 (diff)
downloadlanes-6073478ce424b3e50e639b3f37e876a9cacc8a73.tar.gz
lanes-6073478ce424b3e50e639b3f37e876a9cacc8a73.tar.bz2
lanes-6073478ce424b3e50e639b3f37e876a9cacc8a73.zip
Modernize cancel code some more
Diffstat (limited to 'src/cancel.cpp')
-rw-r--r--src/cancel.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cancel.cpp b/src/cancel.cpp
index a62fcdf..4f04857 100644
--- a/src/cancel.cpp
+++ b/src/cancel.cpp
@@ -50,7 +50,7 @@ THE SOFTWARE.
50 * Returns CANCEL_SOFT/HARD if any locks are to be exited, and 'raise_cancel_error()' called, 50 * Returns CANCEL_SOFT/HARD if any locks are to be exited, and 'raise_cancel_error()' called,
51 * to make execution of the lane end. 51 * to make execution of the lane end.
52 */ 52 */
53[[nodiscard]] CancelRequest cancel_test(lua_State* const L_) 53[[nodiscard]] CancelRequest CheckCancelRequest(lua_State* const L_)
54{ 54{
55 Lane* const _lane{ kLanePointerRegKey.readLightUserDataValue<Lane>(L_) }; 55 Lane* const _lane{ kLanePointerRegKey.readLightUserDataValue<Lane>(L_) };
56 // 'lane' is nullptr for the original main state (and no-one can cancel that) 56 // 'lane' is nullptr for the original main state (and no-one can cancel that)
@@ -129,7 +129,7 @@ CancelOp WhichCancelOp(std::string_view const& opString_)
129// 129//
130LUAG_FUNC(cancel_test) 130LUAG_FUNC(cancel_test)
131{ 131{
132 CancelRequest _test{ cancel_test(L_) }; 132 CancelRequest _test{ CheckCancelRequest(L_) };
133 lua_pushboolean(L_, _test != CancelRequest::None); 133 lua_pushboolean(L_, _test != CancelRequest::None);
134 return 1; 134 return 1;
135} 135}