Commit e8838501 authored by Michael Beck's avatar Michael Beck
Browse files

Fixed a lot of size_t related warnings, most of them due to array implementation change.

[r28272]
parent 65f08a3f
/*
* 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.
*
......@@ -435,8 +435,8 @@ void ir_lower_mode_b(ir_graph *irg, const lower_mode_b_config_t *nconfig)
ir_entity *entity = get_irg_entity(irg);
ir_type *type = get_entity_type(entity);
bool changed = false;
int i;
int n;
size_t i;
size_t n;
config = nconfig;
lowered_nodes = NEW_ARR_F(ir_node*, 0);
......@@ -455,13 +455,12 @@ void ir_lower_mode_b(ir_graph *irg, const lower_mode_b_config_t *nconfig)
irg_walk_graph(irg, firm_clear_link, NULL, NULL);
irg_walk_graph(irg, lower_mode_b_walker, NULL, &changed);
for (i = 0; i < ARR_LEN(check_later); ++i) {
for (i = 0, n = ARR_LEN(check_later); i < n; ++i) {
ir_node *node = check_later[i];
irg_walk_core(node, lower_mode_b_walker, NULL, &changed);
}
n = ARR_LEN(lowered_nodes);
for (i = 0; i < n; ++i) {
for (i = 0, n = ARR_LEN(lowered_nodes); i < n; ++i) {
ir_node *node = lowered_nodes[i];
maybe_kill_node(node);
}
......
/*
* 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.
*
......@@ -114,7 +114,7 @@ static void lower_mux_node(ir_node* mux)
void lower_mux(ir_graph *irg, lower_mux_callback *cb_func)
{
int i, n_muxes;
size_t i, n_muxes;
walk_env_t env;
/* Scan the graph for mux nodes to lower. */
......
/*
* 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 create_out_of_bounds_check(cond_env_t *env, ir_node *cond)
ir_node *oob_cond;
ir_node *in[1];
ir_node *new_block;
int n_default_preds;
size_t n_default_preds;
int i;
ir_node *proj;
......@@ -275,7 +275,7 @@ static void create_out_of_bounds_check(cond_env_t *env, ir_node *cond)
/* adapt default block */
n_default_preds = ARR_LEN(default_preds);
if (n_default_preds > 1) {
int i;
size_t i;
/* create new intermediate blocks so we don't have critical edges */
for (i = 0; i < n_default_preds; ++i) {
......
......@@ -3564,7 +3564,7 @@ void combo(ir_graph *irg)
ir_node *initial_bl;
node_t *start;
ir_graph *rem = current_ir_graph;
int len;
size_t len;
current_ir_graph = irg;
......
/*
* 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.
*
......@@ -1692,7 +1692,7 @@ typedef struct node_entry {
typedef struct loop_env {
ir_phase ph; /**< the phase object */
ir_node **stack; /**< the node stack */
int tos; /**< tos index */
size_t tos; /**< tos index */
unsigned nextDFSnum; /**< the current DFS number */
unsigned POnum; /**< current post order number */
......@@ -1726,7 +1726,7 @@ static void push(loop_env *env, ir_node *n)
node_entry *e;
if (env->tos == ARR_LEN(env->stack)) {
int nlen = ARR_LEN(env->stack) * 2;
size_t nlen = ARR_LEN(env->stack) * 2;
ARR_RESIZE(ir_node *, env->stack, nlen);
}
env->stack[env->tos++] = n;
......
/*
* 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.
*
......@@ -859,8 +859,8 @@ static void copy_walk_n(ir_node *node, walker_condition *walk_condition,
/* Removes alle Blocks with non marked predecessors from the condition chain. */
static void unmark_not_allowed_cc_blocks(void)
{
int blocks = ARR_LEN(cc_blocks);
int i;
size_t blocks = ARR_LEN(cc_blocks);
size_t i;
for(i = 0; i < blocks; ++i) {
ir_node *block = cc_blocks[i];
......@@ -888,8 +888,8 @@ static void unmark_not_allowed_cc_blocks(void)
* TODO: invert head for unrolling? */
static void unmark_cc_blocks(void)
{
int blocks = ARR_LEN(cc_blocks);
int i;
size_t blocks = ARR_LEN(cc_blocks);
size_t i;
for(i = 0; i < blocks; ++i) {
ir_node *block = cc_blocks[i];
......
......@@ -1175,7 +1175,7 @@ static void add_roots(ir_graph *irg, environment_t *env)
* Else, we will split identical blocks if we start which different roots.
*/
for (bl = env->all_blocks; bl != NULL; bl = bl->all_next) {
int i, n = ARR_LEN(bl->roots);
size_t i, n = ARR_LEN(bl->roots);
#if 1
/* TODO: is this really needed? The roots are already in
......
/*
* 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.
*
......@@ -79,7 +79,7 @@ typedef struct node_entry {
typedef struct iv_env {
struct obstack obst; /**< an obstack for allocations */
ir_node **stack; /**< the node stack */
int tos; /**< tos index */
size_t tos; /**< tos index */
unsigned nextDFSnum; /**< the current DFS number */
unsigned POnum; /**< current post order number */
set *quad_map; /**< a map from (op, iv, rc) to node */
......@@ -950,7 +950,7 @@ static void push(iv_env *env, ir_node *n)
node_entry *e;
if (env->tos == ARR_LEN(env->stack)) {
int nlen = ARR_LEN(env->stack) * 2;
size_t nlen = ARR_LEN(env->stack) * 2;
ARR_RESIZE(ir_node *, env->stack, nlen);
}
env->stack[env->tos++] = n;
......
/*
* 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.
*
......@@ -522,7 +522,7 @@ static float calculate_weight(const entry_t *entry)
static void reorder_weights(q_set *hmap, float threshold)
{
entry_t **adr, *p, *entry;
int i, len;
size_t i, len;
ir_entity *callee;
restart:
......
/*
* 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.
*
......@@ -230,7 +230,7 @@ ir_node *get_compound_ent_value_by_path(const ir_entity *ent,
void remove_compound_ent_value(ir_entity *ent, ir_entity *value_ent)
{
int i, n;
size_t i, n;
assert(is_compound_entity(ent));
n = ARR_LEN(ent->attr.cmpd_attr.val_paths);
......
/*
* 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.
*
......@@ -412,10 +412,10 @@ static inline int _is_class_type(const ir_type *clss)
return (clss->type_op == type_class);
}
static inline int _get_class_n_members (const ir_type *clss)
static inline int _get_class_n_members(const ir_type *clss)
{
assert(clss && (clss->type_op == type_class));
return (ARR_LEN (clss->attr.ca.members));
return (int)(ARR_LEN(clss->attr.ca.members));
}
static inline ir_entity *_get_class_member(const ir_type *clss, int pos)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment