Resolve some warnings.
authorChristoph Mallon <christoph.mallon@gmx.de>
Sun, 19 Oct 2008 16:42:19 +0000 (16:42 +0000)
committerChristoph Mallon <christoph.mallon@gmx.de>
Sun, 19 Oct 2008 16:42:19 +0000 (16:42 +0000)
[r23013]

adt/hashset.c
ast.c
ast2firm.c
symbol_table.c

index 415aaab..0579044 100644 (file)
@@ -84,7 +84,7 @@
 
 #ifdef DO_REHASH
 #define HashSetEntry                   ValueType
-#define EntrySetHash(entry,new_hash)
+#define EntrySetHash(entry,new_hash)   ((void)0)
 #define EntryGetHash(self,entry)       Hash(self, GetKey(entry))
 #define EntryGetValue(entry)           (entry)
 #else /* ! DO_REHASH */
diff --git a/ast.c b/ast.c
index 6b0542e..abcf622 100644 (file)
--- a/ast.c
+++ b/ast.c
@@ -268,7 +268,7 @@ static void print_quoted_string(const string_t *const string, char border, int s
                        /*fallthrough*/
                default:
                        if(!isprint(*c)) {
-                               fprintf(out, "\\%03o", *c);
+                               fprintf(out, "\\%03o", (unsigned)*c);
                                break;
                        }
                        fputc(*c, out);
index 80cb506..72a56d4 100644 (file)
@@ -176,13 +176,13 @@ static ir_mode *init_atomic_ir_mode(atomic_type_kind_t kind)
 
                if (flags & ATOMIC_TYPE_FLAG_INTEGER) {
                        assert(! (flags & ATOMIC_TYPE_FLAG_FLOAT));
-                       snprintf(name, sizeof(name), "i%s%d", is_signed?"":"u", bit_size);
+                       snprintf(name, sizeof(name), "i%s%u", is_signed ? "" : "u", bit_size);
                        sort         = irms_int_number;
                        arithmetic   = irma_twos_complement;
                        modulo_shift = bit_size < machine_size ? machine_size : bit_size;
                } else {
                        assert(flags & ATOMIC_TYPE_FLAG_FLOAT);
-                       snprintf(name, sizeof(name), "f%d", bit_size);
+                       snprintf(name, sizeof(name), "f%u", bit_size);
                        sort         = irms_float_number;
                        arithmetic   = irma_ieee754;
                        modulo_shift = 0;
@@ -217,7 +217,7 @@ static void init_atomic_modes(void)
        unsigned        modulo_shift
                = bit_size < machine_size ? machine_size : bit_size;
 
-       snprintf(name, sizeof(name), "p%d", machine_size);
+       snprintf(name, sizeof(name), "p%u", machine_size);
        ir_mode *ptr_mode = new_ir_mode(name, sort, bit_size, is_signed, arithmetic,
                                        modulo_shift);
 
@@ -3317,7 +3317,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->symbol->string);
                } else if (is_type_array(type)) {
-                       fprintf(stderr, "[%zd]", entry->index);
+                       fprintf(stderr, "[%zu]", entry->index);
                } else {
                        fprintf(stderr, "-INVALID-");
                }
@@ -4822,7 +4822,7 @@ static void asm_statement_to_firm(const asm_statement_t *statement)
                                char     buf[64];
                                ir_node *value = get_value_from_lvalue(expr, addr);
 
-                               snprintf(buf, sizeof(buf), "%d", pos);
+                               snprintf(buf, sizeof(buf), "%u", pos);
 
                                ir_asm_constraint constraint;
                                constraint.pos              = pos;
index e6e4589..00b38ad 100644 (file)
@@ -45,7 +45,7 @@ void init_symbol_table_entry(symbol_t *entry, const char *string)
 #define KeyType                    const char *
 #define ConstKeyType               const char *
 #define GetKey(value)              (value)->string
-#define InitData(this,value,key)   { (value) = (ValueType) obstack_alloc(&symbol_obstack, sizeof(symbol_t)); init_symbol_table_entry((value), key); }
+#define InitData(this,value,key)   ((void)((value) = (ValueType)obstack_alloc(&symbol_obstack, sizeof(symbol_t)), init_symbol_table_entry((value), key)))
 #define Hash(this, key)            hash_string(key)
 #define KeysEqual(this,key1,key2)  (strcmp(key1, key2) == 0)
 #define SetRangeEmpty(ptr,size)    memset(ptr, 0, (size) * sizeof(symbol_table_hash_entry_t))