Mercurial > vim
comparison src/eval.c @ 21915:2559dc02bd64 v8.2.1507
patch 8.2.1507: using malloc() directly
Commit: https://github.com/vim/vim/commit/51b6eb47b3c41b01a5559b099e65354c8897093e
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Aug 22 15:19:18 2020 +0200
patch 8.2.1507: using malloc() directly
Problem: Using malloc() directly.
Solution: Use ALLOC_ONE(). Remove superfluous typecast. (Hussam al-Homsi,
closes #6768)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 22 Aug 2020 15:30:04 +0200 |
parents | 8fe86125dcba |
children | 51d591dbb8df |
comparison
equal
deleted
inserted
replaced
21914:9a034db1bae7 | 21915:2559dc02bd64 |
---|---|
4350 { | 4350 { |
4351 abort = set_ref_in_ht(&dd->dv_hashtab, copyID, list_stack); | 4351 abort = set_ref_in_ht(&dd->dv_hashtab, copyID, list_stack); |
4352 } | 4352 } |
4353 else | 4353 else |
4354 { | 4354 { |
4355 ht_stack_T *newitem = (ht_stack_T*)malloc(sizeof(ht_stack_T)); | 4355 ht_stack_T *newitem = ALLOC_ONE(ht_stack_T); |
4356 | |
4356 if (newitem == NULL) | 4357 if (newitem == NULL) |
4357 abort = TRUE; | 4358 abort = TRUE; |
4358 else | 4359 else |
4359 { | 4360 { |
4360 newitem->ht = &dd->dv_hashtab; | 4361 newitem->ht = &dd->dv_hashtab; |
4376 { | 4377 { |
4377 abort = set_ref_in_list_items(ll, copyID, ht_stack); | 4378 abort = set_ref_in_list_items(ll, copyID, ht_stack); |
4378 } | 4379 } |
4379 else | 4380 else |
4380 { | 4381 { |
4381 list_stack_T *newitem = (list_stack_T*)malloc( | 4382 list_stack_T *newitem = ALLOC_ONE(list_stack_T); |
4382 sizeof(list_stack_T)); | 4383 |
4383 if (newitem == NULL) | 4384 if (newitem == NULL) |
4384 abort = TRUE; | 4385 abort = TRUE; |
4385 else | 4386 else |
4386 { | 4387 { |
4387 newitem->list = ll; | 4388 newitem->list = ll; |