1
0
mirror of git://sigrok.org/libserialport synced 2023-08-10 21:13:24 +03:00

Replace some usages of int with size_t to fix overflow warnings.

On MSVC, these gave the following warning:

warning C4267: '=': conversion from 'size_t' to 'int', possible loss of data
This commit is contained in:
Martin Ling 2020-01-24 03:01:23 +00:00
parent 75f468923b
commit 4651adb4f6

View File

@ -59,7 +59,7 @@ SP_API enum sp_return sp_get_port_by_name(const char *portname, struct sp_port *
#ifndef NO_PORT_METADATA #ifndef NO_PORT_METADATA
enum sp_return ret; enum sp_return ret;
#endif #endif
int len; size_t len;
TRACE("%s, %p", portname, port_ptr); TRACE("%s, %p", portname, port_ptr);
@ -323,7 +323,7 @@ SP_PRIV struct sp_port **list_append(struct sp_port **list,
const char *portname) const char *portname)
{ {
void *tmp; void *tmp;
unsigned int count; size_t count;
for (count = 0; list[count]; count++) for (count = 0; list[count]; count++)
; ;