/*
- * 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.
/* 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 */