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:
@@ -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;
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user