In choose_orig and vis_choose the size agrument was int while the hash result is uint32_t, then the argument has been fixed to uint32_t too. The same apply for the returned type.
Signed-off-by: Antonio Quartulli ordex@autistici.org --- hash.h | 2 +- originator.h | 2 +- vis.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/hash.h b/hash.h index d20aa71..588ef79 100644 --- a/hash.h +++ b/hash.h @@ -33,7 +33,7 @@ typedef int (*hashdata_compare_cb)(const struct hlist_node *, const void *); /* the hashfunction, should return an index * based on the key in the data of the first * argument and the size the second */ -typedef int (*hashdata_choose_cb)(const void *, int); +typedef uint32_t (*hashdata_choose_cb)(const void *, uint32_t); typedef void (*hashdata_free_cb)(struct hlist_node *, void *);
struct hashtable_t { diff --git a/originator.h b/originator.h index cfc1f60..67765ff 100644 --- a/originator.h +++ b/originator.h @@ -42,7 +42,7 @@ int orig_hash_del_if(struct hard_iface *hard_iface, int max_if_num);
/* hashfunction to choose an entry in a hash table of given size */ /* hash algorithm from http://en.wikipedia.org/wiki/Hash_table */ -static inline int choose_orig(const void *data, int32_t size) +static inline uint32_t choose_orig(const void *data, uint32_t size) { const unsigned char *key = data; uint32_t hash = 0; diff --git a/vis.c b/vis.c index f81a6b6..a9cd152 100644 --- a/vis.c +++ b/vis.c @@ -66,7 +66,7 @@ static int vis_info_cmp(const struct hlist_node *node, const void *data2)
/* hash function to choose an entry in a hash table of given size */ /* hash algorithm from http://en.wikipedia.org/wiki/Hash_table */ -static int vis_info_choose(const void *data, int size) +static uint32_t vis_info_choose(const void *data, uint32_t size) { const struct vis_info *vis_info = data; const struct vis_packet *packet;