]> sigrok.org Git - libsigrok.git/commitdiff
sr: don't use deprecated glib functions
authorBert Vermeulen <redacted>
Mon, 23 Apr 2012 13:31:41 +0000 (15:31 +0200)
committerBert Vermeulen <redacted>
Mon, 23 Apr 2012 13:31:41 +0000 (15:31 +0200)
As of the recent glib 2.32 release, these produce deprecation warnings
at compile time.

hardware/demo/demo.c
strutil.c

index 2d3a4618679e2a24001ae66e9c073e34dc3a8185..48f7cf52791d1c74538c879c3bf8417d1cb42824 100644 (file)
@@ -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;
index f8a52918deee38adef0217760a16dcd5ceabb456..cb51b2ab72ae241e42b0f96662bc52f531cedb15 100644 (file)
--- 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;