summaryrefslogtreecommitdiff
path: root/src/lib/hashtable.c
diff options
context:
space:
mode:
authorSander Vrijders <[email protected]>2017-01-09 16:42:25 +0100
committerSander Vrijders <[email protected]>2017-01-09 16:42:25 +0100
commit77c32c24b781eafd518e2cbe9de46b348a26a201 (patch)
tree817ead055668848866738e037ac3cb4c2a269bfd /src/lib/hashtable.c
parentf0167930862e57a2aa22520cd574f0368cb1032c (diff)
parent6c1cfb990f56b2fa87500732cb4f0966616907c7 (diff)
downloadouroboros-77c32c24b781eafd518e2cbe9de46b348a26a201.tar.gz
ouroboros-77c32c24b781eafd518e2cbe9de46b348a26a201.zip
Merge remote-tracking branch 'upstream/be' into be-gam
Diffstat (limited to 'src/lib/hashtable.c')
-rw-r--r--src/lib/hashtable.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/src/lib/hashtable.c b/src/lib/hashtable.c
index 8dcd4ec1..f17accaf 100644
--- a/src/lib/hashtable.c
+++ b/src/lib/hashtable.c
@@ -1,22 +1,23 @@
/*
- * Ouroboros - Copyright (C) 2016
+ * Ouroboros - Copyright (C) 2016 - 2017
*
* Hash table with separate chaining on collisions
*
* Sander Vrijders <[email protected]>
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * version 2.1 as published by the Free Software Foundation.
*
- * This program is distributed in the hope that it will be useful,
+ * This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA
*/
#include <ouroboros/config.h>
@@ -69,7 +70,7 @@ struct htable * htable_create(uint64_t buckets, bool hash_key)
}
for (i = 0; i < buckets; i++)
- INIT_LIST_HEAD(&(tmp->buckets[i]));
+ list_head_init(&(tmp->buckets[i]));
return tmp;
}
@@ -136,7 +137,7 @@ int htable_insert(struct htable * table, uint64_t key, void * val)
entry->key = key;
entry->val = val;
- INIT_LIST_HEAD(&entry->next);
+ list_head_init(&entry->next);
list_add(&entry->next, &(table->buckets[lookup_key]));