chiark / gitweb /
more informative assertions
authorRichard Kettlewell <rjk@greenend.org.uk>
Mon, 24 Mar 2008 17:40:25 +0000 (17:40 +0000)
committerRichard Kettlewell <rjk@greenend.org.uk>
Mon, 24 Mar 2008 17:40:25 +0000 (17:40 +0000)
lib/heap.h

index ebd2f60b2468f182e3878c05eaf3b3155dbb9c8b..c9913defa88a38bf415fad8ffc7ad0d424dd06cc 100644 (file)
@@ -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];                                                \
   }                                                                     \
                                                                         \
     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) {                             \