]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
Lint complained, fixup array lookup using hash value.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Wed, 14 Mar 2007 10:47:11 +0000 (10:47 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Wed, 14 Mar 2007 10:47:11 +0000 (10:47 +0000)
git-svn-id: file:///svn/unbound/trunk@177 be551aaa-1e26-0410-a405-d3ace91eadb9

util/storage/lruhash.c

index 998ff3abd5fafb4a751335ec492d219668f2fb84..de6fc7aa1eb8d7d74d9f74b6a4e611077fd52b85 100644 (file)
@@ -195,7 +195,7 @@ bin_split(struct lruhash* table, struct lruhash_bin* newa,
 {
        size_t i;
        struct lruhash_entry *p, *np;
-       int newbin;
+       struct lruhash_bin* newbin;
        /* move entries to new table. Notice that since hash x is mapped to
         * bin x & mask, and new mask uses one more bit, so all entries in
         * one bin will go into the old bin or bin | newbit */
@@ -209,9 +209,9 @@ bin_split(struct lruhash* table, struct lruhash_bin* newa,
                while(p) {
                        np = p->overflow_next;
                        /* link into correct new bin */
-                       newbin = p->hash & newmask;
-                       p->overflow_next = newa[newbin].overflow_list;
-                       newa[newbin].overflow_list = p;
+                       newbin = &newa[p->hash & newmask];
+                       p->overflow_next = newbin->overflow_list;
+                       newbin->overflow_list = p;
                        p=np;
                }
        }