Fixed some 64bit warnings because of mixing size_t and other types.
authorMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Thu, 6 Jan 2011 23:36:57 +0000 (23:36 +0000)
committerMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Thu, 6 Jan 2011 23:36:57 +0000 (23:36 +0000)
[r28221]

19 files changed:
include/libfirm/adt/hashptr.h
ir/ana/irbackedge.c
ir/ana/irlivechk.c
ir/be/becopyheur2.c
ir/be/becopyheur4.c
ir/be/beloopana.c
ir/be/belower.c
ir/be/beprefalloc.c
ir/be/bespilldaemel.c
ir/be/bestat.c
ir/be/ia32/ia32_transform.c
ir/opt/convopt.c
ir/tr/tpop.c
ir/tr/tpop_t.h
ir/tr/type.c
ir/tv/fltcalc.c
ir/tv/fltcalc.h
ir/tv/strcalc.c
ir/tv/strcalc.h

index 80cde95..b8804df 100644 (file)
@@ -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) {
index 00cdd39..9bc7b3a 100644 (file)
@@ -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
index fb66abd..c7dcf51 100644 (file)
@@ -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.
index 27127d1..8a0e5a8 100644 (file)
@@ -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;
                }
 
index f41a49c..4e341fd 100644 (file)
@@ -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;
 
index 8c05a5d..9074bee 100644 (file)
@@ -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;
index e320bae..f1d5a17 100644 (file)
@@ -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;
index e6cea4f..ec4c894 100644 (file)
@@ -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;
 
index 956a00d..292d864 100644 (file)
@@ -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;
index be09837..bd2895f 100644 (file)
@@ -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;
index 58a4010..4352afc 100644 (file)
@@ -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;
 
index 7a10068..9785dea 100644 (file)
@@ -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;
 
index d7a92d3..1237aac 100644 (file)
@@ -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);
 }
index 4dca8ea..0035215 100644 (file)
@@ -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);
 
 
 /* ---------------- *
index 3f909d3..de55dcf 100644 (file)
@@ -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);
index 60e2aff..3230541 100644 (file)
@@ -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;
 
index ccd6e85..a71e779 100644 (file)
@@ -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
index 04257c4..1f77823 100644 (file)
@@ -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;
 
index 5f5bb69..cea758f 100644 (file)
@@ -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);