mirror of
https://github.com/labwc/labwc.git
synced 2025-11-05 13:29:58 -05:00
common: Add znew/znew_n() macros
This commit is contained in:
parent
da57483961
commit
a54d378e6c
26 changed files with 47 additions and 47 deletions
|
|
@ -19,7 +19,7 @@ add_extent(struct wl_list *part_list, enum ssd_part_type type,
|
|||
* part->geometry will get free'd automatically in ssd_destroy_parts().
|
||||
*/
|
||||
part->node = &wlr_scene_rect_create(parent, 0, 0, invisible)->node;
|
||||
part->geometry = xzalloc(sizeof(struct wlr_box));
|
||||
part->geometry = znew(struct wlr_box);
|
||||
return part;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ static struct ssd_button *
|
|||
ssd_button_descriptor_create(struct wlr_scene_node *node)
|
||||
{
|
||||
/* Create new ssd_button */
|
||||
struct ssd_button *button = xzalloc(sizeof(struct ssd_button));
|
||||
struct ssd_button *button = znew(*button);
|
||||
|
||||
/* Let it destroy automatically when the scene node destroys */
|
||||
button->destroy.notify = ssd_button_destroy_notify;
|
||||
|
|
@ -39,7 +39,7 @@ ssd_button_descriptor_create(struct wlr_scene_node *node)
|
|||
struct ssd_part *
|
||||
add_scene_part(struct wl_list *part_list, enum ssd_part_type type)
|
||||
{
|
||||
struct ssd_part *part = xzalloc(sizeof(struct ssd_part));
|
||||
struct ssd_part *part = znew(*part);
|
||||
part->type = type;
|
||||
wl_list_insert(part_list->prev, &part->link);
|
||||
return part;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue