@@ -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) {
@@ -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;
@@ -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;
@@ -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:
Suggested-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> --- 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(-)