Mercurial > vim
changeset 35875:d4695391d734 v9.1.0649
patch 9.1.0649: Wrong comment for "len" argument of call_simple_func()
Commit: https://github.com/vim/vim/commit/c1ed788c1b41db9b5f1ef548dc877f771f535bbe
Author: zeertzjq <zeertzjq@outlook.com>
Date: Thu Aug 1 22:46:54 2024 +0200
patch 9.1.0649: Wrong comment for "len" argument of call_simple_func()
Problem: Wrong comment for "len" argument of call_simple_func().
Solution: Remove the "or -1 to use strlen()". Also change its type to
size_t to remove one cast. (zeertzjq)
closes: #15410
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Thu, 01 Aug 2024 23:00:03 +0200 |
parents | d6db0423a54b |
children | a2fb6fe75882 |
files | src/eval.c src/proto/userfunc.pro src/userfunc.c src/version.c |
diffstat | 4 files changed, 5 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/eval.c +++ b/src/eval.c @@ -3259,7 +3259,7 @@ may_call_simple_func( char_u *p = STRNCMP(arg, "<SNR>", 5) == 0 ? skipdigits(arg + 5) : arg; if (to_name_end(p, TRUE) == parens) - r = call_simple_func(arg, (int)(parens - arg), rettv); + r = call_simple_func(arg, (size_t)(parens - arg), rettv); } return r; }
--- a/src/proto/userfunc.pro +++ b/src/proto/userfunc.pro @@ -39,7 +39,7 @@ int call_callback(callback_T *callback, varnumber_T call_callback_retnr(callback_T *callback, int argcount, typval_T *argvars); void user_func_error(funcerror_T error, char_u *name, int found_var); int call_func(char_u *funcname, int len, typval_T *rettv, int argcount_in, typval_T *argvars_in, funcexe_T *funcexe); -int call_simple_func(char_u *funcname, int len, typval_T *rettv); +int call_simple_func(char_u *funcname, size_t len, typval_T *rettv); char_u *printable_func_name(ufunc_T *fp); char_u *trans_function_name(char_u **pp, int *is_global, int skip, int flags); char_u *trans_function_name_ext(char_u **pp, int *is_global, int skip, int flags, funcdict_T *fdp, partial_T **partial, type_T **type, ufunc_T **ufunc);