Don't explicitly dereference function pointers in calls. No
functional changes.
This commit is contained in:
parent
4836f6c543
commit
8fea65f73f
3 changed files with 7 additions and 9 deletions
|
@ -40,8 +40,7 @@ as_extend(struct as_data *adp)
|
|||
head = adp->head;
|
||||
|
||||
/* Find the neighboring coordinates. */
|
||||
i = (*adp->neighbor) (head->np->c, adp->neighbor_coords,
|
||||
adp->userdata);
|
||||
i = adp->neighbor(head->np->c, adp->neighbor_coords, adp->userdata);
|
||||
if (i == 0)
|
||||
return NULL;
|
||||
/*
|
||||
|
|
|
@ -34,7 +34,7 @@ as_iscinq(struct as_data *adp, struct as_coord c)
|
|||
int hashval;
|
||||
struct as_hash *hp;
|
||||
|
||||
hashval = (*adp->hash) (c) % adp->hashsize;
|
||||
hashval = adp->hash(c) % adp->hashsize;
|
||||
|
||||
for (hp = adp->hashtab[hashval]; hp; hp = hp->next)
|
||||
if (hp->c.x == c.x && hp->c.y == c.y)
|
||||
|
@ -57,7 +57,7 @@ as_setcinq(struct as_data *adp, struct as_coord c, struct as_queue *qp)
|
|||
new->c = c;
|
||||
new->qp = qp;
|
||||
|
||||
hashval = (*adp->hash) (c) % adp->hashsize;
|
||||
hashval = adp->hash(c) % adp->hashsize;
|
||||
hp = adp->hashtab[hashval];
|
||||
|
||||
new->next = (hp) ? hp : NULL;
|
||||
|
|
|
@ -59,8 +59,7 @@ as_winnow(struct as_data *adp, struct as_coord *coords, int ncoords)
|
|||
|
||||
for (cp = coords, end = coords + ncoords; cp < end; cp++) {
|
||||
fix_pointer = 0;
|
||||
incknowncost = (*adp->realcost) (adp->head->np->c, *cp,
|
||||
adp->userdata);
|
||||
incknowncost = adp->realcost(adp->head->np->c, *cp, adp->userdata);
|
||||
knowncost = adp->head->np->knowncost + incknowncost;
|
||||
/*
|
||||
* If this neighbor is already in the queue, we can
|
||||
|
@ -68,7 +67,7 @@ as_winnow(struct as_data *adp, struct as_coord *coords, int ncoords)
|
|||
*/
|
||||
qp = as_iscinq(adp, *cp);
|
||||
inclbcost = qp ? qp->np->inclbcost :
|
||||
(*adp->lbcost) (*cp, adp->to, adp->userdata);
|
||||
adp->lbcost(*cp, adp->to, adp->userdata);
|
||||
if (inclbcost < 0.0) /* skip bad cases */
|
||||
continue;
|
||||
lbcost = knowncost + inclbcost;
|
||||
|
@ -133,8 +132,8 @@ as_winnow(struct as_data *adp, struct as_coord *coords, int ncoords)
|
|||
if (qp)
|
||||
seccost = qp->np->seccost;
|
||||
else
|
||||
seccost = (adp->seccost) ?
|
||||
(*adp->seccost) (*cp, adp->to, adp->userdata) : 0.0;
|
||||
seccost = adp->seccost ?
|
||||
adp->seccost(*cp, adp->to, adp->userdata) : 0.0;
|
||||
np = as_newnode(adp->head->np, *cp, inclbcost, lbcost,
|
||||
knowncost, seccost);
|
||||
if (np == NULL)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue