X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Fhmap.h;h=9b6d8c7b302e0d4341daed1dc483f3099b3043c2;hb=8d71683b7632b5b621dd21418bf33ff90865b4e0;hp=9d07e842043f4666d79e2fe633bb45348ab5beac;hpb=e0edde6fee279cdbbf3c179f5f50adaf0c7c7f1e;p=sliver-openvswitch.git diff --git a/lib/hmap.h b/lib/hmap.h index 9d07e8420..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 *); @@ -247,7 +248,7 @@ hmap_next_with_hash__(const struct hmap_node *node, size_t hash) while (node != NULL && node->hash != hash) { node = node->next; } - return (struct hmap_node *) node; + return CONST_CAST(struct hmap_node *, node); } /* Returns the first node in 'hmap' with the given 'hash', or a null pointer if