- (void)sdi;
- (void)cg;
-
- switch (key) {
- case SR_CONF_SCAN_OPTIONS:
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
- hwopts, ARRAY_SIZE(hwopts), sizeof(int32_t));
- break;
- case SR_CONF_DEVICE_OPTIONS:
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
- hwcaps, ARRAY_SIZE(hwcaps), sizeof(int32_t));
- break;
- default:
- return SR_ERR_NA;
- }
-
- return SR_OK;
+ /*
+ * We can't use the ternary operator here! The result would contain
+ * sizeof((cond) ? A : B) where A/B are arrays of different type/size.
+ * The ternary operator always returns the "common" type of A and B,
+ * which would be a pointer instead of either the A or B arrays.
+ * Thus, sizeof() would yield the size of a pointer, not the size
+ * of either the A or B array, which is not what we want.
+ */
+ if (mic_devs[idx].has_humidity)
+ return STD_CONFIG_LIST(key, data, sdi, cg, scanopts, drvopts_temp_hum, devopts);
+ else
+ return STD_CONFIG_LIST(key, data, sdi, cg, scanopts, drvopts_temp, devopts);