Skip to content
This repository has been archived by the owner on Feb 26, 2020. It is now read-only.

glibc 2.25 compat: remove assert(X=Y) #610

Merged
merged 1 commit into from
Apr 3, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 15 additions & 5 deletions lib/list.c
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,9 @@ list_create (ListDelF f)
l->fDel = f;
l->count = 0;
list_mutex_init(&l->mutex);
assert(l->magic = LIST_MAGIC); /* set magic via assert abuse */
#ifndef NDEBUG
l->magic = LIST_MAGIC;
#endif
return(l);
}

Expand All @@ -238,7 +240,9 @@ list_destroy (List l)
while (i) {
assert(i->magic == LIST_MAGIC);
iTmp = i->iNext;
assert(i->magic = ~LIST_MAGIC); /* clear magic via assert abuse */
#ifndef NDEBUG
i->magic = ~LIST_MAGIC;
#endif /* !NDEBUG */
list_iterator_free(i);
i = iTmp;
}
Expand All @@ -250,7 +254,9 @@ list_destroy (List l)
list_node_free(p);
p = pTmp;
}
assert(l->magic = ~LIST_MAGIC); /* clear magic via assert abuse */
#ifndef NDEBUG
l->magic = ~LIST_MAGIC;
#endif /* !NDEBUG */
list_mutex_unlock(&l->mutex);
list_mutex_destroy(&l->mutex);
list_free(l);
Expand Down Expand Up @@ -520,7 +526,9 @@ list_iterator_create (List l)
i->prev = &l->head;
i->iNext = l->iNext;
l->iNext = i;
assert(i->magic = LIST_MAGIC); /* set magic via assert abuse */
#ifndef NDEBUG
i->magic = LIST_MAGIC;
#endif /* !NDEBUG */
list_mutex_unlock(&l->mutex);
return(i);
}
Expand Down Expand Up @@ -557,7 +565,9 @@ list_iterator_destroy (ListIterator i)
}
}
list_mutex_unlock(&i->list->mutex);
assert(i->magic = ~LIST_MAGIC); /* clear magic via assert abuse */
#ifndef NDEBUG
i->magic = ~LIST_MAGIC;
#endif /* !NDEBUG */
list_iterator_free(i);
return;
}
Expand Down