From: Bert Vermeulen Date: Mon, 23 Apr 2012 13:31:41 +0000 (+0200) Subject: sr: don't use deprecated glib functions X-Git-Tag: libsigrok-0.1.1~32 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=993526f82421d3954b1032bfc1affb208916ebeb;p=libsigrok.git sr: don't use deprecated glib functions As of the recent glib 2.32 release, these produce deprecation warnings at compile time. --- diff --git a/hardware/demo/demo.c b/hardware/demo/demo.c index 2d3a4618..48f7cf52 100644 --- a/hardware/demo/demo.c +++ b/hardware/demo/demo.c @@ -398,7 +398,7 @@ static int receive_data(int fd, int revents, void *cb_data) if (!thread_running && z <= 0) { /* Make sure we don't receive more packets. */ - g_io_channel_close(channels[0]); + g_io_channel_shutdown(channels[0], FALSE, NULL); /* Send last packet. */ packet.type = SR_DF_END; diff --git a/strutil.c b/strutil.c index f8a52918..cb51b2ab 100644 --- a/strutil.c +++ b/strutil.c @@ -306,10 +306,10 @@ SR_API gboolean sr_parse_boolstring(const char *boolstr) if (!boolstr) return FALSE; - if (!g_strcasecmp(boolstr, "true") || - !g_strcasecmp(boolstr, "yes") || - !g_strcasecmp(boolstr, "on") || - !g_strcasecmp(boolstr, "1")) + if (!g_ascii_strncasecmp(boolstr, "true", 4) || + !g_ascii_strncasecmp(boolstr, "yes", 3) || + !g_ascii_strncasecmp(boolstr, "on", 2) || + !g_ascii_strncasecmp(boolstr, "1", 1)) return TRUE; return FALSE;