aboutsummaryrefslogtreecommitdiff
path: root/src/window.c
diff options
context:
space:
mode:
authorJohn Schmidt <john.schmidt.h@gmail.com>2014-04-22 11:35:11 +0200
committerThiago de Arruda <tpadilha84@gmail.com>2014-04-28 07:41:45 -0300
commit4e1b364a3e255742522d4d76c5ccddd7a36c1769 (patch)
tree667a250396bc009ec56f3dad563882b9367b4441 /src/window.c
parentc70a526a5df2b8a7353c3c71e241cd51bf099a64 (diff)
downloadrneovim-4e1b364a3e255742522d4d76c5ccddd7a36c1769.tar.gz
rneovim-4e1b364a3e255742522d4d76c5ccddd7a36c1769.tar.bz2
rneovim-4e1b364a3e255742522d4d76c5ccddd7a36c1769.zip
Remove `alloc_clear`
Use `xcalloc` instead. Inline `alloc_tv` and `alloc_string_tv` in eval.c
Diffstat (limited to 'src/window.c')
-rw-r--r--src/window.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/window.c b/src/window.c
index d47ed22720..305bf6b7c9 100644
--- a/src/window.c
+++ b/src/window.c
@@ -784,7 +784,7 @@ int win_split_ins(int size, int flags, win_T *new_wp, int dir)
}
if (curfrp->fr_parent == NULL || curfrp->fr_parent->fr_layout != layout) {
/* Need to create a new frame in the tree to make a branch. */
- frp = (frame_T *)alloc_clear((unsigned)sizeof(frame_T));
+ frp = xcalloc(1, sizeof(frame_T));
*frp = *curfrp;
curfrp->fr_layout = layout;
frp->fr_parent = curfrp;
@@ -2847,7 +2847,6 @@ static tabpage_T *alloc_tabpage(void)
/* init t: variables */
tp->tp_vars = dict_alloc();
init_var_dict(tp->tp_vars, &tp->tp_winvar, VAR_SCOPE);
-
tp->tp_diff_invalid = TRUE;
tp->tp_ch_used = p_ch;
@@ -3766,6 +3765,7 @@ static void frame_remove(frame_T *frp)
void win_alloc_lines(win_T *wp)
{
wp->w_lines_valid = 0;
+ assert(Rows >= 0);
wp->w_lines = xcalloc(Rows, sizeof(wline_T));
}
@@ -5019,7 +5019,7 @@ void make_snapshot(int idx)
static void make_snapshot_rec(frame_T *fr, frame_T **frp)
{
- *frp = (frame_T *)alloc_clear((unsigned)sizeof(frame_T));
+ *frp = xcalloc(1, sizeof(frame_T));
(*frp)->fr_layout = fr->fr_layout;
(*frp)->fr_width = fr->fr_width;
(*frp)->fr_height = fr->fr_height;