static const char *channel_names[] = {
"CH1", "CH2",
- NULL,
};
static const uint64_t buffersizes_32k[] = {
struct sr_channel_group *cg;
struct drv_context *drvc;
struct dev_context *devc;
- int i;
+ unsigned int i;
sdi = g_malloc0(sizeof(struct sr_dev_inst));
sdi->status = SR_ST_INITIALIZING;
* Add only the real channels -- EXT isn't a source of data, only
* a trigger source internal to the device.
*/
- for (i = 0; channel_names[i]; i++) {
+ for (i = 0; i < ARRAY_SIZE(channel_names); i++) {
ch = sr_channel_new(sdi, i, SR_CHANNEL_ANALOG, TRUE, channel_names[i]);
cg = g_malloc0(sizeof(struct sr_channel_group));
cg->name = g_strdup(channel_names[i]);
const uint64_t *vdiv;
int ch_idx;
- (void)cg;
-
switch (key) {
case SR_CONF_NUM_HDIV:
*data = g_variant_new_int32(NUM_TIMEBASE);
ch_idx = 1;
else
return SR_ERR_ARG;
- switch(key) {
+ switch (key) {
case SR_CONF_FILTER:
*data = g_variant_new_boolean(devc->filter[ch_idx]);
break;
return SR_ERR_ARG;
if (!cg) {
- switch (key) {
+ switch (key) {
case SR_CONF_DEVICE_OPTIONS:
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
devopts, ARRAY_SIZE(devopts), sizeof(uint32_t));
return SR_ERR_NA;
}
} else {
- switch (key) {
+ switch (key) {
case SR_CONF_DEVICE_OPTIONS:
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
devopts_cg, ARRAY_SIZE(devopts_cg), sizeof(uint32_t));