qemu-trivial.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-trivial] [PATCH] net/socket: Fix compiler warning (regression for MinGW)
@ 2012-09-20 19:32 Stefan Weil
  2012-09-22 16:32 ` Stefan Hajnoczi
  0 siblings, 1 reply; 5+ messages in thread
From: Stefan Weil @ 2012-09-20 19:32 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: qemu-trivial, Stefan Weil, qemu-devel

Add a type cast which was removed by commit
213fd5087e2e4e2da10ad266df0ba950cf7618bf again.

Without it, MinGW compilers complain:

net/socket.c:136: warning:
 pointer targets in passing argument 2 of ‘sendto’ differ in signedness
/usr/lib/gcc/amd64-mingw32msvc/4.4.4/../../../../amd64-mingw32msvc/include/winsock2.h:1313: note:
 expected ‘const char *’ but argument is of type ‘const uint8_t *’

Signed-off-by: Stefan Weil <sw@weilnetz.de>
---
 net/socket.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/socket.c b/net/socket.c
index 69aad03..833f79f 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -131,7 +131,7 @@ static ssize_t net_socket_receive_dgram(NetClientState *nc, const uint8_t *buf,
     ssize_t ret;
 
     do {
-        ret = sendto(s->fd, buf, size, 0,
+        ret = sendto(s->fd, (const void *)buf, size, 0,
                      (struct sockaddr *)&s->dgram_dst,
                      sizeof(s->dgram_dst));
     } while (ret == -1 && errno == EINTR);
-- 
1.7.10



^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-09-22 18:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-20 19:32 [Qemu-trivial] [PATCH] net/socket: Fix compiler warning (regression for MinGW) Stefan Weil
2012-09-22 16:32 ` Stefan Hajnoczi
2012-09-22 18:01   ` [Qemu-trivial] [Qemu-devel] " Michael Tokarev
2012-09-22 18:17     ` Stefan Weil
2012-09-22 18:25       ` Blue Swirl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).