mirror of
https://github.com/vim/vim.git
synced 2025-10-07 05:54:16 -04:00
patch 8.1.1414: alloc() returning "char_u *" causes a lot of type casts
Problem: Alloc() returning "char_u *" causes a lot of type casts. Solution: Have it return "void *". (Mike Williams) Define ALLOC_ONE() to check the simple allocations.
This commit is contained in:
@@ -85,7 +85,7 @@ sign_group_ref(char_u *groupname)
|
||||
if (HASHITEM_EMPTY(hi))
|
||||
{
|
||||
// new group
|
||||
group = (signgroup_T *)alloc(sizeof(signgroup_T) + STRLEN(groupname));
|
||||
group = alloc(sizeof(signgroup_T) + STRLEN(groupname));
|
||||
if (group == NULL)
|
||||
return NULL;
|
||||
STRCPY(group->sg_name, groupname);
|
||||
@@ -201,8 +201,7 @@ insert_sign(
|
||||
{
|
||||
signlist_T *newsign;
|
||||
|
||||
newsign = (signlist_T *)lalloc_id(sizeof(signlist_T), FALSE,
|
||||
aid_insert_sign);
|
||||
newsign = lalloc_id(sizeof(signlist_T), FALSE, aid_insert_sign);
|
||||
if (newsign != NULL)
|
||||
{
|
||||
newsign->id = id;
|
||||
@@ -736,7 +735,7 @@ alloc_new_sign(char_u *name)
|
||||
int start = next_sign_typenr;
|
||||
|
||||
// Allocate a new sign.
|
||||
sp = (sign_T *)alloc_clear_id(sizeof(sign_T), aid_sign_define_by_name);
|
||||
sp = alloc_clear_id(sizeof(sign_T), aid_sign_define_by_name);
|
||||
if (sp == NULL)
|
||||
return NULL;
|
||||
|
||||
|
Reference in New Issue
Block a user