comparison src/autocmd.c @ 20751:d9a2e5dcfd9f v8.2.0928

patch 8.2.0928: many type casts are used for vim_strnsave() Commit: https://github.com/vim/vim/commit/df44a27b53586fccfc6a3aedc89061fdd9a515ff Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jun 7 20:49:05 2020 +0200 patch 8.2.0928: many type casts are used for vim_strnsave() Problem: Many type casts are used for vim_strnsave(). Solution: Make the length argument size_t instead of int. (Ken Takata, closes #5633) Remove some type casts.
author Bram Moolenaar <Bram@vim.org>
date Sun, 07 Jun 2020 21:00:03 +0200
parents 435726a03481
children e76b83c07bd8
comparison
equal deleted inserted replaced
20750:020a100bfa92 20751:d9a2e5dcfd9f
761 char_u *save_ei; 761 char_u *save_ei;
762 762
763 save_ei = vim_strsave(p_ei); 763 save_ei = vim_strsave(p_ei);
764 if (save_ei != NULL) 764 if (save_ei != NULL)
765 { 765 {
766 new_ei = vim_strnsave(p_ei, (int)(STRLEN(p_ei) + STRLEN(what))); 766 new_ei = vim_strnsave(p_ei, STRLEN(p_ei) + STRLEN(what));
767 if (new_ei != NULL) 767 if (new_ei != NULL)
768 { 768 {
769 if (*what == ',' && *p_ei == NUL) 769 if (*what == ',' && *p_ei == NUL)
770 STRCPY(new_ei, what + 1); 770 STRCPY(new_ei, what + 1);
771 else 771 else
989 989
990 for (p = arg; *p && !VIM_ISWHITE(*p) && *p != '|'; ++p) 990 for (p = arg; *p && !VIM_ISWHITE(*p) && *p != '|'; ++p)
991 ; 991 ;
992 if (p > arg) 992 if (p > arg)
993 { 993 {
994 group_name = vim_strnsave(arg, (int)(p - arg)); 994 group_name = vim_strnsave(arg, p - arg);
995 if (group_name == NULL) // out of memory 995 if (group_name == NULL) // out of memory
996 return AUGROUP_ERROR; 996 return AUGROUP_ERROR;
997 group = au_find_group(group_name); 997 group = au_find_group(group_name);
998 if (group == AUGROUP_ERROR) 998 if (group == AUGROUP_ERROR)
999 group = AUGROUP_ALL; // no match, use all groups 999 group = AUGROUP_ALL; // no match, use all groups