keep it simple and stupid: cast to unsigned instead of messing around with SIZET_FMT...
authorMatthias Braun <matze@braunis.de>
Sun, 16 Nov 2008 23:16:20 +0000 (23:16 +0000)
committerMatthias Braun <matze@braunis.de>
Sun, 16 Nov 2008 23:16:20 +0000 (23:16 +0000)
[r23715]

ast2firm.c
config.h.in
mangle.c
parser.c

index 6d1c466..bffaed2 100644 (file)
@@ -3287,7 +3287,7 @@ static __attribute__((unused)) void debug_print_type_path(const type_path_t *pat
                if (is_type_compound(type)) {
                        fprintf(stderr, ".%s", entry->compound_entry->base.symbol->string);
                } else if (is_type_array(type)) {
-                       fprintf(stderr, "[" SIZET_FMT "]", entry->index);
+                       fprintf(stderr, "[%u]", (unsigned) entry->index);
                } else {
                        fprintf(stderr, "-INVALID-");
                }
index 523798e..36ee491 100644 (file)
@@ -17,9 +17,3 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  * 02111-1307, USA.
  */
-#ifdef _WIN32
-/* default windows runtime does not support %zu */
-#define SIZET_FMT  "%u"
-#else
-#define SIZET_FMT  "%zu"
-#endif
index 6822b84..e4f1092 100644 (file)
--- a/mangle.c
+++ b/mangle.c
@@ -108,7 +108,7 @@ static void mangle_class_enum_type(const entity_base_t *ent)
        const symbol_t *sym = ent->symbol;
        if (sym != NULL) {
                const char *name = sym->string;
-               obstack_printf(&obst, SIZET_FMT "%s", strlen(name), name);
+               obstack_printf(&obst, "%u%s", (unsigned) strlen(name), name);
        } else {
                /* TODO need the first typedef name here */
                panic("mangling of unnamed class/enum types not implemented yet");
@@ -121,7 +121,7 @@ static void mangle_array_type(const array_type_t *type)
                obstack_1grow(&obst, 'A');
                obstack_1grow(&obst, '_');
        } else if (type->size_constant) {
-               obstack_printf(&obst, "A" SIZET_FMT "_", type->size);
+               obstack_printf(&obst, "A%u_", (unsigned) type->size);
        } else {
                panic("mangling of non-constant sized array types not implemented yet");
        }
@@ -208,7 +208,7 @@ static void mangle_entity(entity_t *entity)
        /* TODO: mangle scope */
 
        const char *name = entity->base.symbol->string;
-       obstack_printf(&obst, SIZET_FMT "%s", strlen(name), name);
+       obstack_printf(&obst, "%u%s", (unsigned) strlen(name), name);
 
        if (entity->kind == ENTITY_FUNCTION) {
                mangle_parameters(&entity->declaration.type->function);
index ea832ca..7e2f224 100644 (file)
--- a/parser.c
+++ b/parser.c
@@ -2358,7 +2358,7 @@ static __attribute__((unused)) void debug_print_type_path(
                        fprintf(stderr, ".%s",
                                entry->v.compound_entry->base.symbol->string);
                } else if (is_type_array(type)) {
-                       fprintf(stderr, "[" SIZET_FMT "]", entry->v.index);
+                       fprintf(stderr, "[%u]", (unsigned) entry->v.index);
                } else {
                        fprintf(stderr, "-INVALID-");
                }