Fix miscellaneous minor things, by Andre Przywara.
authorths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>
Mon, 17 Dec 2007 03:15:52 +0000 (03:15 +0000)
committerths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>
Mon, 17 Dec 2007 03:15:52 +0000 (03:15 +0000)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3826 c046a42c-6fe2-441c-8c8c-71466251a162

aes.c
hw/adlib.c
hw/ide.c
hw/pcnet.c
monitor.c
vl.c

diff --git a/aes.c b/aes.c
index bb1e104..3700894 100644 (file)
--- a/aes.c
+++ b/aes.c
 #include "qemu-common.h"
 #include "aes.h"
 
+#ifndef NDEBUG
 #define NDEBUG
+#endif
+
 #include <assert.h>
 
 typedef uint32_t u32;
index 1376db9..7a9c2e7 100644 (file)
@@ -26,6 +26,7 @@
 #include "hw.h"
 #include "audiodev.h"
 #include "audio/audio.h"
+#include "isa.h"
 
 //#define DEBUG
 
index bc82bb2..3715b9c 100644 (file)
--- a/hw/ide.c
+++ b/hw/ide.c
@@ -430,8 +430,7 @@ static void padstr(char *str, const char *src, int len)
             v = *src++;
         else
             v = ' ';
-        *(char *)((long)str ^ 1) = v;
-        str++;
+        str[i^1] = v;
     }
 }
 
index 3466082..40070ee 100644 (file)
@@ -350,8 +350,8 @@ static inline void pcnet_tmd_load(PCNetState *s, struct pcnet_TMD *tmd,
     } else {
         s->phys_mem_read(s->dma_opaque, addr, (void *)tmd, sizeof(*tmd), 0);
         le32_to_cpus(&tmd->tbadr);
-        le16_to_cpus(&tmd->length);
-        le16_to_cpus(&tmd->status);
+        le16_to_cpus((uint16_t *)&tmd->length);
+        le16_to_cpus((uint16_t *)&tmd->status);
         le32_to_cpus(&tmd->misc);
         le32_to_cpus(&tmd->res);
         if (BCR_SWSTYLE(s) == 3) {
@@ -416,8 +416,8 @@ static inline void pcnet_rmd_load(PCNetState *s, struct pcnet_RMD *rmd,
     } else {
         s->phys_mem_read(s->dma_opaque, addr, (void *)rmd, sizeof(*rmd), 0);
         le32_to_cpus(&rmd->rbadr);
-        le16_to_cpus(&rmd->buf_length);
-        le16_to_cpus(&rmd->status);
+        le16_to_cpus((uint16_t *)&rmd->buf_length);
+        le16_to_cpus((uint16_t *)&rmd->status);
         le32_to_cpus(&rmd->msg_length);
         le32_to_cpus(&rmd->res);
         if (BCR_SWSTYLE(s) == 3) {
index 97ac583..0783eaf 100644 (file)
--- a/monitor.c
+++ b/monitor.c
@@ -1824,7 +1824,7 @@ static int64_t expr_unary(void)
     case '$':
         {
             char buf[128], *q;
-            target_long reg;
+            target_long reg=0;
 
             pch++;
             q = buf;
diff --git a/vl.c b/vl.c
index 70950f8..3c1a476 100644 (file)
--- a/vl.c
+++ b/vl.c
@@ -4423,7 +4423,8 @@ static NetSocketState *net_socket_fd_init(VLANState *vlan, int fd,
 {
     int so_type=-1, optlen=sizeof(so_type);
 
-    if(getsockopt(fd, SOL_SOCKET, SO_TYPE, (char *)&so_type, &optlen)< 0) {
+    if(getsockopt(fd, SOL_SOCKET, SO_TYPE, (char *)&so_type,
+        (socklen_t *)&optlen)< 0) {
        fprintf(stderr, "qemu: error: getsockopt(SO_TYPE) for fd=%d failed\n", fd);
        return NULL;
     }