break;
case SR_CONF_TRIGGER_SOURCE:
tmp = g_variant_get_string(data, NULL);
- for (i = 0; (*model->trigger_sources)[i]; i++) {
+ for (i = 0; i < model->num_trigger_sources; i++) {
if (g_strcmp0(tmp, (*model->trigger_sources)[i]) != 0)
continue;
state->trigger_source = i;
tmp = g_variant_get_string(data, NULL);
- for (i = 0; (*model->coupling_options)[i]; i++) {
+ for (i = 0; i < model->num_coupling_options; i++) {
if (strcmp(tmp, (*model->coupling_options)[i]) != 0)
continue;
for (j = 1; j <= model->analog_channels; j++) {
case SR_CONF_TRIGGER_SOURCE:
if (!model)
return SR_ERR_ARG;
- *data = g_variant_new_strv(*model->trigger_sources,
- g_strv_length((char **)*model->trigger_sources));
+ *data = g_variant_new_strv(*model->trigger_sources, model->num_trigger_sources);
return SR_OK;
case SR_CONF_TRIGGER_SLOPE:
- *data = g_variant_new_strv(dlm_trigger_slopes,
- g_strv_length((char **)dlm_trigger_slopes));
+ *data = g_variant_new_strv(ARRAY_AND_SIZE(dlm_trigger_slopes));
return SR_OK;
case SR_CONF_NUM_HDIV:
*data = g_variant_new_uint32(model->num_xdivs);
case SR_CONF_COUPLING:
if (cg_type == CG_NONE)
return SR_ERR_CHANNEL_GROUP;
- *data = g_variant_new_strv(*model->coupling_options,
- g_strv_length((char **)*model->coupling_options));
+ *data = g_variant_new_strv(*model->coupling_options, model->num_coupling_options);
break;
case SR_CONF_VDIV:
if (cg_type == CG_NONE)