Changeset f959a20f in mainline for uspace/lib/c
- Timestamp:
- 2019-02-01T22:32:38Z (6 years ago)
- Children:
- 00b7fc8
- Parents:
- 1a37496
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2019-02-01 21:22:39)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2019-02-01 22:32:38)
- Location:
- uspace/lib/c
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/adt/hash_table.c
r1a37496 rf959a20f 273 273 274 274 size_t idx = h->op->hash(item) % h->bucket_cnt; 275 list_t *list = &h->bucket[idx]; 275 276 276 277 /* Traverse the circular list until we reach the starting item again. */ 277 for (link_t *cur = item->link.next; cur != &first->link; 278 cur = cur->next) { 279 assert(cur); 280 281 if (cur == &h->bucket[idx].head) 282 continue; 278 for (link_t *cur = list_next(&item->link, list); cur != &first->link; 279 cur = list_next(cur, list)) { 280 281 if (!cur) 282 cur = list_first(list); 283 283 284 284 ht_link_t *cur_link = member_to_inst(cur, ht_link_t, link); -
uspace/lib/c/generic/thread/fibril.c
r1a37496 rf959a20f 601 601 assert(timeout); 602 602 603 link_t *tmp = timeout_list.head.next; 604 while (tmp != &timeout_list.head) { 605 _timeout_t *cur = list_get_instance(tmp, _timeout_t, link); 606 607 if (ts_gteq(&cur->expires, &timeout->expires)) 608 break; 609 610 tmp = tmp->next; 611 } 612 613 list_insert_before(&timeout->link, tmp); 603 list_foreach(timeout_list, link, _timeout_t, cur) { 604 if (ts_gteq(&cur->expires, &timeout->expires)) { 605 list_insert_before(&timeout->link, &cur->link); 606 return; 607 } 608 } 609 610 list_append(&timeout->link, &timeout_list); 614 611 } 615 612 -
uspace/lib/c/include/ipc/devman.h
r1a37496 rf959a20f 108 108 static inline void add_match_id(match_id_list_t *ids, match_id_t *id) 109 109 { 110 match_id_t *mid = NULL; 111 link_t *link = ids->ids.head.next; 112 113 while (link != &ids->ids.head) { 114 mid = list_get_instance(link, match_id_t, link); 110 list_foreach(ids->ids, link, match_id_t, mid) { 115 111 if (mid->score < id->score) { 116 break; 112 list_insert_before(&id->link, &mid->link); 113 return; 117 114 } 118 link = link->next;119 115 } 120 116 121 list_ insert_before(&id->link, link);117 list_append(&id->link, &ids->ids); 122 118 } 123 119
Note:
See TracChangeset
for help on using the changeset viewer.