From: André Fonseca Date: Tue, 29 Aug 2023 08:11:10 +0000 (+0200) Subject: change type of result variables to ssize_t X-Git-Tag: libserialport-0.1.2~10 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=fd20b0fc5a34cd7f776e4af6c763f59041de223b;p=libserialport.git change type of result variables to ssize_t These variables are being used to store the result of read/write calls, which return a ssize_t value, which depending on platform can be bigger than an int. --- diff --git a/serialport.c b/serialport.c index e6097ee..1b5a95e 100644 --- a/serialport.c +++ b/serialport.c @@ -886,7 +886,7 @@ SP_API enum sp_return sp_blocking_write(struct sp_port *port, const void *buf, unsigned char *ptr = (unsigned char *) buf; struct timeout timeout; fd_set fds; - int result; + ssize_t result; timeout_start(&timeout, timeout_ms); @@ -1091,7 +1091,7 @@ SP_API enum sp_return sp_blocking_read(struct sp_port *port, void *buf, unsigned char *ptr = (unsigned char *) buf; struct timeout timeout; fd_set fds; - int result; + ssize_t result; timeout_start(&timeout, timeout_ms); @@ -1214,7 +1214,7 @@ SP_API enum sp_return sp_blocking_read_next(struct sp_port *port, void *buf, size_t bytes_read = 0; struct timeout timeout; fd_set fds; - int result; + ssize_t result; timeout_start(&timeout, timeout_ms);