Remove a bunch of redundant casts.

This commit is contained in:
Markus Armbruster 2005-06-12 06:31:48 +00:00
parent ee6d72f3b8
commit 4f59fc9967
125 changed files with 417 additions and 432 deletions

View file

@ -102,7 +102,7 @@ as_add_cachepath(struct as_data *adp)
}
} else {
/* We must make a new one of these */
from = (struct as_frompath *)malloc(sizeof(struct as_frompath));
from = malloc(sizeof(struct as_frompath));
if (from == NULL)
return;
/* And set some stuff */
@ -115,7 +115,7 @@ as_add_cachepath(struct as_data *adp)
}
if (!to) {
/* We must make a new one */
to = (struct as_topath *)malloc(sizeof(struct as_topath));
to = malloc(sizeof(struct as_topath));
/* We can't, sorry */
if (to == NULL)
return;
@ -152,15 +152,15 @@ as_clear_cachepath(void)
/* Free this path */
as_free_path(to->path);
/* Free this node */
free((s_char *)to);
free(to);
}
}
/* Now, free the list of lists */
free((s_char *)from->tolist);
free(from->tolist);
/* Save the next pointer */
from2 = from->next;
/* now, free this from node */
free((s_char *)from);
free(from);
}
}
/* Note we don't free the fromhead here, we just zero it. That way,

View file

@ -50,9 +50,9 @@ as_free_queue(struct as_queue *queue)
struct as_queue *qp, *qp2;
for (qp = queue; qp; qp = qp2) {
free((s_char *)qp->np);
free(qp->np);
qp2 = qp->next;
free((s_char *)qp);
free(qp);
}
}
@ -66,7 +66,7 @@ as_free_path(struct as_path *pp)
for (; pp; pp = pp2) {
pp2 = pp->next;
free((s_char *)pp);
free(pp);
}
}
@ -77,8 +77,8 @@ void
as_delete(struct as_data *adp)
{
as_reset(adp);
free((s_char *)adp->neighbor_coords);
free((s_char *)adp->neighbor_nodes);
free((s_char *)adp->hashtab);
free((s_char *)adp);
free(adp->neighbor_coords);
free(adp->neighbor_nodes);
free(adp->hashtab);
free(adp);
}

View file

@ -74,7 +74,7 @@ as_free_hashtab(struct as_data *adp)
for (i = 0; i < adp->hashsize; i++) {
for (hp = adp->hashtab[i]; hp; hp = hp2) {
hp2 = hp->next;
free((char *)hp);
free(hp);
}
adp->hashtab[i] = NULL;
}

View file

@ -135,7 +135,7 @@ as_makepath(struct as_data *adp)
struct as_node *np;
for (np = adp->head->np; np; np = np->back) {
pp = (struct as_path *)malloc(sizeof(struct as_path));
pp = malloc(sizeof(struct as_path));
pp->c = np->c;
pp->next = adp->path;
adp->path = pp;