1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-03 04:22:47 -05:00

Make lots of 'int' length fields into size_t.

This is a general cleanup which has been overdue for some time: lots
of length fields are now the machine word type rather than the (in
practice) fixed 'int'.
This commit is contained in:
Simon Tatham
2019-02-06 20:42:44 +00:00
parent f60fe670ad
commit 0cda34c6f8
52 changed files with 312 additions and 285 deletions

View File

@ -23,7 +23,7 @@ struct Serial {
LogContext *logctx;
int fd;
bool finished;
int inbufsize;
size_t inbufsize;
bufchain output_data;
Backend backend;
};
@ -423,7 +423,8 @@ static void serial_uxsel_setup(Serial *serial)
static void serial_try_write(Serial *serial)
{
void *data;
int len, ret;
size_t len;
ssize_t ret;
assert(serial->fd >= 0);
@ -450,7 +451,7 @@ static void serial_try_write(Serial *serial)
/*
* Called to send data down the serial connection.
*/
static int serial_send(Backend *be, const char *buf, int len)
static size_t serial_send(Backend *be, const char *buf, size_t len)
{
Serial *serial = container_of(be, Serial, backend);
@ -466,7 +467,7 @@ static int serial_send(Backend *be, const char *buf, int len)
/*
* Called to query the current sendability status.
*/
static int serial_sendbuffer(Backend *be)
static size_t serial_sendbuffer(Backend *be)
{
Serial *serial = container_of(be, Serial, backend);
return bufchain_size(&serial->output_data);
@ -519,7 +520,7 @@ static bool serial_sendok(Backend *be)
return true;
}
static void serial_unthrottle(Backend *be, int backlog)
static void serial_unthrottle(Backend *be, size_t backlog)
{
Serial *serial = container_of(be, Serial, backend);
serial->inbufsize = backlog;