Mercurial > vim
comparison src/popupmnu.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 | ff3c99bd1038 |
children | ce04ebdf26b8 |
comparison
equal
deleted
inserted
replaced
16767:3959544fc067 | 16768:695d9ef00b03 |
---|---|
1069 | 1069 |
1070 /* Limit to half the window height, it has to fit above or below the mouse | 1070 /* Limit to half the window height, it has to fit above or below the mouse |
1071 * position. */ | 1071 * position. */ |
1072 if (height > max_height) | 1072 if (height > max_height) |
1073 height = max_height; | 1073 height = max_height; |
1074 *array = (pumitem_T *)alloc_clear((unsigned)sizeof(pumitem_T) * height); | 1074 *array = (pumitem_T *)alloc_clear(sizeof(pumitem_T) * height); |
1075 if (*array == NULL) | 1075 if (*array == NULL) |
1076 goto failed; | 1076 goto failed; |
1077 | 1077 |
1078 /* Add an empty line above and below, looks better. */ | 1078 /* Add an empty line above and below, looks better. */ |
1079 (*array)->pum_text = vim_strsave((char_u *)""); | 1079 (*array)->pum_text = vim_strsave((char_u *)""); |
1163 listitem_T *li; | 1163 listitem_T *li; |
1164 int idx; | 1164 int idx; |
1165 | 1165 |
1166 balloon_arraysize = list->lv_len; | 1166 balloon_arraysize = list->lv_len; |
1167 balloon_array = (pumitem_T *)alloc_clear( | 1167 balloon_array = (pumitem_T *)alloc_clear( |
1168 (unsigned)sizeof(pumitem_T) * list->lv_len); | 1168 sizeof(pumitem_T) * list->lv_len); |
1169 if (balloon_array == NULL) | 1169 if (balloon_array == NULL) |
1170 return; | 1170 return; |
1171 for (idx = 0, li = list->lv_first; li != NULL; li = li->li_next, ++idx) | 1171 for (idx = 0, li = list->lv_first; li != NULL; li = li->li_next, ++idx) |
1172 { | 1172 { |
1173 char_u *text = tv_get_string_chk(&li->li_tv); | 1173 char_u *text = tv_get_string_chk(&li->li_tv); |
1269 { | 1269 { |
1270 emsg(e_menuothermode); | 1270 emsg(e_menuothermode); |
1271 return; | 1271 return; |
1272 } | 1272 } |
1273 | 1273 |
1274 array = (pumitem_T *)alloc_clear((unsigned)sizeof(pumitem_T) * pum_size); | 1274 array = (pumitem_T *)alloc_clear(sizeof(pumitem_T) * pum_size); |
1275 if (array == NULL) | 1275 if (array == NULL) |
1276 return; | 1276 return; |
1277 | 1277 |
1278 for (mp = menu->children; mp != NULL; mp = mp->next) | 1278 for (mp = menu->children; mp != NULL; mp = mp->next) |
1279 if (menu_is_separator(mp->dname)) | 1279 if (menu_is_separator(mp->dname)) |