[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 09/11] chardev: Let qemu_chr_fe_* use unsigned ty
From: |
Philippe Mathieu-Daudé |
Subject: |
[Qemu-devel] [PATCH v2 09/11] chardev: Let qemu_chr_fe_* use unsigned type |
Date: |
Fri, 12 Oct 2018 02:22:15 +0200 |
Suggested-by: Paolo Bonzini <address@hidden>
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
---
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"
-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 = be->chr;
@@ -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);
}
-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 len)
{
Chardev *s = be->chr;
@@ -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);
}
-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 = be->chr;
- int offset = 0;
+ size_t offset = 0;
int res;
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)
}
}
-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 = 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)
}
/* 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 = 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, GIOCondition
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);
/**
* qemu_chr_fe_write_all:
@@ -198,7 +198,7 @@ int qemu_chr_fe_write(CharBackend *be, const uint8_t *buf,
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 len);
/**
* 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);
/**
* qemu_chr_fe_ioctl:
--
2.17.1
- [Qemu-devel] [PATCH v2 00/11] chardev: Convert IO handlers to use unsigned type, Philippe Mathieu-Daudé, 2018/10/11
- [Qemu-devel] [PATCH v2 01/11] hw/ipmi: Remove unnecessary declarations, Philippe Mathieu-Daudé, 2018/10/11
- [Qemu-devel] [PATCH v2 02/11] target/xtensa: Remove unnecessary declarations, Philippe Mathieu-Daudé, 2018/10/11
- [Qemu-devel] [PATCH v2 03/11] chardev: Simplify IOWatchPoll::fd_can_read as a GSourceFunc, Philippe Mathieu-Daudé, 2018/10/11
- [Qemu-devel] [PATCH v2 04/11] chardev: Assert backend's chr_can_read() is positive, Philippe Mathieu-Daudé, 2018/10/11
- [Qemu-devel] [PATCH v2 05/11] chardev: Let chr_sync_read() use unsigned type, Philippe Mathieu-Daudé, 2018/10/11
- [Qemu-devel] [PATCH v2 06/11] chardev: Let chr_write use unsigned type, Philippe Mathieu-Daudé, 2018/10/11
- [Qemu-devel] [PATCH v2 07/11] chardev: Let IOReadHandler use unsigned type, Philippe Mathieu-Daudé, 2018/10/11
- [Qemu-devel] [PATCH v2 09/11] chardev: Let qemu_chr_fe_* use unsigned type,
Philippe Mathieu-Daudé <=
- [Qemu-devel] [PATCH v2 08/11] chardev: Let IOCanReadHandler use unsigned type, Philippe Mathieu-Daudé, 2018/10/11
- [Qemu-devel] [PATCH v2 10/11] chardev: Let qemu_chr_be_* use unsigned type, Philippe Mathieu-Daudé, 2018/10/11
- [Qemu-devel] [PATCH v2 11/11] chardev: FDChardev::max_size be unsigned, Philippe Mathieu-Daudé, 2018/10/11
- Re: [Qemu-devel] [PATCH v2 00/11] chardev: Convert IO handlers to use unsigned type, Daniel P . Berrangé, 2018/10/12