Patch 9.0.0450

4 views
Skip to first unread message

Bram Moolenaar

unread,
Sep 12, 2022, 9:10:07 AM9/12/22
to vim...@googlegroups.com

Patch 9.0.0450
Problem: Return value of argument check functions is inconsistent.
Solution: Return OK/FAIL instead of TRUE/FALSE. (closes #11112)
Files: src/typval.c


*** ../vim-9.0.0449/src/typval.c 2022-09-09 18:46:41.558660414 +0100
--- src/typval.c 2022-09-12 14:08:05.362207543 +0100
***************
*** 410,416 ****
check_for_opt_string_arg(typval_T *args, int idx)
{
return (args[idx].v_type == VAR_UNKNOWN
! || check_for_string_arg(args, idx) != FAIL);
}

/*
--- 410,416 ----
check_for_opt_string_arg(typval_T *args, int idx)
{
return (args[idx].v_type == VAR_UNKNOWN
! || check_for_string_arg(args, idx) != FAIL) ? OK : FAIL;
}

/*
***************
*** 434,440 ****
check_for_opt_number_arg(typval_T *args, int idx)
{
return (args[idx].v_type == VAR_UNKNOWN
! || check_for_number_arg(args, idx) != FAIL);
}

/*
--- 434,440 ----
check_for_opt_number_arg(typval_T *args, int idx)
{
return (args[idx].v_type == VAR_UNKNOWN
! || check_for_number_arg(args, idx) != FAIL) ? OK : FAIL;
}

/*
***************
*** 532,538 ****
check_for_opt_list_arg(typval_T *args, int idx)
{
return (args[idx].v_type == VAR_UNKNOWN
! || check_for_list_arg(args, idx) != FAIL);
}

/*
--- 532,538 ----
check_for_opt_list_arg(typval_T *args, int idx)
{
return (args[idx].v_type == VAR_UNKNOWN
! || check_for_list_arg(args, idx) != FAIL) ? OK : FAIL;
}

/*
***************
*** 573,579 ****
check_for_opt_dict_arg(typval_T *args, int idx)
{
return (args[idx].v_type == VAR_UNKNOWN
! || check_for_dict_arg(args, idx) != FAIL);
}

#if defined(FEAT_JOB_CHANNEL) || defined(PROTO)
--- 573,579 ----
check_for_opt_dict_arg(typval_T *args, int idx)
{
return (args[idx].v_type == VAR_UNKNOWN
! || check_for_dict_arg(args, idx) != FAIL) ? OK : FAIL;
}

#if defined(FEAT_JOB_CHANNEL) || defined(PROTO)
***************
*** 599,605 ****
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);
}

/*
--- 599,605 ----
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) ? OK : FAIL;
}

/*
***************
*** 623,629 ****
check_for_opt_job_arg(typval_T *args, int idx)
{
return (args[idx].v_type == VAR_UNKNOWN
! || check_for_job_arg(args, idx) != FAIL);
}
#endif

--- 623,629 ----
check_for_opt_job_arg(typval_T *args, int idx)
{
return (args[idx].v_type == VAR_UNKNOWN
! || check_for_job_arg(args, idx) != FAIL) ? OK : FAIL;
}
#endif

***************
*** 649,655 ****
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);
}

/*
--- 649,655 ----
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) ? OK : FAIL;
}

/*
***************
*** 669,675 ****
check_for_opt_buffer_arg(typval_T *args, int idx)
{
return (args[idx].v_type == VAR_UNKNOWN
! || check_for_buffer_arg(args, idx));
}

/*
--- 669,675 ----
check_for_opt_buffer_arg(typval_T *args, int idx)
{
return (args[idx].v_type == VAR_UNKNOWN
! || check_for_buffer_arg(args, idx) != FAIL) ? OK : FAIL;
}

/*
***************
*** 689,695 ****
check_for_opt_lnum_arg(typval_T *args, int idx)
{
return (args[idx].v_type == VAR_UNKNOWN
! || check_for_lnum_arg(args, idx));
}

#if defined(FEAT_JOB_CHANNEL) || defined(PROTO)
--- 689,695 ----
check_for_opt_lnum_arg(typval_T *args, int idx)
{
return (args[idx].v_type == VAR_UNKNOWN
! || check_for_lnum_arg(args, idx) != FAIL) ? OK : FAIL;
}

#if defined(FEAT_JOB_CHANNEL) || defined(PROTO)
***************
*** 746,752 ****
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));
}

/*
--- 746,752 ----
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) != FAIL) ? OK : FAIL;
}

/*
***************
*** 788,794 ****
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);
}

/*
--- 788,795 ----
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) ? OK : FAIL;
}

/*
*** ../vim-9.0.0449/src/version.c 2022-09-12 13:35:06.514946763 +0100
--- src/version.c 2022-09-12 14:09:18.038027920 +0100
***************
*** 705,706 ****
--- 705,708 ----
{ /* Add new patch number below this line */
+ /**/
+ 450,
/**/

--
CVS sux, men don't like commitment

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages