b.a.t.m.a.n.lists.open-mesh.org archive mirror
 help / color / mirror / Atom feed
From: Edwe Cowley <edwecowley@gmail.com>
To: b.a.t.m.a.n@lists.open-mesh.net
Subject: [B.A.T.M.A.N.] [vis] Remove duplicate routes from vis output
Date: Wed, 15 Jul 2009 15:59:32 +0200	[thread overview]
Message-ID: <dd8d36130907150659v74773aw1fd1060c43ab337b@mail.gmail.com> (raw)

Revision 1271 introduced a bug on the call to hash->compare() that
caused duplicate routes to appear in the output.  Inverted the
conditional and now it works.

Signed-off-by: Edwe Cowley <edwecowley@gmail.com>
Index: batman/hash.c
===================================================================
--- batman/hash.c (revision 1343)
+++ batman/hash.c (working copy)
@@ -179,7 +179,7 @@
bucket = hash->table[index];

while (bucket != NULL) {
- if (hash->compare(bucket->data, data))
+ if (!(hash->compare(bucket->data, data)))
return -1;

prev_bucket = bucket;
@@ -217,7 +217,7 @@
bucket = hash->table[index];

while (bucket != NULL) {
- if (hash->compare(bucket->data, keydata))
+ if (!(hash->compare(bucket->data, keydata)))
return bucket->data;

bucket = bucket->next;
@@ -260,7 +260,7 @@
hash_it_t.prev_bucket = NULL;

while (hash_it_t.bucket != NULL) {
- if (hash->compare(hash_it_t.bucket->data, data)) {
+ if (!(hash->compare(hash_it_t.bucket->data, data))) {
hash_it_t.first_bucket = (hash_it_t.bucket ==
hash->table[hash_it_t.index] ? &hash->table[ hash_it_t.index ] :
NULL);
return hash_remove_bucket(hash, &hash_it_t);
}

             reply	other threads:[~2009-07-15 13:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-15 13:59 Edwe Cowley [this message]
2009-07-15 17:21 ` [B.A.T.M.A.N.] [vis] Remove duplicate routes from vis output Marek Lindner
2009-07-16  6:57   ` Edwe Cowley
2009-07-16 10:42     ` Marek Lindner
2009-07-15 17:37 ` [B.A.T.M.A.N.] [vis] Remove duplicate routes from vis output (revised) 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=dd8d36130907150659v74773aw1fd1060c43ab337b@mail.gmail.com \
    --to=edwecowley@gmail.com \
    --cc=b.a.t.m.a.n@lists.open-mesh.net \
    /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;
as well as URLs for NNTP newsgroup(s).