From: Matthias Braun Date: Mon, 18 Jun 2007 14:05:31 +0000 (+0000) Subject: fixed warnings X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=f430a768a5b70618597871d6bbc1c212d2b325c1;p=libfirm fixed warnings [r14598] --- diff --git a/ir/stat/const_stat.c b/ir/stat/const_stat.c index 1b0fad0c8..8a824c7b9 100644 --- a/ir/stat/const_stat.c +++ b/ir/stat/const_stat.c @@ -95,6 +95,7 @@ void stat_update_const(stat_info_t *status, ir_node *node, graph_entry_t *graph) ir_mode *mode = get_irn_mode(node); tarval *tv; unsigned bits; + (void) graph; if (mode_is_int(mode)) { tv = get_Const_tarval(node); @@ -121,7 +122,7 @@ void stat_update_const(stat_info_t *status, ir_node *node, graph_entry_t *graph) /* clears the const statistics for a new snapshot */ void stat_const_clear(stat_info_t *status) { - int i; + size_t i; for (i = 0; i < ARR_SIZE(status->const_info.int_bits_count); ++i) cnt_clr(&status->const_info.int_bits_count[i]); @@ -134,5 +135,6 @@ void stat_const_clear(stat_info_t *status) { /* initialize the Const statistic. */ void stat_init_const_cnt(stat_info_t *status) { + (void) status; /* currently nothing */ } diff --git a/ir/stat/counter.h b/ir/stat/counter.h index 9bcbbaf6f..223bc4ea9 100644 --- a/ir/stat/counter.h +++ b/ir/stat/counter.h @@ -64,7 +64,7 @@ static INLINE void cnt_dec(counter_t *cnt) int i; for (i = 0; i < STAT_CNT_NUM; ++i) { - if (--cnt->cnt[i] != -1) + if (--cnt->cnt[i] != (unsigned) -1) break; } } diff --git a/ir/stat/dags.c b/ir/stat/dags.c index 88904afd4..f1ee38427 100644 --- a/ir/stat/dags.c +++ b/ir/stat/dags.c @@ -360,6 +360,7 @@ void count_dags_in_graph(graph_entry_t *global, graph_entry_t *graph) dag_env_t root_env; dag_entry_t *entry; unsigned id; + (void) global; /* do NOT check the const code irg */ if (graph->irg == get_const_code_irg()) diff --git a/ir/stat/distrib.c b/ir/stat/distrib.c index 82100e764..4a74b0416 100644 --- a/ir/stat/distrib.c +++ b/ir/stat/distrib.c @@ -210,7 +210,7 @@ double stat_calc_mean_distrib_tbl(distrib_tbl_t *tbl) { if (value < min) min = value; - if (value > max); + if (value > max) max = value; sum += cnt_to_dbl(&entry->cnt); diff --git a/ir/stat/firmstat.c b/ir/stat/firmstat.c index 3c7170e94..a2f822d92 100644 --- a/ir/stat/firmstat.c +++ b/ir/stat/firmstat.c @@ -195,6 +195,7 @@ static int opcode_cmp_2(const void *elt, const void *key) { static int address_mark_cmp(const void *elt, const void *key, size_t size) { const address_mark_entry_t *e1 = elt; const address_mark_entry_t *e2 = key; + (void) size; /* compare only the nodes, the rest is used as data container */ return e1->node != e2->node; @@ -287,7 +288,7 @@ static graph_entry_t *graph_get_entry(ir_graph *irg, hmap_graph_entry_t *hmap) { graph_entry_t key; graph_entry_t *elem; - int i; + size_t i; key.irg = irg; @@ -1245,6 +1246,7 @@ static void update_graph_stat(graph_entry_t *global, graph_entry_t *graph) */ static void update_graph_stat_2(graph_entry_t *global, graph_entry_t *graph) { + (void) global; if (graph->is_deleted) { /* deleted, ignore */ return; @@ -1381,6 +1383,7 @@ ir_op *stat_get_op_from_opcode(ir_opcode code) { * @param op the new IR opcode that was created. */ static void stat_new_ir_op(void *ctx, ir_op *op) { + (void) ctx; if (! status->stat_options) return; @@ -1403,6 +1406,8 @@ static void stat_new_ir_op(void *ctx, ir_op *op) { * @param op the IR opcode that is freed */ static void stat_free_ir_op(void *ctx, ir_op *op) { + (void) ctx; + (void) op; if (! status->stat_options) return; @@ -1420,6 +1425,8 @@ static void stat_free_ir_op(void *ctx, ir_op *op) { * @param node the new IR node that was created */ static void stat_new_node(void *ctx, ir_graph *irg, ir_node *node) { + (void) ctx; + (void) irg; if (! status->stat_options) return; @@ -1453,6 +1460,7 @@ static void stat_new_node(void *ctx, ir_graph *irg, ir_node *node) { * @param node the IR node that will be turned into an ID */ static void stat_turn_into_id(void *ctx, ir_node *node) { + (void) ctx; if (! status->stat_options) return; @@ -1483,6 +1491,7 @@ static void stat_turn_into_id(void *ctx, ir_node *node) { * @param ent the entity of this graph */ static void stat_new_graph(void *ctx, ir_graph *irg, ir_entity *ent) { + (void) ctx; if (! status->stat_options) return; @@ -1513,6 +1522,7 @@ static void stat_new_graph(void *ctx, ir_graph *irg, ir_entity *ent) { * information from being changed, it's "frozen" from now. */ static void stat_free_graph(void *ctx, ir_graph *irg) { + (void) ctx; if (! status->stat_options) return; @@ -1541,6 +1551,9 @@ static void stat_free_graph(void *ctx, ir_graph *irg) { */ static void stat_irg_walk(void *ctx, ir_graph *irg, generic_func *pre, generic_func *post) { + (void) ctx; + (void) pre; + (void) post; if (! status->stat_options) return; @@ -1578,6 +1591,10 @@ static void stat_irg_walk_blkwise(void *ctx, ir_graph *irg, generic_func *pre, g */ static void stat_irg_block_walk(void *ctx, ir_graph *irg, ir_node *node, generic_func *pre, generic_func *post) { + (void) ctx; + (void) node; + (void) pre; + (void) post; if (! status->stat_options) return; @@ -1615,6 +1632,7 @@ static void stat_merge_nodes( ir_node **old_node_array, int old_num_entries, hook_opt_kind opt) { + (void) ctx; if (! status->stat_options) return; @@ -1658,6 +1676,7 @@ static void stat_merge_nodes( * @param flag if non-zero, reassociation is started else stopped */ static void stat_reassociate(void *ctx, int flag) { + (void) ctx; if (! status->stat_options) return; @@ -1675,6 +1694,7 @@ static void stat_reassociate(void *ctx, int flag) { * @param node the IR node that will be lowered */ static void stat_lower(void *ctx, ir_node *node) { + (void) ctx; if (! status->stat_options) return; @@ -1697,6 +1717,7 @@ static void stat_lower(void *ctx, ir_node *node) { */ static void stat_inline(void *ctx, ir_node *call, ir_graph *called_irg) { + (void) ctx; if (! status->stat_options) return; @@ -1718,6 +1739,7 @@ static void stat_inline(void *ctx, ir_node *call, ir_graph *called_irg) * @param ctx the hook context */ static void stat_tail_rec(void *ctx, ir_graph *irg, int n_calls) { + (void) ctx; if (! status->stat_options) return; @@ -1736,6 +1758,7 @@ static void stat_tail_rec(void *ctx, ir_graph *irg, int n_calls) { * @param ctx the hook context */ static void stat_strength_red(void *ctx, ir_graph *irg, ir_node *strong) { + (void) ctx; if (! status->stat_options) return; @@ -1755,6 +1778,8 @@ static void stat_strength_red(void *ctx, ir_graph *irg, ir_node *strong) { * @param ctx the hook context */ static void stat_dead_node_elim(void *ctx, ir_graph *irg, int start) { + (void) ctx; + (void) irg; if (! status->stat_options) return; @@ -1767,6 +1792,10 @@ static void stat_dead_node_elim(void *ctx, ir_graph *irg, int start) { static void stat_if_conversion(void *context, ir_graph *irg, ir_node *phi, int pos, ir_node *mux, if_result_t reason) { + (void) context; + (void) phi; + (void) pos; + (void) mux; if (! status->stat_options) return; @@ -1784,6 +1813,8 @@ static void stat_if_conversion(void *context, ir_graph *irg, ir_node *phi, */ static void stat_func_call(void *context, ir_graph *irg, ir_node *call) { + (void) context; + (void) call; if (! status->stat_options) return; @@ -1802,6 +1833,7 @@ static void stat_func_call(void *context, ir_graph *irg, ir_node *call) * @param ctx the hook context */ static void stat_arch_dep_replace_mul_with_shifts(void *ctx, ir_node *mul) { + (void) ctx; if (! status->stat_options) return; @@ -1820,6 +1852,7 @@ static void stat_arch_dep_replace_mul_with_shifts(void *ctx, ir_node *mul) { * @param node the division node that will be optimized */ static void stat_arch_dep_replace_division_by_const(void *ctx, ir_node *node) { + (void) ctx; if (! status->stat_options) return; @@ -2001,7 +2034,7 @@ void stat_dump_snapshot(const char *name, const char *phase) ++p; l = p - name; - if (l > sizeof(fname) - 1) + if (l > (int) (sizeof(fname) - 1)) l = sizeof(fname) - 1; memcpy(fname, name, l); diff --git a/ir/stat/pattern.c b/ir/stat/pattern.c index b213faeb0..00ab38fc6 100644 --- a/ir/stat/pattern.c +++ b/ir/stat/pattern.c @@ -375,6 +375,7 @@ typedef struct _addr_entry_t { static int addr_cmp(const void *p1, const void *p2, size_t size) { const addr_entry_t *e1 = p1; const addr_entry_t *e2 = p2; + (void) size; return e1->addr != e2->addr; } /* addr_cmp */ @@ -876,6 +877,7 @@ void stat_init_pattern_history(int enable) { * Finish the pattern history. */ void stat_finish_pattern_history(const char *fname) { + (void) fname; if (! status->enable) return; diff --git a/ir/stat/pattern_dmp.c b/ir/stat/pattern_dmp.c index d2b42401e..d8752fc13 100644 --- a/ir/stat/pattern_dmp.c +++ b/ir/stat/pattern_dmp.c @@ -173,6 +173,7 @@ static void vcg_dump_node(pattern_dumper_t *self, unsigned id, static void vcg_dump_edge(pattern_dumper_t *self, unsigned tgt, unsigned src, unsigned pos, unsigned mode_code) { vcg_private_t *priv = self->data; + (void) mode_code; if (priv->pattern_id > priv->max_pattern) return; @@ -229,6 +230,7 @@ static void stdout_dump_node(pattern_dumper_t *self, unsigned id, unsigned op_co FILE *f = self->data; ir_op *op = stat_get_op_from_opcode(op_code); ir_mode *mode = (ir_mode *)mode_code; + (void) attr; /* if (env->options & OPT_ENC_GRAPH) */ fprintf(f, "%u:", id); @@ -255,6 +257,10 @@ static void stdout_dump_ref(pattern_dumper_t *self, unsigned id) static void stdout_dump_edge(pattern_dumper_t *self, unsigned tgt, unsigned src, unsigned pos, unsigned mode_code) { FILE *f = self->data; + (void) tgt; + (void) src; + (void) pos; + (void) mode_code; if (pos > 0) fprintf(f, ", "); @@ -266,6 +272,7 @@ static void stdout_dump_edge(pattern_dumper_t *self, unsigned tgt, unsigned src, static void stdout_start_children(pattern_dumper_t *self, unsigned id) { FILE *f = self->data; + (void) id; fprintf(f, "("); } /* stdout_start_children */ @@ -276,6 +283,7 @@ static void stdout_start_children(pattern_dumper_t *self, unsigned id) static void stdout_finish_children(pattern_dumper_t *self, unsigned id) { FILE *f = self->data; + (void) id; fprintf(f, ")"); } /* stdout_finish_children */ diff --git a/ir/stat/stat_dmp.c b/ir/stat/stat_dmp.c index 72f2bd0f4..9c68f5b96 100644 --- a/ir/stat/stat_dmp.c +++ b/ir/stat/stat_dmp.c @@ -155,8 +155,8 @@ static void simple_dump_opcode_hash(dumper_t *dmp, pset *set) */ static void simple_dump_opt_hash(dumper_t *dmp, pset *set, int index) { - assert(index < ARR_SIZE(opt_names) && "index out of range"); - assert(opt_names[index].kind == index && "opt_names broken"); + assert(index < (int) ARR_SIZE(opt_names) && "index out of range"); + assert((int) opt_names[index].kind == index && "opt_names broken"); if (pset_count(set) > 0) { opt_entry_t *entry; @@ -461,7 +461,7 @@ static void simple_dump_graph(dumper_t *dmp, graph_entry_t *entry) /* effects of optimizations */ if (dump_opts) { - int i; + size_t i; simple_dump_real_func_calls(dmp, &entry->cnt[gcnt_acc_real_func_call]); simple_dump_tail_recursion(dmp, entry->num_tail_recursion); @@ -516,7 +516,7 @@ static void simple_dump_graph(dumper_t *dmp, graph_entry_t *entry) */ static void simple_dump_const_tbl(dumper_t *dmp, const constant_info_t *tbl) { - int i; + size_t i; counter_t sum; if (! dmp->f) @@ -691,6 +691,8 @@ static void csv_dump_graph(dumper_t *dmp, graph_entry_t *entry) */ static void csv_dump_const_tbl(dumper_t *dmp, const constant_info_t *tbl) { + (void) dmp; + (void) tbl; /* FIXME: NYI */ } /* csv_dump_const_tbl */ @@ -698,6 +700,9 @@ static void csv_dump_const_tbl(dumper_t *dmp, const constant_info_t *tbl) * dumps the parameter distribution table */ static void csv_dump_param_tbl(dumper_t *dmp, const distrib_tbl_t *tbl, graph_entry_t *global) { + (void) dmp; + (void) tbl; + (void) global; /* FIXME: NYI */ } /* csv_dump_param_tbl */