Skip to content

Commit e97c4e7

Browse files
committed
treematch: fix several compiler warnings
Fix compiler warnings about having "shadow" variable declarations. Signed-off-by: Jeff Squyres <jsquyres@cisco.com>
1 parent 02b2010 commit e97c4e7

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed

3rd-party/treematch/fibo.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,13 @@ typedef struct FiboTree_ {
101101
the algorithms have been de-recursived
102102
and written as macros. */
103103

104-
#define fiboTreeLinkAfter(o,n) do { \
105-
FiboNode * nextptr; \
106-
nextptr = (o)->linkdat.nextptr; \
107-
(n)->linkdat.nextptr = nextptr; \
108-
(n)->linkdat.prevptr = (o); \
109-
nextptr->linkdat.prevptr = (n); \
110-
(o)->linkdat.nextptr = (n); \
104+
#define fiboTreeLinkAfter(o,n) do { \
105+
FiboNode * nextptr_loc; \
106+
nextptr_loc = (o)->linkdat.nextptr; \
107+
(n)->linkdat.nextptr = nextptr_loc; \
108+
(n)->linkdat.prevptr = (o); \
109+
nextptr_loc->linkdat.prevptr = (n); \
110+
(o)->linkdat.nextptr = (n); \
111111
} while (0)
112112

113113
#define fiboTreeUnlink(n) do { \

3rd-party/treematch/tm_topology.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ int tm_topology_add_binding_constraints(char *constraints_filename, tm_topology
575575
}
576576

577577

578-
void topology_numbering_cpy(tm_topology_t *topology,int **numbering,int *nb_nodes)
578+
void topology_numbering_cpy(tm_topology_t *topology,int **numbering_loc,int *nb_nodes)
579579
{
580580
int nb_levels;
581581
unsigned int vl = tm_get_verbose_level();
@@ -584,8 +584,8 @@ void topology_numbering_cpy(tm_topology_t *topology,int **numbering,int *nb_node
584584
*nb_nodes = topology->nb_nodes[nb_levels-1];
585585
if(vl >= INFO)
586586
printf("nb_nodes=%d\n",*nb_nodes);
587-
*numbering = (int*)MALLOC(sizeof(int)*(*nb_nodes));
588-
memcpy(*numbering,topology->node_id,sizeof(int)*(*nb_nodes));
587+
*numbering_loc = (int*)MALLOC(sizeof(int)*(*nb_nodes));
588+
memcpy(*numbering_loc,topology->node_id,sizeof(int)*(*nb_nodes));
589589
}
590590

591591
void topology_arity_cpy(tm_topology_t *topology,int **arity,int *nb_levels)
@@ -699,7 +699,7 @@ void optimize_arity(int **arity, double **cost, int *nb_levels,int n)
699699

700700
void tm_optimize_topology(tm_topology_t **topology){
701701
int *arity = NULL,nb_levels;
702-
int *numbering = NULL,nb_nodes;
702+
int *numbering_loc = NULL,nb_nodes;
703703
tm_topology_t *new_topo;
704704
double *cost;
705705
unsigned int vl = tm_get_verbose_level();
@@ -710,13 +710,13 @@ void tm_optimize_topology(tm_topology_t **topology){
710710
tm_display_arity(*topology);
711711

712712
topology_arity_cpy(*topology,&arity,&nb_levels);
713-
topology_numbering_cpy(*topology,&numbering,&nb_nodes);
713+
topology_numbering_cpy(*topology,&numbering_loc,&nb_nodes);
714714
topology_constraints_cpy(*topology,&constraints,&nb_constraints);
715715
topology_cost_cpy(*topology,&cost);
716716

717717

718718
optimize_arity(&arity,&cost,&nb_levels,nb_levels-2);
719-
new_topo = tm_build_synthetic_topology(arity, NULL, nb_levels,numbering,nb_nodes);
719+
new_topo = tm_build_synthetic_topology(arity, NULL, nb_levels,numbering_loc,nb_nodes);
720720
new_topo->cost = cost;
721721
new_topo->constraints = constraints;
722722
new_topo->nb_constraints = nb_constraints;
@@ -736,7 +736,7 @@ void tm_optimize_topology(tm_topology_t **topology){
736736
tm_display_arity(new_topo);
737737
}
738738
FREE(arity);
739-
FREE(numbering);
739+
FREE(numbering_loc);
740740
tm_free_topology(*topology);
741741

742742
*topology = new_topo;

3rd-party/treematch/tm_tree.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1793,7 +1793,7 @@ void group_nodes(tm_affinity_mat_t *aff_mat, tm_tree_t *tab_node, tm_tree_t *new
17931793
/* if(nb_groups>30000||depth>5){*/
17941794
if( nbg > 30000 ){
17951795

1796-
double duration;
1796+
double duration_loc;
17971797

17981798
TIC;
17991799
if( arity <= 2 ){
@@ -1811,9 +1811,9 @@ void group_nodes(tm_affinity_mat_t *aff_mat, tm_tree_t *tab_node, tm_tree_t *new
18111811
val = k_partition_grouping(cost_mat, tab_node, new_tab_node, arity, solution_size);
18121812
}
18131813

1814-
duration = TOC;
1814+
duration_loc = TOC;
18151815
if(verbose_level >= INFO)
1816-
printf("Fast grouping duration=%f\n", duration);
1816+
printf("Fast grouping duration=%f\n", duration_loc);
18171817

18181818
if(verbose_level >= INFO)
18191819
display_grouping(new_tab_node, solution_size, arity, val);

0 commit comments

Comments
 (0)