Ignore:
Timestamp:
11/29/18 10:12:59 (2 years ago)
Author:
Jacob Van Walraven <jcv9@…>
Branches:
develop
Children:
fdf23b8
Parents:
d74ca03
Message:

Apply changes required for pull request #81

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/data-struct/deque.c

    r88b9798 r2193905  
    6363        ASSERT_RET(pthread_mutex_lock(&q->lock), == 0);
    6464        if (q->head == NULL) {
    65                 /*assert(q->tail == NULL && q->size == 0);*/
    66                 if (q->tail != NULL && q->size != 0) {
     65                if (q->tail != NULL || q->size != 0) {
    6766                        fprintf(stderr, "Error deque head cannot be NULL with a non NULL tail and size of more than 0 in libtrace_deque_push_back()\n");
    6867                        return;
     
    7170                q->head = q->tail = new_node;
    7271        } else {
    73                 /*assert (q->tail != NULL);*/
    7472                if (q->tail == NULL) {
    7573                        fprintf(stderr, "Error deque tail cannot be NULL if it contains a head in libtrace_deque_push_back()\n");
     
    9492        ASSERT_RET(pthread_mutex_lock(&q->lock), == 0);
    9593        if (q->head == NULL) {
    96                 /*assert(q->tail == NULL && q->size == 0);*/
    97                 if (q->tail != NULL && q->size != 0) {
     94                if (q->tail != NULL || q->size != 0) {
    9895                        fprintf(stderr, "Error deque head cannot be NULL with a non NULL tail and size of more than 0 in libtrace_deque_push_front()\n");
    9996                        return;
     
    10299                q->head = q->tail = new_node;
    103100        } else {
    104                 /*assert (q->head != NULL);*/
    105                 if (q->head == NULL) {
    106                         fprintf(stderr, "Error deque tail cannot be NULL if it contains a head in libtrace_deque_push_front()\n");
    107                         return;
    108                 }
    109101                q->head->prev = new_node;
    110102                new_node->next = q->head; // Done the double link
Note: See TracChangeset for help on using the changeset viewer.