From 5244f95767968d8b59ef3f2031612b86474e2455 Mon Sep 17 00:00:00 2001 From: Michael Beck Date: Thu, 6 Jan 2011 23:36:57 +0000 Subject: [PATCH] Fixed some 64bit warnings because of mixing size_t and other types. [r28221] --- include/libfirm/adt/hashptr.h | 6 +++--- ir/ana/irbackedge.c | 6 +++--- ir/ana/irlivechk.c | 3 ++- ir/be/becopyheur2.c | 4 ++-- ir/be/becopyheur4.c | 3 ++- ir/be/beloopana.c | 8 ++++---- ir/be/belower.c | 4 ++-- ir/be/beprefalloc.c | 4 ++-- ir/be/bespilldaemel.c | 6 +++--- ir/be/bestat.c | 8 ++++---- ir/be/ia32/ia32_transform.c | 4 ++-- ir/opt/convopt.c | 16 ++++++++-------- ir/tr/tpop.c | 4 ++-- ir/tr/tpop_t.h | 4 ++-- ir/tr/type.c | 4 ++-- ir/tv/fltcalc.c | 4 ++-- ir/tv/fltcalc.h | 4 ++-- ir/tv/strcalc.c | 4 ++-- ir/tv/strcalc.h | 4 ++-- 19 files changed, 51 insertions(+), 49 deletions(-) diff --git a/include/libfirm/adt/hashptr.h b/include/libfirm/adt/hashptr.h index 80cde9580..b8804df90 100644 --- a/include/libfirm/adt/hashptr.h +++ b/include/libfirm/adt/hashptr.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved. + * Copyright (C) 1995-2011 University of Karlsruhe. All right reserved. * * This file is part of libFirm. * @@ -34,9 +34,9 @@ /* Computing x * _FIRM_FNV_FNV_PRIME */ #define _FIRM_FNV_TIMES_PRIME(x) ((x) * _FIRM_FNV_FNV_PRIME) -static inline unsigned firm_fnv_hash(const unsigned char *data, unsigned bytes) +static inline unsigned firm_fnv_hash(const unsigned char *data, size_t bytes) { - unsigned i; + size_t i; unsigned hash = _FIRM_FNV_OFFSET_BASIS; for(i = 0; i < bytes; ++i) { diff --git a/ir/ana/irbackedge.c b/ir/ana/irbackedge.c index 00cdd390c..9bc7b3a30 100644 --- a/ir/ana/irbackedge.c +++ b/ir/ana/irbackedge.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved. + * Copyright (C) 1995-2011 University of Karlsruhe. All right reserved. * * This file is part of libFirm. * @@ -71,8 +71,8 @@ static bitset_t *get_backarray(ir_node *n) #ifndef NDEBUG if (ba) { - int bal = bitset_size(ba); /* avoid macro expansion in assertion. */ - int inl = get_irn_arity(n); + size_t bal = bitset_size(ba); /* avoid macro expansion in assertion. */ + size_t inl = get_irn_arity(n); assert(bal == inl && "backedge array with faulty length"); } #endif diff --git a/ir/ana/irlivechk.c b/ir/ana/irlivechk.c index fb66abd04..c7dcf5172 100644 --- a/ir/ana/irlivechk.c +++ b/ir/ana/irlivechk.c @@ -569,7 +569,8 @@ unsigned lv_chk_bl_xxx(const lv_chk_t *lv, const ir_node *bl, const ir_node *var bitset_t *uses = bitset_alloca(lv->n_blocks); bitset_t *Tq; - unsigned i, min_dom, max_dom; + size_t i; + unsigned min_dom, max_dom; const ir_edge_t *edge; /* if the block has no DFS info, it cannot be reached. diff --git a/ir/be/becopyheur2.c b/ir/be/becopyheur2.c index 27127d131..8a0e5a89c 100644 --- a/ir/be/becopyheur2.c +++ b/ir/be/becopyheur2.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved. + * Copyright (C) 1995-2011 University of Karlsruhe. All right reserved. * * This file is part of libFirm. * @@ -624,7 +624,7 @@ static void node_color_badness(co2_cloud_irn_t *ci, int *badness) admissible_colors(env, ni, bs); if (bitset_popcount(bs) == 1) { - unsigned c = bitset_next_set(bs, 0); + size_t c = bitset_next_set(bs, 0); badness[c] += ci->costs; } diff --git a/ir/be/becopyheur4.c b/ir/be/becopyheur4.c index f41a49c32..4e341fd3d 100644 --- a/ir/be/becopyheur4.c +++ b/ir/be/becopyheur4.c @@ -1421,7 +1421,8 @@ static int co_solve_heuristic_mst(copy_opt_t *co) { unsigned n_regs = co->cls->n_regs; bitset_t *allocatable_regs = bitset_alloca(n_regs); - unsigned i, j, k; + unsigned i, j; + size_t k; ir_node *irn; co_mst_env_t mst_env; diff --git a/ir/be/beloopana.c b/ir/be/beloopana.c index 8c05a5d2a..9074beecd 100644 --- a/ir/be/beloopana.c +++ b/ir/be/beloopana.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved. + * Copyright (C) 1995-2011 University of Karlsruhe. All right reserved. * * This file is part of libFirm. * @@ -78,7 +78,7 @@ static unsigned be_compute_block_pressure(const ir_graph *irg, be_lv_t *lv = be_get_irg_liveness(irg); ir_nodeset_t live_nodes; ir_node *irn; - int max_live; + size_t max_live; DBG((dbg, LEVEL_1, "Processing Block %+F\n", block)); @@ -88,7 +88,7 @@ static unsigned be_compute_block_pressure(const ir_graph *irg, max_live = ir_nodeset_size(&live_nodes); sched_foreach_reverse(block, irn) { - int cnt; + size_t cnt; if (is_Phi(irn)) break; @@ -98,7 +98,7 @@ static unsigned be_compute_block_pressure(const ir_graph *irg, max_live = MAX(cnt, max_live); } - DBG((dbg, LEVEL_1, "Finished with Block %+F (%s %u)\n", block, cls->name, max_live)); + DBG((dbg, LEVEL_1, "Finished with Block %+F (%s %zu)\n", block, cls->name, max_live)); ir_nodeset_destroy(&live_nodes); return max_live; diff --git a/ir/be/belower.c b/ir/be/belower.c index e320bae63..f1d5a17be 100644 --- a/ir/be/belower.c +++ b/ir/be/belower.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved. + * Copyright (C) 1995-2011 University of Karlsruhe. All right reserved. * * This file is part of libFirm. * @@ -786,7 +786,7 @@ void assure_constraints(ir_graph *irg) /* for all */ foreach_ir_nodemap(&cenv.op_set, map_entry, map_iter) { op_copy_assoc_t *entry = (op_copy_assoc_t*)map_entry.data; - int n = ir_nodeset_size(&entry->copies); + size_t n = ir_nodeset_size(&entry->copies); ir_node **nodes = ALLOCAN(ir_node*, n); ir_node *cp; ir_nodeset_iterator_t iter; diff --git a/ir/be/beprefalloc.c b/ir/be/beprefalloc.c index e6cea4fe3..ec4c89477 100644 --- a/ir/be/beprefalloc.c +++ b/ir/be/beprefalloc.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved. + * Copyright (C) 1995-2011 University of Karlsruhe. All right reserved. * * This file is part of libFirm. * @@ -218,7 +218,7 @@ static void give_penalties_for_limits(const ir_nodeset_t *live_nodes, { ir_nodeset_iterator_t iter; unsigned r; - unsigned n_allowed; + size_t n_allowed; allocation_info_t *info = get_allocation_info(node); ir_node *neighbor; diff --git a/ir/be/bespilldaemel.c b/ir/be/bespilldaemel.c index 956a00d48..292d864b3 100644 --- a/ir/be/bespilldaemel.c +++ b/ir/be/bespilldaemel.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved. + * Copyright (C) 1995-2011 University of Karlsruhe. All right reserved. * * This file is part of libFirm. * @@ -57,7 +57,7 @@ DEBUG_ONLY(static firm_dbg_module_t *dbg = NULL;) static spill_env_t *spill_env; -static int n_regs; +static unsigned n_regs; static const arch_register_class_t *cls; static const be_lv_t *lv; static bitset_t *spilled_nodes; @@ -150,7 +150,7 @@ static void do_spilling(ir_nodeset_t *live_nodes, ir_node *node) size_t free_regs_needed = 0; spill_candidate_t *candidates; ir_nodeset_iterator_t iter; - size_t i, arity; + int i, arity; int spills_needed; size_t cand_idx; ir_node *n; diff --git a/ir/be/bestat.c b/ir/be/bestat.c index be0983792..bd2895fe3 100644 --- a/ir/be/bestat.c +++ b/ir/be/bestat.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved. + * Copyright (C) 1995-2011 University of Karlsruhe. All right reserved. * * This file is part of libFirm. * @@ -52,7 +52,7 @@ struct pressure_walker_env_t { be_lv_t *lv; double insn_count; double regpressure; - int max_pressure; + size_t max_pressure; const arch_register_class_t *cls; }; @@ -63,7 +63,7 @@ static void check_reg_pressure_class(pressure_walker_env_t *env, ir_graph *irg = env->irg; ir_node *irn; ir_nodeset_t live_nodes; - int max_live; + size_t max_live; ir_nodeset_init(&live_nodes); be_liveness_end_of_block(env->lv, cls, block, &live_nodes); @@ -71,7 +71,7 @@ static void check_reg_pressure_class(pressure_walker_env_t *env, env->regpressure += max_live; sched_foreach_reverse(block, irn) { - int cnt; + size_t cnt; if (is_Phi(irn)) break; diff --git a/ir/be/ia32/ia32_transform.c b/ir/be/ia32/ia32_transform.c index 58a4010cc..4352afcd2 100644 --- a/ir/be/ia32/ia32_transform.c +++ b/ir/be/ia32/ia32_transform.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved. + * Copyright (C) 1995-2011 University of Karlsruhe. All right reserved. * * This file is part of libFirm. * @@ -2456,7 +2456,7 @@ static ir_node *gen_float_const_Store(ir_node *node, ir_node *cns) ir_node *mem = get_Store_mem(node); dbg_info *dbgi = get_irn_dbg_info(node); int ofs = 0; - size_t i = 0; + int i = 0; ir_node *ins[4]; ia32_address_t addr; diff --git a/ir/opt/convopt.c b/ir/opt/convopt.c index 7a10068f5..9785deaf8 100644 --- a/ir/opt/convopt.c +++ b/ir/opt/convopt.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved. + * Copyright (C) 1995-2011 University of Karlsruhe. All right reserved. * * This file is part of libFirm. * @@ -93,8 +93,8 @@ static int is_downconv(ir_mode *src_mode, ir_mode *dest_mode) static int get_conv_costs(const ir_node *node, ir_mode *dest_mode) { ir_mode *mode = get_irn_mode(node); - size_t arity; - size_t i; + int arity; + int i; int costs; if (mode == dest_mode) @@ -120,8 +120,8 @@ static int get_conv_costs(const ir_node *node, ir_mode *dest_mode) /* Take the minimum of the conversion costs for Phi predecessors as only one * branch is actually executed at a time */ if (is_Phi(node)) { - size_t i; - size_t arity = get_Phi_n_preds(node); + int i; + int arity = get_Phi_n_preds(node); int costs; costs = get_conv_costs(get_Phi_pred(node, 0), dest_mode); @@ -175,9 +175,9 @@ static ir_node *conv_transform(ir_node *node, ir_mode *dest_mode) { ir_mode *mode = get_irn_mode(node); ir_graph *irg = get_irn_irg(node); - size_t arity; - size_t conv_arity; - size_t i; + int arity; + int conv_arity; + int i; ir_node *new_node; ir_node **ins; diff --git a/ir/tr/tpop.c b/ir/tr/tpop.c index d7a92d3b1..1237aacb1 100644 --- a/ir/tr/tpop.c +++ b/ir/tr/tpop.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved. + * Copyright (C) 1995-2011 University of Karlsruhe. All right reserved. * * This file is part of libFirm. * @@ -211,7 +211,7 @@ tp_opcode (get_tpop_code)(const tp_op *op) } /* returns the attribute size of the operator. */ -int (get_tpop_attr_size)(const tp_op *op) +size_t (get_tpop_attr_size)(const tp_op *op) { return _get_tpop_attr_size(op); } diff --git a/ir/tr/tpop_t.h b/ir/tr/tpop_t.h index 4dca8ea31..0035215b2 100644 --- a/ir/tr/tpop_t.h +++ b/ir/tr/tpop_t.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved. + * Copyright (C) 1995-2011 University of Karlsruhe. All right reserved. * * This file is part of libFirm. * @@ -135,7 +135,7 @@ void finish_tpop(void); * @param op The type opcode to get the size for. * @return The size of the attribute of types with this opcode. */ -int get_tpop_attr_size (const tp_op *op); +size_t get_tpop_attr_size(const tp_op *op); /* ---------------- * diff --git a/ir/tr/type.c b/ir/tr/type.c index 3f909d3b2..de55dcfb8 100644 --- a/ir/tr/type.c +++ b/ir/tr/type.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved. + * Copyright (C) 1995-2011 University of Karlsruhe. All right reserved. * * This file is part of libFirm. * @@ -145,7 +145,7 @@ void (inc_master_type_visited)(void) ir_type *new_type(const tp_op *type_op, ir_mode *mode, type_dbg_info *db) { ir_type *res; - int node_size; + size_t node_size; node_size = offsetof(ir_type, attr) + type_op->attr_size; res = (ir_type*)xmalloc(node_size); diff --git a/ir/tv/fltcalc.c b/ir/tv/fltcalc.c index 60e2aff03..3230541c7 100644 --- a/ir/tv/fltcalc.c +++ b/ir/tv/fltcalc.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1995-2010 University of Karlsruhe. All right reserved. + * Copyright (C) 1995-2011 University of Karlsruhe. All right reserved. * * This file is part of libFirm. * @@ -849,7 +849,7 @@ int fc_get_buffer_length(void) return calc_buffer_size; } -void *fc_val_from_str(const char *str, unsigned int len, const ieee_descriptor_t *desc, void *result) +void *fc_val_from_str(const char *str, size_t len, const ieee_descriptor_t *desc, void *result) { char *buffer; diff --git a/ir/tv/fltcalc.h b/ir/tv/fltcalc.h index ccd6e85ec..a71e779fb 100644 --- a/ir/tv/fltcalc.h +++ b/ir/tv/fltcalc.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved. + * Copyright (C) 1995-2011 University of Karlsruhe. All right reserved. * * This file is part of libFirm. * @@ -89,7 +89,7 @@ const void *fc_get_buffer(void); int fc_get_buffer_length(void); /*}@*/ -void *fc_val_from_str(const char *str, unsigned int len, const ieee_descriptor_t *desc, void *result); +void *fc_val_from_str(const char *str, size_t len, const ieee_descriptor_t *desc, void *result); /** get the representation of a floating point value * This function tries to builds a representation having the same value as the diff --git a/ir/tv/strcalc.c b/ir/tv/strcalc.c index 04257c435..1f77823c9 100644 --- a/ir/tv/strcalc.c +++ b/ir/tv/strcalc.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved. + * Copyright (C) 1995-2011 University of Karlsruhe. All right reserved. * * This file is part of libFirm. * @@ -831,7 +831,7 @@ static inline void check_ascii(void) } int sc_val_from_str(char sign, unsigned base, const char *str, - unsigned int len, void *buffer) + size_t len, void *buffer) { char *sc_base, *val; diff --git a/ir/tv/strcalc.h b/ir/tv/strcalc.h index 5f5bb69d7..cea758fa3 100644 --- a/ir/tv/strcalc.h +++ b/ir/tv/strcalc.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved. + * Copyright (C) 1995-2011 University of Karlsruhe. All right reserved. * * This file is part of libFirm. * @@ -196,7 +196,7 @@ void sign_extend(void *buffer, ir_mode *mode); * @return 1 if ok, 0 in case of parse error */ int sc_val_from_str(char sign, unsigned base, const char *str, - unsigned int len, void *buffer); + size_t len, void *buffer); /** create a value from a long */ void sc_val_from_long(long l, void *buffer); -- 2.20.1