diff options
-rw-r--r-- | Makefile | 4 | ||||
-rw-r--r-- | backend.c | 4 | ||||
-rw-r--r-- | blastem.c | 5 | ||||
-rwxr-xr-x | render_sdl.c | 8 | ||||
-rw-r--r-- | romdb.c | 4 |
5 files changed, 14 insertions, 11 deletions
@@ -31,7 +31,7 @@ SDL2_PREFIX:="sdl/x86_64-w64-mingw32" GLUDIR:=x64 endif GLEW32S_LIB:=$(GLEW_PREFIX)/lib/Release/$(GLUDIR)/glew32s.lib -CFLAGS:=-std=gnu99 -Wreturn-type -Werror=return-type -Werror=implicit-function-declaration +CFLAGS:=-std=gnu99 -Wreturn-type -Werror=return-type -Werror=implicit-function-declaration -Wpointer-arith -Werror=pointer-arith LDFLAGS:=-lm -lmingw32 -lws2_32 -mwindows ifneq ($(MAKECMDGOALS),libblastem.dll) CFLAGS+= -I"$(SDL2_PREFIX)/include/SDL2" -I"$(GLEW_PREFIX)/include" -DGLEW_STATIC @@ -47,7 +47,7 @@ NET:=net.o EXE:= HAS_PROC:=$(shell if [ -d /proc ]; then /bin/echo -e -DHAS_PROC; fi) -CFLAGS:=-std=gnu99 -Wreturn-type -Werror=return-type -Werror=implicit-function-declaration -Wno-unused-value $(HAS_PROC) -DHAVE_UNISTD_H +CFLAGS:=-std=gnu99 -Wreturn-type -Werror=return-type -Werror=implicit-function-declaration -Wno-unused-value -Wpointer-arith -Werror=pointer-arith $(HAS_PROC) -DHAVE_UNISTD_H ifeq ($(OS),Darwin) LIBS=sdl2 glew @@ -83,7 +83,7 @@ void * get_native_pointer(uint32_t address, void ** mem_pointers, cpu_options * : memmap[chunk].buffer; if (!base) { if (memmap[chunk].flags & MMAP_AUX_BUFF) { - return memmap[chunk].buffer + (address & memmap[chunk].aux_mask); + return ((uint8_t *)memmap[chunk].buffer) + (address & memmap[chunk].aux_mask); } return NULL; } @@ -108,7 +108,7 @@ void * get_native_write_pointer(uint32_t address, void ** mem_pointers, cpu_opti : memmap[chunk].buffer; if (!base) { if (memmap[chunk].flags & MMAP_AUX_BUFF) { - return memmap[chunk].buffer + (address & memmap[chunk].aux_mask); + return ((uint8_t *)memmap[chunk].buffer) + (address & memmap[chunk].aux_mask); } return NULL; } @@ -158,8 +158,9 @@ uint32_t load_rom_zip(const char *filename, void **dst) for (offset = 0; offset + SMD_BLOCK_SIZE + SMD_HEADER_SIZE <= out_size; offset += SMD_BLOCK_SIZE) { uint8_t tmp[SMD_BLOCK_SIZE]; - memcpy(tmp, *dst + offset + SMD_HEADER_SIZE, SMD_BLOCK_SIZE); - process_smd_block(*dst + offset, tmp, SMD_BLOCK_SIZE); + uint8_t *u8dst = *dst; + memcpy(tmp, u8dst + offset + SMD_HEADER_SIZE, SMD_BLOCK_SIZE); + process_smd_block((void *)(u8dst + offset), tmp, SMD_BLOCK_SIZE); } out_size = offset; } diff --git a/render_sdl.c b/render_sdl.c index 5526dd7..1077109 100755 --- a/render_sdl.c +++ b/render_sdl.c @@ -1361,14 +1361,14 @@ uint32_t *render_get_framebuffer(uint8_t which, int *pitch) warning("Request for invalid framebuffer number %d\n", which); return NULL; } - void *pixels; - if (SDL_LockTexture(sdl_textures[which], NULL, &pixels, pitch) < 0) { + uint8_t *pixels; + if (SDL_LockTexture(sdl_textures[which], NULL, (void **)&pixels, pitch) < 0) { warning("Failed to lock texture: %s\n", SDL_GetError()); return NULL; } static uint8_t last; if (which <= FRAMEBUFFER_EVEN) { - locked_pixels = pixels; + locked_pixels = (uint32_t *)pixels; if (which == FRAMEBUFFER_EVEN) { pixels += *pitch; } @@ -1378,7 +1378,7 @@ uint32_t *render_get_framebuffer(uint8_t which, int *pitch) } last = which; } - return pixels; + return (uint32_t *)pixels; #ifndef DISABLE_OPENGL } #endif @@ -675,7 +675,9 @@ void map_iter_fun(char *key, tern_val val, uint8_t valtype, void *data) *map = lock_info.map[i]; if (map->start < 0x200000) { if (map->buffer) { - map->buffer += (0x200000 - map->start) & ((map->flags & MMAP_AUX_BUFF) ? map->aux_mask : map->mask); + uint8_t *buf = map->buffer; + buf += (0x200000 - map->start) & ((map->flags & MMAP_AUX_BUFF) ? map->aux_mask : map->mask); + map->buffer = buf; } map->start = 0x200000; } |