From patchwork Tue Mar 5 09:51:21 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lei Li X-Patchwork-Id: 224976 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 2D6232C02F2 for ; Tue, 5 Mar 2013 20:52:03 +1100 (EST) Received: from localhost ([::1]:58876 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCoXR-0003LS-Ef for incoming@patchwork.ozlabs.org; Tue, 05 Mar 2013 04:52:01 -0500 Received: from eggs.gnu.org ([208.118.235.92]:34516) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCoX5-0003K7-F7 for qemu-devel@nongnu.org; Tue, 05 Mar 2013 04:51:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UCoX3-0006AG-Sh for qemu-devel@nongnu.org; Tue, 05 Mar 2013 04:51:39 -0500 Received: from e28smtp05.in.ibm.com ([122.248.162.5]:60685) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCoX3-00069v-3W for qemu-devel@nongnu.org; Tue, 05 Mar 2013 04:51:37 -0500 Received: from /spool/local by e28smtp05.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 5 Mar 2013 15:19:14 +0530 Received: from d28dlp01.in.ibm.com (9.184.220.126) by e28smtp05.in.ibm.com (192.168.1.135) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 5 Mar 2013 15:19:11 +0530 Received: from d28relay03.in.ibm.com (d28relay03.in.ibm.com [9.184.220.60]) by d28dlp01.in.ibm.com (Postfix) with ESMTP id A84E4E002D for ; Tue, 5 Mar 2013 15:22:42 +0530 (IST) Received: from d28av05.in.ibm.com (d28av05.in.ibm.com [9.184.220.67]) by d28relay03.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r259pPGQ28508332 for ; Tue, 5 Mar 2013 15:21:25 +0530 Received: from d28av05.in.ibm.com (loopback [127.0.0.1]) by d28av05.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r259pSYs029344 for ; Tue, 5 Mar 2013 20:51:30 +1100 Received: from localhost.cn.ibm.com ([9.115.122.212]) by d28av05.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id r259pQdI029190; Tue, 5 Mar 2013 20:51:27 +1100 From: Lei Li To: qemu-devel@nongnu.org Date: Tue, 5 Mar 2013 17:51:21 +0800 Message-Id: <1362477081-31843-1-git-send-email-lilei@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.7.6 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13030509-8256-0000-0000-00000679296F X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 122.248.162.5 Cc: stefanha@gmail.com, mdroh@linux.vnet.ibm.com, Lei Li Subject: [Qemu-devel] [PATCH] osdep: pass const char pointer to setsockopt X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Pass the right type for setsockopt(), and this will also fix the compiler warning when cross build for qemu-ga.exe: util/osdep.c: In function 'socket_set_nodelay': util/osdep.c:69:5: warning: passing argument 4 of 'setsockopt' from incompatible pointer type [enabled by default] In file included from /home/lei/qemu_b/include/sysemu/os-win32.h:30:0, from /home/lei/qemu_b/include/qemu-common.h:46, from util/osdep.c:48: /usr/i686-w64-mingw32/sys-root/mingw/include/winsock2.h:990:63: note: expected 'const char *' but argument is of type 'int *' Signed-off-by: Lei Li --- util/osdep.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/osdep.c b/util/osdep.c index c408261..ce472a9 100644 --- a/util/osdep.c +++ b/util/osdep.c @@ -57,7 +57,7 @@ static const char *qemu_version = QEMU_VERSION; int socket_set_cork(int fd, int v) { #if defined(SOL_TCP) && defined(TCP_CORK) - return setsockopt(fd, SOL_TCP, TCP_CORK, &v, sizeof(v)); + return setsockopt(fd, SOL_TCP, TCP_CORK, (char *)&v, sizeof(v)); #else return 0; #endif @@ -66,7 +66,7 @@ int socket_set_cork(int fd, int v) int socket_set_nodelay(int fd) { int v = 1; - return setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &v, sizeof(v)); + return setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, (char *)&v, sizeof(v)); } int qemu_madvise(void *addr, size_t len, int advice)