From: Richard Kettlewell Date: Mon, 24 Mar 2008 17:40:25 +0000 (+0000) Subject: more informative assertions X-Git-Tag: 3.0~7 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/disorder/commitdiff_plain/4c672170094ffb7a1ef6e1afeb23f55f3da417d7 more informative assertions --- diff --git a/lib/heap.h b/lib/heap.h index ebd2f60..c9913de 100644 --- a/lib/heap.h +++ b/lib/heap.h @@ -85,7 +85,7 @@ } \ \ static inline NAME##_element NAME##_first(struct NAME *heap) { \ - assert(heap->nvec > 0); \ + assert(heap->nvec > 0 && "_first"); \ return heap->vec[0]; \ } \ \ @@ -116,7 +116,7 @@ int n = 0; \ NAME##_element r; \ \ - assert(heap->nvec > 0); \ + assert(heap->nvec > 0 && "_remove"); \ r = heap->vec[0]; \ heap->vec[0] = heap->vec[--heap->nvec]; \ while(2 * n + 1 < heap->nvec) { \