comparison src/ex_getln.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 fc58fee685e2
comparison
equal deleted inserted replaced
16767:3959544fc067 16768:695d9ef00b03
4164 if (mode == WILD_ALL && xp->xp_numfiles > 0) 4164 if (mode == WILD_ALL && xp->xp_numfiles > 0)
4165 { 4165 {
4166 len = 0; 4166 len = 0;
4167 for (i = 0; i < xp->xp_numfiles; ++i) 4167 for (i = 0; i < xp->xp_numfiles; ++i)
4168 len += (long_u)STRLEN(xp->xp_files[i]) + 1; 4168 len += (long_u)STRLEN(xp->xp_files[i]) + 1;
4169 ss = lalloc(len, TRUE); 4169 ss = alloc(len);
4170 if (ss != NULL) 4170 if (ss != NULL)
4171 { 4171 {
4172 *ss = NUL; 4172 *ss = NUL;
4173 for (i = 0; i < xp->xp_numfiles; ++i) 4173 for (i = 0; i < xp->xp_numfiles; ++i)
4174 { 4174 {
5912 { 5912 {
5913 for (type = 0; type < HIST_COUNT; ++type) /* adjust the tables */ 5913 for (type = 0; type < HIST_COUNT; ++type) /* adjust the tables */
5914 { 5914 {
5915 if (newlen) 5915 if (newlen)
5916 { 5916 {
5917 temp = (histentry_T *)lalloc( 5917 temp = (histentry_T *)alloc(
5918 (long_u)(newlen * sizeof(histentry_T)), TRUE); 5918 (long_u)(newlen * sizeof(histentry_T)));
5919 if (temp == NULL) /* out of memory! */ 5919 if (temp == NULL) /* out of memory! */
5920 { 5920 {
5921 if (type == 0) /* first one: just keep the old length */ 5921 if (type == 0) /* first one: just keep the old length */
5922 { 5922 {
5923 newlen = hislen; 5923 newlen = hislen;
6686 if (!in_history(type, val + (type == HIST_SEARCH), 6686 if (!in_history(type, val + (type == HIST_SEARCH),
6687 viminfo_add_at_front, sep, writing)) 6687 viminfo_add_at_front, sep, writing))
6688 { 6688 {
6689 /* Need to re-allocate to append the separator byte. */ 6689 /* Need to re-allocate to append the separator byte. */
6690 len = STRLEN(val); 6690 len = STRLEN(val);
6691 p = lalloc(len + 2, TRUE); 6691 p = alloc(len + 2);
6692 if (p != NULL) 6692 if (p != NULL)
6693 { 6693 {
6694 if (type == HIST_SEARCH) 6694 if (type == HIST_SEARCH)
6695 { 6695 {
6696 /* Search entry: Move the separator from the first 6696 /* Search entry: Move the separator from the first
6772 6772
6773 if (!overwrite) 6773 if (!overwrite)
6774 { 6774 {
6775 /* Need to re-allocate to append the separator byte. */ 6775 /* Need to re-allocate to append the separator byte. */
6776 len = vp[3].bv_len; 6776 len = vp[3].bv_len;
6777 p = lalloc(len + 2, TRUE); 6777 p = alloc(len + 2);
6778 } 6778 }
6779 else 6779 else
6780 len = 0; /* for picky compilers */ 6780 len = 0; /* for picky compilers */
6781 if (p != NULL) 6781 if (p != NULL)
6782 { 6782 {