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.
diff --git a/src/insexpand.c b/src/insexpand.c
index eeff64c..4a807f4 100644
--- a/src/insexpand.c
+++ b/src/insexpand.c
@@ -473,7 +473,7 @@
? actual_len : actual_compl_length;
// Allocate wide character array for the completion and fill it.
- wca = (int *)alloc((unsigned)(actual_len * sizeof(int)));
+ wca = (int *)alloc(actual_len * sizeof(int));
if (wca != NULL)
{
p = str;
@@ -1230,7 +1230,7 @@
if (pat_esc == NULL)
goto theend;
len = STRLEN(pat_esc) + 10;
- ptr = alloc((unsigned)len);
+ ptr = alloc(len);
if (ptr == NULL)
{
vim_free(pat_esc);