From: Marek Lindner <lindner_marek@yahoo.de>
To: The list for a Better Approach To Mobile Ad-hoc Networking
<b.a.t.m.a.n@lists.open-mesh.org>
Subject: Re: [B.A.T.M.A.N.] [PATCH 1/2] batman-adv: move hash_bytes into hash.h
Date: Tue, 16 Oct 2012 04:28:46 +0800 [thread overview]
Message-ID: <201210160428.46880.lindner_marek@yahoo.de> (raw)
In-Reply-To: <1350332596-23684-1-git-send-email-siwu@hrz.tu-chemnitz.de>
On Tuesday, October 16, 2012 04:23:15 Simon Wunderlich wrote:
> /**
> + * batadv_hash_bytes - hash some bytes and add them to the previous
> hash + * @hash: previous hash value
> + * @data: data to be hashed
> + * @size: number of bytes to be hashed
> + *
> + * Returns 0 on success, 1 if the element already is in the hash
> + * and -1 on error.
> + */
> +static inline void batadv_hash_bytes(uint32_t *hash, void *data, uint32_t
> size) +{
> + const unsigned char *key = data;
> + int i;
> +
> + for (i = 0; i < size; i++) {
> + *hash += key[i];
> + *hash += (*hash << 10);
> + *hash ^= (*hash >> 6);
> + }
> +}
Seems the function lacks the documented return behavior .. ;-)
Cheers,
Marek
next prev parent reply other threads:[~2012-10-15 20:28 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-15 20:23 [B.A.T.M.A.N.] [PATCH 1/2] batman-adv: move hash_bytes into hash.h Simon Wunderlich
2012-10-15 20:23 ` [B.A.T.M.A.N.] [PATCH 2/2] batman-adv: fix bla compare function Simon Wunderlich
2012-10-15 20:28 ` Marek Lindner [this message]
2012-10-15 20:38 ` [B.A.T.M.A.N.] [PATCHv2 1/2] batman-adv: move hash_bytes into hash.h Simon Wunderlich
2012-10-15 21:19 ` Marek Lindner
2012-10-15 20:38 ` [B.A.T.M.A.N.] [PATCHv2 2/2] batman-adv: fix bla compare function Simon Wunderlich
2012-10-15 21:21 ` Marek Lindner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201210160428.46880.lindner_marek@yahoo.de \
--to=lindner_marek@yahoo.de \
--cc=b.a.t.m.a.n@lists.open-mesh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox