summaryrefslogtreecommitdiffhomepage
path: root/ir/kaps
diff options
context:
space:
mode:
authorMatthias Braun <matze@braunis.de>2011-06-20 19:47:51 +0200
committerMatthias Braun <matze@braunis.de>2011-06-21 20:05:11 +0200
commit8ccfe04ca59ff56fc32b2323b80cee2a5194694d (patch)
tree3b0173d80029bbf7cdedcd2c24792b495946c588 /ir/kaps
parent89ac4d2c92d3aa5fa50bac6944c3db6fb1e1fdd1 (diff)
fix more cparser warnings, cleanup some libcore code
Diffstat (limited to 'ir/kaps')
-rw-r--r--ir/kaps/brute_force.c1
-rw-r--r--ir/kaps/optimal.c9
-rw-r--r--ir/kaps/pbqp_t.h4
3 files changed, 5 insertions, 9 deletions
diff --git a/ir/kaps/brute_force.c b/ir/kaps/brute_force.c
index a819107..32a1488 100644
--- a/ir/kaps/brute_force.c
+++ b/ir/kaps/brute_force.c
@@ -337,7 +337,6 @@ static void back_propagate_brute_force(pbqp_t *pbqp)
break;
default:
panic("Only nodes with degree one or two should be in this bucket");
- break;
}
}
}
diff --git a/ir/kaps/optimal.c b/ir/kaps/optimal.c
index a37bc2f..221bdda 100644
--- a/ir/kaps/optimal.c
+++ b/ir/kaps/optimal.c
@@ -47,7 +47,7 @@
#include "timing.h"
pbqp_edge_t **edge_bucket;
-pbqp_edge_t **rm_bucket;
+static pbqp_edge_t **rm_bucket;
pbqp_node_t **node_buckets[4];
pbqp_node_t **reduced_bucket = NULL;
pbqp_node_t *merged_node = NULL;
@@ -271,7 +271,6 @@ static void merge_source_into_target(pbqp_t *pbqp, pbqp_edge_t *edge)
unsigned *mapping;
unsigned src_len;
unsigned tgt_len;
- unsigned src_index;
unsigned tgt_index;
unsigned edge_index;
unsigned edge_len;
@@ -296,6 +295,7 @@ static void merge_source_into_target(pbqp_t *pbqp, pbqp_edge_t *edge)
/* Check that each column has at most one zero entry. */
for (tgt_index = 0; tgt_index < tgt_len; ++tgt_index) {
unsigned onlyOneZero = 0;
+ unsigned src_index;
if (tgt_vec->entries[tgt_index].data == INF_COSTS)
continue;
@@ -343,7 +343,6 @@ static void merge_source_into_target(pbqp_t *pbqp, pbqp_edge_t *edge)
vector_t *other_vec;
unsigned other_len;
unsigned other_index;
- unsigned tgt_index;
assert(old_edge);
if (old_edge == edge)
@@ -435,7 +434,6 @@ static void merge_target_into_source(pbqp_t *pbqp, pbqp_edge_t *edge)
unsigned src_len;
unsigned tgt_len;
unsigned src_index;
- unsigned tgt_index;
unsigned edge_index;
unsigned edge_len;
@@ -459,6 +457,7 @@ static void merge_target_into_source(pbqp_t *pbqp, pbqp_edge_t *edge)
/* Check that each row has at most one zero entry. */
for (src_index = 0; src_index < src_len; ++src_index) {
unsigned onlyOneZero = 0;
+ unsigned tgt_index;
if (src_vec->entries[src_index].data == INF_COSTS)
continue;
@@ -506,7 +505,6 @@ static void merge_target_into_source(pbqp_t *pbqp, pbqp_edge_t *edge)
vector_t *other_vec;
unsigned other_len;
unsigned other_index;
- unsigned src_index;
assert(old_edge);
@@ -967,7 +965,6 @@ void back_propagate(pbqp_t *pbqp)
break;
default:
panic("Only nodes with degree one or two should be in this bucket");
- break;
}
}
}
diff --git a/ir/kaps/pbqp_t.h b/ir/kaps/pbqp_t.h
index 11cb51c..b2db379 100644
--- a/ir/kaps/pbqp_t.h
+++ b/ir/kaps/pbqp_t.h
@@ -41,10 +41,10 @@
#if KAPS_USE_UNSIGNED
typedef unsigned num;
- static const num INF_COSTS = UINT_MAX;
+ #define INF_COSTS UINT_MAX
#else
typedef intmax_t num;
- static const num INF_COSTS = INTMAX_MAX;
+ #define INF_COSTS INTMAX_MAX
#endif
#include "matrix_t.h"