lcr/es51919: minor style nits in the ES51919 packet parser

Use macros for frequency constants. They hopfully are more readable than
large number literals with their magnitude being not as apparent.
This commit is contained in:
Gerhard Sittig 2019-06-17 22:44:44 +02:00
parent 8556703a6c
commit 238b874e44
1 changed files with 3 additions and 2 deletions

View File

@ -124,7 +124,8 @@
*/
static const double frequencies[] = {
0, 100, 120, 1000, 10000, 100000,
SR_HZ(0), SR_HZ(100), SR_HZ(120),
SR_KHZ(1), SR_KHZ(10), SR_KHZ(100),
};
static const size_t freq_code_map[] = {
@ -354,7 +355,7 @@ SR_PRIV int es51919_config_list(uint32_t key, GVariant **data,
switch (key) {
case SR_CONF_OUTPUT_FREQUENCY:
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_DOUBLE,
ARRAY_AND_SIZE(frequencies), sizeof(double));
ARRAY_AND_SIZE(frequencies), sizeof(frequencies[0]));
return SR_OK;
case SR_CONF_EQUIV_CIRCUIT_MODEL:
*data = g_variant_new_strv(ARRAY_AND_SIZE(circuit_models));