refactor: format casting of negative number better (#26482)

This commit is contained in:
zeertzjq
2023-12-09 11:36:11 +08:00
committed by GitHub
parent c651fb3042
commit 2ebd328a79
6 changed files with 9 additions and 9 deletions

View File

@@ -1254,7 +1254,7 @@ handle_T nlua_pop_handle(lua_State *lstate, Error *err)
handle_T ret;
if (lua_type(lstate, -1) != LUA_TNUMBER) {
api_set_error(err, kErrorTypeValidation, "Expected Lua number");
ret = (handle_T) - 1;
ret = (handle_T)(-1);
} else {
ret = (handle_T)lua_tonumber(lstate, -1);
}