From: André Fonseca Date: Tue, 29 Aug 2023 08:11:10 +0000 (+0200) Subject: change type of result variables to ssize_t X-Git-Url: http://sigrok.org/gitweb/?p=libserialport.git;a=commitdiff_plain;h=fd20b0fc5a34cd7f776e4af6c763f59041de223b 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);