0
0
mirror of https://github.com/vim/vim.git synced 2025-10-02 05:04:20 -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

@@ -328,30 +328,27 @@ redraw_asap(int type)
/* Allocate space to save the text displayed in the command line area. */
rows = screen_Rows - cmdline_row;
screenline = (schar_T *)lalloc(
(long_u)(rows * cols * sizeof(schar_T)), FALSE);
screenattr = (sattr_T *)lalloc(
(long_u)(rows * cols * sizeof(sattr_T)), FALSE);
screenline = (schar_T *)lalloc(rows * cols * sizeof(schar_T), FALSE);
screenattr = (sattr_T *)lalloc(rows * cols * sizeof(sattr_T), FALSE);
if (screenline == NULL || screenattr == NULL)
ret = 2;
if (enc_utf8)
{
screenlineUC = (u8char_T *)lalloc(
(long_u)(rows * cols * sizeof(u8char_T)), FALSE);
rows * cols * sizeof(u8char_T), FALSE);
if (screenlineUC == NULL)
ret = 2;
for (i = 0; i < p_mco; ++i)
{
screenlineC[i] = (u8char_T *)lalloc(
(long_u)(rows * cols * sizeof(u8char_T)), FALSE);
rows * cols * sizeof(u8char_T), FALSE);
if (screenlineC[i] == NULL)
ret = 2;
}
}
if (enc_dbcs == DBCS_JPNU)
{
screenline2 = (schar_T *)lalloc(
(long_u)(rows * cols * sizeof(schar_T)), FALSE);
screenline2 = (schar_T *)lalloc(rows * cols * sizeof(schar_T), FALSE);
if (screenline2 == NULL)
ret = 2;
}