diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-05-24 18:54:09 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-05-24 18:54:09 +0200 |
commit | 964b3746b9c81e65887e2ac9a335f181db2bb592 (patch) | |
tree | 9afaaac41a1c4f71b359fd6706b88df00e22e7a1 /src/ex_getln.c | |
parent | d33a764123a8aedb20cd84aeff3b94810ee67c4c (diff) | |
download | vim-git-964b3746b9c81e65887e2ac9a335f181db2bb592.tar.gz |
patch 8.1.1384: using "int" for alloc() often results in compiler warningsv8.1.1384
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.
Diffstat (limited to 'src/ex_getln.c')
-rw-r--r-- | src/ex_getln.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/ex_getln.c b/src/ex_getln.c index ba3dc7358..00193fee8 100644 --- a/src/ex_getln.c +++ b/src/ex_getln.c @@ -4154,7 +4154,7 @@ ExpandOne( } } - ss = alloc((unsigned)len + 1); + ss = alloc(len + 1); if (ss) vim_strncpy(ss, xp->xp_files[0], (size_t)len); findex = -1; /* next p_wc gets first one */ @@ -4362,7 +4362,7 @@ escape_fname(char_u **pp) { char_u *p; - p = alloc((unsigned)(STRLEN(*pp) + 2)); + p = alloc(STRLEN(*pp) + 2); if (p != NULL) { p[0] = '\\'; @@ -5294,7 +5294,7 @@ ExpandGeneric( if (count == 0) return OK; *num_file = count; - *file = (char_u **)alloc((unsigned)(count * sizeof(char_u *))); + *file = (char_u **)alloc(count * sizeof(char_u *)); if (*file == NULL) { *file = (char_u **)""; @@ -5636,7 +5636,7 @@ ExpandRTDir( for (i = 0; dirnames[i] != NULL; ++i) { - s = alloc((unsigned)(STRLEN(dirnames[i]) + pat_len + 7)); + s = alloc(STRLEN(dirnames[i]) + pat_len + 7); if (s == NULL) { ga_clear_strings(&ga); @@ -5650,7 +5650,7 @@ ExpandRTDir( if (flags & DIP_START) { for (i = 0; dirnames[i] != NULL; ++i) { - s = alloc((unsigned)(STRLEN(dirnames[i]) + pat_len + 22)); + s = alloc(STRLEN(dirnames[i]) + pat_len + 22); if (s == NULL) { ga_clear_strings(&ga); @@ -5665,7 +5665,7 @@ ExpandRTDir( if (flags & DIP_OPT) { for (i = 0; dirnames[i] != NULL; ++i) { - s = alloc((unsigned)(STRLEN(dirnames[i]) + pat_len + 20)); + s = alloc(STRLEN(dirnames[i]) + pat_len + 20); if (s == NULL) { ga_clear_strings(&ga); @@ -5728,7 +5728,7 @@ ExpandPackAddDir( pat_len = (int)STRLEN(pat); ga_init2(&ga, (int)sizeof(char *), 10); - s = alloc((unsigned)(pat_len + 26)); + s = alloc(pat_len + 26); if (s == NULL) { ga_clear_strings(&ga); |