Re: [PATCH v2 04/19] hashmap_entry_init takes "struct hashmap_entry *"
- From
Derrick Stolee <stolee@gmail.com>
- Date
- Sep 25, 2019, 12:48 UTC
- Message-ID
- <d0f08de3-3fa8-1e76-0b57-425eb96aefcf@gmail.com>
- In-Reply-To
- <20190924010324.22619-5-e@80x24.org>
On 9/23/2019 9:03 PM, Eric Wong wrote:
> C compilers do type checking to make life easier for us. So > rely on that and update all hashmap_entry_init callers to take > "struct hashmap_entry *" to avoid future bugs while improving > safety and readability.
[snip]
Show 8 quoted lines
> @@ -244,9 +244,9 @@ void hashmap_free(struct hashmap *map, int free_entries);
> * your structure was allocated with xmalloc(), you can just free(3) it,
> * and if it is on stack, you can just let it go out of scope).
> */
> -static inline void hashmap_entry_init(void *entry, unsigned int hash)
> +static inline void
> +hashmap_entry_init(struct hashmap_entry *e, unsigned int hash)
> {I think the preferred line break here would be something like:
static inline void hashmap_entry_init(struct hashmap_entry *e, unsigned int hash)
The rest of this patch is very mechanical and easy to check for correctness.
Thanks, -Stolee