]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/uni-t-ut32x/api.c
Replace some magic numbers with a #define.
[libsigrok.git] / src / hardware / uni-t-ut32x / api.c
index a4868287d5b3d9f838657cf82424a757eee35328..136182e2aea9eb00cd9562b61a13785f50166998 100644 (file)
@@ -50,7 +50,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
        struct sr_dev_inst *sdi;
        struct sr_config *src;
        GSList *usb_devices, *devices, *l;
-       int i;
+       unsigned int i;
        const char *conn;
 
        drvc = di->priv;
@@ -80,7 +80,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
                        sdi->driver = di;
                        sdi->inst_type = SR_INST_USB;
                        sdi->conn = l->data;
-                       for (i = 0; i < 3; i++)
+                       for (i = 0; i < ARRAY_SIZE(channel_names); i++)
                                sr_channel_new(sdi, i, SR_CHANNEL_ANALOG, TRUE,
                                                channel_names[i]);
                        devc = g_malloc0(sizeof(struct dev_context));