0
0
mirror of https://github.com/vim/vim.git synced 2025-09-25 03:54:15 -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

@@ -1346,7 +1346,7 @@ qf_parse_multiline_pfx(
if (*fields->errmsg && !qfl->qf_multiignore)
{
len = (int)STRLEN(qfprev->qf_text);
if ((ptr = alloc((unsigned)(len + STRLEN(fields->errmsg) + 2)))
if ((ptr = alloc(len + STRLEN(fields->errmsg) + 2))
== NULL)
return QF_FAIL;
STRCPY(ptr, qfprev->qf_text);
@@ -1890,7 +1890,7 @@ locstack_queue_delreq(qf_info_T *qi)
{
qf_delq_T *q;
q = (qf_delq_T *)alloc((unsigned)sizeof(qf_delq_T));
q = (qf_delq_T *)alloc(sizeof(qf_delq_T));
if (q != NULL)
{
q->qi = qi;
@@ -2063,7 +2063,7 @@ qf_add_entry(
qfline_T *qfp;
qfline_T **lastp; // pointer to qf_last or NULL
if ((qfp = (qfline_T *)alloc((unsigned)sizeof(qfline_T))) == NULL)
if ((qfp = (qfline_T *)alloc(sizeof(qfline_T))) == NULL)
return QF_FAIL;
if (bufnum != 0)
{
@@ -2429,7 +2429,7 @@ qf_push_dir(char_u *dirbuf, struct dir_stack_T **stackptr, int is_file_stack)
struct dir_stack_T *ds_ptr;
// allocate new stack element and hook it in
ds_new = (struct dir_stack_T *)alloc((unsigned)sizeof(struct dir_stack_T));
ds_new = (struct dir_stack_T *)alloc(sizeof(struct dir_stack_T));
if (ds_new == NULL)
return NULL;
@@ -4707,7 +4707,7 @@ get_mef_name(void)
else
off += 19;
name = alloc((unsigned)STRLEN(p_mef) + 30);
name = alloc(STRLEN(p_mef) + 30);
if (name == NULL)
break;
STRCPY(name, p_mef);