Changeset 9b20126 in mainline for uspace/lib/pcut/src/list.c
- Timestamp:
- 2014-09-19T08:23:01Z (10 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- c85a57f
- Parents:
- 15d0046
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/pcut/src/list.c
r15d0046 r9b20126 82 82 */ 83 83 static void inline_nested_lists(pcut_item_t *nested) { 84 pcut_item_t *first; 85 84 86 if (nested->kind != PCUT_KIND_NESTED) { 85 87 return; 86 88 } 87 89 88 if (nested->nested .last== NULL) {90 if (nested->nested == NULL) { 89 91 nested->kind = PCUT_KIND_SKIP; 90 92 return; 91 93 } 92 94 93 pcut_item_t *first = pcut_fix_list_get_real_head(nested->nested.last);94 nested->nested .last->next = nested->next;95 first = pcut_fix_list_get_real_head(nested->nested); 96 nested->nested->next = nested->next; 95 97 if (nested->next != NULL) { 96 nested->next->previous = nested->nested .last;98 nested->next->previous = nested->nested; 97 99 } 98 100 nested->next = first; … … 107 109 */ 108 110 static void set_ids(pcut_item_t *first) { 111 int id = 1; 112 pcut_item_t *it; 113 109 114 assert(first != NULL); 110 int id = 1; 115 111 116 if (first->kind == PCUT_KIND_SKIP) { 112 117 first = pcut_get_real_next(first); 113 118 } 114 for (pcut_item_t *it = first; it != NULL; it = pcut_get_real_next(it)) { 119 120 for (it = first; it != NULL; it = pcut_get_real_next(it)) { 115 121 it->id = id; 116 122 id++; … … 126 132 */ 127 133 static void detect_skipped_tests(pcut_item_t *first) { 134 pcut_item_t *it; 135 128 136 assert(first != NULL); 129 137 if (first->kind == PCUT_KIND_SKIP) { 130 138 first = pcut_get_real_next(first); 131 139 } 132 for (pcut_item_t *it = first; it != NULL; it = pcut_get_real_next(it)) { 140 141 for (it = first; it != NULL; it = pcut_get_real_next(it)) { 142 pcut_extra_t *extras; 143 133 144 if (it->kind != PCUT_KIND_TEST) { 134 145 continue; 135 146 } 136 pcut_extra_t *extras = it->test.extras; 147 148 extras = it->extras; 137 149 while (extras->type != PCUT_EXTRA_LAST) { 138 150 if (extras->type == PCUT_EXTRA_SKIP) { … … 156 168 */ 157 169 pcut_item_t *pcut_fix_list_get_real_head(pcut_item_t *last) { 170 pcut_item_t *next, *it; 171 158 172 last->next = NULL; 159 173 160 174 inline_nested_lists(last); 161 175 162 pcut_item_t *next = last; 163 164 pcut_item_t *it = last->previous; 176 next = last; 177 it = last->previous; 165 178 while (it != NULL) { 166 179 it->next = next;
Note:
See TracChangeset
for help on using the changeset viewer.