Remove unused void_ptr_hash_function and void_ptr_compare_function
PATCH 1/1 Remove unused void_ptr_hash_function and void_ptr_compare_function
Both functions are never used, so let's get rid of them.
Signed-off-by Steffan Karger <[email protected]...>
--- src/openvpn/list.c | 12 ------------ src/openvpn/list.h | 4 ---- 2 files changed, 16 deletions(-)
src/openvpn/list.c +0 -12
@@ -222,18 +222,6 @@ hash_remove_marked(struct hash *hash, struct hash_bucket *bucket) } } -uint32_t -void_ptr_hash_function (const void *key,uint32_t iv) -{ -return hash_func ((const void *)&key,sizeof (key), iv); -} - -bool -void_ptr_compare_function (const void *key1,const void *key2) -{ -return key1 == key2; -} - void hash_iterator_init_range(struct hash *hash, struct hash_iterator *hi,
src/openvpn/list.h +0 -4
@@ -116,10 +116,6 @@ void hash_iterator_free(struct hash_iterator *hi);uint32_t hash_func (const uint8_t *k,uint32_t length,uint32_t initval); -uint32_t void_ptr_hash_function (const void *key,uint32_t iv); - -bool void_ptr_compare_function (const void *key1,const void *key2); -#ifdef LIST_TEST void list_test (void );
Signature · 1 line
2.7.4
Acked-by Gert Doering <[email protected]...>
Because it's dead code. Looking again, it actually seems correct after all :-) (void_ptr_hash_function() is passed in a pointer *value*, which is then stored locally, and the address of this local store is handed to hash_func() - so it compares "memory addresses". Misread the code before. It's James code so it must be correct. But unused still!
Your patch has been applied to the master branch.
commit 01f7bb52ce510f0fc915c9aa6a14f79b2779a7f8
Author: Steffan Karger Date: Wed Sep 19 18:20:09 2018 +0200
Remove unused void_ptr_hash_function and void_ptr_compare_function
Signed-off-by: Steffan Karger <[email protected]...>
Acked-by: Gert Doering <[email protected]...>
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg17473.html
Signed-off-by: Gert Doering <[email protected]...>--
kind regards,
Gert Doering