]> sigrok.org Git - libsigrok.git/blobdiff - src/scpi/helpers.c
Build: Include <config.h> first in all source files
[libsigrok.git] / src / scpi / helpers.c
index 0fb1d40194ca47d76857c9d9ff0f5a368c83b388..9efa10c5f08a93357848e61bf4a5c6f5b9720d01 100644 (file)
@@ -17,6 +17,7 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#include <config.h>
 #include <strings.h>
 #include <libsigrok/libsigrok.h>
 #include "libsigrok-internal.h"
@@ -38,7 +39,7 @@ SR_PRIV const char *sr_vendor_alias(const char *raw_vendor)
        unsigned int i;
 
        for (i = 0; i < ARRAY_SIZE(scpi_vendors); i++) {
-               if (!strcasecmp(raw_vendor, scpi_vendors[i][0]))
+               if (!g_ascii_strcasecmp(raw_vendor, scpi_vendors[i][0]))
                        return scpi_vendors[i][1];
        }
 
@@ -111,11 +112,11 @@ SR_PRIV int scpi_cmd_resp(const struct sr_dev_inst *sdi, const struct scpi_comma
        if (g_variant_type_equal(gvtype, G_VARIANT_TYPE_BOOLEAN)) {
                if ((ret = sr_scpi_get_string(scpi, NULL, &s)) != SR_OK)
                        return ret;
-               if (!strcasecmp(s, "ON") || !strcasecmp(s, "1")
-                               || !strcasecmp(s, "YES"))
+               if (!g_ascii_strcasecmp(s, "ON") || !g_ascii_strcasecmp(s, "1")
+                               || !g_ascii_strcasecmp(s, "YES"))
                        *gvar = g_variant_new_boolean(TRUE);
-               else if (!strcasecmp(s, "OFF") || !strcasecmp(s, "0")
-                               || !strcasecmp(s, "NO"))
+               else if (!g_ascii_strcasecmp(s, "OFF") || !g_ascii_strcasecmp(s, "0")
+                               || !g_ascii_strcasecmp(s, "NO"))
                        *gvar = g_variant_new_boolean(FALSE);
                else
                        ret = SR_ERR;