Thread (13 messages) flat view 13 messages, 4 authors, 2016-06-15

Re: [PATCH 1/5] hashmap: add enum for hashmap free_entries option

From: Karsten Blees <hidden>
Date: 2016-06-15 23:01:31

Am 05.06.2014 08:06, schrieb Heiko Voigt:
This allows a reader to immediately know which options can be used and
what this parameter is about.
[...]
-void hashmap_free(struct hashmap *map, int free_entries)
+void hashmap_free(struct hashmap *map, enum hashmap_free_options free_entries)
[...]
 
+enum hashmap_free_options {
+	HASHMAP_NO_FREE_ENTRIES = 0,
+	HASHMAP_FREE_ENTRIES = 1,
+};
This was meant as a boolean parameter. Would it make sense to have

enum boolean {
	false,
	true
};

or similar in some central place?

Note that an earlier version took a function pointer, and you could pass stdlib's free() in the common case, or a special free routine for nested entry structures, or NULL to do the cleanup yourself.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help