All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Andre Przywara" <andre.przywara@amd.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH 5/5] gcc4 warnings: miscellaneous minor things
Date: Thu, 06 Dec 2007 11:54:23 +0100	[thread overview]
Message-ID: <4757D4DF.6030504@amd.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 744 bytes --]

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

[-- Attachment #2: misc.diff --]
[-- Type: text/plain, Size: 3579 bytes --]

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	other threads:[~2007-12-06 10:55 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4757D4DF.6030504@amd.com \
    --to=andre.przywara@amd.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.