aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-12-03 08:24:22 +0800
committerzeertzjq <zeertzjq@outlook.com>2022-12-03 08:24:48 +0800
commit2ae0d32a72c3ee207b6f9cd48c4beffa6e7c774f (patch)
tree345bdaf306f0949f32ba41800821842da0326d1c
parent10c50d9f30138e7811789ba1c62f4c520cf04c8f (diff)
downloadrneovim-2ae0d32a72c3ee207b6f9cd48c4beffa6e7c774f.tar.gz
rneovim-2ae0d32a72c3ee207b6f9cd48c4beffa6e7c774f.tar.bz2
rneovim-2ae0d32a72c3ee207b6f9cd48c4beffa6e7c774f.zip
refactor: make sure getting a callback doesn't modify argument
-rw-r--r--src/nvim/eval.c2
-rw-r--r--src/nvim/lua/executor.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c
index 6d8f4d092c..fdb379a682 100644
--- a/src/nvim/eval.c
+++ b/src/nvim/eval.c
@@ -5511,7 +5511,7 @@ void get_system_output_as_rettv(typval_T *argvars, typval_T *rettv, bool retlist
}
/// Get a callback from "arg". It can be a Funcref or a function name.
-bool callback_from_typval(Callback *const callback, typval_T *const arg)
+bool callback_from_typval(Callback *const callback, const typval_T *const arg)
FUNC_ATTR_NONNULL_ALL FUNC_ATTR_WARN_UNUSED_RESULT
{
int r = OK;
diff --git a/src/nvim/lua/executor.c b/src/nvim/lua/executor.c
index 5380559baf..48ab2e3d70 100644
--- a/src/nvim/lua/executor.c
+++ b/src/nvim/lua/executor.c
@@ -1845,7 +1845,7 @@ static int nlua_is_thread(lua_State *lstate)
return 1;
}
-bool nlua_is_table_from_lua(typval_T *const arg)
+bool nlua_is_table_from_lua(const typval_T *const arg)
{
if (arg->v_type == VAR_DICT) {
return arg->vval.v_dict->lua_table_ref != LUA_NOREF;
@@ -1856,7 +1856,7 @@ bool nlua_is_table_from_lua(typval_T *const arg)
}
}
-char_u *nlua_register_table_as_callable(typval_T *const arg)
+char_u *nlua_register_table_as_callable(const typval_T *const arg)
{
LuaRef table_ref = LUA_NOREF;
if (arg->v_type == VAR_DICT) {