summaryrefslogtreecommitdiff
path: root/lib/qobj.h
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2019-01-31 01:27:02 +0100
committerDavid Lamparter <equinox@diac24.net>2019-04-27 19:33:45 +0200
commit679b1649cb98040e1b6ec9cf0089d005740a2b6d (patch)
treee970d47bd17bc01e7314cf36d1699fea930883b8 /lib/qobj.h
parent992f9967db14b18ee0eb5a4a104f17ab1dfb2d41 (diff)
lib: use DECLARE_HASH for qobj hash
This changes the qobj node ID hash to use the new typed hash instead of the old hash_* code. Signed-off-by: David Lamparter <equinox@diac24.net>
Diffstat (limited to 'lib/qobj.h')
-rw-r--r--lib/qobj.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/qobj.h b/lib/qobj.h
index d63988cbab..415eae02ef 100644
--- a/lib/qobj.h
+++ b/lib/qobj.h
@@ -21,6 +21,8 @@
#include <stdlib.h>
#include <stddef.h>
+#include "typesafe.h"
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -69,6 +71,8 @@ struct qobj_nodetype_capnp {
};
#endif
+#include "typesafe.h"
+
/* each different kind of object will have a global variable of this type,
* which can be used by various other pieces to store type-related bits.
* type equality can be tested as pointer equality. (cf. QOBJ_GET_TYPESAFE)
@@ -79,9 +83,12 @@ struct qobj_nodetype {
RESERVED_SPACE_STRUCT(qobj_nodetype_capnp, capnp, 256)
};
+PREDECL_HASH(qobj_nodes)
+
/* anchor to be embedded somewhere in the object's struct */
struct qobj_node {
uint64_t nid;
+ struct qobj_nodes_item nodehash;
struct qobj_nodetype *type;
};