From 9c359401bbbb6cc870909cf556f87a375807bdb7 Mon Sep 17 00:00:00 2001 From: Michael Beck Date: Mon, 24 Jan 2011 00:22:16 +0000 Subject: [PATCH] Fixed some size_t related warnings. [r28266] --- ir/be/bepeephole.c | 6 +++--- ir/be/beschedtrace.c | 6 +++--- ir/ir/iropt.c | 4 ++-- ir/libcore/lc_appendable.c | 2 +- ir/libcore/lc_opts.c | 4 ++-- ir/opt/scalar_replace.c | 9 +++++---- 6 files changed, 16 insertions(+), 15 deletions(-) diff --git a/ir/be/bepeephole.c b/ir/be/bepeephole.c index 490bc92dc..aba47c7cb 100644 --- a/ir/be/bepeephole.c +++ b/ir/be/bepeephole.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. * @@ -264,7 +264,7 @@ static void skip_barrier(ir_node *block, ir_graph *irg) sched_foreach_reverse(block, irn) { int arity; unsigned *used; - unsigned n_used; + size_t n_used; const ir_edge_t *edge, *next; if (!be_is_Barrier(irn)) @@ -295,7 +295,7 @@ static void skip_barrier(ir_node *block, ir_graph *irg) /* the barrier also had the effect of a Keep for unused inputs. * we now have to create an explicit Keep for them */ n_used = rbitset_popcount(used, arity); - if (n_used < (unsigned) arity) { + if (n_used < (size_t) arity) { int n_in = arity - (int) n_used; ir_node **in = ALLOCAN(ir_node*, n_in); int i = 0; diff --git a/ir/be/beschedtrace.c b/ir/be/beschedtrace.c index 6896b6568..895fd583b 100644 --- a/ir/be/beschedtrace.c +++ b/ir/be/beschedtrace.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. * @@ -597,7 +597,7 @@ static ir_node *muchnik_select(void *block_env, ir_nodeset_t *ready_set, ir_node DB((env->dbg, LEVEL_3, "\tirn = %+F, mcand = 1, max_delay = %u\n", irn, max_delay)); } else { - int cnt = ir_nodeset_size(&ecands); + size_t cnt = ir_nodeset_size(&ecands); if (cnt == 1) { irn = get_nodeset_node(&ecands); @@ -608,7 +608,7 @@ static ir_node *muchnik_select(void *block_env, ir_nodeset_t *ready_set, ir_node DB((env->dbg, LEVEL_3, "\tirn = %+F, ecand = 1, max_delay = %u\n", irn, max_delay)); } else if (cnt > 1) { - DB((env->dbg, LEVEL_3, "\tecand = %d, max_delay = %u\n", cnt, max_delay)); + DB((env->dbg, LEVEL_3, "\tecand = %zu, max_delay = %u\n", cnt, max_delay)); irn = basic_selection(&ecands); } else { diff --git a/ir/ir/iropt.c b/ir/ir/iropt.c index 08c7e9094..f72a33754 100644 --- a/ir/ir/iropt.c +++ b/ir/ir/iropt.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. * @@ -6689,7 +6689,7 @@ ir_node *optimize_node(ir_node *n) tv = computed_value(n); if (tv != tarval_bad) { ir_node *nw; - int node_size; + size_t node_size; /* * we MUST copy the node here temporary, because it's still diff --git a/ir/libcore/lc_appendable.c b/ir/libcore/lc_appendable.c index 65503afbc..9a3f7ad94 100644 --- a/ir/libcore/lc_appendable.c +++ b/ir/libcore/lc_appendable.c @@ -33,7 +33,7 @@ int lc_appendable_snwadd(lc_appendable_t *app, const char *str, size_t len, { int res = 0; int i; - int to_pad = width - len; + size_t to_pad = width > len ? width - len : 0; /* If not left justified, pad left */ for (i = 0; !left_just && i < to_pad; ++i) diff --git a/ir/libcore/lc_opts.c b/ir/libcore/lc_opts.c index a1470b9af..04b456b44 100644 --- a/ir/libcore/lc_opts.c +++ b/ir/libcore/lc_opts.c @@ -725,8 +725,8 @@ int lc_opt_from_single_arg(const lc_opt_entry_t *root, const char *arg, lc_opt_error_handler_t *handler) { const lc_opt_entry_t *grp = root; - int n = strlen(arg); - int n_prefix = opt_prefix ? strlen(opt_prefix) : 0; + size_t n = strlen(arg); + size_t n_prefix = opt_prefix ? strlen(opt_prefix) : 0; int error = 0; int ret = 0; diff --git a/ir/opt/scalar_replace.c b/ir/opt/scalar_replace.c index ad3c7316d..113aed8ed 100644 --- a/ir/opt/scalar_replace.c +++ b/ir/opt/scalar_replace.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. * @@ -66,7 +66,7 @@ typedef union { */ typedef struct path_t { unsigned vnum; /**< The value number. */ - unsigned path_len; /**< The length of the access path. */ + size_t path_len; /**< The length of the access path. */ path_elem_t path[1]; /**< The path. */ } path_t; @@ -436,9 +436,10 @@ static int find_possible_replacements(ir_graph *irg) * @param sel the Sel node * @param len the length of the path so far */ -static path_t *find_path(ir_node *sel, unsigned len) +static path_t *find_path(ir_node *sel, size_t len) { - int pos, i, n; + size_t pos; + int i, n; path_t *res; ir_node *pred = get_Sel_ptr(sel); -- 2.20.1