chiark / gitweb /
Further macro tests
[disorder] / lib / heap.h
index ebd2f60b2468f182e3878c05eaf3b3155dbb9c8b..6f9bcab7c1e6fd6866178fb950bc6ef2bd080870 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * This file is part of DisOrder.
- * Copyright (C) 2007 Richard Kettlewell
+ * Copyright (C) 2007, 2008 Richard Kettlewell
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -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) {                             \