summaryrefslogtreecommitdiff
path: root/lib/hmap.h
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2013-04-26 11:10:53 -0700
committerBen Pfaff <blp@nicira.com>2013-05-03 13:29:46 -0700
commite37726e467cf5523161c1b932b979a8818c76b25 (patch)
treef19efc3e383004d7c8e3e5583bd5e9dbfe62d4b3 /lib/hmap.h
parent07fc4ed3410006950012aef8d78f017c5b833e98 (diff)
downloadopenvswitch-e37726e467cf5523161c1b932b979a8818c76b25.tar.gz
hmap: Make HMAP_INITIALIZER a valid initializer for a const hmap.
Without this change, an initialization such as const struct hmap map = HMAP_INITIALIZER(&map); yields a compiler warning "initialization discards qualifiers from pointer target type". Signed-off-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'lib/hmap.h')
-rw-r--r--lib/hmap.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/hmap.h b/lib/hmap.h
index 2867bfa0b..9b6d8c7b3 100644
--- a/lib/hmap.h
+++ b/lib/hmap.h
@@ -65,7 +65,8 @@ struct hmap {
};
/* Initializer for an empty hash map. */
-#define HMAP_INITIALIZER(HMAP) { &(HMAP)->one, NULL, 0, 0 }
+#define HMAP_INITIALIZER(HMAP) \
+ { (struct hmap_node **const) &(HMAP)->one, NULL, 0, 0 }
/* Initialization. */
void hmap_init(struct hmap *);