chiark
/
gitweb
/
~mdw
/
disorder
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
eabdb9b
)
more informative assertions
author
Richard Kettlewell
<rjk@greenend.org.uk>
Mon, 24 Mar 2008 17:40:25 +0000
(17:40 +0000)
committer
Richard Kettlewell
<rjk@greenend.org.uk>
Mon, 24 Mar 2008 17:40:25 +0000
(17:40 +0000)
lib/heap.h
patch
|
blob
|
blame
|
history
diff --git
a/lib/heap.h
b/lib/heap.h
index ebd2f60b2468f182e3878c05eaf3b3155dbb9c8b..c9913defa88a38bf415fad8ffc7ad0d424dd06cc 100644
(file)
--- a/
lib/heap.h
+++ b/
lib/heap.h
@@
-85,7
+85,7
@@
} \
\
static inline NAME##_element NAME##_first(struct NAME *heap) { \
} \
\
static inline NAME##_element NAME##_first(struct NAME *heap) { \
- assert(heap->nvec > 0
);
\
+ assert(heap->nvec > 0
&& "_first");
\
return heap->vec[0]; \
} \
\
return heap->vec[0]; \
} \
\
@@
-116,7
+116,7
@@
int n = 0; \
NAME##_element r; \
\
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) { \
r = heap->vec[0]; \
heap->vec[0] = heap->vec[--heap->nvec]; \
while(2 * n + 1 < heap->nvec) { \