ovs-bugtool: Create OVN plugin and add output.
[cascardo/ovs.git] / lib / hmapx.h
index 226255d..f977d9e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011 Nicira Networks.
+ * Copyright (c) 2011, 2016 Nicira, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -60,12 +60,17 @@ bool hmapx_equals(const struct hmapx *, const struct hmapx *);
 /* Iteration. */
 
 /* Iterates through every hmapx_node in HMAPX. */
-#define HMAPX_FOR_EACH(NODE, HMAPX)             \
-    HMAP_FOR_EACH(NODE, hmap_node, &(HMAPX)->map)
+#define HMAPX_FOR_EACH(NODE, HMAPX)                                     \
+    HMAP_FOR_EACH_INIT(NODE, hmap_node, &(HMAPX)->map,                  \
+                       BUILD_ASSERT_TYPE(NODE, struct hmapx_node *),    \
+                       BUILD_ASSERT_TYPE(HMAPX, struct hmapx *))
 
 /* Safe when NODE may be freed (not needed when NODE may be removed from the
  * hash map but its members remain accessible and intact). */
-#define HMAPX_FOR_EACH_SAFE(NODE, NEXT, HMAPX)                  \
-    HMAP_FOR_EACH_SAFE(NODE, NEXT, hmap_node, &(HMAPX)->map)
+#define HMAPX_FOR_EACH_SAFE(NODE, NEXT, HMAPX)                          \
+    HMAP_FOR_EACH_SAFE_INIT(NODE, NEXT, hmap_node, &(HMAPX)->map,       \
+                            BUILD_ASSERT_TYPE(NODE, struct hmapx_node *), \
+                            BUILD_ASSERT_TYPE(NEXT, struct hmapx_node *), \
+                            BUILD_ASSERT_TYPE(HMAPX, struct hmapx *))
 
 #endif /* hmapx.h */