Mercurial > vim
comparison src/evalfunc.c @ 23650:83a69ada0274 v8.2.2367
patch 8.2.2367: test failures on some less often used systems
Commit: https://github.com/vim/vim/commit/239f8d932672bcf5be6d32fc7c0bf95a2e69f5eb
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jan 17 13:21:20 2021 +0100
patch 8.2.2367: test failures on some less often used systems
Problem: Test failures on some less often used systems.
Solution: Adjust printf formats and types. (James McCoy, closes https://github.com/vim/vim/issues/7691)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 17 Jan 2021 13:30:05 +0100 |
parents | 8df4e9e2394f |
children | 1974c5122506 |
comparison
equal
deleted
inserted
replaced
23649:fb80a74c1069 | 23650:83a69ada0274 |
---|---|
2565 static void | 2565 static void |
2566 f_charidx(typval_T *argvars, typval_T *rettv) | 2566 f_charidx(typval_T *argvars, typval_T *rettv) |
2567 { | 2567 { |
2568 char_u *str; | 2568 char_u *str; |
2569 varnumber_T idx; | 2569 varnumber_T idx; |
2570 int countcc = FALSE; | 2570 varnumber_T countcc = FALSE; |
2571 char_u *p; | 2571 char_u *p; |
2572 int len; | 2572 int len; |
2573 int (*ptr2len)(char_u *); | 2573 int (*ptr2len)(char_u *); |
2574 | 2574 |
2575 rettv->vval.v_number = -1; | 2575 rettv->vval.v_number = -1; |
2586 idx = tv_get_number_chk(&argvars[1], NULL); | 2586 idx = tv_get_number_chk(&argvars[1], NULL); |
2587 if (str == NULL || idx < 0) | 2587 if (str == NULL || idx < 0) |
2588 return; | 2588 return; |
2589 | 2589 |
2590 if (argvars[2].v_type != VAR_UNKNOWN) | 2590 if (argvars[2].v_type != VAR_UNKNOWN) |
2591 countcc = (int)tv_get_bool(&argvars[2]); | 2591 countcc = tv_get_bool(&argvars[2]); |
2592 if (countcc < 0 || countcc > 1) | 2592 if (countcc < 0 || countcc > 1) |
2593 { | 2593 { |
2594 semsg(_(e_using_number_as_bool_nr), countcc); | 2594 semsg(_(e_using_number_as_bool_nr), countcc); |
2595 return; | 2595 return; |
2596 } | 2596 } |
2846 * "deepcopy()" function | 2846 * "deepcopy()" function |
2847 */ | 2847 */ |
2848 static void | 2848 static void |
2849 f_deepcopy(typval_T *argvars, typval_T *rettv) | 2849 f_deepcopy(typval_T *argvars, typval_T *rettv) |
2850 { | 2850 { |
2851 int noref = 0; | 2851 varnumber_T noref = 0; |
2852 int copyID; | 2852 int copyID; |
2853 | 2853 |
2854 if (argvars[1].v_type != VAR_UNKNOWN) | 2854 if (argvars[1].v_type != VAR_UNKNOWN) |
2855 noref = (int)tv_get_bool_chk(&argvars[1], NULL); | 2855 noref = tv_get_bool_chk(&argvars[1], NULL); |
2856 if (noref < 0 || noref > 1) | 2856 if (noref < 0 || noref > 1) |
2857 semsg(_(e_using_number_as_bool_nr), noref); | 2857 semsg(_(e_using_number_as_bool_nr), noref); |
2858 else | 2858 else |
2859 { | 2859 { |
2860 copyID = get_copyID(); | 2860 copyID = get_copyID(); |
9183 */ | 9183 */ |
9184 static void | 9184 static void |
9185 f_strchars(typval_T *argvars, typval_T *rettv) | 9185 f_strchars(typval_T *argvars, typval_T *rettv) |
9186 { | 9186 { |
9187 char_u *s = tv_get_string(&argvars[0]); | 9187 char_u *s = tv_get_string(&argvars[0]); |
9188 int skipcc = FALSE; | 9188 varnumber_T skipcc = FALSE; |
9189 varnumber_T len = 0; | 9189 varnumber_T len = 0; |
9190 int (*func_mb_ptr2char_adv)(char_u **pp); | 9190 int (*func_mb_ptr2char_adv)(char_u **pp); |
9191 | 9191 |
9192 if (argvars[1].v_type != VAR_UNKNOWN) | 9192 if (argvars[1].v_type != VAR_UNKNOWN) |
9193 skipcc = (int)tv_get_bool(&argvars[1]); | 9193 skipcc = tv_get_bool(&argvars[1]); |
9194 if (skipcc < 0 || skipcc > 1) | 9194 if (skipcc < 0 || skipcc > 1) |
9195 semsg(_(e_using_number_as_bool_nr), skipcc); | 9195 semsg(_(e_using_number_as_bool_nr), skipcc); |
9196 else | 9196 else |
9197 { | 9197 { |
9198 func_mb_ptr2char_adv = skipcc ? mb_ptr2char_adv : mb_cptr2char_adv; | 9198 func_mb_ptr2char_adv = skipcc ? mb_ptr2char_adv : mb_cptr2char_adv; |