# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Date 1181210543 -3600
# Node ID b090c290d9f8fc579be32ddd68f2bcd96e05aa03
# Parent 6d45351273da0b49ed328ef8077446c4ceedf3ff
tools: Fix some type issues GCC 4.1.0 warnings.
FC5's gcc 4.1.0 can't make some files in tools/ due to its stronger
type checking.
From: Dexuan Cui <dexuan.cui@xxxxxxxxx>
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
tools/console/daemon/io.c | 3 ++-
tools/ioemu/target-i386-dm/exec-dm.c | 29 ++++++++++++++++++++---------
2 files changed, 22 insertions(+), 10 deletions(-)
diff -r 6d45351273da -r b090c290d9f8 tools/console/daemon/io.c
--- a/tools/console/daemon/io.c Wed Jun 06 20:25:58 2007 +0100
+++ b/tools/console/daemon/io.c Thu Jun 07 11:02:23 2007 +0100
@@ -183,7 +183,8 @@ static int create_domain_log(struct doma
{
char logfile[PATH_MAX];
char *namepath, *data, *s;
- int fd, len;
+ int fd;
+ unsigned int len;
namepath = xs_get_domain_path(xs, dom->domid);
s = realloc(namepath, strlen(namepath) + 6);
diff -r 6d45351273da -r b090c290d9f8 tools/ioemu/target-i386-dm/exec-dm.c
--- a/tools/ioemu/target-i386-dm/exec-dm.c Wed Jun 06 20:25:58 2007 +0100
+++ b/tools/ioemu/target-i386-dm/exec-dm.c Thu Jun 07 11:02:23 2007 +0100
@@ -448,18 +448,29 @@ void memcpy_words(void *dst, void *src,
void memcpy_words(void *dst, void *src, size_t n)
{
while (n >= sizeof(long)) {
- *((long *)dst)++ = *((long *)src)++;
+ *((long *)dst) = *((long *)src);
+ dst = ((long *)dst) + 1;
+ src = ((long *)src) + 1;
n -= sizeof(long);
}
- if (n & 4)
- *((uint32_t *)dst)++ = *((uint32_t *)src)++;
-
- if (n & 2)
- *((uint16_t *)dst)++ = *((uint16_t *)src)++;
-
- if (n & 1)
- *((uint8_t *)dst)++ = *((uint8_t *)src)++;
+ if (n & 4) {
+ *((uint32_t *)dst) = *((uint32_t *)src);
+ dst = ((uint32_t *)dst) + 1;
+ src = ((uint32_t *)src) + 1;
+ }
+
+ if (n & 2) {
+ *((uint16_t *)dst) = *((uint16_t *)src);
+ dst = ((uint16_t *)dst) + 1;
+ src = ((uint16_t *)src) + 1;
+ }
+
+ if (n & 1) {
+ *((uint8_t *)dst) = *((uint8_t *)src);
+ dst = ((uint8_t *)dst) + 1;
+ src = ((uint8_t *)src) + 1;
+ }
}
void cpu_physical_memory_rw(target_phys_addr_t addr, uint8_t *buf,
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|