aboutsummaryrefslogtreecommitdiff
path: root/src/cancel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/cancel.cpp')
-rw-r--r--src/cancel.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/cancel.cpp b/src/cancel.cpp
index 23d9d04..f53dc36 100644
--- a/src/cancel.cpp
+++ b/src/cancel.cpp
@@ -185,8 +185,8 @@ CancelOp which_cancel_op(std::string_view const& opString_)
185 185
186[[nodiscard]] static CancelOp which_cancel_op(lua_State* L_, int idx_) 186[[nodiscard]] static CancelOp which_cancel_op(lua_State* L_, int idx_)
187{ 187{
188 if (lua_type(L_, idx_) == LUA_TSTRING) { 188 if (luaG_type(L_, idx_) == LuaType::STRING) {
189 std::string_view const _str{ lua_tostringview(L_, idx_) }; 189 std::string_view const _str{ luaG_tostringview(L_, idx_) };
190 CancelOp _op{ which_cancel_op(_str) }; 190 CancelOp _op{ which_cancel_op(_str) };
191 lua_remove(L_, idx_); // argument is processed, remove it 191 lua_remove(L_, idx_); // argument is processed, remove it
192 if (_op == CancelOp::Invalid) { 192 if (_op == CancelOp::Invalid) {
@@ -215,7 +215,7 @@ LUAG_FUNC(thread_cancel)
215 } 215 }
216 216
217 std::chrono::time_point<std::chrono::steady_clock> _until{ std::chrono::time_point<std::chrono::steady_clock>::max() }; 217 std::chrono::time_point<std::chrono::steady_clock> _until{ std::chrono::time_point<std::chrono::steady_clock>::max() };
218 if (lua_type(L_, 2) == LUA_TNUMBER) { // we don't want to use lua_isnumber() because of autocoercion 218 if (luaG_type(L_, 2) == LuaType::NUMBER) { // we don't want to use lua_isnumber() because of autocoercion
219 lua_Duration const duration{ lua_tonumber(L_, 2) }; 219 lua_Duration const duration{ lua_tonumber(L_, 2) };
220 if (duration.count() >= 0.0) { 220 if (duration.count() >= 0.0) {
221 _until = std::chrono::steady_clock::now() + std::chrono::duration_cast<std::chrono::steady_clock::duration>(duration); 221 _until = std::chrono::steady_clock::now() + std::chrono::duration_cast<std::chrono::steady_clock::duration>(duration);