X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fheap.h;h=a70fb2cd8c806551fe87b995e013913a3f581e4d;hb=0c53af3db5fdca461f49998194ecbfd8f55b7a8a;hp=268cc2572cd8d3ad855464d7c8a6e2a5b41dead7;hpb=dd1d31f3e9b115b3e5a35d18243880ebc41990f2;p=libucw.git diff --git a/lib/heap.h b/lib/heap.h index 268cc257..a70fb2cd 100644 --- a/lib/heap.h +++ b/lib/heap.h @@ -2,6 +2,9 @@ * Sherlock Library -- Universal Heap Macros * * (c) 2001 Martin Mares + * + * This software may be freely distributed and used according to the terms + * of the GNU Lesser General Public License. */ #define HEAP_BUBBLE_DOWN_J(heap,num,less,swap) \ @@ -71,9 +74,9 @@ do { \ uns j, l, u; \ type x; \ - swap(heap,pos,num,x); \ - num--; \ j = pos; \ + swap(heap,j,num,x); \ + num--; \ if (less(heap[j], heap[num+1])) \ HEAP_BUBBLE_UP_J(heap,num,less,swap) \ else \