From e49aeba3639611a6f9c322bb6493aac1d5f3fcbe Mon Sep 17 00:00:00 2001 From: =?utf8?q?Christian=20W=C3=BCrdig?= Date: Tue, 15 May 2007 13:47:48 +0000 Subject: [PATCH] fixed strange obstack usage changed indent [r13877] --- ir/be/becopyopt.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/ir/be/becopyopt.c b/ir/be/becopyopt.c index 40c3a1c42..fbfb5e044 100644 --- a/ir/be/becopyopt.c +++ b/ir/be/becopyopt.c @@ -708,15 +708,14 @@ static int compare_affinity_node_t(const void *k1, const void *k2, size_t size) static void add_edge(copy_opt_t *co, ir_node *n1, ir_node *n2, int costs) { affinity_node_t new_node, *node; - neighb_t new_nbr, *nbr; - int allocnew; + neighb_t new_nbr, *nbr; + int allocnew = 1; new_node.irn = n1; new_node.degree = 0; new_node.neighbours = NULL; node = set_insert(co->nodes, &new_node, sizeof(new_node), nodeset_hash(new_node.irn)); - allocnew = 1; for (nbr = node->neighbours; nbr; nbr = nbr->next) if (nbr->irn == n2) { allocnew = 0; @@ -725,11 +724,11 @@ static void add_edge(copy_opt_t *co, ir_node *n1, ir_node *n2, int costs) { /* if we did not find n2 in n1's neighbourhood insert it */ if (allocnew) { - obstack_grow(&co->obst, &new_nbr, sizeof(new_nbr)); - nbr = obstack_finish(&co->obst); + nbr = obstack_alloc(&co->obst, sizeof(*nbr)); nbr->irn = n2; nbr->costs = 0; nbr->next = node->neighbours; + node->neighbours = nbr; node->degree++; } -- 2.20.1