aboutsummaryrefslogtreecommitdiff
path: root/src/cancel.cpp
diff options
context:
space:
mode:
authorBenoit Germain <benoit.germain@ubisoft.com>2024-06-05 16:07:08 +0200
committerBenoit Germain <benoit.germain@ubisoft.com>2024-06-05 16:07:08 +0200
commit4670b7deee3eeca20f72d91d9fb7094b51348956 (patch)
tree7064c7de946cfa717e128dc680756ecd6dc4e13f /src/cancel.cpp
parentb6d344fe7991b525958a5825fbd22d7c529d21cc (diff)
downloadlanes-4670b7deee3eeca20f72d91d9fb7094b51348956.tar.gz
lanes-4670b7deee3eeca20f72d91d9fb7094b51348956.tar.bz2
lanes-4670b7deee3eeca20f72d91d9fb7094b51348956.zip
Modernize compat
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);