@@ -494,7 +494,7 @@ static gboolean tcp_chr_hup(QIOChannel *channel,
return G_SOURCE_REMOVE;
}
-static int tcp_chr_sync_read(Chardev *chr, const uint8_t *buf, int len)
+static size_t tcp_chr_sync_read(Chardev *chr, const uint8_t *buf, size_t len)
{
SocketChardev *s = SOCKET_CHARDEV(chr);
int size;
@@ -251,7 +251,7 @@ typedef struct ChardevClass {
bool *be_opened, Error **errp);
int (*chr_write)(Chardev *s, const uint8_t *buf, int len);
- int (*chr_sync_read)(Chardev *s, const uint8_t *buf, int len);
+ size_t (*chr_sync_read)(Chardev *s, const uint8_t *buf, size_t len);
GSource *(*chr_add_watch)(Chardev *s, GIOCondition cond);
void (*chr_update_read_handler)(Chardev *s);
int (*chr_ioctl)(Chardev *s, int cmd, void *arg);
Note than tcp_chr_recv() already use size_t. Suggested-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> --- chardev/char-socket.c | 2 +- include/chardev/char.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)