From e3ca4afb595e63e1acfabd2c6e5de75ec6461e07 Mon Sep 17 00:00:00 2001 From: Marcus Comstedt Date: Sat, 21 Mar 2009 15:47:45 +0000 Subject: Fixed some warnings. svn-id: r39590 --- backends/platform/dc/dcloader.cpp | 55 ++++++++++++++++++++------------------- backends/platform/dc/dcmain.cpp | 2 +- backends/platform/dc/display.cpp | 1 - backends/platform/dc/label.cpp | 2 +- backends/platform/dc/selector.cpp | 7 +++-- backends/platform/dc/vmsave.cpp | 4 --- 6 files changed, 33 insertions(+), 38 deletions(-) (limited to 'backends/platform/dc') diff --git a/backends/platform/dc/dcloader.cpp b/backends/platform/dc/dcloader.cpp index 2aba1cddf5..db0160b953 100644 --- a/backends/platform/dc/dcloader.cpp +++ b/backends/platform/dc/dcloader.cpp @@ -30,9 +30,9 @@ #include "dcloader.h" #ifdef DL_DEBUG -#define DBG(...) reportf(__VA_ARGS__) +#define DBG(x) reportf x #else -#define DBG(...) 0 +#define DBG(x) do{}while(0) #endif @@ -156,7 +156,7 @@ bool DLObject::relocate(int fd, unsigned long offset, unsigned long size) } if (lseek(fd, offset, SEEK_SET)<0 || - read(fd, rela, size) != size) { + read(fd, rela, size) != (ssize_t)size) { seterror("Relocation table load failed."); free(rela); return false; @@ -165,7 +165,7 @@ bool DLObject::relocate(int fd, unsigned long offset, unsigned long size) int cnt = size / sizeof(*rela); for (int i=0; i>4)); + Elf32_Sym *sym = (Elf32_Sym *)(void *)(((char *)symtab)+(rela[i].r_info>>4)); void *target = ((char *)segment)+rela[i].r_offset; @@ -203,8 +203,8 @@ bool DLObject::load(int fd) return false; } - DBG("phoff = %d, phentsz = %d, phnum = %d\n", - ehdr.e_phoff, ehdr.e_phentsize, ehdr.e_phnum); + DBG(("phoff = %d, phentsz = %d, phnum = %d\n", + ehdr.e_phoff, ehdr.e_phentsize, ehdr.e_phnum)); if (lseek(fd, ehdr.e_phoff, SEEK_SET)<0 || read(fd, &phdr, sizeof(phdr)) != sizeof(phdr)) { @@ -218,27 +218,27 @@ bool DLObject::load(int fd) return false; } - DBG("offs = %d, filesz = %d, memsz = %d, align = %d\n", - phdr.p_offset, phdr.p_filesz, phdr.p_memsz, phdr.p_align); + DBG(("offs = %d, filesz = %d, memsz = %d, align = %d\n", + phdr.p_offset, phdr.p_filesz, phdr.p_memsz, phdr.p_align)); if (!(segment = memalign(phdr.p_align, phdr.p_memsz))) { seterror("Out of memory."); return false; } - DBG("segment @ %p\n", segment); + DBG(("segment @ %p\n", segment)); if (phdr.p_memsz > phdr.p_filesz) memset(((char *)segment) + phdr.p_filesz, 0, phdr.p_memsz - phdr.p_filesz); if (lseek(fd, phdr.p_offset, SEEK_SET)<0 || - read(fd, segment, phdr.p_filesz) != phdr.p_filesz) { + read(fd, segment, phdr.p_filesz) != (ssize_t)phdr.p_filesz) { seterror("Segment load failed."); return false; } - DBG("shoff = %d, shentsz = %d, shnum = %d\n", - ehdr.e_shoff, ehdr.e_shentsize, ehdr.e_shnum); + DBG(("shoff = %d, shentsz = %d, shnum = %d\n", + ehdr.e_shoff, ehdr.e_shentsize, ehdr.e_shnum)); if (!(shdr = (Elf32_Shdr *)malloc(ehdr.e_shnum * sizeof(*shdr)))) { seterror("Out of memory."); @@ -246,16 +246,16 @@ bool DLObject::load(int fd) } if (lseek(fd, ehdr.e_shoff, SEEK_SET)<0 || - read(fd, shdr, ehdr.e_shnum * sizeof(*shdr)) != - ehdr.e_shnum * sizeof(*shdr)) { + read(fd, shdr, ehdr.e_shnum * sizeof(*shdr)) != + (ssize_t)(ehdr.e_shnum * sizeof(*shdr))) { seterror("Section headers load failed."); free(shdr); return false; } for (int i=0; ist_info>>4 == 1 || s->st_info>>4 == 2) && strtab[s->st_name] == '_' && !strcmp(name, strtab+s->st_name+1)) { - DBG("=> %p\n", (void*)s->st_value); + DBG(("=> %p\n", (void*)s->st_value)); return (void*)s->st_value; } diff --git a/backends/platform/dc/dcmain.cpp b/backends/platform/dc/dcmain.cpp index bdec7f41f1..b32ee53131 100644 --- a/backends/platform/dc/dcmain.cpp +++ b/backends/platform/dc/dcmain.cpp @@ -226,7 +226,7 @@ int main() PluginManager::instance().addPluginProvider(new DCPluginProvider()); #endif - int res = scummvm_main(argc, argv); + scummvm_main(argc, argv); g_system->quit(); } diff --git a/backends/platform/dc/display.cpp b/backends/platform/dc/display.cpp index b52ecebd5e..ba8e1ba04f 100644 --- a/backends/platform/dc/display.cpp +++ b/backends/platform/dc/display.cpp @@ -462,7 +462,6 @@ void OSystem_Dreamcast::drawMouse(int xdraw, int ydraw, int w, int h, _mouse_buffer &= NUM_BUFFERS-1; unsigned short *dst = (unsigned short *)mouse_tx[_mouse_buffer]; - int y=0; if (visible && w && h && w<=MOUSE_W && h<=MOUSE_H) for (int y=0; y