static const char *channel_names[] = {
"0", "1", "2", "3", "4", "5", "6", "7", "8",
"9", "10", "11", "12", "13", "14", "15",
- NULL,
};
static const struct {
GSList *l, *devices, *conn_devices;
struct libusb_device_descriptor des;
libusb_device **devlist;
- int ret, i, j;
+ int ret;
+ unsigned int i, j;
const char *conn;
char connection_id[64];
sdi->driver = di;
sdi->connection_id = g_strdup(connection_id);
- for (j = 0; channel_names[j]; j++)
+ for (j = 0; j < ARRAY_SIZE(channel_names); j++)
sr_channel_new(sdi, j, SR_CHANNEL_LOGIC, TRUE,
channel_names[j]);
struct sr_usb_dev_inst *usb;
usb = sdi->conn;
- if (usb->devhdl == NULL)
+ if (!usb->devhdl)
return SR_ERR;
sr_info("Closing device on %d.%d (logical) / %s (physical) interface %d.",
if (devc->limit_samples > 0)
pre_trigger_samples = devc->capture_ratio * devc->limit_samples/100;
devc->stl = soft_trigger_logic_new(sdi, trigger, pre_trigger_samples);
- if (devc->stl == NULL)
+ if (!devc->stl)
return SR_ERR_MALLOC;
devc->trigger_fired = FALSE;
} else