diff options
author | Maria Matejka <mq@ucw.cz> | 2022-05-30 16:52:38 +0200 |
---|---|---|
committer | Maria Matejka <mq@ucw.cz> | 2022-05-30 16:52:38 +0200 |
commit | 8b4b7c6eaefff43508179b05acbc061fa6b19291 (patch) | |
tree | f341aa39cc7fcf05280def678db764361295bb3d /lib/route.h | |
parent | b7e2edd4419fecb09b8690f8731e172f0c24789c (diff) | |
parent | cf07d8ad79273a3bbf0617c17e438602e4b64ece (diff) |
Merge commit 'cf07d8ad79273a3bbf0617c17e438602e4b64ece' into haugesund
Diffstat (limited to 'lib/route.h')
-rw-r--r-- | lib/route.h | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/lib/route.h b/lib/route.h index 48595091..e40a2747 100644 --- a/lib/route.h +++ b/lib/route.h @@ -219,10 +219,7 @@ ea_list *ea_normalize(const ea_list *e); uint ea_list_size(ea_list *); void ea_list_copy(ea_list *dest, ea_list *src, uint size); -struct ea_one_attr_list { - ea_list l; - eattr a; -}; +#define EA_LOCAL_LIST(N) struct { ea_list l; eattr a[N]; } #define EA_LITERAL_EMBEDDED(_id, _type, _flags, _val) ({ \ ASSERT_DIE(_type & EAF_EMBEDDED); \ @@ -245,16 +242,16 @@ struct ea_one_attr_list { static inline eattr * ea_set_attr(ea_list **to, eattr a) { - struct ea_one_attr_list *ea = tmp_alloc(sizeof(*ea)); - *ea = (struct ea_one_attr_list) { + EA_LOCAL_LIST(1) *ea = tmp_alloc(sizeof(*ea)); + *ea = (typeof(*ea)) { .l.flags = EALF_SORTED, .l.count = 1, .l.next = *to, - .a = a, + .a[0] = a, }; *to = &ea->l; - return &ea->a; + return &ea->a[0]; } static inline void |