Changeset 00b7fc8 in mainline for uspace/lib/c/generic/adt/list.c
- Timestamp:
- 2019-02-01T22:32:38Z (6 years ago)
- Parents:
- f959a20f
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2019-02-01 21:46:05)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2019-02-01 22:32:38)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/adt/list.c
rf959a20f r00b7fc8 55 55 bool list_member(const link_t *link, const list_t *list) 56 56 { 57 bool found = false;58 link_t *hlp = list->head.next;57 if (list_empty(list)) 58 return false; 59 59 60 while (hlp != &list->head) {61 if (hlp == link) { 62 found = true;63 break;64 }65 hlp = hlp-> next;60 link_t *hlp = list->__adt_list_head.__adt_link_next; 61 62 while (hlp != &list->__adt_list_head) { 63 if (hlp == link) 64 return true; 65 hlp = hlp->__adt_link_next; 66 66 } 67 67 68 return f ound;68 return false; 69 69 } 70 70 … … 83 83 84 84 /* Attach list to destination. */ 85 list-> head.next->prev = pos;86 list-> head.prev->next = pos->next;85 list->__adt_list_head.__adt_link_next->__adt_link_prev = pos; 86 list->__adt_list_head.__adt_link_prev->__adt_link_next = pos->__adt_link_next; 87 87 88 88 /* Link destination list to the added list. */ 89 pos-> next->prev = list->head.prev;90 pos-> next = list->head.next;89 pos->__adt_link_next->__adt_link_prev = list->__adt_list_head.__adt_link_prev; 90 pos->__adt_link_next = list->__adt_list_head.__adt_link_next; 91 91 92 92 list_initialize(list);
Note:
See TracChangeset
for help on using the changeset viewer.