@@ -61,7 +61,7 @@ static int rng_egd_chr_can_read(void *opaque)
return size;
}
-static void rng_egd_chr_read(void *opaque, const uint8_t *buf, int size)
+static void rng_egd_chr_read(void *opaque, const uint8_t *buf, size_t size)
{
RngEgd *s = RNG_EGD(opaque);
size_t buf_offset = 0;
@@ -209,7 +209,7 @@ static int mux_chr_can_read(void *opaque)
return 0;
}
-static void mux_chr_read(void *opaque, const uint8_t *buf, int size)
+static void mux_chr_read(void *opaque, const uint8_t *buf, size_t size)
{
Chardev *chr = CHARDEV(opaque);
MuxChardev *d = MUX_CHARDEV(opaque);
@@ -1923,7 +1923,7 @@ static int gdb_chr_can_receive(void *opaque)
return MAX_PACKET_LENGTH;
}
-static void gdb_chr_receive(void *opaque, const uint8_t *buf, int size)
+static void gdb_chr_receive(void *opaque, const uint8_t *buf, size_t size)
{
int i;
@@ -1929,7 +1929,7 @@ static int pxa2xx_fir_is_empty(void *opaque)
return (s->rx_len < 64);
}
-static void pxa2xx_fir_rx(void *opaque, const uint8_t *buf, int size)
+static void pxa2xx_fir_rx(void *opaque, const uint8_t *buf, size_t size)
{
PXA2xxFIrState *s = (PXA2xxFIrState *) opaque;
if (!(s->control[0] & (1 << 4))) /* RXE */
@@ -1072,7 +1072,8 @@ static int strongarm_uart_can_receive(void *opaque)
return 1;
}
-static void strongarm_uart_receive(void *opaque, const uint8_t *buf, int size)
+static void strongarm_uart_receive(void *opaque, const uint8_t *buf,
+ size_t size)
{
StrongARMUARTState *s = opaque;
int i;
@@ -235,7 +235,7 @@ static void bcm2835_aux_put_fifo(void *opaque, uint8_t value)
bcm2835_aux_update(s);
}
-static void bcm2835_aux_receive(void *opaque, const uint8_t *buf, int size)
+static void bcm2835_aux_receive(void *opaque, const uint8_t *buf, size_t size)
{
bcm2835_aux_put_fifo(opaque, *buf);
}
@@ -332,7 +332,7 @@ static void uart_write_tx_fifo(CadenceUARTState *s, const uint8_t *buf,
cadence_uart_xmit(NULL, G_IO_OUT, s);
}
-static void uart_receive(void *opaque, const uint8_t *buf, int size)
+static void uart_receive(void *opaque, const uint8_t *buf, size_t size)
{
CadenceUARTState *s = opaque;
uint32_t ch_mode = s->r[R_MR] & UART_MR_CHMODE;
@@ -119,7 +119,7 @@ static int uart_can_receive(void *opaque)
return 0;
}
-static void uart_receive(void *opaque, const uint8_t *buf, int size)
+static void uart_receive(void *opaque, const uint8_t *buf, size_t size)
{
CMSDKAPBUART *s = CMSDK_APB_UART(opaque);
@@ -119,7 +119,7 @@ static int uart_can_rx(void *opaque)
return !(s->reg_st & ST_RX_RDY);
}
-static void uart_rx(void *opaque, const uint8_t *buf, int size)
+static void uart_rx(void *opaque, const uint8_t *buf, size_t size)
{
DigicUartState *s = opaque;
@@ -601,7 +601,7 @@ static void serial_receive_break(ESCCChannelState *s)
escc_update_irq(s);
}
-static void serial_receive1(void *opaque, const uint8_t *buf, int size)
+static void serial_receive1(void *opaque, const uint8_t *buf, size_t size)
{
ESCCChannelState *s = opaque;
serial_receive_byte(s, buf[0]);
@@ -166,7 +166,7 @@ static Property etraxfs_ser_properties[] = {
DEFINE_PROP_END_OF_LIST(),
};
-static void serial_receive(void *opaque, const uint8_t *buf, int size)
+static void serial_receive(void *opaque, const uint8_t *buf, size_t size)
{
ETRAXSerial *s = opaque;
int i;
@@ -495,7 +495,8 @@ static int exynos4210_uart_can_receive(void *opaque)
}
-static void exynos4210_uart_receive(void *opaque, const uint8_t *buf, int size)
+static void exynos4210_uart_receive(void *opaque, const uint8_t *buf,
+ size_t size)
{
Exynos4210UartState *s = (Exynos4210UartState *)opaque;
int i;
@@ -137,7 +137,7 @@ static int grlib_apbuart_can_receive(void *opaque)
return FIFO_LENGTH - uart->len;
}
-static void grlib_apbuart_receive(void *opaque, const uint8_t *buf, int size)
+static void grlib_apbuart_receive(void *opaque, const uint8_t *buf, size_t size)
{
UART *uart = opaque;
@@ -315,7 +315,7 @@ static void imx_put_data(void *opaque, uint32_t value)
imx_update(s);
}
-static void imx_receive(void *opaque, const uint8_t *buf, int size)
+static void imx_receive(void *opaque, const uint8_t *buf, size_t size)
{
imx_put_data(opaque, *buf);
}
@@ -468,7 +468,7 @@ static int hostdev_can_receive(void *opaque)
return ch->rx_enabled ? available_bytes : 0;
}
-static void hostdev_receive(void *opaque, const uint8_t *buf, int size)
+static void hostdev_receive(void *opaque, const uint8_t *buf, size_t size)
{
SCC2698Channel *ch = opaque;
IPOctalState *dev = ch->ipoctal;
@@ -88,7 +88,7 @@ void lm32_juart_set_jrx(DeviceState *d, uint32_t jtx)
s->jrx &= ~JRX_FULL;
}
-static void juart_rx(void *opaque, const uint8_t *buf, int size)
+static void juart_rx(void *opaque, const uint8_t *buf, size_t size)
{
LM32JuartState *s = opaque;
@@ -211,7 +211,7 @@ static const MemoryRegionOps uart_ops = {
},
};
-static void uart_rx(void *opaque, const uint8_t *buf, int size)
+static void uart_rx(void *opaque, const uint8_t *buf, size_t size)
{
LM32UartState *s = opaque;
@@ -274,7 +274,7 @@ static int mcf_uart_can_receive(void *opaque)
return s->rx_enabled && (s->sr & MCF_UART_FFULL) == 0;
}
-static void mcf_uart_receive(void *opaque, const uint8_t *buf, int size)
+static void mcf_uart_receive(void *opaque, const uint8_t *buf, size_t size)
{
mcf_uart_state *s = (mcf_uart_state *)opaque;
@@ -158,7 +158,7 @@ static const MemoryRegionOps uart_mmio_ops = {
.endianness = DEVICE_NATIVE_ENDIAN,
};
-static void uart_rx(void *opaque, const uint8_t *buf, int size)
+static void uart_rx(void *opaque, const uint8_t *buf, size_t size)
{
MilkymistUartState *s = opaque;
@@ -260,7 +260,7 @@ static void pl011_put_fifo(void *opaque, uint32_t value)
}
}
-static void pl011_receive(void *opaque, const uint8_t *buf, int size)
+static void pl011_receive(void *opaque, const uint8_t *buf, size_t size)
{
pl011_put_fifo(opaque, *buf);
}
@@ -71,7 +71,7 @@ static int chr_can_read(void *opaque)
return 1;
}
-static void chr_read(void *opaque, const uint8_t *buf, int size)
+static void chr_read(void *opaque, const uint8_t *buf, size_t size)
{
SCLPConsoleLM *scon = opaque;
@@ -59,7 +59,7 @@ static int chr_can_read(void *opaque)
}
/* Send data from a char device over to the guest */
-static void chr_read(void *opaque, const uint8_t *buf, int size)
+static void chr_read(void *opaque, const uint8_t *buf, size_t size)
{
SCLPConsole *scon = opaque;
@@ -105,7 +105,7 @@ do { fprintf(stderr, "serial: " fmt , ## __VA_ARGS__); } while (0)
do {} while (0)
#endif
-static void serial_receive1(void *opaque, const uint8_t *buf, int size);
+static void serial_receive1(void *opaque, const uint8_t *buf, size_t size);
static void serial_xmit(SerialState *s);
static inline void recv_fifo_put(SerialState *s, uint8_t chr)
@@ -606,7 +606,7 @@ static int serial_can_receive1(void *opaque)
return serial_can_receive(s);
}
-static void serial_receive1(void *opaque, const uint8_t *buf, int size)
+static void serial_receive1(void *opaque, const uint8_t *buf, size_t size)
{
SerialState *s = opaque;
@@ -327,7 +327,7 @@ static void sh_serial_timeout_int(void *opaque)
}
}
-static void sh_serial_receive1(void *opaque, const uint8_t *buf, int size)
+static void sh_serial_receive1(void *opaque, const uint8_t *buf, size_t size)
{
sh_serial_state *s = opaque;
@@ -28,7 +28,7 @@ static int vty_can_receive(void *opaque)
return VTERM_BUFSIZE - (dev->in - dev->out);
}
-static void vty_receive(void *opaque, const uint8_t *buf, int size)
+static void vty_receive(void *opaque, const uint8_t *buf, size_t size)
{
VIOsPAPRVTYDevice *dev = VIO_SPAPR_VTY_DEVICE(opaque);
int i;
@@ -42,7 +42,7 @@ static void vty_receive(void *opaque, const uint8_t *buf, int size)
static bool reported;
if (!reported) {
error_report("VTY input buffer exhausted - characters dropped."
- " (input size = %i)", size);
+ " (input size = %zu)", size);
reported = true;
}
break;
@@ -49,7 +49,8 @@ static int stm32f2xx_usart_can_receive(void *opaque)
return 0;
}
-static void stm32f2xx_usart_receive(void *opaque, const uint8_t *buf, int size)
+static void stm32f2xx_usart_receive(void *opaque, const uint8_t *buf,
+ size_t size)
{
STM32F2XXUsartState *s = opaque;
@@ -90,7 +90,7 @@ static gboolean send_timing_mark_cb(gpointer opaque)
* As of now, for such case, we simply terminate the connection,
* and we should come back here later with a better solution.
*/
-static void terminal_read(void *opaque, const uint8_t *buf, int size)
+static void terminal_read(void *opaque, const uint8_t *buf, size_t size)
{
Terminal3270 *t = opaque;
CcwDevice *ccw_dev = CCW_DEVICE(t);
@@ -134,7 +134,7 @@ static int chr_can_read(void *opaque)
}
/* Send data from a char device over to the guest */
-static void chr_read(void *opaque, const uint8_t *buf, int size)
+static void chr_read(void *opaque, const uint8_t *buf, size_t size)
{
VirtConsole *vcon = opaque;
VirtIOSerialPort *port = VIRTIO_SERIAL_PORT(vcon);
@@ -122,7 +122,7 @@ static int xencons_can_receive(void *opaque)
return ring_free_bytes(con);
}
-static void xencons_receive(void *opaque, const uint8_t *buf, int len)
+static void xencons_receive(void *opaque, const uint8_t *buf, size_t len)
{
struct XenConsole *con = opaque;
struct xencons_interface *intf = con->sring;
@@ -177,7 +177,7 @@ static Property xilinx_uartlite_properties[] = {
DEFINE_PROP_END_OF_LIST(),
};
-static void uart_rx(void *opaque, const uint8_t *buf, int size)
+static void uart_rx(void *opaque, const uint8_t *buf, size_t size)
{
XilinxUARTLite *s = opaque;
@@ -312,7 +312,7 @@ static int can_receive(void *opaque)
return 1;
}
-static void receive(void *opaque, const uint8_t *buf, int size)
+static void receive(void *opaque, const uint8_t *buf, size_t size)
{
IPMIBmcExtern *ibe = opaque;
int i;
@@ -628,14 +628,14 @@ static int ivshmem_can_receive(void *opaque)
return sizeof(s->msg_buf) - s->msg_buffered_bytes;
}
-static void ivshmem_read(void *opaque, const uint8_t *buf, int size)
+static void ivshmem_read(void *opaque, const uint8_t *buf, size_t size)
{
IVShmemState *s = opaque;
Error *err = NULL;
int fd;
int64_t msg;
- assert(size >= 0 && s->msg_buffered_bytes + size <= sizeof(s->msg_buf));
+ assert(s->msg_buffered_bytes + size <= sizeof(s->msg_buf));
memcpy((unsigned char *)&s->msg_buf + s->msg_buffered_bytes, buf, size);
s->msg_buffered_bytes += size;
if (s->msg_buffered_bytes < sizeof(s->msg_buf)) {
@@ -74,7 +74,7 @@ static int htif_can_recv(void *opaque)
* Called by the char dev to supply input to HTIF console.
* We assume that we will receive one character at a time.
*/
-static void htif_recv(void *opaque, const uint8_t *buf, int size)
+static void htif_recv(void *opaque, const uint8_t *buf, size_t size)
{
HTIFState *htifstate = opaque;
@@ -123,7 +123,7 @@ static const MemoryRegionOps uart_ops = {
}
};
-static void uart_rx(void *opaque, const uint8_t *buf, int size)
+static void uart_rx(void *opaque, const uint8_t *buf, size_t size)
{
SiFiveUARTState *s = opaque;
@@ -270,13 +270,13 @@ static void ccid_card_vscard_drop_connection(PassthruState *card)
card->vscard_in_pos = card->vscard_in_hdr = 0;
}
-static void ccid_card_vscard_read(void *opaque, const uint8_t *buf, int size)
+static void ccid_card_vscard_read(void *opaque, const uint8_t *buf, size_t size)
{
PassthruState *card = opaque;
VSCMsgHeader *hdr;
if (card->vscard_in_pos + size > VSCARD_IN_SIZE) {
- error_report("no room for data: pos %u + size %d > %" PRId64 "."
+ error_report("no room for data: pos %u + size %zu > %" PRId64 "."
" dropping connection.",
card->vscard_in_pos, size, VSCARD_IN_SIZE);
ccid_card_vscard_drop_connection(card);
@@ -431,7 +431,7 @@ static int usb_serial_can_read(void *opaque)
return RECV_BUF - s->recv_used;
}
-static void usb_serial_read(void *opaque, const uint8_t *buf, int size)
+static void usb_serial_read(void *opaque, const uint8_t *buf, size_t size)
{
USBSerialState *s = opaque;
int first_size, start;
@@ -1302,7 +1302,7 @@ static int usbredir_chardev_can_read(void *opaque)
return 1 * MiB;
}
-static void usbredir_chardev_read(void *opaque, const uint8_t *buf, int size)
+static void usbredir_chardev_read(void *opaque, const uint8_t *buf, size_t size)
{
USBRedirDevice *dev = opaque;
@@ -167,7 +167,7 @@ void qemu_del_wait_object(HANDLE handle, WaitObjectFunc *func, void *opaque);
/* async I/O support */
-typedef void IOReadHandler(void *opaque, const uint8_t *buf, int size);
+typedef void IOReadHandler(void *opaque, const uint8_t *buf, size_t size);
/**
* IOCanReadHandler: Return the number of bytes that #IOReadHandler can accept
@@ -4240,14 +4240,14 @@ static void handle_qmp_command(void *opaque, QObject *req, Error *err)
qemu_bh_schedule(qmp_dispatcher_bh);
}
-static void monitor_qmp_read(void *opaque, const uint8_t *buf, int size)
+static void monitor_qmp_read(void *opaque, const uint8_t *buf, size_t size)
{
Monitor *mon = opaque;
json_message_parser_feed(&mon->qmp.parser, (const char *) buf, size);
}
-static void monitor_read(void *opaque, const uint8_t *buf, int size)
+static void monitor_read(void *opaque, const uint8_t *buf, size_t size)
{
Monitor *old_mon = cur_mon;
int i;
@@ -692,7 +692,7 @@ static int compare_chr_can_read(void *opaque)
* Called from the main thread on the primary for packets
* arriving over the socket from the primary.
*/
-static void compare_pri_chr_in(void *opaque, const uint8_t *buf, int size)
+static void compare_pri_chr_in(void *opaque, const uint8_t *buf, size_t size)
{
CompareState *s = COLO_COMPARE(opaque);
int ret;
@@ -709,7 +709,7 @@ static void compare_pri_chr_in(void *opaque, const uint8_t *buf, int size)
* Called from the main thread on the primary for packets
* arriving over the socket from the secondary.
*/
-static void compare_sec_chr_in(void *opaque, const uint8_t *buf, int size)
+static void compare_sec_chr_in(void *opaque, const uint8_t *buf, size_t size)
{
CompareState *s = COLO_COMPARE(opaque);
int ret;
@@ -119,7 +119,7 @@ static int redirector_chr_can_read(void *opaque)
return REDIRECTOR_MAX_LEN;
}
-static void redirector_chr_read(void *opaque, const uint8_t *buf, int size)
+static void redirector_chr_read(void *opaque, const uint8_t *buf, size_t size)
{
NetFilterState *nf = opaque;
MirrorState *s = FILTER_REDIRECTOR(nf);
@@ -718,7 +718,7 @@ static int guestfwd_can_read(void *opaque)
return slirp_socket_can_recv(fwd->slirp, fwd->server, fwd->port);
}
-static void guestfwd_read(void *opaque, const uint8_t *buf, int size)
+static void guestfwd_read(void *opaque, const uint8_t *buf, size_t size)
{
struct GuestFwd *fwd = opaque;
slirp_socket_recv(fwd->slirp, fwd->server, fwd->port, buf, size);
@@ -657,7 +657,7 @@ static void qtest_process_inbuf(CharBackend *chr, GString *inbuf)
}
}
-static void qtest_read(void *opaque, const uint8_t *buf, int size)
+static void qtest_read(void *opaque, const uint8_t *buf, size_t size)
{
CharBackend *chr = opaque;
@@ -168,7 +168,7 @@ static int sim_console_can_read(void *opaque)
return sizeof(p->input.buffer) - p->input.offset;
}
-static void sim_console_read(void *opaque, const uint8_t *buf, int size)
+static void sim_console_read(void *opaque, const uint8_t *buf, size_t size)
{
XtensaSimConsole *p = opaque;
size_t copy = sizeof(p->input.buffer) - p->input.offset;