Mercurial > vim
comparison src/screen.c @ 16768:695d9ef00b03 v8.1.1386
patch 8.1.1386: unessesary type casts for lalloc()
commit https://github.com/vim/vim/commit/18a4ba29aeccb9841d5bfdd2eaaffdfae2f15ced
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri May 24 19:39:03 2019 +0200
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).
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 24 May 2019 19:45:05 +0200 |
parents | ef00b6bc186b |
children | eda4d65f232c |
comparison
equal
deleted
inserted
replaced
16767:3959544fc067 | 16768:695d9ef00b03 |
---|---|
8780 FOR_ALL_TAB_WINDOWS(tp, wp) | 8780 FOR_ALL_TAB_WINDOWS(tp, wp) |
8781 win_free_lsize(wp); | 8781 win_free_lsize(wp); |
8782 if (aucmd_win != NULL) | 8782 if (aucmd_win != NULL) |
8783 win_free_lsize(aucmd_win); | 8783 win_free_lsize(aucmd_win); |
8784 | 8784 |
8785 new_ScreenLines = (schar_T *)lalloc((long_u)( | 8785 new_ScreenLines = (schar_T *)lalloc( |
8786 (Rows + 1) * Columns * sizeof(schar_T)), FALSE); | 8786 (Rows + 1) * Columns * sizeof(schar_T), FALSE); |
8787 vim_memset(new_ScreenLinesC, 0, sizeof(u8char_T *) * MAX_MCO); | 8787 vim_memset(new_ScreenLinesC, 0, sizeof(u8char_T *) * MAX_MCO); |
8788 if (enc_utf8) | 8788 if (enc_utf8) |
8789 { | 8789 { |
8790 new_ScreenLinesUC = (u8char_T *)lalloc((long_u)( | 8790 new_ScreenLinesUC = (u8char_T *)lalloc( |
8791 (Rows + 1) * Columns * sizeof(u8char_T)), FALSE); | 8791 (Rows + 1) * Columns * sizeof(u8char_T), FALSE); |
8792 for (i = 0; i < p_mco; ++i) | 8792 for (i = 0; i < p_mco; ++i) |
8793 new_ScreenLinesC[i] = (u8char_T *)lalloc_clear((long_u)( | 8793 new_ScreenLinesC[i] = (u8char_T *)lalloc_clear( |
8794 (Rows + 1) * Columns * sizeof(u8char_T)), FALSE); | 8794 (Rows + 1) * Columns * sizeof(u8char_T), FALSE); |
8795 } | 8795 } |
8796 if (enc_dbcs == DBCS_JPNU) | 8796 if (enc_dbcs == DBCS_JPNU) |
8797 new_ScreenLines2 = (schar_T *)lalloc((long_u)( | 8797 new_ScreenLines2 = (schar_T *)lalloc( |
8798 (Rows + 1) * Columns * sizeof(schar_T)), FALSE); | 8798 (Rows + 1) * Columns * sizeof(schar_T), FALSE); |
8799 new_ScreenAttrs = (sattr_T *)lalloc((long_u)( | 8799 new_ScreenAttrs = (sattr_T *)lalloc( |
8800 (Rows + 1) * Columns * sizeof(sattr_T)), FALSE); | 8800 (Rows + 1) * Columns * sizeof(sattr_T), FALSE); |
8801 new_LineOffset = (unsigned *)lalloc((long_u)( | 8801 new_LineOffset = (unsigned *)lalloc(Rows * sizeof(unsigned), FALSE); |
8802 Rows * sizeof(unsigned)), FALSE); | 8802 new_LineWraps = (char_u *)lalloc(Rows * sizeof(char_u), FALSE); |
8803 new_LineWraps = (char_u *)lalloc((long_u)(Rows * sizeof(char_u)), FALSE); | 8803 new_TabPageIdxs = (short *)lalloc(Columns * sizeof(short), FALSE); |
8804 new_TabPageIdxs = (short *)lalloc((long_u)(Columns * sizeof(short)), FALSE); | |
8805 | 8804 |
8806 FOR_ALL_TAB_WINDOWS(tp, wp) | 8805 FOR_ALL_TAB_WINDOWS(tp, wp) |
8807 { | 8806 { |
8808 if (win_alloc_lines(wp) == FAIL) | 8807 if (win_alloc_lines(wp) == FAIL) |
8809 { | 8808 { |
10739 | 10738 |
10740 vim_free(wp->w_winbar_items); | 10739 vim_free(wp->w_winbar_items); |
10741 for (menu = wp->w_winbar->children; menu != NULL; menu = menu->next) | 10740 for (menu = wp->w_winbar->children; menu != NULL; menu = menu->next) |
10742 ++item_count; | 10741 ++item_count; |
10743 wp->w_winbar_items = (winbar_item_T *)alloc_clear( | 10742 wp->w_winbar_items = (winbar_item_T *)alloc_clear( |
10744 (unsigned)sizeof(winbar_item_T) * (item_count + 1)); | 10743 sizeof(winbar_item_T) * (item_count + 1)); |
10745 | 10744 |
10746 /* TODO: use fewer spaces if there is not enough room */ | 10745 /* TODO: use fewer spaces if there is not enough room */ |
10747 for (menu = wp->w_winbar->children; | 10746 for (menu = wp->w_winbar->children; |
10748 menu != NULL && col < wp->w_width; menu = menu->next) | 10747 menu != NULL && col < wp->w_width; menu = menu->next) |
10749 { | 10748 { |