diff options
author | Jan Edmund Lazo <janedmundlazo@hotmail.com> | 2018-08-01 12:29:42 -0400 |
---|---|---|
committer | Jan Edmund Lazo <janedmundlazo@hotmail.com> | 2018-08-06 21:56:39 -0400 |
commit | c23327773724bd66942e541113b9053481b949e7 (patch) | |
tree | 53dae1aaa33ab8050e7b2f22e48da77ae0b4d953 | |
parent | e6127a49db3fbc14f982775856ee7bd29fe29ec6 (diff) | |
download | rneovim-c23327773724bd66942e541113b9053481b949e7.tar.gz rneovim-c23327773724bd66942e541113b9053481b949e7.tar.bz2 rneovim-c23327773724bd66942e541113b9053481b949e7.zip |
eval: add const to f_gettabvar() variables
-rw-r--r-- | src/nvim/eval.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c index b495e591d2..c51ffbdc3c 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -10210,25 +10210,26 @@ static void f_gettabinfo(typval_T *argvars, typval_T *rettv, FunPtr fptr) static void f_gettabvar(typval_T *argvars, typval_T *rettv, FunPtr fptr) { win_T *oldcurwin; - tabpage_T *tp, *oldtabpage; - dictitem_T *v; + tabpage_T *oldtabpage; bool done = false; rettv->v_type = VAR_STRING; rettv->vval.v_string = NULL; const char *const varname = tv_get_string_chk(&argvars[1]); - tp = find_tabpage((int)tv_get_number_chk(&argvars[0], NULL)); + tabpage_T *const tp = find_tabpage((int)tv_get_number_chk(&argvars[0], NULL)); if (tp != NULL && varname != NULL) { // Set tp to be our tabpage, temporarily. Also set the window to the // first window in the tabpage, otherwise the window is not valid. - win_T *window = tp == curtab || tp->tp_firstwin == NULL ? firstwin - : tp->tp_firstwin; + win_T *const window = tp == curtab || tp->tp_firstwin == NULL + ? firstwin + : tp->tp_firstwin; if (switch_win(&oldcurwin, &oldtabpage, window, tp, true) == OK) { // look up the variable // Let gettabvar({nr}, "") return the "t:" dictionary. - v = find_var_in_ht(&tp->tp_vars->dv_hashtab, 't', - varname, strlen(varname), false); + const dictitem_T *const v = find_var_in_ht(&tp->tp_vars->dv_hashtab, 't', + varname, strlen(varname), + false); if (v != NULL) { tv_copy(&v->di_tv, rettv); done = true; |