Wrap recv to avoid warnings

Avoid warnings like these by wrapping recv():
  CC    slirp/ip_icmp.o
/src/qemu/slirp/ip_icmp.c: In function 'icmp_receive':
/src/qemu/slirp/ip_icmp.c:418:5: error: passing argument 2 of 'recv' from incompatible pointer type [-Werror]
/usr/local/lib/gcc/i686-mingw32msvc/4.6.0/../../../../i686-mingw32msvc/include/winsock2.h:547:32: note: expected 'char *' but argument is of type 'struct icmp *'

Remove also casts used to avoid warnings.

Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
This commit is contained in:
Blue Swirl 2011-07-23 20:04:29 +00:00
parent aad04cd024
commit 00aa0040e8
13 changed files with 21 additions and 15 deletions

View file

@ -200,6 +200,12 @@ int qemu_eventfd(int pipefd[2]);
int qemu_pipe(int pipefd[2]);
#endif
#ifdef _WIN32
#define qemu_recv(sockfd, buf, len, flags) recv(sockfd, (void *)buf, len, flags)
#else
#define qemu_recv(sockfd, buf, len, flags) recv(sockfd, buf, len, flags)
#endif
/* Error handling. */
void QEMU_NORETURN hw_error(const char *fmt, ...) GCC_FMT_ATTR(1, 2);