X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fbeemitter_binary.c;h=7507fa85dc899f0ec292cdae7e4fd9468859349f;hb=5474a1c188c9d59eea2c915515980cd9cbab58d8;hp=e3d1cc54bc813f836cb52b8d48d7df5a36aa7e93;hpb=a1e9069afa4fa1e16e2d176bcd7905d6a1ed4677;p=libfirm diff --git a/ir/be/beemitter_binary.c b/ir/be/beemitter_binary.c index e3d1cc54b..7507fa85d 100644 --- a/ir/be/beemitter_binary.c +++ b/ir/be/beemitter_binary.c @@ -22,7 +22,6 @@ * @brief Interface for machine code output * @author Matthias Braun * @date 12.03.2007 - * @version $Id$ */ #include "config.h" @@ -44,7 +43,7 @@ struct obstack code_fragment_obst; be_emit(8/16/32/entity) call!) */ code_fragment_t *be_get_current_fragment(void) { - code_fragment_t *fragment = obstack_base(&code_fragment_obst); + code_fragment_t *fragment = (code_fragment_t*)obstack_base(&code_fragment_obst); assert(obstack_object_size(&code_fragment_obst) >= sizeof(code_fragment_t)); assert(fragment->magic == CODE_FRAGMENT_MAGIC); @@ -61,7 +60,7 @@ static void alloc_fragment(void) assert(obstack_object_size(&code_fragment_obst) == 0); obstack_blank(&code_fragment_obst, sizeof(*fragment)); - fragment = obstack_base(&code_fragment_obst); + fragment = (code_fragment_t*)obstack_base(&code_fragment_obst); memset(fragment, 0, sizeof(*fragment)); #ifndef NDEBUG fragment->magic = CODE_FRAGMENT_MAGIC; @@ -107,7 +106,7 @@ static void emit(FILE *file, const unsigned char *buffer, size_t len) size_t i2; fputs("\t.byte ", file); for (i2 = i; i2 < i + 30 && i2 < len; ++i2) { - fprintf(file, "0x%02X", buffer[i2]); + fprintf(file, "0x%02X", (unsigned)buffer[i2]); } i = i2; fputs("\n", file); @@ -209,7 +208,7 @@ void be_emit_code(FILE *output, const binary_emiter_interface_t *interface) assert(fragment->offset >= offset); nops = fragment->offset - offset; if (nops > 0) { - unsigned char *nopbuffer = obstack_alloc(&code_fragment_obst, nops); + unsigned char *nopbuffer = (unsigned char*)obstack_alloc(&code_fragment_obst, nops); interface->create_nops(nopbuffer, nops); emit(output, nopbuffer, nops); offset = fragment->offset; @@ -221,7 +220,7 @@ void be_emit_code(FILE *output, const binary_emiter_interface_t *interface) offset += fragment->len; /* emit the jump */ - jmpbuffer = obstack_alloc(&code_fragment_obst, fragment->jumpsize_min); + jmpbuffer = (unsigned char*)obstack_alloc(&code_fragment_obst, fragment->jumpsize_min); interface->emit_jump(fragment, jmpbuffer); emit(output, jmpbuffer, fragment->jumpsize_min); offset += fragment->jumpsize_min;