From: Uwe Hermann Date: Wed, 29 Aug 2018 23:02:32 +0000 (+0200) Subject: ipdbg-la: data_available(): Return gboolean. X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=4465837b7da4e56d28981c09051aa87b6236085a;p=libsigrok.git ipdbg-la: data_available(): Return gboolean. --- diff --git a/src/hardware/ipdbg-la/protocol.c b/src/hardware/ipdbg-la/protocol.c index 0ba2d6d6..69c461ff 100644 --- a/src/hardware/ipdbg-la/protocol.c +++ b/src/hardware/ipdbg-la/protocol.c @@ -68,7 +68,7 @@ /* LA subfunction command opcodes */ #define CMD_LA_DELAY 0x1F -SR_PRIV int data_available(struct ipdbg_la_tcp *tcp) +SR_PRIV gboolean data_available(struct ipdbg_la_tcp *tcp) { #ifdef __WIN32__ ioctlsocket(tcp->socket, FIONREAD, &bytes_available); @@ -77,10 +77,10 @@ SR_PRIV int data_available(struct ipdbg_la_tcp *tcp) if (ioctl(tcp->socket, FIONREAD, &status) < 0) { // TIOCMGET sr_err("FIONREAD failed: %s\n", g_strerror(errno)); - return 0; + return FALSE; } - return (status < 1) ? 0 : 1; + return (status < 1) ? FALSE : TRUE; #endif // __WIN32__ } diff --git a/src/hardware/ipdbg-la/protocol.h b/src/hardware/ipdbg-la/protocol.h index 85f41a16..363d4462 100644 --- a/src/hardware/ipdbg-la/protocol.h +++ b/src/hardware/ipdbg-la/protocol.h @@ -54,7 +54,7 @@ struct dev_context { uint8_t *raw_sample_buf; }; -int data_available(struct ipdbg_la_tcp *tcp); +SR_PRIV gboolean data_available(struct ipdbg_la_tcp *tcp); SR_PRIV struct ipdbg_la_tcp *ipdbg_la_tcp_new(void); SR_PRIV void ipdbg_la_tcp_free(struct ipdbg_la_tcp *tcp);