From 7ad63f57b6ce7ae9e3cc19dcb441f0a4494fa3f2 Mon Sep 17 00:00:00 2001 From: Michal Schmidt Date: Wed, 15 Oct 2014 00:17:51 +0200 Subject: hashmap: allow hashmap_move() to fail It cannot fail in the current hashmap implementation, but it may fail in alternative implementations (unless a sufficiently large reservation has been placed beforehand). --- src/shared/hashmap.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/shared/hashmap.h') diff --git a/src/shared/hashmap.h b/src/shared/hashmap.h index e0ff26c006..65fb3c0ee9 100644 --- a/src/shared/hashmap.h +++ b/src/shared/hashmap.h @@ -160,9 +160,9 @@ int hashmap_reserve(Hashmap *h, unsigned entries_add); static inline int ordered_hashmap_reserve(OrderedHashmap *h, unsigned entries_add) { return hashmap_reserve((Hashmap*) h, entries_add); } -void hashmap_move(Hashmap *h, Hashmap *other); -static inline void ordered_hashmap_move(OrderedHashmap *h, OrderedHashmap *other) { - hashmap_move((Hashmap*) h, (Hashmap*) other); +int hashmap_move(Hashmap *h, Hashmap *other); +static inline int ordered_hashmap_move(OrderedHashmap *h, OrderedHashmap *other) { + return hashmap_move((Hashmap*) h, (Hashmap*) other); } int hashmap_move_one(Hashmap *h, Hashmap *other, const void *key); static inline int ordered_hashmap_move_one(OrderedHashmap *h, OrderedHashmap *other, const void *key) { -- cgit v1.2.3-54-g00ecf