mmf_value_spec_clear(&attrs->items[idx].value_spec);
assert(attrs->items[idx].value_spec.type == MMF_VALUE_SPEC_DOUBLE_RANGE);
- return mmf_value_spec_set_double_range(&attrs->items[idx].value_spec, min, max, dval);
+
+ if (mmf_value_spec_set_double_range(&attrs->items[idx].value_spec, min, max, dval) != 0)
+ return -1;
+
+ return mmf_value_set_double(&attrs->items[idx].value, dval);
}
int mmf_attrs_set_valid_double_array(MMHandleType h, int idx, const double *array, int count, double dval)
mmf_value_spec_clear(&attrs->items[idx].value_spec);
assert(attrs->items[idx].value_spec.type == MMF_VALUE_SPEC_DOUBLE_ARRAY);
- return mmf_value_spec_set_double_array(&attrs->items[idx].value_spec, array, count, dval);
+
+ if (mmf_value_spec_set_double_array(&attrs->items[idx].value_spec, array, count, dval) != 0)
+ return -1;
+
+ return mmf_value_set_double(&attrs->items[idx].value, dval);
}