qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 5/5] gcc4 warnings: miscellaneous minor things


From: Andre Przywara
Subject: [Qemu-devel] [PATCH 5/5] gcc4 warnings: miscellaneous minor things
Date: Thu, 06 Dec 2007 11:54:23 +0100
User-agent: Thunderbird 1.5.0.10 (X11/20070409)

some things found on the way:
- missing include in hw/adlib.c
- avoid double definition of NDEBUG in aes.h
- fix some strange pointer acrobatics in hw/ide.c#padstr
- fix getsockopt socklen_t warning
- fix uninitialized variable warning in monitor.c
- fix wrong signedness in le16_to_cpus calls in hw/pcnet.c

--
Andre Przywara
AMD-Operating System Research Center (OSRC), Dresden, Germany
Tel: +49 351 277-84917
----to satisfy European Law for business letters:
AMD Saxony Limited Liability Company & Co. KG,
Wilschdorfer Landstr. 101, 01109 Dresden, Germany
Register Court Dresden: HRA 4896, General Partner authorized
to represent: AMD Saxony LLC (Wilmington, Delaware, US)
General Manager of AMD Saxony LLC: Dr. Hans-R. Deppe, Thomas McCoy
Index: aes.c
===================================================================
RCS file: /sources/qemu/qemu/aes.c,v
retrieving revision 1.4
diff -p -u -r1.4 aes.c
--- aes.c       11 Nov 2007 02:51:15 -0000      1.4
+++ aes.c       5 Dec 2007 23:38:56 -0000
@@ -30,7 +30,10 @@
 #include "qemu-common.h"
 #include "aes.h"
 
+#ifndef NDEBUG
 #define NDEBUG
+#endif
+
 #include <assert.h>
 
 typedef uint32_t u32;
Index: hw/adlib.c
===================================================================
RCS file: /sources/qemu/qemu/hw/adlib.c,v
retrieving revision 1.10
diff -p -u -r1.10 adlib.c
--- hw/adlib.c  2 Dec 2007 17:47:33 -0000       1.10
+++ hw/adlib.c  5 Dec 2007 23:38:57 -0000
@@ -26,6 +26,7 @@
 #include "hw.h"
 #include "audiodev.h"
 #include "audio/audio.h"
+#include "isa.h"
 
 //#define DEBUG
 
Index: hw/ide.c
===================================================================
RCS file: /sources/qemu/qemu/hw/ide.c,v
retrieving revision 1.72
diff -p -u -r1.72 ide.c
--- hw/ide.c    18 Nov 2007 01:44:37 -0000      1.72
+++ hw/ide.c    5 Dec 2007 23:38:57 -0000
@@ -430,8 +430,7 @@ static void padstr(char *str, const char
             v = *src++;
         else
             v = ' ';
-        *(char *)((long)str ^ 1) = v;
-        str++;
+        str[i^1] = v;
     }
 }
 
Index: hw/pcnet.c
===================================================================
RCS file: /sources/qemu/qemu/hw/pcnet.c,v
retrieving revision 1.20
diff -p -u -r1.20 pcnet.c
--- hw/pcnet.c  17 Nov 2007 17:14:45 -0000      1.20
+++ hw/pcnet.c  5 Dec 2007 23:38:58 -0000
@@ -350,8 +350,8 @@ static inline void pcnet_tmd_load(PCNetS
     } 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(PCNetS
     } 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: monitor.c
===================================================================
RCS file: /sources/qemu/qemu/monitor.c,v
retrieving revision 1.91
diff -p -u -r1.91 monitor.c
--- monitor.c   3 Dec 2007 17:05:38 -0000       1.91
+++ monitor.c   5 Dec 2007 23:38:57 -0000
@@ -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;
Index: vl.c
===================================================================
RCS file: /sources/qemu/qemu/vl.c,v
retrieving revision 1.376
diff -p -u -r1.376 vl.c
--- vl.c        4 Dec 2007 00:10:34 -0000       1.376
+++ vl.c        5 Dec 2007 23:38:57 -0000
@@ -4397,7 +4398,8 @@ static NetSocketState *net_socket_fd_ini
 {
     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;
     }

reply via email to

[Prev in Thread] Current Thread [Next in Thread]