comparison src/screen.c @ 16764:ef00b6bc186b v8.1.1384

patch 8.1.1384: using "int" for alloc() often results in compiler warnings commit https://github.com/vim/vim/commit/964b3746b9c81e65887e2ac9a335f181db2bb592 Author: Bram Moolenaar <Bram@vim.org> Date: Fri May 24 18:54:09 2019 +0200 patch 8.1.1384: using "int" for alloc() often results in compiler warnings Problem: Using "int" for alloc() often results in compiler warnings. Solution: Use "size_t" and remove type casts. Remove alloc_check(), Vim only works with 32 bit ints anyway.
author Bram Moolenaar <Bram@vim.org>
date Fri, 24 May 2019 19:00:07 +0200
parents 79c5f723bb5d
children 695d9ef00b03
comparison
equal deleted inserted replaced
16763:fccf84413b53 16764:ef00b6bc186b
4946 * for a tab */ 4946 * for a tab */
4947 len = (tab_len * mb_char2len(lcs_tab2)); 4947 len = (tab_len * mb_char2len(lcs_tab2));
4948 if (n_extra > 0) 4948 if (n_extra > 0)
4949 len += n_extra - tab_len; 4949 len += n_extra - tab_len;
4950 c = lcs_tab1; 4950 c = lcs_tab1;
4951 p = alloc((unsigned)(len + 1)); 4951 p = alloc(len + 1);
4952 vim_memset(p, ' ', len); 4952 vim_memset(p, ' ', len);
4953 p[len] = NUL; 4953 p[len] = NUL;
4954 vim_free(p_extra_free); 4954 vim_free(p_extra_free);
4955 p_extra_free = p; 4955 p_extra_free = p;
4956 for (i = 0; i < tab_len; i++) 4956 for (i = 0; i < tab_len; i++)
5105 if (wp->w_p_lbr) 5105 if (wp->w_p_lbr)
5106 { 5106 {
5107 char_u *p; 5107 char_u *p;
5108 5108
5109 c = *p_extra; 5109 c = *p_extra;
5110 p = alloc((unsigned)n_extra + 1); 5110 p = alloc(n_extra + 1);
5111 vim_memset(p, ' ', n_extra); 5111 vim_memset(p, ' ', n_extra);
5112 STRNCPY(p, p_extra + 1, STRLEN(p_extra) - 1); 5112 STRNCPY(p, p_extra + 1, STRLEN(p_extra) - 1);
5113 p[n_extra] = NUL; 5113 p[n_extra] = NUL;
5114 vim_free(p_extra_free); 5114 vim_free(p_extra_free);
5115 p_extra_free = p_extra = p; 5115 p_extra_free = p_extra = p;
6678 6678
6679 if (matches == NULL) /* interrupted completion? */ 6679 if (matches == NULL) /* interrupted completion? */
6680 return; 6680 return;
6681 6681
6682 if (has_mbyte) 6682 if (has_mbyte)
6683 buf = alloc((unsigned)Columns * MB_MAXBYTES + 1); 6683 buf = alloc(Columns * MB_MAXBYTES + 1);
6684 else 6684 else
6685 buf = alloc((unsigned)Columns + 1); 6685 buf = alloc(Columns + 1);
6686 if (buf == NULL) 6686 if (buf == NULL)
6687 return; 6687 return;
6688 6688
6689 if (match == -1) /* don't show match but original text */ 6689 if (match == -1) /* don't show match but original text */
6690 { 6690 {