From patchwork Tue Oct 4 22:12:04 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Quartulli X-Patchwork-Id: 1286 Return-Path: Received: from latitanza.investici.org (latitanza.investici.org [82.94.249.234]) by open-mesh.org (Postfix) with ESMTPS id CD24B6007FA for ; Wed, 5 Oct 2011 00:12:56 +0200 (CEST) Authentication-Results: open-mesh.org; dkim=pass (1024-bit key) header.i=@autistici.org; dkim-adsp=pass Received: from [82.94.249.234] (latitanza [82.94.249.234]) (Authenticated sender: ordex@autistici.org) by localhost (Postfix) with ESMTPSA id E7A3A98971; Tue, 4 Oct 2011 22:12:55 +0000 (UTC) X-DKIM: Sendmail DKIM Filter v2.8.2 latitanza.investici.org E7A3A98971 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=autistici.org; s=stigmate; t=1317766376; bh=10tq4pvzeHuATTTWFSFBQCmNTX/8OOG9DhJdWGGoEHQ=; h=From:To:Cc:Subject:Date:Message-Id; b=CPne5ay3GkDCyLFBf6lQOBrp2WZh0bTa/UrujdEy1JKNha8ftTQNICHA+lfvUQiT7 kXAKLpYOAjhGnweXwkp/BAlwUY7Cua4tCgCUlDxmT6xZqAouPECImWuWwFHUyerP9u 26kCjlH25houTF/2KzpXF5G3VklDZ9x3OQAZzLK8= From: Antonio Quartulli To: b.a.t.m.a.n@lists.open-mesh.org Date: Wed, 5 Oct 2011 00:12:04 +0200 Message-Id: <1317766324-28264-1-git-send-email-ordex@autistici.org> X-Mailer: git-send-email 1.7.3.4 Subject: [B.A.T.M.A.N.] [PATCH] batman-adv: fixed hash functions type to uint32_t instead of int X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Oct 2011 22:12:57 -0000 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 --- 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;