mirror of
https://github.com/amadvance/snapraid.git
synced 2026-11-30 03:47:05 -05:00
Fix undefined behavior by making TommyDS foreach callback signatures take void*
Some checks are pending
Build / build-mac (push) Waiting to run
Build / build-linux (push) Waiting to run
Build / build-arm32 (push) Waiting to run
Build / build-win (push) Waiting to run
CodeQL Advanced / Analyze (c-cpp) (push) Waiting to run
CodeQL Advanced / Analyze (actions) (push) Waiting to run
Some checks are pending
Build / build-mac (push) Waiting to run
Build / build-linux (push) Waiting to run
Build / build-arm32 (push) Waiting to run
Build / build-win (push) Waiting to run
CodeQL Advanced / Analyze (c-cpp) (push) Waiting to run
CodeQL Advanced / Analyze (actions) (push) Waiting to run
This commit is contained in:
parent
7250521e66
commit
fd65dbd9ea
13 changed files with 84 additions and 53 deletions
|
|
@ -60,8 +60,10 @@ static inline tommy_uint32_t hash_hash(struct snapraid_hash* hash)
|
|||
return tommy_hash_u32(0, hash->hash, HASH_MAX);
|
||||
}
|
||||
|
||||
void hash_free(struct snapraid_hash* hash)
|
||||
static void hash_free(void* void_hash)
|
||||
{
|
||||
struct snapraid_hash* hash = void_hash;
|
||||
|
||||
free(hash);
|
||||
}
|
||||
|
||||
|
|
@ -122,7 +124,7 @@ void state_dup(struct snapraid_state* state)
|
|||
}
|
||||
}
|
||||
|
||||
tommy_hashdyn_foreach(&hashset, (tommy_foreach_func*)hash_free);
|
||||
tommy_hashdyn_foreach(&hashset, hash_free);
|
||||
tommy_hashdyn_done(&hashset);
|
||||
|
||||
msg_status("\n");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue