Changeset 9b20126 in mainline for uspace/lib/pcut/src/list.c


Ignore:
Timestamp:
2014-09-19T08:23:01Z (10 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c85a57f
Parents:
15d0046
Message:

Update PCUT to newest version

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/pcut/src/list.c

    r15d0046 r9b20126  
    8282 */
    8383static void inline_nested_lists(pcut_item_t *nested) {
     84        pcut_item_t *first;
     85
    8486        if (nested->kind != PCUT_KIND_NESTED) {
    8587                return;
    8688        }
    8789
    88         if (nested->nested.last == NULL) {
     90        if (nested->nested == NULL) {
    8991                nested->kind = PCUT_KIND_SKIP;
    9092                return;
    9193        }
    9294
    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;
    9597        if (nested->next != NULL) {
    96                 nested->next->previous = nested->nested.last;
     98                nested->next->previous = nested->nested;
    9799        }
    98100        nested->next = first;
     
    107109 */
    108110static void set_ids(pcut_item_t *first) {
     111        int id = 1;
     112        pcut_item_t *it;
     113
    109114        assert(first != NULL);
    110         int id = 1;
     115
    111116        if (first->kind == PCUT_KIND_SKIP) {
    112117                first = pcut_get_real_next(first);
    113118        }
    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)) {
    115121                it->id = id;
    116122                id++;
     
    126132 */
    127133static void detect_skipped_tests(pcut_item_t *first) {
     134        pcut_item_t *it;
     135
    128136        assert(first != NULL);
    129137        if (first->kind == PCUT_KIND_SKIP) {
    130138                first = pcut_get_real_next(first);
    131139        }
    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
    133144                if (it->kind != PCUT_KIND_TEST) {
    134145                        continue;
    135146                }
    136                 pcut_extra_t *extras = it->test.extras;
     147
     148                extras = it->extras;
    137149                while (extras->type != PCUT_EXTRA_LAST) {
    138150                        if (extras->type == PCUT_EXTRA_SKIP) {
     
    156168 */
    157169pcut_item_t *pcut_fix_list_get_real_head(pcut_item_t *last) {
     170        pcut_item_t *next, *it;
     171
    158172        last->next = NULL;
    159173
    160174        inline_nested_lists(last);
    161175
    162         pcut_item_t *next = last;
    163 
    164         pcut_item_t *it = last->previous;
     176        next = last;
     177        it = last->previous;
    165178        while (it != NULL) {
    166179                it->next = next;
Note: See TracChangeset for help on using the changeset viewer.