Changeset 2246de6 in mainline for uspace/lib/libc/generic/libadt/list.c
- Timestamp:
- 2009-05-21T06:57:08Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- cb41a5e
- Parents:
- 55982d6
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/libc/generic/libadt/list.c
r55982d6 r2246de6 49 49 int list_member(const link_t *link, const link_t *head) 50 50 { 51 int found = false;51 int found = 0; 52 52 link_t *hlp = head->next; 53 53 54 54 while (hlp != head) { 55 55 if (hlp == link) { 56 found = true;56 found = 1; 57 57 break; 58 58 } … … 78 78 if (list_empty(head2)) 79 79 return; 80 80 81 81 head2->next->prev = head1->prev; 82 head2->prev->next = head1; 82 head2->prev->next = head1; 83 83 head1->prev->next = head2->next; 84 84 head1->prev = head2->prev; … … 86 86 } 87 87 88 89 /** Count list items 90 * 91 * Return the number of items in the list. 92 * 93 * @param link List to count. 94 * 95 * @return Number of items in the list. 96 * 97 */ 98 unsigned int list_count(const link_t *link) 99 { 100 unsigned int count = 0; 101 link_t *hlp = link->next; 102 103 while (hlp != link) { 104 count++; 105 hlp = hlp->next; 106 } 107 108 return count; 109 } 110 88 111 /** @} 89 112 */
Note:
See TracChangeset
for help on using the changeset viewer.