0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.1.1393: unnecessary type casts

Problem:    Unnecessary type casts.
Solution:   Remove type casts from alloc() and lalloc() calls. (Mike Williams)
This commit is contained in:
Bram Moolenaar
2019-05-25 20:21:28 +02:00
parent 682725c141
commit 51e14387f1
31 changed files with 70 additions and 74 deletions

View File

@@ -534,7 +534,7 @@ term_start(
cmd = (char_u*)"";
len = STRLEN(cmd) + 10;
p = alloc((int)len);
p = alloc(len);
for (i = 0; p != NULL; ++i)
{
@@ -1630,7 +1630,7 @@ update_snapshot(term_T *term)
if (len == 0)
p = NULL;
else
p = (cellattr_T *)alloc((int)sizeof(cellattr_T) * len);
p = (cellattr_T *)alloc(sizeof(cellattr_T) * len);
if ((p != NULL || len == 0)
&& ga_grow(&term->tl_scrollback, 1) == OK)
{
@@ -2884,7 +2884,7 @@ handle_pushline(int cols, const VTermScreenCell *cells, void *user)
ga_init2(&ga, 1, 100);
if (len > 0)
p = (cellattr_T *)alloc((int)sizeof(cellattr_T) * len);
p = (cellattr_T *)alloc(sizeof(cellattr_T) * len);
if (p != NULL)
{
for (col = 0; col < len; col += cells[col].width)
@@ -3718,7 +3718,7 @@ handle_drop_command(listitem_T *item)
p = dict_get_string(dict, (char_u *)"encoding", FALSE);
if (p != NULL)
{
ea.cmd = alloc((int)STRLEN(p) + 12);
ea.cmd = alloc(STRLEN(p) + 12);
if (ea.cmd != NULL)
{
sprintf((char *)ea.cmd, "sbuf ++enc=%s", p);
@@ -4031,7 +4031,7 @@ term_get_status_text(term_T *term)
else
txt = (char_u *)_("finished");
len = 9 + STRLEN(term->tl_buffer->b_fname) + STRLEN(txt);
term->tl_status_text = alloc((int)len);
term->tl_status_text = alloc(len);
if (term->tl_status_text != NULL)
vim_snprintf((char *)term->tl_status_text, len, "%s [%s]",
term->tl_buffer->b_fname, txt);
@@ -4663,7 +4663,7 @@ term_load_dump(typval_T *argvars, typval_T *rettv, int do_diff)
{
size_t len = STRLEN(fname1) + 12;
fname_tofree = alloc((int)len);
fname_tofree = alloc(len);
if (fname_tofree != NULL)
{
vim_snprintf((char *)fname_tofree, len, "dump diff %s", fname1);
@@ -4935,7 +4935,7 @@ term_swap_diff()
else
{
size_t size = sizeof(sb_line_T) * term->tl_scrollback.ga_len;
sb_line_T *temp = (sb_line_T *)alloc((int)size);
sb_line_T *temp = (sb_line_T *)alloc(size);
/* need to copy cell properties into temp memory */
if (temp != NULL)
@@ -5800,7 +5800,7 @@ conpty_term_and_job_init(
{
/* Request by CreateProcessW */
breq = wcslen(cmd_wchar) + 1 + 1; /* Addition of NUL by API */
cmd_wchar_copy = (PWSTR)alloc((int)(breq * sizeof(WCHAR)));
cmd_wchar_copy = (PWSTR)alloc(breq * sizeof(WCHAR));
wcsncpy(cmd_wchar_copy, cmd_wchar, breq - 1);
}
@@ -5830,7 +5830,7 @@ conpty_term_and_job_init(
/* Set up pipe inheritance safely: Vista or later. */
pInitializeProcThreadAttributeList(NULL, 1, 0, &breq);
term->tl_siex.lpAttributeList =
(PPROC_THREAD_ATTRIBUTE_LIST)alloc((int)breq);
(PPROC_THREAD_ATTRIBUTE_LIST)alloc(breq);
if (!term->tl_siex.lpAttributeList)
goto failed;
if (!pInitializeProcThreadAttributeList(term->tl_siex.lpAttributeList, 1,