0
0
mirror of https://github.com/vim/vim.git synced 2025-10-06 05:44:14 -04:00

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.
This commit is contained in:
Bram Moolenaar
2019-05-24 18:54:09 +02:00
parent d33a764123
commit 964b3746b9
63 changed files with 293 additions and 322 deletions

View File

@@ -130,7 +130,7 @@ mf_open(char_u *fname, int flags)
struct STATFS stf;
#endif
if ((mfp = (memfile_T *)alloc((unsigned)sizeof(memfile_T))) == NULL)
if ((mfp = (memfile_T *)alloc(sizeof(memfile_T))) == NULL)
return NULL;
if (fname == NULL) /* no file for this memfile, use memory only */
@@ -893,7 +893,7 @@ mf_alloc_bhdr(memfile_T *mfp, int page_count)
{
bhdr_T *hp;
if ((hp = (bhdr_T *)alloc((unsigned)sizeof(bhdr_T))) != NULL)
if ((hp = (bhdr_T *)alloc(sizeof(bhdr_T))) != NULL)
{
if ((hp->bh_data = (char_u *)alloc(mfp->mf_page_size * page_count))
== NULL)
@@ -1108,7 +1108,7 @@ mf_trans_add(memfile_T *mfp, bhdr_T *hp)
if (hp->bh_bnum >= 0) /* it's already positive */
return OK;
if ((np = (NR_TRANS *)alloc((unsigned)sizeof(NR_TRANS))) == NULL)
if ((np = (NR_TRANS *)alloc(sizeof(NR_TRANS))) == NULL)
return FAIL;
/*