comparison src/strings.c @ 27028:c9474ae175f4 v8.2.4043

patch 8.2.4043: using int for second argument of ga_init2() Commit: https://github.com/vim/vim/commit/04935fb17e5f0f66b82cf4546b9752d3d1fa650e Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jan 8 16:19:22 2022 +0000 patch 8.2.4043: using int for second argument of ga_init2() Problem: Using int for second argument of ga_init2(). Solution: Remove unnessary type cast (int) when using sizeof().
author Bram Moolenaar <Bram@vim.org>
date Sat, 08 Jan 2022 17:30:04 +0100
parents 85866e069c24
children fb4c30606b4a
comparison
equal deleted inserted replaced
27027:167e35b85720 27028:c9474ae175f4
891 rettv->vval.v_string = NULL; 891 rettv->vval.v_string = NULL;
892 892
893 // set_vim_var_nr() doesn't set the type 893 // set_vim_var_nr() doesn't set the type
894 set_vim_var_type(VV_KEY, VAR_NUMBER); 894 set_vim_var_type(VV_KEY, VAR_NUMBER);
895 895
896 ga_init2(&ga, (int)sizeof(char), 80); 896 ga_init2(&ga, sizeof(char), 80);
897 for (p = str; *p != NUL; p += len) 897 for (p = str; *p != NUL; p += len)
898 { 898 {
899 typval_T newtv; 899 typval_T newtv;
900 900
901 if (copy_first_char_to_tv(p, &tv) == FAIL) 901 if (copy_first_char_to_tv(p, &tv) == FAIL)
1671 // Default return value: empty string. 1671 // Default return value: empty string.
1672 rettv->v_type = VAR_STRING; 1672 rettv->v_type = VAR_STRING;
1673 rettv->vval.v_string = NULL; 1673 rettv->vval.v_string = NULL;
1674 if (fromstr == NULL || tostr == NULL) 1674 if (fromstr == NULL || tostr == NULL)
1675 return; // type error; errmsg already given 1675 return; // type error; errmsg already given
1676 ga_init2(&ga, (int)sizeof(char), 80); 1676 ga_init2(&ga, sizeof(char), 80);
1677 1677
1678 if (!has_mbyte) 1678 if (!has_mbyte)
1679 // not multi-byte: fromstr and tostr must be the same length 1679 // not multi-byte: fromstr and tostr must be the same length
1680 if (STRLEN(fromstr) != STRLEN(tostr)) 1680 if (STRLEN(fromstr) != STRLEN(tostr))
1681 { 1681 {