Changeset 00aece0 in mainline for uspace/lib/c/include/adt/list.h
- Timestamp:
- 2012-02-18T16:47:38Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 4449c6c
- Parents:
- bd5f3b7 (diff), f943dd3 (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/include/adt/list.h
rbd5f3b7 r00aece0 72 72 73 73 #define assert_link_not_used(link) \ 74 assert(( link)->prev == NULL && (link)->next == NULL)74 assert(((link)->prev == NULL) && ((link)->next == NULL)) 75 75 76 76 /** Initialize doubly-linked circular list link … … 158 158 static inline void list_remove(link_t *link) 159 159 { 160 link->next->prev = link->prev; 161 link->prev->next = link->next; 160 if ((link->prev != NULL) && (link->next != NULL)) { 161 link->next->prev = link->prev; 162 link->prev->next = link->next; 163 } 164 162 165 link_initialize(link); 163 166 } … … 170 173 * 171 174 */ 172 static inline int list_empty( list_t *list)175 static inline int list_empty(const list_t *list) 173 176 { 174 177 return (list->head.next == &list->head); … … 183 186 * 184 187 */ 185 static inline link_t *list_first( list_t *list)188 static inline link_t *list_first(const list_t *list) 186 189 { 187 190 return ((list->head.next == &list->head) ? NULL : list->head.next);
Note:
See TracChangeset
for help on using the changeset viewer.