Changeset 63e27ef in mainline for kernel/generic/src/adt/hash_table.c
- Timestamp:
- 2017-06-19T21:47:42Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- deacc58d
- Parents:
- 7354b5e
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/adt/hash_table.c
r7354b5e r63e27ef 40 40 #include <adt/hash_table.h> 41 41 #include <adt/list.h> 42 #include <assert.h> 42 43 #include <typedefs.h> 43 #include <debug.h>44 44 #include <mm/slab.h> 45 45 #include <mem.h> … … 56 56 size_t i; 57 57 58 ASSERT(h);59 ASSERT(op);60 ASSERT(op->hash);61 ASSERT(op->compare);62 ASSERT(max_keys > 0);58 assert(h); 59 assert(op); 60 assert(op->hash); 61 assert(op->compare); 62 assert(max_keys > 0); 63 63 64 64 h->entry = (list_t *) malloc(m * sizeof(list_t), 0); … … 86 86 size_t chain; 87 87 88 ASSERT(item);89 ASSERT(h);90 ASSERT(h->op);91 ASSERT(h->op->hash);92 ASSERT(h->op->compare);88 assert(item); 89 assert(h); 90 assert(h->op); 91 assert(h->op->hash); 92 assert(h->op->compare); 93 93 94 94 chain = h->op->hash(key); 95 ASSERT(chain < h->entries);95 assert(chain < h->entries); 96 96 97 97 list_append(item, &h->entry[chain]); … … 109 109 size_t chain; 110 110 111 ASSERT(h);112 ASSERT(h->op);113 ASSERT(h->op->hash);114 ASSERT(h->op->compare);111 assert(h); 112 assert(h->op); 113 assert(h->op->hash); 114 assert(h->op->compare); 115 115 116 116 chain = h->op->hash(key); 117 ASSERT(chain < h->entries);117 assert(chain < h->entries); 118 118 119 119 link_t *cur = list_first(&h->entry[chain]); … … 143 143 size_t chain; 144 144 145 ASSERT(h);146 ASSERT(h->op);147 ASSERT(h->op->hash);148 ASSERT(h->op->compare);149 ASSERT(keys <= h->max_keys);145 assert(h); 146 assert(h->op); 147 assert(h->op->hash); 148 assert(h->op->compare); 149 assert(keys <= h->max_keys); 150 150 151 151
Note:
See TracChangeset
for help on using the changeset viewer.