aboutsummaryrefslogtreecommitdiffstats
path: root/hw
diff options
context:
space:
mode:
authorDavid 'Digit' Turner <digit@android.com>2010-09-22 14:19:28 +0200
committerDavid 'Digit' Turner <digit@android.com>2010-09-22 14:19:28 +0200
commit4e024bb4f5c8aa8b07459f7fbd65c35122127fd1 (patch)
treeccd5835eef17757d3e1c069e391c415c0135023d /hw
parent1d9873b37d2478554d9d678cd410bd3638c8dab3 (diff)
downloadexternal_qemu-4e024bb4f5c8aa8b07459f7fbd65c35122127fd1.zip
external_qemu-4e024bb4f5c8aa8b07459f7fbd65c35122127fd1.tar.gz
external_qemu-4e024bb4f5c8aa8b07459f7fbd65c35122127fd1.tar.bz2
Remove compiler warnings when building the emulator.
This forces -Wall during the build. Note that this patch doesn't remove all warnings, but most of the remaining ones are from upstream anyway. Change-Id: I8808d8495e99866e156ce5780d2e3c305eab491f
Diffstat (limited to 'hw')
-rw-r--r--hw/goldfish_audio.c2
-rw-r--r--hw/goldfish_events_device.c1
-rw-r--r--hw/goldfish_memlog.c20
-rw-r--r--hw/goldfish_nand.c4
-rw-r--r--hw/goldfish_trace.c10
-rw-r--r--hw/goldfish_tty.c4
6 files changed, 28 insertions, 13 deletions
diff --git a/hw/goldfish_audio.c b/hw/goldfish_audio.c
index c8a6712..75f65bb 100644
--- a/hw/goldfish_audio.c
+++ b/hw/goldfish_audio.c
@@ -217,7 +217,7 @@ goldfish_audio_buff_put( struct goldfish_audio_buff* b, QEMUFile* f )
qemu_put_buffer(f, b->data, b->length );
}
-static int
+static void
goldfish_audio_buff_get( struct goldfish_audio_buff* b, QEMUFile* f )
{
b->address = qemu_get_be32(f);
diff --git a/hw/goldfish_events_device.c b/hw/goldfish_events_device.c
index 3f5bf0b..1f932f3 100644
--- a/hw/goldfish_events_device.c
+++ b/hw/goldfish_events_device.c
@@ -15,6 +15,7 @@
#include "android/globals.h" /* for android_hw */
#include "irq.h"
#include "user-events.h"
+#include "console.h"
#define MAX_EVENTS 256*4
diff --git a/hw/goldfish_memlog.c b/hw/goldfish_memlog.c
index f4be28a..6024f38 100644
--- a/hw/goldfish_memlog.c
+++ b/hw/goldfish_memlog.c
@@ -23,8 +23,8 @@ int fd = -1;
static uint32_t memlog_read(void *opaque, target_phys_addr_t offset)
{
- struct goldfish_device *dev = opaque;
-
+ (void)opaque;
+ (void)offset;
return 0;
}
@@ -34,13 +34,19 @@ static void memlog_write(void *opaque, target_phys_addr_t offset, uint32_t val)
{
char buf[128];
struct goldfish_device *dev = opaque;
+ int ret;
+
+ (void)dev;
- info[offset / 4] = val;
+ if (offset < 8*4)
+ info[offset / 4] = val;
if (offset == 0) {
/* write PID and VADDR to logfile */
- sprintf(buf,"%08x %08x\n", info[0], info[1]);
- write(fd, buf, strlen(buf));
+ snprintf(buf, sizeof buf, "%08x %08x\n", info[0], info[1]);
+ do {
+ ret = write(fd, buf, strlen(buf));
+ } while (ret < 0 && errno == EINTR);
}
}
@@ -69,7 +75,9 @@ void goldfish_memlog_init(uint32_t base)
dev->size = 0x1000;
dev->irq_count = 0;
- fd = open("mem.log", /* O_CREAT | */ O_TRUNC | O_WRONLY, 0644);
+ do {
+ fd = open("mem.log", /* O_CREAT | */ O_TRUNC | O_WRONLY, 0644);
+ } while (fd < 0 && errno == EINTR);
goldfish_device_add(dev, memlog_readfn, memlog_writefn, dev);
}
diff --git a/hw/goldfish_nand.c b/hw/goldfish_nand.c
index 1570095..e222cd1 100644
--- a/hw/goldfish_nand.c
+++ b/hw/goldfish_nand.c
@@ -52,7 +52,7 @@ xlog( const char* format, ... )
typedef struct {
char* devname;
size_t devname_len;
- char* data;
+ uint8_t* data;
int fd;
uint32_t flags;
uint32_t page_size;
@@ -274,7 +274,7 @@ uint32_t nand_dev_do_cmd(nand_dev_state *s, uint32_t cmd)
case NAND_CMD_GET_DEV_NAME:
if(size > dev->devname_len)
size = dev->devname_len;
- cpu_memory_rw_debug(cpu_single_env, s->data, dev->devname, size, 1);
+ cpu_memory_rw_debug(cpu_single_env, s->data, (uint8_t*)dev->devname, size, 1);
return size;
case NAND_CMD_READ:
if(addr >= dev->size)
diff --git a/hw/goldfish_trace.c b/hw/goldfish_trace.c
index a7e589d..fc338c8 100644
--- a/hw/goldfish_trace.c
+++ b/hw/goldfish_trace.c
@@ -15,8 +15,11 @@
*/
#include "qemu_file.h"
#include "goldfish_trace.h"
+#include "sysemu.h"
+#include "trace.h"
#ifdef CONFIG_MEMCHECK
#include "memcheck/memcheck.h"
+#include "memcheck/memcheck_util.h"
#endif // CONFIG_MEMCHECK
//#define DEBUG 1
@@ -46,6 +49,8 @@ static void trace_dev_write(void *opaque, target_phys_addr_t offset, uint32_t va
{
trace_dev_state *s = (trace_dev_state *)opaque;
+ (void)s;
+
switch (offset >> 2) {
case TRACE_DEV_REG_SWITCH: // context switch, switch to pid
if (trace_filename != NULL) {
@@ -128,7 +133,7 @@ static void trace_dev_write(void *opaque, target_phys_addr_t offset, uint32_t va
cmdlen = value;
break;
case TRACE_DEV_REG_CMDLINE: // execve, process cmdline
- cpu_memory_rw_debug(cpu_single_env, value, exec_arg, cmdlen, 0);
+ cpu_memory_rw_debug(cpu_single_env, value, (uint8_t*)exec_arg, cmdlen, 0);
if (trace_filename != NULL) {
trace_execve(exec_arg, cmdlen);
}
@@ -351,6 +356,8 @@ static uint32_t trace_dev_read(void *opaque, target_phys_addr_t offset)
{
trace_dev_state *s = (trace_dev_state *)opaque;
+ (void)s;
+
switch (offset >> 2) {
case TRACE_DEV_REG_ENABLE: // tracing enable
return tracing;
@@ -378,7 +385,6 @@ static CPUWriteMemoryFunc *trace_dev_writefn[] = {
/* initialize the trace device */
void trace_dev_init()
{
- int iomemtype;
trace_dev_state *s;
s = (trace_dev_state *)qemu_mallocz(sizeof(trace_dev_state));
diff --git a/hw/goldfish_tty.c b/hw/goldfish_tty.c
index dd50efc..904a07b 100644
--- a/hw/goldfish_tty.c
+++ b/hw/goldfish_tty.c
@@ -126,8 +126,8 @@ static void goldfish_tty_write(void *opaque, target_phys_addr_t offset, uint32_t
if (to_write > len)
to_write = len;
- cpu_memory_rw_debug(cpu_single_env, buf, temp, to_write, 0);
- qemu_chr_write(s->cs, temp, to_write);
+ cpu_memory_rw_debug(cpu_single_env, buf, (uint8_t*)temp, to_write, 0);
+ qemu_chr_write(s->cs, (const uint8_t*)temp, to_write);
buf += to_write;
len -= to_write;
}