aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/dc
diff options
context:
space:
mode:
authorMarcus Comstedt2009-03-21 15:47:45 +0000
committerMarcus Comstedt2009-03-21 15:47:45 +0000
commite3ca4afb595e63e1acfabd2c6e5de75ec6461e07 (patch)
treeebaa9de3801929ae6c1de507dd144582a36067ed /backends/platform/dc
parent29ebafb5d55961fde145691397fac3a21b9ccbd1 (diff)
downloadscummvm-rg350-e3ca4afb595e63e1acfabd2c6e5de75ec6461e07.tar.gz
scummvm-rg350-e3ca4afb595e63e1acfabd2c6e5de75ec6461e07.tar.bz2
scummvm-rg350-e3ca4afb595e63e1acfabd2c6e5de75ec6461e07.zip
Fixed some warnings.
svn-id: r39590
Diffstat (limited to 'backends/platform/dc')
-rw-r--r--backends/platform/dc/dcloader.cpp55
-rw-r--r--backends/platform/dc/dcmain.cpp2
-rw-r--r--backends/platform/dc/display.cpp1
-rw-r--r--backends/platform/dc/label.cpp2
-rw-r--r--backends/platform/dc/selector.cpp7
-rw-r--r--backends/platform/dc/vmsave.cpp4
6 files changed, 33 insertions, 38 deletions
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<cnt; i++) {
- Elf32_Sym *sym = (Elf32_Sym *)(((char *)symtab)+(rela[i].r_info>>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; i<ehdr.e_shnum; i++) {
- DBG("Section %d: type = %d, size = %d, entsize = %d, link = %d\n",
- i, shdr[i].sh_type, shdr[i].sh_size, shdr[i].sh_entsize, shdr[i].sh_link);
+ DBG(("Section %d: type = %d, size = %d, entsize = %d, link = %d\n",
+ i, shdr[i].sh_type, shdr[i].sh_size, shdr[i].sh_entsize, shdr[i].sh_link));
if (shdr[i].sh_type == 2 && shdr[i].sh_entsize == sizeof(Elf32_Sym) &&
shdr[i].sh_link < ehdr.e_shnum && shdr[shdr[i].sh_link].sh_type == 3 &&
symtab_sect < 0)
@@ -275,7 +275,8 @@ bool DLObject::load(int fd)
}
if (lseek(fd, shdr[symtab_sect].sh_offset, SEEK_SET)<0 ||
- read(fd, symtab, shdr[symtab_sect].sh_size) != shdr[symtab_sect].sh_size){
+ read(fd, symtab, shdr[symtab_sect].sh_size) !=
+ (ssize_t)shdr[symtab_sect].sh_size){
seterror("Symbol table load failed.");
free(shdr);
return false;
@@ -288,15 +289,15 @@ bool DLObject::load(int fd)
}
if (lseek(fd, shdr[shdr[symtab_sect].sh_link].sh_offset, SEEK_SET)<0 ||
- read(fd, strtab, shdr[shdr[symtab_sect].sh_link].sh_size) !=
- shdr[shdr[symtab_sect].sh_link].sh_size){
+ read(fd, strtab, shdr[shdr[symtab_sect].sh_link].sh_size) !=
+ (ssize_t)shdr[shdr[symtab_sect].sh_link].sh_size){
seterror("Symbol table strings load failed.");
free(shdr);
return false;
}
symbol_cnt = shdr[symtab_sect].sh_size / sizeof(Elf32_Sym);
- DBG("Loaded %d symbols.\n", symbol_cnt);
+ DBG(("Loaded %d symbols.\n", symbol_cnt));
Elf32_Sym *s = (Elf32_Sym *)symtab;
for (int c = symbol_cnt; c--; s++)
@@ -305,8 +306,8 @@ bool DLObject::load(int fd)
for (int i=0; i<ehdr.e_shnum; i++)
if (shdr[i].sh_type == 4 && shdr[i].sh_entsize == sizeof(Elf32_Rela) &&
- shdr[i].sh_link == symtab_sect && shdr[i].sh_info < ehdr.e_shnum &&
- (shdr[shdr[i].sh_info].sh_flags & 2))
+ (int)shdr[i].sh_link == symtab_sect && shdr[i].sh_info < ehdr.e_shnum &&
+ (shdr[shdr[i].sh_info].sh_flags & 2))
if (!relocate(fd, shdr[i].sh_offset, shdr[i].sh_size)) {
free(shdr);
return false;
@@ -322,7 +323,7 @@ bool DLObject::open(const char *path)
int fd;
void *ctors_start, *ctors_end;
- DBG("open(\"%s\")\n", path);
+ DBG(("open(\"%s\")\n", path));
if ((fd = ::open(path, O_RDONLY))<0) {
seterror("%s not found.", path);
@@ -356,11 +357,11 @@ bool DLObject::open(const char *path)
return false;
}
- DBG("Calling constructors.\n");
+ DBG(("Calling constructors.\n"));
for (void (**f)(void) = (void (**)(void))ctors_start; f != ctors_end; f++)
(**f)();
- DBG("%s opened ok.\n", path);
+ DBG(("%s opened ok.\n", path));
return true;
}
@@ -376,7 +377,7 @@ bool DLObject::close()
void *DLObject::symbol(const char *name)
{
- DBG("symbol(\"%s\")\n", name);
+ DBG(("symbol(\"%s\")\n", name));
if (symtab == NULL || strtab == NULL || symbol_cnt < 1) {
seterror("No symbol table loaded.");
@@ -387,7 +388,7 @@ void *DLObject::symbol(const char *name)
for (int c = symbol_cnt; c--; s++)
if ((s->st_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<h; y++) {
diff --git a/backends/platform/dc/label.cpp b/backends/platform/dc/label.cpp
index 44e4701a43..5ad75cd20d 100644
--- a/backends/platform/dc/label.cpp
+++ b/backends/platform/dc/label.cpp
@@ -29,7 +29,7 @@
#include "label.h"
-static void *get_romfont_address() __asm__(".get_romfont_address");
+void *get_romfont_address() __asm__(".get_romfont_address");
__asm__("\
\n\
.get_romfont_address: \n\
diff --git a/backends/platform/dc/selector.cpp b/backends/platform/dc/selector.cpp
index f9646ff22f..9465769ea3 100644
--- a/backends/platform/dc/selector.cpp
+++ b/backends/platform/dc/selector.cpp
@@ -316,6 +316,7 @@ int gameMenu(Game *games, int num_games)
{
int top_game = 0, selector_pos = 0;
int mousex = 0, mousey = 0;
+ float y;
if (!num_games)
return -1;
@@ -331,7 +332,7 @@ int gameMenu(Game *games, int num_games)
ta_commit_end();
- float y = 40.0;
+ y = 40.0;
for (int i=top_game, cnt=0; cnt<10 && i<num_games; i++, cnt++) {
int pal = 48+(i&15);
@@ -360,15 +361,13 @@ int gameMenu(Game *games, int num_games)
for (int fade=0; fade<=256; fade+=4) {
- unsigned int fade_colour = 0x00ffffff | ((255-fade)<<24);
-
ta_begin_frame();
drawBackground();
ta_commit_end();
- float y = 40.0;
+ y = 40.0;
if (fade < 256)
for (int i=top_game, cnt=0; cnt<10 && i<num_games;
diff --git a/backends/platform/dc/vmsave.cpp b/backends/platform/dc/vmsave.cpp
index 840188a421..ab4b42648a 100644
--- a/backends/platform/dc/vmsave.cpp
+++ b/backends/platform/dc/vmsave.cpp
@@ -132,10 +132,6 @@ static bool tryLoad(char *&buffer, int &size, const char *filename, int vm)
struct vmsinfo info;
struct superblock super;
struct vms_file file;
- struct vms_file_header header;
- struct timestamp tstamp;
- struct tm tm;
- time_t t;
if (!vmsfs_check_unit(vm, 0, &info))
return false;