Changeset 2193905 for lib/data-struct/deque.c
- Timestamp:
- 11/29/18 10:12:59 (2 years ago)
- Branches:
- develop
- Children:
- fdf23b8
- Parents:
- d74ca03
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/data-struct/deque.c
r88b9798 r2193905 63 63 ASSERT_RET(pthread_mutex_lock(&q->lock), == 0); 64 64 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) { 67 66 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"); 68 67 return; … … 71 70 q->head = q->tail = new_node; 72 71 } else { 73 /*assert (q->tail != NULL);*/74 72 if (q->tail == NULL) { 75 73 fprintf(stderr, "Error deque tail cannot be NULL if it contains a head in libtrace_deque_push_back()\n"); … … 94 92 ASSERT_RET(pthread_mutex_lock(&q->lock), == 0); 95 93 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) { 98 95 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"); 99 96 return; … … 102 99 q->head = q->tail = new_node; 103 100 } 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 }109 101 q->head->prev = new_node; 110 102 new_node->next = q->head; // Done the double link
Note: See TracChangeset
for help on using the changeset viewer.