comparison src/buffer.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
1956 clear_string_option(&buf->b_p_bt); 1956 clear_string_option(&buf->b_p_bt);
1957 } 1957 }
1958 } 1958 }
1959 if (buf != curbuf || curbuf == NULL) 1959 if (buf != curbuf || curbuf == NULL)
1960 { 1960 {
1961 buf = (buf_T *)alloc_clear((unsigned)sizeof(buf_T)); 1961 buf = (buf_T *)alloc_clear(sizeof(buf_T));
1962 if (buf == NULL) 1962 if (buf == NULL)
1963 { 1963 {
1964 vim_free(ffname); 1964 vim_free(ffname);
1965 return NULL; 1965 return NULL;
1966 } 1966 }
1983 buf->b_ffname = ffname; 1983 buf->b_ffname = ffname;
1984 buf->b_sfname = vim_strsave(sfname); 1984 buf->b_sfname = vim_strsave(sfname);
1985 } 1985 }
1986 1986
1987 clear_wininfo(buf); 1987 clear_wininfo(buf);
1988 buf->b_wininfo = (wininfo_T *)alloc_clear((unsigned)sizeof(wininfo_T)); 1988 buf->b_wininfo = (wininfo_T *)alloc_clear(sizeof(wininfo_T));
1989 1989
1990 if ((ffname != NULL && (buf->b_ffname == NULL || buf->b_sfname == NULL)) 1990 if ((ffname != NULL && (buf->b_ffname == NULL || buf->b_sfname == NULL))
1991 || buf->b_wininfo == NULL) 1991 || buf->b_wininfo == NULL)
1992 { 1992 {
1993 if (buf->b_sfname != buf->b_ffname) 1993 if (buf->b_sfname != buf->b_ffname)
2769 if (wip->wi_win == win) 2769 if (wip->wi_win == win)
2770 break; 2770 break;
2771 if (wip == NULL) 2771 if (wip == NULL)
2772 { 2772 {
2773 /* allocate a new entry */ 2773 /* allocate a new entry */
2774 wip = (wininfo_T *)alloc_clear((unsigned)sizeof(wininfo_T)); 2774 wip = (wininfo_T *)alloc_clear(sizeof(wininfo_T));
2775 if (wip == NULL) 2775 if (wip == NULL)
2776 return; 2776 return;
2777 wip->wi_win = win; 2777 wip->wi_win = win;
2778 if (lnum == 0) /* set lnum even when it's 0 */ 2778 if (lnum == 0) /* set lnum even when it's 0 */
2779 lnum = 1; 2779 lnum = 1;
4909 return; 4909 return;
4910 } 4910 }
4911 setpcmark(); 4911 setpcmark();
4912 4912
4913 opened_len = ARGCOUNT; 4913 opened_len = ARGCOUNT;
4914 opened = alloc_clear((unsigned)opened_len); 4914 opened = alloc_clear(opened_len);
4915 if (opened == NULL) 4915 if (opened == NULL)
4916 return; 4916 return;
4917 4917
4918 /* Autocommands may do anything to the argument list. Make sure it's not 4918 /* Autocommands may do anything to the argument list. Make sure it's not
4919 * freed while we are working here by "locking" it. We still have to 4919 * freed while we are working here by "locking" it. We still have to