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));
+ g_variant_builder_add_value(&gvb, g_variant_new_tuple(rational,
+ ARRAY_SIZE(rational)));
}
return g_variant_builder_end(&gvb);
rational[1] = g_variant_new_uint64(r[i].q);
/* FIXME: Valgrind reports a memory leak here. */
- g_variant_builder_add_value(&gvb, g_variant_new_tuple(rational, 2));
+ g_variant_builder_add_value(&gvb, g_variant_new_tuple(rational,
+ ARRAY_SIZE(rational)));
}
return g_variant_builder_end(&gvb);
* We will never see exactly 0.0 because of the error we're
* accumulating, so catch the "zero" value and force it to be 0.
*/
- v = ((d > (-step / 2)) && (d < (step / 2))) ? 0 : d;
+ v = ((d > (-step / 2.0)) && (d < (step / 2.0))) ? 0 : d;
range[0] = g_variant_new_double(v);
range[1] = g_variant_new_double(v);
- gvar = g_variant_new_tuple(range, 2);
+ gvar = g_variant_new_tuple(range, ARRAY_SIZE(range));
g_variant_builder_add_value(&gvb, gvar);
}
range[0] = g_variant_new_uint64(low);
range[1] = g_variant_new_uint64(high);
- return g_variant_new_tuple(range, 2);
+ return g_variant_new_tuple(range, ARRAY_SIZE(range));
}
SR_PRIV GVariant *std_gvar_tuple_double(double low, double high)
range[0] = g_variant_new_double(low);
range[1] = g_variant_new_double(high);
- return g_variant_new_tuple(range, 2);
+ return g_variant_new_tuple(range, ARRAY_SIZE(range));
}
SR_PRIV GVariant *std_gvar_array_i32(const int32_t a[], unsigned int n)
for (i = 0; i < n; i++) {
range[0] = g_variant_new_double(a[i][0]);
range[1] = g_variant_new_double(a[i][1]);
- gvar = g_variant_new_tuple(range, 2);
+ gvar = g_variant_new_tuple(range, ARRAY_SIZE(range));
g_variant_builder_add_value(&gvb, gvar);
}