Mercurial > vim
comparison src/screen.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 | f7268ec2c889 |
comparison
equal
deleted
inserted
replaced
16781:db5dc8db015c | 16782:fc58fee685e2 |
---|---|
326 if (msg_scrolled || (State != NORMAL && State != NORMAL_BUSY) || exiting) | 326 if (msg_scrolled || (State != NORMAL && State != NORMAL_BUSY) || exiting) |
327 return ret; | 327 return ret; |
328 | 328 |
329 /* Allocate space to save the text displayed in the command line area. */ | 329 /* Allocate space to save the text displayed in the command line area. */ |
330 rows = screen_Rows - cmdline_row; | 330 rows = screen_Rows - cmdline_row; |
331 screenline = (schar_T *)lalloc( | 331 screenline = (schar_T *)lalloc(rows * cols * sizeof(schar_T), FALSE); |
332 (long_u)(rows * cols * sizeof(schar_T)), FALSE); | 332 screenattr = (sattr_T *)lalloc(rows * cols * sizeof(sattr_T), FALSE); |
333 screenattr = (sattr_T *)lalloc( | |
334 (long_u)(rows * cols * sizeof(sattr_T)), FALSE); | |
335 if (screenline == NULL || screenattr == NULL) | 333 if (screenline == NULL || screenattr == NULL) |
336 ret = 2; | 334 ret = 2; |
337 if (enc_utf8) | 335 if (enc_utf8) |
338 { | 336 { |
339 screenlineUC = (u8char_T *)lalloc( | 337 screenlineUC = (u8char_T *)lalloc( |
340 (long_u)(rows * cols * sizeof(u8char_T)), FALSE); | 338 rows * cols * sizeof(u8char_T), FALSE); |
341 if (screenlineUC == NULL) | 339 if (screenlineUC == NULL) |
342 ret = 2; | 340 ret = 2; |
343 for (i = 0; i < p_mco; ++i) | 341 for (i = 0; i < p_mco; ++i) |
344 { | 342 { |
345 screenlineC[i] = (u8char_T *)lalloc( | 343 screenlineC[i] = (u8char_T *)lalloc( |
346 (long_u)(rows * cols * sizeof(u8char_T)), FALSE); | 344 rows * cols * sizeof(u8char_T), FALSE); |
347 if (screenlineC[i] == NULL) | 345 if (screenlineC[i] == NULL) |
348 ret = 2; | 346 ret = 2; |
349 } | 347 } |
350 } | 348 } |
351 if (enc_dbcs == DBCS_JPNU) | 349 if (enc_dbcs == DBCS_JPNU) |
352 { | 350 { |
353 screenline2 = (schar_T *)lalloc( | 351 screenline2 = (schar_T *)lalloc(rows * cols * sizeof(schar_T), FALSE); |
354 (long_u)(rows * cols * sizeof(schar_T)), FALSE); | |
355 if (screenline2 == NULL) | 352 if (screenline2 == NULL) |
356 ret = 2; | 353 ret = 2; |
357 } | 354 } |
358 | 355 |
359 if (ret != 2) | 356 if (ret != 2) |