diff src/mbyte.c @ 14071:c1fcfafa8d1a v8.1.0053

patch 8.1.0053: first argument of 'completefunc' has inconsistent type commit https://github.com/vim/vim/commit/ffa9684150f5441e84d492e7184ef73587bd6c6c Author: Bram Moolenaar <Bram@vim.org> Date: Tue Jun 12 22:05:14 2018 +0200 patch 8.1.0053: first argument of 'completefunc' has inconsistent type Problem: The first argument given to 'completefunc' can be Number or String, depending on the value. Solution: Avoid guessing the type of an argument, use typval_T in the callers of call_vim_function(). (Ozaki Kiichi, closes #2993)
author Christian Brabandt <cb@256bit.org>
date Tue, 12 Jun 2018 22:15:06 +0200
parents fbd4f9645b57
children 320956bddcef
line wrap: on
line diff
--- a/src/mbyte.c
+++ b/src/mbyte.c
@@ -4795,12 +4795,11 @@ iconv_end(void)
     static void
 call_imactivatefunc(int active)
 {
-    char_u *argv[1];
-
-    if (active)
-	argv[0] = (char_u *)"1";
-    else
-	argv[0] = (char_u *)"0";
+    typval_T argv[2];
+
+    argv[0].v_type = VAR_NUMBER;
+    argv[0].vval.v_number = active ? 1 : 0;
+    argv[1].v_type = VAR_NUMBER;
     (void)call_func_retnr(p_imaf, 1, argv, FALSE);
 }