mirror of
https://github.com/systemd/systemd.git
synced 2025-02-09 13:57:42 +03:00
Merge pull request #11647 from thom311/hashmap-avoid-compiler-warning
Hashmap avoid compiler warning
This commit is contained in:
commit
9ef55e8b48
@ -888,7 +888,8 @@ void internal_hashmap_clear(HashmapBase *h, free_func_t default_free_key, free_f
|
||||
* themselves from our hash table a second time, the entry is already gone. */
|
||||
|
||||
while (internal_hashmap_size(h) > 0) {
|
||||
void *v, *k;
|
||||
void *k = NULL;
|
||||
void *v;
|
||||
|
||||
v = internal_hashmap_first_key_and_value(h, true, &k);
|
||||
|
||||
@ -1515,8 +1516,11 @@ void *internal_hashmap_first_key_and_value(HashmapBase *h, bool remove, void **r
|
||||
unsigned idx;
|
||||
|
||||
idx = find_first_entry(h);
|
||||
if (idx == IDX_NIL)
|
||||
if (idx == IDX_NIL) {
|
||||
if (ret_key)
|
||||
*ret_key = NULL;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
e = bucket_at(h, idx);
|
||||
key = (void*) e->key;
|
||||
|
Loading…
x
Reference in New Issue
Block a user