Commit c79dbaa3 authored by Christian Würdig's avatar Christian Würdig
Browse files

changed key to double

added missing void declaration

[r13411]
parent 3c53cd3d
...@@ -20,8 +20,8 @@ ...@@ -20,8 +20,8 @@
*/ */
typedef struct _pqueue_el_t { typedef struct _pqueue_el_t {
void *data; void *data;
int key; double key;
} pqueue_el_t; } pqueue_el_t;
struct _pqueue_t { struct _pqueue_t {
...@@ -77,7 +77,7 @@ static void pqueue_sift_up(pqueue *q, int pos) { ...@@ -77,7 +77,7 @@ static void pqueue_sift_up(pqueue *q, int pos) {
* Creates a new priority queue. * Creates a new priority queue.
* @return A priority queue of initial length 0. * @return A priority queue of initial length 0.
*/ */
pqueue *new_pqueue() { pqueue *new_pqueue(void) {
pqueue *res = xmalloc(sizeof(*res)); pqueue *res = xmalloc(sizeof(*res));
res->elems = NEW_ARR_F(pqueue_el_t, 0); res->elems = NEW_ARR_F(pqueue_el_t, 0);
return res; return res;
...@@ -98,7 +98,7 @@ void del_pqueue(pqueue *q) { ...@@ -98,7 +98,7 @@ void del_pqueue(pqueue *q) {
* @param data The actual data which should be stored in the queue. * @param data The actual data which should be stored in the queue.
* @param key The priority for the data. * @param key The priority for the data.
*/ */
void pqueue_put(pqueue *q, void *data, int key) { void pqueue_put(pqueue *q, void *data, double key) {
pqueue_el_t el; pqueue_el_t el;
el.data = data; el.data = data;
......
...@@ -16,7 +16,7 @@ typedef struct _pqueue_t pqueue; ...@@ -16,7 +16,7 @@ typedef struct _pqueue_t pqueue;
* Creates a new priority queue. * Creates a new priority queue.
* @return A priority queue of initial length 0. * @return A priority queue of initial length 0.
*/ */
pqueue *new_pqueue(); pqueue *new_pqueue(void);
/** /**
* Frees all memory allocated by the priority queue. * Frees all memory allocated by the priority queue.
...@@ -30,7 +30,7 @@ void del_pqueue(pqueue *q); ...@@ -30,7 +30,7 @@ void del_pqueue(pqueue *q);
* @param data The actual data which should be stored in the queue. * @param data The actual data which should be stored in the queue.
* @param key The priority for the data. * @param key The priority for the data.
*/ */
void pqueue_put(pqueue *q, void *data, int key); void pqueue_put(pqueue *q, void *data, double key);
/** /**
* Returns and removes the first element, ie. that one with the highest priority, from the queue. * Returns and removes the first element, ie. that one with the highest priority, from the queue.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment