0
0
mirror of https://github.com/vim/vim.git synced 2025-10-02 05:04:20 -04:00

patch 8.1.1386: unessesary type casts for lalloc()

Problem:    Unessesary type casts for lalloc().
Solution:   Remove type casts.  Change lalloc(size, TRUE) to alloc(size).
This commit is contained in:
Bram Moolenaar
2019-05-24 19:39:03 +02:00
parent 71de720c2c
commit 18a4ba29ae
41 changed files with 127 additions and 138 deletions

View File

@@ -8782,26 +8782,25 @@ retry:
if (aucmd_win != NULL)
win_free_lsize(aucmd_win);
new_ScreenLines = (schar_T *)lalloc((long_u)(
(Rows + 1) * Columns * sizeof(schar_T)), FALSE);
new_ScreenLines = (schar_T *)lalloc(
(Rows + 1) * Columns * sizeof(schar_T), FALSE);
vim_memset(new_ScreenLinesC, 0, sizeof(u8char_T *) * MAX_MCO);
if (enc_utf8)
{
new_ScreenLinesUC = (u8char_T *)lalloc((long_u)(
(Rows + 1) * Columns * sizeof(u8char_T)), FALSE);
new_ScreenLinesUC = (u8char_T *)lalloc(
(Rows + 1) * Columns * sizeof(u8char_T), FALSE);
for (i = 0; i < p_mco; ++i)
new_ScreenLinesC[i] = (u8char_T *)lalloc_clear((long_u)(
(Rows + 1) * Columns * sizeof(u8char_T)), FALSE);
new_ScreenLinesC[i] = (u8char_T *)lalloc_clear(
(Rows + 1) * Columns * sizeof(u8char_T), FALSE);
}
if (enc_dbcs == DBCS_JPNU)
new_ScreenLines2 = (schar_T *)lalloc((long_u)(
(Rows + 1) * Columns * sizeof(schar_T)), FALSE);
new_ScreenAttrs = (sattr_T *)lalloc((long_u)(
(Rows + 1) * Columns * sizeof(sattr_T)), FALSE);
new_LineOffset = (unsigned *)lalloc((long_u)(
Rows * sizeof(unsigned)), FALSE);
new_LineWraps = (char_u *)lalloc((long_u)(Rows * sizeof(char_u)), FALSE);
new_TabPageIdxs = (short *)lalloc((long_u)(Columns * sizeof(short)), FALSE);
new_ScreenLines2 = (schar_T *)lalloc(
(Rows + 1) * Columns * sizeof(schar_T), FALSE);
new_ScreenAttrs = (sattr_T *)lalloc(
(Rows + 1) * Columns * sizeof(sattr_T), FALSE);
new_LineOffset = (unsigned *)lalloc(Rows * sizeof(unsigned), FALSE);
new_LineWraps = (char_u *)lalloc(Rows * sizeof(char_u), FALSE);
new_TabPageIdxs = (short *)lalloc(Columns * sizeof(short), FALSE);
FOR_ALL_TAB_WINDOWS(tp, wp)
{
@@ -10741,7 +10740,7 @@ redraw_win_toolbar(win_T *wp)
for (menu = wp->w_winbar->children; menu != NULL; menu = menu->next)
++item_count;
wp->w_winbar_items = (winbar_item_T *)alloc_clear(
(unsigned)sizeof(winbar_item_T) * (item_count + 1));
sizeof(winbar_item_T) * (item_count + 1));
/* TODO: use fewer spaces if there is not enough room */
for (menu = wp->w_winbar->children;