]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.0649: Wrong comment for "len" argument of call_simple_func() v9.1.0649
authorzeertzjq <zeertzjq@outlook.com>
Thu, 1 Aug 2024 20:46:54 +0000 (22:46 +0200)
committerChristian Brabandt <cb@256bit.org>
Thu, 1 Aug 2024 20:46:54 +0000 (22:46 +0200)
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>
src/eval.c
src/proto/userfunc.pro
src/userfunc.c
src/version.c

index 4f5646377d77aa2acb752930eddb06e3b8555b73..cc289b4535e3c0f52c698c0e10af613c235aef68 100644 (file)
@@ -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;
 }
index ce5d257caf2a2911e0f17fccb8acd64a1478b0e9..32dac661b03a0a1f5e63c4fc3f1b5e4c5595f078 100644 (file)
@@ -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);
index 1c58b01c73addfa1bfac519f8fe3cf0cebffa36a..9a82394013a15e767a0383fe19f857e80bc8b8f4 100644 (file)
@@ -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;
index 3ca60012693a3c00da4e2f74b23ea252aee114a3..76b00a9898a2e1b93c0c4b53a9e243ebefb4b407 100644 (file)
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    649,
 /**/
     648,
 /**/