]> git.proxmox.com Git - mirror_frr.git/blobdiff - lib/qobj.h
Merge pull request #13649 from donaldsharp/unlock_the_node_or_else
[mirror_frr.git] / lib / qobj.h
index 400ae0151cc7b5bd13bc6de5579c92c11270db67..a3883fdad6da420c704467c46b903ddad99a4a6c 100644 (file)
@@ -1,17 +1,6 @@
+// SPDX-License-Identifier: ISC
 /*
  * Copyright (c) 2015-16  David Lamparter, for NetDEF, Inc.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
 #ifndef _QOBJ_H
@@ -83,7 +72,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 +81,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 +107,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. */