*data = g_variant_new_strv(ARRAY_AND_SIZE(weight_time));
break;
case SR_CONF_SPL_MEASUREMENT_RANGE:
- *data = std_gvar_tuple_array(&meas_ranges, ARRAY_SIZE(meas_ranges));
+ *data = std_gvar_tuple_array(ARRAY_AND_SIZE(meas_ranges));
break;
case SR_CONF_DATA_SOURCE:
*data = g_variant_new_strv(ARRAY_AND_SIZE(data_sources));
case SR_CONF_TIMEBASE:
if (!model)
return SR_ERR_ARG;
- *data = std_gvar_tuple_array(model->timebases, model->num_timebases);
+ *data = std_gvar_tuple_array(*model->timebases, model->num_timebases);
break;
case SR_CONF_VDIV:
if (cg_type == CG_NONE)
return SR_ERR_CHANNEL_GROUP;
- *data = std_gvar_tuple_array(model->vdivs, model->num_vdivs);
+ *data = std_gvar_tuple_array(*model->vdivs, model->num_vdivs);
break;
default:
return SR_ERR_NA;
*data = g_variant_new_strv(devc->coupling_vals, devc->coupling_tab_size);
break;
case SR_CONF_VDIV:
- *data = std_gvar_tuple_array(&vdivs, ARRAY_SIZE(vdivs));
+ *data = std_gvar_tuple_array(ARRAY_AND_SIZE(vdivs));
break;
default:
return SR_ERR_NA;
*data = std_gvar_array_u64(devc->profile->buffersizes, NUM_BUFFER_SIZES);
break;
case SR_CONF_TIMEBASE:
- *data = std_gvar_tuple_array(&timebases, ARRAY_SIZE(timebases));
+ *data = std_gvar_tuple_array(ARRAY_AND_SIZE(timebases));
break;
case SR_CONF_TRIGGER_SOURCE:
*data = g_variant_new_strv(ARRAY_AND_SIZE(trigger_sources));
*data = g_variant_new_strv(ARRAY_AND_SIZE(coupling));
break;
case SR_CONF_VDIV:
- *data = std_gvar_tuple_array(&vdivs, ARRAY_SIZE(vdivs));
+ *data = std_gvar_tuple_array(ARRAY_AND_SIZE(vdivs));
break;
default:
return SR_ERR_NA;
*data = std_gvar_array_u64(ARRAY_AND_SIZE(buffersizes));
break;
case SR_CONF_VDIV:
- *data = std_gvar_tuple_array(&vdivs, ARRAY_SIZE(vdivs));
+ *data = std_gvar_tuple_array(ARRAY_AND_SIZE(vdivs));
break;
case SR_CONF_COUPLING:
*data = g_variant_new_strv(ARRAY_AND_SIZE(coupling));
case SR_CONF_DEVICE_OPTIONS:
return STD_CONFIG_LIST(key, data, sdi, cg, NULL, drvopts, devopts);
case SR_CONF_SAMPLE_INTERVAL:
- *data = std_gvar_tuple_array(&kecheng_kc_330b_sample_intervals,
- ARRAY_SIZE(kecheng_kc_330b_sample_intervals));
+ *data = std_gvar_tuple_array(ARRAY_AND_SIZE(kecheng_kc_330b_sample_intervals));
break;
case SR_CONF_SPL_WEIGHT_FREQ:
*data = g_variant_new_strv(ARRAY_AND_SIZE(weight_freq));
*data = g_variant_new_strv(ARRAY_AND_SIZE(weight_time));
break;
case SR_CONF_SPL_MEASUREMENT_RANGE:
- *data = std_gvar_tuple_array(&meas_ranges, ARRAY_SIZE(meas_ranges));
+ *data = std_gvar_tuple_array(ARRAY_AND_SIZE(meas_ranges));
break;
case SR_CONF_DATA_SOURCE:
*data = g_variant_new_strv(ARRAY_AND_SIZE(data_sources));
return SR_ERR_ARG;
if (!cg)
return SR_ERR_CHANNEL_GROUP;
- *data = std_gvar_tuple_array((const uint64_t (*)[][2])devc->vdivs, devc->num_vdivs);
+ *data = std_gvar_tuple_array(devc->vdivs, devc->num_vdivs);
break;
case SR_CONF_TIMEBASE:
if (!devc)
return SR_ERR_ARG;
if (devc->num_timebases <= 0)
return SR_ERR_NA;
- *data = std_gvar_tuple_array((const uint64_t (*)[][2])devc->timebases, devc->num_timebases);
+ *data = std_gvar_tuple_array(devc->timebases, devc->num_timebases);
break;
case SR_CONF_TRIGGER_SOURCE:
if (!devc)
case SR_CONF_DEVICE_OPTIONS:
return STD_CONFIG_LIST(key, data, sdi, cg, scanopts, drvopts, devopts);
case SR_CONF_TIMEBASE:
- *data = std_gvar_tuple_array(&dlm_timebases, ARRAY_SIZE(dlm_timebases));
+ *data = std_gvar_tuple_array(ARRAY_AND_SIZE(dlm_timebases));
return SR_OK;
case SR_CONF_TRIGGER_SOURCE:
if (!model)
case SR_CONF_VDIV:
if (cg_type == CG_NONE)
return SR_ERR_CHANNEL_GROUP;
- *data = std_gvar_tuple_array(&dlm_vdivs, ARRAY_SIZE(dlm_vdivs));
+ *data = std_gvar_tuple_array(ARRAY_AND_SIZE(dlm_vdivs));
break;
default:
return SR_ERR_NA;
std_opts_config_list(key, data, sdi, cg, ARRAY_AND_SIZE(scanopts), \
ARRAY_AND_SIZE(drvopts), ARRAY_AND_SIZE(devopts))
-SR_PRIV GVariant *std_gvar_tuple_array(const uint64_t (*a)[][2], unsigned int n);
+SR_PRIV GVariant *std_gvar_tuple_array(const uint64_t a[][2], unsigned int n);
SR_PRIV GVariant *std_gvar_tuple_rational(const struct sr_rational *r, unsigned int n);
SR_PRIV GVariant *std_gvar_samplerates(const uint64_t samplerates[], unsigned int n);
SR_PRIV GVariant *std_gvar_samplerates_steps(const uint64_t samplerates[], unsigned int n);
return SR_OK;
}
-SR_PRIV GVariant *std_gvar_tuple_array(const uint64_t (*a)[][2], unsigned int n)
+SR_PRIV GVariant *std_gvar_tuple_array(const uint64_t a[][2], unsigned int n)
{
unsigned int i;
GVariant *rational[2];
g_variant_builder_init(&gvb, G_VARIANT_TYPE_ARRAY);
for (i = 0; i < n; i++) {
- rational[0] = g_variant_new_uint64((*a)[i][0]);
- rational[1] = g_variant_new_uint64((*a)[i][1]);
+ rational[0] = g_variant_new_uint64(a[i][0]);
+ rational[1] = g_variant_new_uint64(a[i][1]);
/* FIXME: Valgrind reports a memory leak here. */
g_variant_builder_add_value(&gvb, g_variant_new_tuple(rational, 2));