Mercurial > vim
diff src/list.c @ 17606:ff097edaae89 v8.1.1800
patch 8.1.1800: function call functions have too many arguments
commit https://github.com/vim/vim/commit/c6538bcc1cdd1fb83732f22fdc69bd9bb66f968a
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Aug 3 18:17:11 2019 +0200
patch 8.1.1800: function call functions have too many arguments
Problem: Function call functions have too many arguments.
Solution: Pass values in a funcexe_T struct.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 03 Aug 2019 18:30:07 +0200 |
parents | ef23ec1eee54 |
children | 0f7ae8010787 |
line wrap: on
line diff
--- a/src/list.c +++ b/src/list.c @@ -1284,9 +1284,9 @@ item_compare2(const void *s1, const void int res; typval_T rettv; typval_T argv[3]; - int dummy; char_u *func_name; partial_T *partial = sortinfo->item_compare_partial; + funcexe_T funcexe; /* shortcut after failure in previous call; compare all items equal */ if (sortinfo->item_compare_func_err) @@ -1306,8 +1306,11 @@ item_compare2(const void *s1, const void copy_tv(&si2->item->li_tv, &argv[1]); rettv.v_type = VAR_UNKNOWN; /* clear_tv() uses this */ - res = call_func(func_name, -1, &rettv, 2, argv, NULL, 0L, 0L, &dummy, TRUE, - partial, sortinfo->item_compare_selfdict); + vim_memset(&funcexe, 0, sizeof(funcexe)); + funcexe.evaluate = TRUE; + funcexe.partial = partial; + funcexe.selfdict = sortinfo->item_compare_selfdict; + res = call_func(func_name, -1, &rettv, 2, argv, &funcexe); clear_tv(&argv[0]); clear_tv(&argv[1]);