aboutsummaryrefslogtreecommitdiff
path: root/src/edit.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/edit.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/edit.c')
-rw-r--r--src/edit.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/edit.c b/src/edit.c
index 31c794dba3..53bb8815ec 100644
--- a/src/edit.c
+++ b/src/edit.c
@@ -2125,7 +2125,7 @@ ins_compl_add (
* Allocate a new match structure.
* Copy the values to the new match structure.
*/
- match = (compl_T *)alloc_clear((unsigned)sizeof(compl_T));
+ match = xcalloc(1, sizeof(compl_T));
match->cp_number = -1;
if (flags & ORIGINAL_TEXT)
match->cp_number = 0;
@@ -2460,9 +2460,9 @@ void ins_compl_show_pum(void)
} while (compl != NULL && compl != compl_first_match);
if (compl_match_arraysize == 0)
return;
- compl_match_array = (pumitem_T *)alloc_clear(
- (unsigned)(sizeof(pumitem_T)
- * compl_match_arraysize));
+
+ assert(compl_match_arraysize >= 0);
+ compl_match_array = xcalloc(compl_match_arraysize, sizeof(pumitem_T));
/* If the current match is the original text don't find the first
* match after it, don't highlight anything. */
if (compl_shown_match->cp_flags & ORIGINAL_TEXT)