changeset 30228:642b5e748028 v9.0.0450

patch 9.0.0450: return value of argument check functions is inconsistent Commit: https://github.com/vim/vim/commit/cd2d5c181a0b91585a591bc9d2c0438937f19814 Author: zeertzjq <zeertzjq@outlook.com> Date: Mon Sep 12 14:09:30 2022 +0100 patch 9.0.0450: return value of argument check functions is inconsistent Problem: Return value of argument check functions is inconsistent. Solution: Return OK/FAIL instead of TRUE/FALSE. (closes https://github.com/vim/vim/issues/11112)
author Bram Moolenaar <Bram@vim.org>
date Mon, 12 Sep 2022 15:15:03 +0200
parents 5e8a1c97cdd7
children e6eacc33ab92
files src/typval.c src/version.c
diffstat 2 files changed, 14 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/src/typval.c
+++ b/src/typval.c
@@ -410,7 +410,7 @@ check_for_nonempty_string_arg(typval_T *
 check_for_opt_string_arg(typval_T *args, int idx)
 {
     return (args[idx].v_type == VAR_UNKNOWN
-	    || check_for_string_arg(args, idx) != FAIL);
+	    || check_for_string_arg(args, idx) != FAIL) ? OK : FAIL;
 }
 
 /*
@@ -434,7 +434,7 @@ check_for_number_arg(typval_T *args, int
 check_for_opt_number_arg(typval_T *args, int idx)
 {
     return (args[idx].v_type == VAR_UNKNOWN
-	    || check_for_number_arg(args, idx) != FAIL);
+	    || check_for_number_arg(args, idx) != FAIL) ? OK : FAIL;
 }
 
 /*
@@ -532,7 +532,7 @@ check_for_nonnull_list_arg(typval_T *arg
 check_for_opt_list_arg(typval_T *args, int idx)
 {
     return (args[idx].v_type == VAR_UNKNOWN
-	    || check_for_list_arg(args, idx) != FAIL);
+	    || check_for_list_arg(args, idx) != FAIL) ? OK : FAIL;
 }
 
 /*
@@ -573,7 +573,7 @@ check_for_nonnull_dict_arg(typval_T *arg
 check_for_opt_dict_arg(typval_T *args, int idx)
 {
     return (args[idx].v_type == VAR_UNKNOWN
-	    || check_for_dict_arg(args, idx) != FAIL);
+	    || check_for_dict_arg(args, idx) != FAIL) ? OK : FAIL;
 }
 
 #if defined(FEAT_JOB_CHANNEL) || defined(PROTO)
@@ -599,7 +599,7 @@ check_for_chan_or_job_arg(typval_T *args
 check_for_opt_chan_or_job_arg(typval_T *args, int idx)
 {
     return (args[idx].v_type == VAR_UNKNOWN
-	    || check_for_chan_or_job_arg(args, idx) != FAIL);
+	    || check_for_chan_or_job_arg(args, idx) != FAIL) ? OK : FAIL;
 }
 
 /*
@@ -623,7 +623,7 @@ check_for_job_arg(typval_T *args, int id
 check_for_opt_job_arg(typval_T *args, int idx)
 {
     return (args[idx].v_type == VAR_UNKNOWN
-	    || check_for_job_arg(args, idx) != FAIL);
+	    || check_for_job_arg(args, idx) != FAIL) ? OK : FAIL;
 }
 #endif
 
@@ -649,7 +649,7 @@ check_for_string_or_number_arg(typval_T 
 check_for_opt_string_or_number_arg(typval_T *args, int idx)
 {
     return (args[idx].v_type == VAR_UNKNOWN
-	    || check_for_string_or_number_arg(args, idx) != FAIL);
+	    || check_for_string_or_number_arg(args, idx) != FAIL) ? OK : FAIL;
 }
 
 /*
@@ -669,7 +669,7 @@ check_for_buffer_arg(typval_T *args, int
 check_for_opt_buffer_arg(typval_T *args, int idx)
 {
     return (args[idx].v_type == VAR_UNKNOWN
-	    || check_for_buffer_arg(args, idx));
+	    || check_for_buffer_arg(args, idx) != FAIL) ? OK : FAIL;
 }
 
 /*
@@ -689,7 +689,7 @@ check_for_lnum_arg(typval_T *args, int i
 check_for_opt_lnum_arg(typval_T *args, int idx)
 {
     return (args[idx].v_type == VAR_UNKNOWN
-	    || check_for_lnum_arg(args, idx));
+	    || check_for_lnum_arg(args, idx) != FAIL) ? OK : FAIL;
 }
 
 #if defined(FEAT_JOB_CHANNEL) || defined(PROTO)
@@ -746,7 +746,7 @@ check_for_string_or_list_or_blob_arg(typ
 check_for_opt_string_or_list_arg(typval_T *args, int idx)
 {
     return (args[idx].v_type == VAR_UNKNOWN
-	    || check_for_string_or_list_arg(args, idx));
+	    || check_for_string_or_list_arg(args, idx) != FAIL) ? OK : FAIL;
 }
 
 /*
@@ -788,7 +788,8 @@ check_for_string_or_number_or_list_arg(t
 check_for_opt_string_or_number_or_list_arg(typval_T *args, int idx)
 {
     return (args[idx].v_type == VAR_UNKNOWN
-	    || check_for_string_or_number_or_list_arg(args, idx) != FAIL);
+	    || check_for_string_or_number_or_list_arg(args, idx)
+							!= FAIL) ? OK : FAIL;
 }
 
 /*
--- a/src/version.c
+++ b/src/version.c
@@ -704,6 +704,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    450,
+/**/
     449,
 /**/
     448,