summaryrefslogtreecommitdiffhomepage
path: root/ir/ident
diff options
context:
space:
mode:
authorMichael Beck <mm.beck@gmx.net>2011-03-06 01:34:36 +0100
committerMichael Beck <mm.beck@gmx.net>2011-03-06 01:35:39 +0100
commit9e31d4eab3ffb00fae7791ed224ea27fbca2eade (patch)
tree8d0fb483245011a71c0b3fad7fab63a4d65faec7 /ir/ident
parent9c6eada40867ea8c34c9db0ce2ca5f18e764e0e4 (diff)
Fixed size_t related warnings.
Diffstat (limited to 'ir/ident')
-rw-r--r--ir/ident/mangle.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/ir/ident/mangle.c b/ir/ident/mangle.c
index 28a5e3d..41177fd 100644
--- a/ir/ident/mangle.c
+++ b/ir/ident/mangle.c
@@ -29,6 +29,7 @@
#include "ident_t.h"
#include "obst.h"
+#include "irprintf.h"
/* Make types visible to allow most efficient access */
#include "entity_t.h"
@@ -132,17 +133,17 @@ ident *id_decorate_win32_c_fkt(const ir_entity *ent, ident *id)
ir_type *tp = get_entity_type(ent);
unsigned cc_mask = get_method_calling_convention(tp);
char buf[16];
- int size, i;
if (IS_CDECL(cc_mask))
return id_mangle3("_", id, "");
else if (IS_STDCALL(cc_mask)) {
- size = 0;
- for (i = get_method_n_params(tp) - 1; i >= 0; --i) {
- size += get_type_size_bytes(get_method_param_type(tp, i));
+ size_t i, size = 0;
+
+ for (i = get_method_n_params(tp); i > 0;) {
+ size += get_type_size_bytes(get_method_param_type(tp, --i));
}
- snprintf(buf, sizeof(buf), "@%d", size);
+ ir_snprintf(buf, sizeof(buf), "@%zu", size);
if (cc_mask & cc_reg_param)
return id_mangle3("@", id, buf);