mirror of
https://github.com/labwc/labwc.git
synced 2025-11-03 09:01:51 -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
|
|
@ -105,7 +105,7 @@ action_create(const char *action_name)
|
|||
wlr_log(WLR_ERROR, "action name not specified");
|
||||
return NULL;
|
||||
}
|
||||
struct action *action = xzalloc(sizeof(struct action));
|
||||
struct action *action = znew(*action);
|
||||
action->type = action_type_from_str(action_name);
|
||||
wl_list_init(&action->args);
|
||||
return action;
|
||||
|
|
@ -372,7 +372,7 @@ void
|
|||
action_arg_add_str(struct action *action, char *key, const char *value)
|
||||
{
|
||||
assert(value && "Tried to add NULL action string argument");
|
||||
struct action_arg_str *arg = xzalloc(sizeof(*arg));
|
||||
struct action_arg_str *arg = znew(*arg);
|
||||
arg->base.type = LAB_ACTION_ARG_STR;
|
||||
if (key) {
|
||||
arg->base.key = xstrdup(key);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue