From 69569a7edb027e6185cb9a91f800f20be29bc816 Mon Sep 17 00:00:00 2001 From: Matthias Braun Date: Mon, 5 Dec 2011 13:38:50 +0100 Subject: [PATCH] pbqp: add pbqp_ prefix to fix nameclashes --- ir/kaps/brute_force.c | 4 ++-- ir/kaps/heuristical.c | 2 +- ir/kaps/heuristical_co.c | 2 +- ir/kaps/heuristical_co_ld.c | 4 ++-- ir/kaps/html_dumper.c | 26 ++++++++++----------- ir/kaps/html_dumper.h | 8 +++---- ir/kaps/optimal.c | 46 ++++++++++++++++++------------------- 7 files changed, 46 insertions(+), 46 deletions(-) diff --git a/ir/kaps/brute_force.c b/ir/kaps/brute_force.c index 4c3e8ef87..ca8f97582 100644 --- a/ir/kaps/brute_force.c +++ b/ir/kaps/brute_force.c @@ -155,7 +155,7 @@ static void apply_Brute_Force(pbqp_t *pbqp) if (pbqp->dump_file) { char txt[100]; sprintf(txt, "BF-Reduction of Node n%d", node->index); - dump_section(pbqp->dump_file, 2, txt); + pbqp_dump_section(pbqp->dump_file, 2, txt); pbqp_dump_graph(pbqp); } #endif @@ -320,7 +320,7 @@ static void back_propagate_brute_force(pbqp_t *pbqp) #if KAPS_DUMP if (pbqp->dump_file) { - dump_section(pbqp->dump_file, 2, "Back Propagation"); + pbqp_dump_section(pbqp->dump_file, 2, "Back Propagation"); } #endif diff --git a/ir/kaps/heuristical.c b/ir/kaps/heuristical.c index 98a6e3f05..18ef165ad 100644 --- a/ir/kaps/heuristical.c +++ b/ir/kaps/heuristical.c @@ -60,7 +60,7 @@ static void apply_RN(pbqp_t *pbqp) if (pbqp->dump_file) { char txt[100]; sprintf(txt, "RN-Reduction of Node n%d", node->index); - dump_section(pbqp->dump_file, 2, txt); + pbqp_dump_section(pbqp->dump_file, 2, txt); pbqp_dump_graph(pbqp); } #endif diff --git a/ir/kaps/heuristical_co.c b/ir/kaps/heuristical_co.c index f3bc582a4..06e7e7c0e 100644 --- a/ir/kaps/heuristical_co.c +++ b/ir/kaps/heuristical_co.c @@ -85,7 +85,7 @@ static void apply_RN_co(pbqp_t *pbqp) if (pbqp->dump_file) { char txt[100]; sprintf(txt, "RN-Reduction of Node n%d", node->index); - dump_section(pbqp->dump_file, 2, txt); + pbqp_dump_section(pbqp->dump_file, 2, txt); pbqp_dump_graph(pbqp); } #endif diff --git a/ir/kaps/heuristical_co_ld.c b/ir/kaps/heuristical_co_ld.c index c0b5f217f..fe7db8cee 100644 --- a/ir/kaps/heuristical_co_ld.c +++ b/ir/kaps/heuristical_co_ld.c @@ -182,7 +182,7 @@ static void back_propagate_ld(pbqp_t *pbqp) #if KAPS_DUMP if (pbqp->dump_file) { - dump_section(pbqp->dump_file, 2, "Back Propagation"); + pbqp_dump_section(pbqp->dump_file, 2, "Back Propagation"); } #endif @@ -241,7 +241,7 @@ static void apply_RN_co_without_selection(pbqp_t *pbqp) if (pbqp->dump_file) { char txt[100]; sprintf(txt, "RN-Reduction of Node n%d", node->index); - dump_section(pbqp->dump_file, 2, txt); + pbqp_dump_section(pbqp->dump_file, 2, txt); pbqp_dump_graph(pbqp); } #endif diff --git a/ir/kaps/html_dumper.c b/ir/kaps/html_dumper.c index cda6cf85f..a9dd2f199 100644 --- a/ir/kaps/html_dumper.c +++ b/ir/kaps/html_dumper.c @@ -86,7 +86,7 @@ static void dump_matrix(FILE *f, pbqp_matrix_t *mat) fprintf(f, "\t\\end{pmatrix}\n"); } -void dump_edge(FILE *file, pbqp_edge_t *edge) +void pbqp_dump_edge(FILE *file, pbqp_edge_t *edge) { fputs("\n", file); fprintf(file, "\t\\overline\n{C}_{%u,%u}=\n", @@ -113,14 +113,14 @@ static void dump_edge_costs(pbqp_t *pbqp) pbqp_edge_t *edge = src_node->edges[edge_index]; unsigned tgt_index = edge->tgt->index; if (src_index < tgt_index) { - dump_edge(pbqp->dump_file, edge); + pbqp_dump_edge(pbqp->dump_file, edge); } } } fputs("

", pbqp->dump_file); } -void dump_node(FILE *file, pbqp_node_t *node) +void pbqp_dump_node(FILE *file, pbqp_node_t *node) { if (node) { fprintf(file, "\tc%u = ", node->index); @@ -136,12 +136,12 @@ static void dump_node_costs(pbqp_t *pbqp) /* dump node costs */ fputs("

", pbqp->dump_file); for (index = 0; index < pbqp->num_nodes; ++index) { - dump_node(pbqp->dump_file, get_node(pbqp, index)); + pbqp_dump_node(pbqp->dump_file, get_node(pbqp, index)); } fputs("

", pbqp->dump_file); } -void dump_section(FILE *f, int level, const char *txt) +void pbqp_dump_section(FILE *f, int level, const char *txt) { fprintf(f, "%s\n", level, txt, level); } @@ -188,18 +188,18 @@ void pbqp_dump_graph(pbqp_t *pbqp) void pbqp_dump_input(pbqp_t *pbqp) { - dump_section(pbqp->dump_file, 1, "1. PBQP Problem"); - dump_section(pbqp->dump_file, 2, "1.1 Topology"); + pbqp_dump_section(pbqp->dump_file, 1, "1. PBQP Problem"); + pbqp_dump_section(pbqp->dump_file, 2, "1.1 Topology"); pbqp_dump_graph(pbqp); - dump_section(pbqp->dump_file, 2, "1.2 Cost Vectors"); + pbqp_dump_section(pbqp->dump_file, 2, "1.2 Cost Vectors"); dump_node_costs(pbqp); - dump_section(pbqp->dump_file, 2, "1.3 Cost Matrices"); + pbqp_dump_section(pbqp->dump_file, 2, "1.3 Cost Matrices"); dump_edge_costs(pbqp); } -void dump_simplifyedge(pbqp_t *pbqp, pbqp_edge_t *edge) +void pbqp_dump_simplifyedge(pbqp_t *pbqp, pbqp_edge_t *edge) { - dump_node(pbqp->dump_file, edge->src); - dump_edge(pbqp->dump_file, edge); - dump_node(pbqp->dump_file, edge->tgt); + pbqp_dump_node(pbqp->dump_file, edge->src); + pbqp_dump_edge(pbqp->dump_file, edge); + pbqp_dump_node(pbqp->dump_file, edge->tgt); } diff --git a/ir/kaps/html_dumper.h b/ir/kaps/html_dumper.h index 62af221f5..7beadf6c8 100644 --- a/ir/kaps/html_dumper.h +++ b/ir/kaps/html_dumper.h @@ -32,11 +32,11 @@ void pbqp_dump_input(pbqp_t *pbqp); void pbqp_dump_graph(pbqp_t *pbqp); -void dump_simplifyedge(pbqp_t *pbqp, pbqp_edge_t *edge); +void pbqp_dump_simplifyedge(pbqp_t *pbqp, pbqp_edge_t *edge); -void dump_section(FILE *f, int level, const char *txt); +void pbqp_dump_section(FILE *f, int level, const char *txt); -void dump_node(FILE *file, pbqp_node_t *node); -void dump_edge(FILE *file, pbqp_edge_t *edge); +void pbqp_dump_node(FILE *file, pbqp_node_t *node); +void pbqp_dump_edge(FILE *file, pbqp_edge_t *edge); #endif /* KAPS_HTML_DUMPER_H */ diff --git a/ir/kaps/optimal.c b/ir/kaps/optimal.c index b5f3a0eab..802534c58 100644 --- a/ir/kaps/optimal.c +++ b/ir/kaps/optimal.c @@ -328,7 +328,7 @@ static void merge_source_into_target(pbqp_t *pbqp, pbqp_edge_t *edge) if (pbqp->dump_file) { char txt[100]; sprintf(txt, "Merging n%d into n%d", src_node->index, tgt_node->index); - dump_section(pbqp->dump_file, 3, txt); + pbqp_dump_section(pbqp->dump_file, 3, txt); } #endif @@ -490,7 +490,7 @@ static void merge_target_into_source(pbqp_t *pbqp, pbqp_edge_t *edge) if (pbqp->dump_file) { char txt[100]; sprintf(txt, "Merging n%d into n%d", tgt_node->index, src_node->index); - dump_section(pbqp->dump_file, 3, txt); + pbqp_dump_section(pbqp->dump_file, 3, txt); } #endif @@ -673,7 +673,7 @@ void simplify_edge(pbqp_t *pbqp, pbqp_edge_t *edge) if (pbqp->dump_file) { char txt[100]; sprintf(txt, "Simplification of Edge n%d-n%d", src_node->index, tgt_node->index); - dump_section(pbqp->dump_file, 3, txt); + pbqp_dump_section(pbqp->dump_file, 3, txt); } #endif @@ -690,7 +690,7 @@ void simplify_edge(pbqp_t *pbqp, pbqp_edge_t *edge) #if KAPS_DUMP if (pbqp->dump_file) { fputs("Input:
\n", pbqp->dump_file); - dump_simplifyedge(pbqp, edge); + pbqp_dump_simplifyedge(pbqp, edge); } #endif @@ -700,7 +700,7 @@ void simplify_edge(pbqp_t *pbqp, pbqp_edge_t *edge) #if KAPS_DUMP if (pbqp->dump_file) { fputs("
\nOutput:
\n", pbqp->dump_file); - dump_simplifyedge(pbqp, edge); + pbqp_dump_simplifyedge(pbqp, edge); } #endif @@ -732,7 +732,7 @@ void initial_simplify_edges(pbqp_t *pbqp) #if KAPS_DUMP if (pbqp->dump_file) { pbqp_dump_input(pbqp); - dump_section(pbqp->dump_file, 1, "2. Simplification of Cost Matrices"); + pbqp_dump_section(pbqp->dump_file, 1, "2. Simplification of Cost Matrices"); } #endif @@ -789,8 +789,8 @@ num determine_solution(pbqp_t *pbqp) file = pbqp->dump_file; if (file) { - dump_section(file, 1, "4. Determine Solution/Minimum"); - dump_section(file, 2, "4.1. Trivial Solution"); + pbqp_dump_section(file, 1, "4. Determine Solution/Minimum"); + pbqp_dump_section(file, 2, "4.1. Trivial Solution"); } #endif @@ -811,14 +811,14 @@ num determine_solution(pbqp_t *pbqp) #if KAPS_DUMP if (file) { fprintf(file, "node n%d is set to %d
\n", node->index, node->solution); - dump_node(file, node); + pbqp_dump_node(file, node); } #endif } #if KAPS_DUMP if (file) { - dump_section(file, 2, "Minimum"); + pbqp_dump_section(file, 2, "Minimum"); #if KAPS_USE_UNSIGNED fprintf(file, "Minimum is equal to %u.", solution); #else @@ -948,7 +948,7 @@ void back_propagate(pbqp_t *pbqp) #if KAPS_DUMP if (pbqp->dump_file) { - dump_section(pbqp->dump_file, 2, "Back Propagation"); + pbqp_dump_section(pbqp->dump_file, 2, "Back Propagation"); } #endif @@ -996,12 +996,12 @@ void apply_RI(pbqp_t *pbqp) if (pbqp->dump_file) { char txt[100]; sprintf(txt, "RI-Reduction of Node n%d", node->index); - dump_section(pbqp->dump_file, 2, txt); + pbqp_dump_section(pbqp->dump_file, 2, txt); pbqp_dump_graph(pbqp); fputs("
\nBefore reduction:
\n", pbqp->dump_file); - dump_node(pbqp->dump_file, node); - dump_node(pbqp->dump_file, other_node); - dump_edge(pbqp->dump_file, edge); + pbqp_dump_node(pbqp->dump_file, node); + pbqp_dump_node(pbqp->dump_file, other_node); + pbqp_dump_edge(pbqp->dump_file, edge); } #endif @@ -1017,7 +1017,7 @@ void apply_RI(pbqp_t *pbqp) #if KAPS_DUMP if (pbqp->dump_file) { fputs("
\nAfter reduction:
\n", pbqp->dump_file); - dump_node(pbqp->dump_file, other_node); + pbqp_dump_node(pbqp->dump_file, other_node); } #endif @@ -1088,14 +1088,14 @@ void apply_RII(pbqp_t *pbqp) if (pbqp->dump_file) { char txt[100]; sprintf(txt, "RII-Reduction of Node n%d", node->index); - dump_section(pbqp->dump_file, 2, txt); + pbqp_dump_section(pbqp->dump_file, 2, txt); pbqp_dump_graph(pbqp); fputs("
\nBefore reduction:
\n", pbqp->dump_file); - dump_node(pbqp->dump_file, src_node); - dump_edge(pbqp->dump_file, src_edge); - dump_node(pbqp->dump_file, node); - dump_edge(pbqp->dump_file, tgt_edge); - dump_node(pbqp->dump_file, tgt_node); + pbqp_dump_node(pbqp->dump_file, src_node); + pbqp_dump_edge(pbqp->dump_file, src_edge); + pbqp_dump_node(pbqp->dump_file, node); + pbqp_dump_edge(pbqp->dump_file, tgt_edge); + pbqp_dump_node(pbqp->dump_file, tgt_node); } #endif @@ -1162,7 +1162,7 @@ void apply_RII(pbqp_t *pbqp) #if KAPS_DUMP if (pbqp->dump_file) { fputs("
\nAfter reduction:
\n", pbqp->dump_file); - dump_edge(pbqp->dump_file, edge); + pbqp_dump_edge(pbqp->dump_file, edge); } #endif -- 2.20.1