From nobody Thu Nov 6 06:15:30 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1539304101247745.1767964940768; Thu, 11 Oct 2018 17:28:21 -0700 (PDT) Received: from localhost ([::1]:37713 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gAlJU-0001Jo-2l for importer@patchew.org; Thu, 11 Oct 2018 20:28:20 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33624) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gAlFG-0006X5-Ld for qemu-devel@nongnu.org; Thu, 11 Oct 2018 20:23:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gAlFF-0006iB-PQ for qemu-devel@nongnu.org; Thu, 11 Oct 2018 20:23:58 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33726) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gAlFF-0006hs-HV for qemu-devel@nongnu.org; Thu, 11 Oct 2018 20:23:57 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E057D30BF447 for ; Fri, 12 Oct 2018 00:23:56 +0000 (UTC) Received: from x1w.redhat.com (ovpn-204-29.brq.redhat.com [10.40.204.29]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C09616055B; Fri, 12 Oct 2018 00:23:48 +0000 (UTC) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Paolo Bonzini , Prasad J Pandit Date: Fri, 12 Oct 2018 02:22:15 +0200 Message-Id: <20181012002217.2864-10-philmd@redhat.com> In-Reply-To: <20181012002217.2864-1-philmd@redhat.com> References: <20181012002217.2864-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Fri, 12 Oct 2018 00:23:56 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v2 09/11] chardev: Let qemu_chr_fe_* use unsigned type X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RDMRC_1 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Suggested-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- chardev/char-fe.c | 8 ++++---- chardev/char-win-stdio.c | 2 +- chardev/char-win.c | 2 +- include/chardev/char-fe.h | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/chardev/char-fe.c b/chardev/char-fe.c index a8931f7afd..b732f6566b 100644 --- a/chardev/char-fe.c +++ b/chardev/char-fe.c @@ -31,7 +31,7 @@ #include "chardev/char-io.h" #include "chardev/char-mux.h" =20 -int qemu_chr_fe_write(CharBackend *be, const uint8_t *buf, int len) +size_t qemu_chr_fe_write(CharBackend *be, const uint8_t *buf, size_t len) { Chardev *s =3D be->chr; =20 @@ -42,7 +42,7 @@ int qemu_chr_fe_write(CharBackend *be, const uint8_t *buf= , int len) return qemu_chr_write(s, buf, len, false); } =20 -int qemu_chr_fe_write_all(CharBackend *be, const uint8_t *buf, int len) +size_t qemu_chr_fe_write_all(CharBackend *be, const uint8_t *buf, size_t l= en) { Chardev *s =3D be->chr; =20 @@ -53,10 +53,10 @@ int qemu_chr_fe_write_all(CharBackend *be, const uint8_= t *buf, int len) return qemu_chr_write(s, buf, len, true); } =20 -int qemu_chr_fe_read_all(CharBackend *be, uint8_t *buf, int len) +size_t qemu_chr_fe_read_all(CharBackend *be, uint8_t *buf, size_t len) { Chardev *s =3D be->chr; - int offset =3D 0; + size_t offset =3D 0; int res; =20 if (!s || !CHARDEV_GET_CLASS(s)->chr_sync_read) { diff --git a/chardev/char-win-stdio.c b/chardev/char-win-stdio.c index efcf7827eb..6b1a97144b 100644 --- a/chardev/char-win-stdio.c +++ b/chardev/char-win-stdio.c @@ -221,7 +221,7 @@ static void char_win_stdio_finalize(Object *obj) } } =20 -static int win_stdio_write(Chardev *chr, const uint8_t *buf, int len) +static size_t win_stdio_write(Chardev *chr, const uint8_t *buf, size_t len) { HANDLE hStdOut =3D GetStdHandle(STD_OUTPUT_HANDLE); DWORD dwSize; diff --git a/chardev/char-win.c b/chardev/char-win.c index 05518e0958..7ea7d0a371 100644 --- a/chardev/char-win.c +++ b/chardev/char-win.c @@ -152,7 +152,7 @@ int win_chr_pipe_poll(void *opaque) } =20 /* Called with chr_write_lock held. */ -static int win_chr_write(Chardev *chr, const uint8_t *buf, int len1) +static size_t win_chr_write(Chardev *chr, const uint8_t *buf, size_t len1) { WinChardev *s =3D WIN_CHARDEV(chr); DWORD len, ret, size, err; diff --git a/include/chardev/char-fe.h b/include/chardev/char-fe.h index 46c997d352..2f95c890d8 100644 --- a/include/chardev/char-fe.h +++ b/include/chardev/char-fe.h @@ -184,7 +184,7 @@ guint qemu_chr_fe_add_watch(CharBackend *be, GIOConditi= on cond, * * Returns: the number of bytes consumed (0 if no associated Chardev) */ -int qemu_chr_fe_write(CharBackend *be, const uint8_t *buf, int len); +size_t qemu_chr_fe_write(CharBackend *be, const uint8_t *buf, size_t len); =20 /** * qemu_chr_fe_write_all: @@ -198,7 +198,7 @@ int qemu_chr_fe_write(CharBackend *be, const uint8_t *b= uf, int len); * * Returns: the number of bytes consumed (0 if no associated Chardev) */ -int qemu_chr_fe_write_all(CharBackend *be, const uint8_t *buf, int len); +size_t qemu_chr_fe_write_all(CharBackend *be, const uint8_t *buf, size_t l= en); =20 /** * qemu_chr_fe_read_all: @@ -209,7 +209,7 @@ int qemu_chr_fe_write_all(CharBackend *be, const uint8_= t *buf, int len); * * Returns: the number of bytes read (0 if no associated Chardev) */ -int qemu_chr_fe_read_all(CharBackend *be, uint8_t *buf, int len); +size_t qemu_chr_fe_read_all(CharBackend *be, uint8_t *buf, size_t len); =20 /** * qemu_chr_fe_ioctl: --=20 2.17.1