X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=lib%2Fbinheap.h;h=0c6ee5a566a54680e7ca24c211a4791bc5bc01fb;hb=e34560a76a7af3fb428604e4da3cd14cfd1bf454;hp=e6f7afda7954c29cd5eedf96d6132952745e325f;hpb=5d15bedea1aaae6ec34f5101a0177d13a84a52dc;p=libucw.git diff --git a/lib/binheap.h b/lib/binheap.h index e6f7afda..0c6ee5a5 100644 --- a/lib/binheap.h +++ b/lib/binheap.h @@ -1,5 +1,5 @@ /* - * Sherlock Library -- Binomial Heaps + * UCW Library -- Binomial Heaps * * (c) 2003 Martin Mares * @@ -177,8 +177,9 @@ BH_PREFIX(init)(BH_HEAP *heap) #define BH_FOR_ALL(bh_px, bh_heap, bh_var) \ do { \ struct bh_node *bh_stack[32]; \ - bh_stack[0] = (bh_heap)->root.first_son; \ - uns bh_sp = 1; \ + uns bh_sp = 0; \ + if (bh_stack[0] = (bh_heap)->root.first_son) \ + bh_sp++; \ while (bh_sp) { \ struct bh_node *bh_var = bh_stack[--bh_sp]; \ if (bh_var->next_sibling) \