Mercurial > vim
diff src/userfunc.c @ 27114:98a01021e465 v8.2.4086
patch 8.2.4086: "cctx" argument of find_func_even_dead() is unused
Commit: https://github.com/vim/vim/commit/d9d2fd0aa33dd9f7460d6f1e403505a60f7ce2fc
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Jan 13 21:15:21 2022 +0000
patch 8.2.4086: "cctx" argument of find_func_even_dead() is unused
Problem: "cctx" argument of find_func_even_dead() is unused.
Solution: Remove the argument.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 13 Jan 2022 22:30:05 +0100 |
parents | 6d063974af23 |
children | 374c7d5a096a |
line wrap: on
line diff
--- a/src/userfunc.c +++ b/src/userfunc.c @@ -1934,7 +1934,7 @@ find_func_with_prefix(char_u *name, int * Return NULL for unknown function. */ ufunc_T * -find_func_even_dead(char_u *name, int is_global, cctx_T *cctx UNUSED) +find_func_even_dead(char_u *name, int is_global) { hashitem_T *hi; ufunc_T *func; @@ -1970,9 +1970,9 @@ find_func_even_dead(char_u *name, int is * Return NULL for unknown or dead function. */ ufunc_T * -find_func(char_u *name, int is_global, cctx_T *cctx) +find_func(char_u *name, int is_global) { - ufunc_T *fp = find_func_even_dead(name, is_global, cctx); + ufunc_T *fp = find_func_even_dead(name, is_global); if (fp != NULL && (fp->uf_flags & FC_DEAD) == 0) return fp; @@ -2343,7 +2343,7 @@ func_clear_free(ufunc_T *fp, int force) int copy_func(char_u *lambda, char_u *global, ectx_T *ectx) { - ufunc_T *ufunc = find_func_even_dead(lambda, TRUE, NULL); + ufunc_T *ufunc = find_func_even_dead(lambda, TRUE); ufunc_T *fp = NULL; if (ufunc == NULL) @@ -2352,7 +2352,7 @@ copy_func(char_u *lambda, char_u *global return FAIL; } - fp = find_func(global, TRUE, NULL); + fp = find_func(global, TRUE); if (fp != NULL) { // TODO: handle ! to overwrite @@ -3413,7 +3413,7 @@ call_func( * User defined function. */ if (fp == NULL) - fp = find_func(rfname, is_global, NULL); + fp = find_func(rfname, is_global); // Trigger FuncUndefined event, may load the function. if (fp == NULL @@ -3422,13 +3422,13 @@ call_func( && !aborting()) { // executed an autocommand, search for the function again - fp = find_func(rfname, is_global, NULL); + fp = find_func(rfname, is_global); } // Try loading a package. if (fp == NULL && script_autoload(rfname, TRUE) && !aborting()) { // loaded a package, search for the function again - fp = find_func(rfname, is_global, NULL); + fp = find_func(rfname, is_global); } if (fp == NULL) { @@ -3437,7 +3437,7 @@ call_func( // If using Vim9 script try not local to the script. // Don't do this if the name starts with "s:". if (p != NULL && (funcname[0] != 's' || funcname[1] != ':')) - fp = find_func(p, is_global, NULL); + fp = find_func(p, is_global); } if (fp != NULL && (fp->uf_flags & FC_DELETED)) @@ -4180,7 +4180,7 @@ define_function(exarg_T *eap, char_u *na *p = NUL; if (!eap->skip && !got_int) { - fp = find_func(name, is_global, NULL); + fp = find_func(name, is_global); if (fp == NULL && ASCII_ISUPPER(*eap->arg)) { char_u *up = untrans_function_name(name); @@ -4188,7 +4188,7 @@ define_function(exarg_T *eap, char_u *na // With Vim9 script the name was made script-local, if not // found try again with the original name. if (up != NULL) - fp = find_func(up, FALSE, NULL); + fp = find_func(up, FALSE); } if (fp != NULL) @@ -4403,7 +4403,7 @@ define_function(exarg_T *eap, char_u *na { if (fudi.fd_dict != NULL && fudi.fd_newkey == NULL) emsg(_(e_dictionary_entry_already_exists)); - else if (name != NULL && find_func(name, is_global, NULL) != NULL) + else if (name != NULL && find_func(name, is_global) != NULL) emsg_funcname(e_function_str_already_exists_add_bang_to_replace, name); } @@ -4437,7 +4437,7 @@ define_function(exarg_T *eap, char_u *na goto erret; } - fp = find_func_even_dead(name, is_global, NULL); + fp = find_func_even_dead(name, is_global); if (vim9script) { char_u *uname = untrans_function_name(name); @@ -4792,7 +4792,7 @@ translated_function_exists(char_u *name, { if (builtin_function(name, -1)) return has_internal_func(name); - return find_func(name, is_global, NULL) != NULL; + return find_func(name, is_global) != NULL; } /* @@ -4939,7 +4939,7 @@ ex_delfunction(exarg_T *eap) return; } if (!eap->skip) - fp = find_func(name, is_global, NULL); + fp = find_func(name, is_global); vim_free(name); if (!eap->skip) @@ -4998,7 +4998,7 @@ func_unref(char_u *name) if (name == NULL || !func_name_refcount(name)) return; - fp = find_func(name, FALSE, NULL); + fp = find_func(name, FALSE); if (fp == NULL && numbered_function(name)) { #ifdef EXITFREE @@ -5039,7 +5039,7 @@ func_ref(char_u *name) if (name == NULL || !func_name_refcount(name)) return; - fp = find_func(name, FALSE, NULL); + fp = find_func(name, FALSE); if (fp != NULL) ++fp->uf_refcount; else if (numbered_function(name)) @@ -5534,7 +5534,7 @@ make_partial(dict_T *selfdict_in, typval : rettv->vval.v_partial->pt_name; // Translate "s:func" to the stored function name. fname = fname_trans_sid(fname, fname_buf, &tofree, &error); - fp = find_func(fname, FALSE, NULL); + fp = find_func(fname, FALSE); vim_free(tofree); } @@ -5953,7 +5953,7 @@ set_ref_in_func(char_u *name, ufunc_T *f if (fp_in == NULL) { fname = fname_trans_sid(name, fname_buf, &tofree, &error); - fp = find_func(fname, FALSE, NULL); + fp = find_func(fname, FALSE); } if (fp != NULL) {