diff options
| author | Donatas Abraitis <donatas.abraitis@gmail.com> | 2021-03-22 11:00:34 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-03-22 11:00:34 +0200 |
| commit | 37916b2b113af12d86208b9abdd594647421d65c (patch) | |
| tree | ffc76feaddd010df2bfdf653a610bcc1929ca98a /lib/qobj.h | |
| parent | 6b78d4c9f07f0a425521a31eee99975c48a0158d (diff) | |
| parent | 941b5172ea78b578a38114268167b9eea1680dc1 (diff) | |
Merge pull request #8121 from opensourcerouting/macro-cleanup
*: require ISO C11 + semicolons after file-scope macros
Diffstat (limited to 'lib/qobj.h')
| -rw-r--r-- | lib/qobj.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/qobj.h b/lib/qobj.h index 400ae0151c..5012c98d74 100644 --- a/lib/qobj.h +++ b/lib/qobj.h @@ -83,7 +83,7 @@ struct qobj_nodetype { RESERVED_SPACE_STRUCT(qobj_nodetype_capnp, capnp, 256) }; -PREDECL_HASH(qobj_nodes) +PREDECL_HASH(qobj_nodes); /* anchor to be embedded somewhere in the object's struct */ struct qobj_node { @@ -92,7 +92,7 @@ struct qobj_node { const struct qobj_nodetype *type; }; -#define QOBJ_FIELDS struct qobj_node qobj_node; +#define QOBJ_FIELDS struct qobj_node qobj_node /* call these at the end of any _create function (QOBJ_REG) * and beginning of any _destroy function (QOBJ_UNREG) */ @@ -118,16 +118,19 @@ void *qobj_get_typed(uint64_t id, const struct qobj_nodetype *type); /* type declarations */ #define DECLARE_QOBJ_TYPE(structname) \ - extern const struct qobj_nodetype qobj_t_##structname; + extern const struct qobj_nodetype qobj_t_##structname \ + /* end */ #define DEFINE_QOBJ_TYPE(structname) \ const struct qobj_nodetype qobj_t_##structname = { \ .node_member_offset = \ - (ptrdiff_t)offsetof(struct structname, qobj_node)}; + (ptrdiff_t)offsetof(struct structname, qobj_node)} \ + /* end */ #define DEFINE_QOBJ_TYPE_INIT(structname, ...) \ const struct qobj_nodetype qobj_t_##structname = { \ .node_member_offset = \ (ptrdiff_t)offsetof(struct structname, qobj_node), \ - __VA_ARGS__}; + __VA_ARGS__} \ + /* end */ /* ID dereference with typecheck. * will return NULL if id not found or wrong type. */ |
