From ce8dae3f0d9d269fc925f3a83abde4cde3b36ebb Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 31 Aug 2016 15:25:22 +0200 Subject: m_property: remove pointless explicitly clamping This is basically dead code, and even the commit that added this code 4 years ago said that this should be for debugging only. (Though it is possible that the clamp callback was used for something else, and then unused again. Also, some of the clamping code remains and is used for internal checking, e.g. clamp_double().) --- options/m_property.c | 9 --------- 1 file changed, 9 deletions(-) (limited to 'options/m_property.c') diff --git a/options/m_property.c b/options/m_property.c index d0579768c6..4ed4f5f586 100644 --- a/options/m_property.c +++ b/options/m_property.c @@ -125,15 +125,6 @@ int m_property_do(struct mp_log *log, const struct m_property *prop_list, return r; } case M_PROPERTY_SET: { - if (!log) - return M_PROPERTY_ERROR; - m_option_copy(&opt, &val, arg); - r = opt.type->clamp ? opt.type->clamp(&opt, arg) : 0; - m_option_free(&opt, &val); - if (r != 0) { - mp_err(log, "Property '%s': invalid value.\n", name); - return M_PROPERTY_ERROR; - } return do_action(prop_list, name, M_PROPERTY_SET, arg, ctx); } case M_PROPERTY_GET_NODE: { -- cgit v1.2.3