summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-08-01 22:46:54 +0200
committerChristian Brabandt <cb@256bit.org>2024-08-01 22:46:54 +0200
commitc1ed788c1b41db9b5f1ef548dc877f771f535bbe (patch)
tree365d5c779316b7e989d3a37a4211332cf8e39ad8
parentb29f4abcd4b3382fa746edd1d0562b7b48c9de60 (diff)
patch 9.1.0649: Wrong comment for "len" argument of call_simple_func()v9.1.0649
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>
-rw-r--r--src/eval.c2
-rw-r--r--src/proto/userfunc.pro2
-rw-r--r--src/userfunc.c2
-rw-r--r--src/version.c2
4 files changed, 5 insertions, 3 deletions
diff --git a/src/eval.c b/src/eval.c
index 4f5646377d..cc289b4535 100644
--- 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;
}
diff --git a/src/proto/userfunc.pro b/src/proto/userfunc.pro
index ce5d257caf..32dac661b0 100644
--- a/src/proto/userfunc.pro
+++ b/src/proto/userfunc.pro
@@ -39,7 +39,7 @@ int call_callback(callback_T *callback, int len, typval_T *rettv, int argcount,
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);
diff --git a/src/userfunc.c b/src/userfunc.c
index 1c58b01c73..9a82394013 100644
--- a/src/userfunc.c
+++ b/src/userfunc.c
@@ -4058,7 +4058,7 @@ theend:
int
call_simple_func(
char_u *funcname, // name of the function
- int len, // length of "name" or -1 to use strlen()
+ size_t len, // length of "name"
typval_T *rettv) // return value goes here
{
int ret = FAIL;
diff --git a/src/version.c b/src/version.c
index 3ca6001269..76b00a9898 100644
--- a/src/version.c
+++ b/src/version.c
@@ -705,6 +705,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 649,
+/**/
648,
/**/
647,