Ignore:
Timestamp:
2011-07-13T22:39:18Z (13 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
e6910c8
Parents:
5974661 (diff), 8ecef91 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge libposix.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/adt/hash_table.c

    r5974661 re4f8c77  
    6161        assert(max_keys > 0);
    6262       
    63         h->entry = malloc(m * sizeof(link_t));
     63        h->entry = malloc(m * sizeof(list_t));
    6464        if (!h->entry)
    6565                return false;
    6666       
    67         memset((void *) h->entry, 0,  m * sizeof(link_t));
     67        memset((void *) h->entry, 0,  m * sizeof(list_t));
    6868       
    6969        hash_count_t i;
     
    123123        assert(chain < h->entries);
    124124       
    125         link_t *cur;
    126         for (cur = h->entry[chain].next; cur != &h->entry[chain];
    127             cur = cur->next) {
     125        list_foreach(h->entry[chain], cur) {
    128126                if (h->op->compare(key, h->max_keys, cur)) {
    129127                        /*
     
    153151        assert(keys <= h->max_keys);
    154152       
    155         link_t *cur;
    156        
    157153        if (keys == h->max_keys) {
     154                link_t *cur;
     155               
    158156                /*
    159157                 * All keys are known, hash_table_find() can be used to find the
     
    176174        hash_index_t chain;
    177175        for (chain = 0; chain < h->entries; chain++) {
    178                 for (cur = h->entry[chain].next; cur != &h->entry[chain];
     176                link_t *cur;
     177               
     178                for (cur = h->entry[chain].head.next; cur != &h->entry[chain].head;
    179179                    cur = cur->next) {
    180180                        if (h->op->compare(key, keys, cur)) {
     
    203203{
    204204        hash_index_t bucket;
    205         link_t *cur;
    206205       
    207206        for (bucket = 0; bucket < h->entries; bucket++) {
    208                 for (cur = h->entry[bucket].next; cur != &h->entry[bucket];
    209                     cur = cur->next) {
     207                list_foreach(h->entry[bucket], cur) {
    210208                        f(cur, arg);
    211209                }
Note: See TracChangeset for help on using the changeset viewer.