(as_extend, as_costcomp, gen_power, powcmp): Fix non-portable function
cast. (qsort_func_t): Unused, remove.
This commit is contained in:
parent
b360d076d3
commit
0aaf0084aa
5 changed files with 12 additions and 12 deletions
|
@ -172,7 +172,7 @@ extern void as_disable_cachepath(void);
|
|||
extern void as_makepath(struct as_data *adp);
|
||||
extern void as_free_path(struct as_path *pp);
|
||||
|
||||
extern int as_costcomp(struct as_node **n1, struct as_node **n2);
|
||||
extern int as_costcomp(const void *, const void *);
|
||||
extern struct as_queue *as_extend(struct as_data *adp);
|
||||
extern struct as_queue *as_merge(struct as_data *adp,
|
||||
struct as_queue *head,
|
||||
|
|
|
@ -25,8 +25,10 @@
|
|||
* Used as comparision function for qsort.
|
||||
*/
|
||||
int
|
||||
as_costcomp(struct as_node **n1, struct as_node **n2)
|
||||
as_costcomp(const void *p1, const void *p2)
|
||||
{
|
||||
struct as_node *const *n1 = p1;
|
||||
struct as_node *const *n2 = p2;
|
||||
double diff;
|
||||
|
||||
diff = (*n1)->lbcost - (*n2)->lbcost;
|
||||
|
|
|
@ -50,7 +50,7 @@ as_extend(struct as_data *adp)
|
|||
return (NULL);
|
||||
if (i > 1)
|
||||
qsort(adp->neighbor_nodes, i,
|
||||
sizeof(*adp->neighbor_nodes), (qsort_func_t)as_costcomp);
|
||||
sizeof(*adp->neighbor_nodes), as_costcomp);
|
||||
|
||||
/* remove old coord from head of queue and add to list of tried */
|
||||
qp = head;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue