Mercurial > vim
diff src/terminal.c @ 16782:fc58fee685e2 v8.1.1393
patch 8.1.1393: unnecessary type casts
commit https://github.com/vim/vim/commit/51e14387f120392b74b84408cafec33942337a05
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat May 25 20:21:28 2019 +0200
patch 8.1.1393: unnecessary type casts
Problem: Unnecessary type casts.
Solution: Remove type casts from alloc() and lalloc() calls. (Mike Williams)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 25 May 2019 20:30:06 +0200 |
parents | eda4d65f232c |
children | ce04ebdf26b8 |
line wrap: on
line diff
--- a/src/terminal.c +++ b/src/terminal.c @@ -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 VTermScr 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 { 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,