From b8193e40719a2a72d9b25e8ea3070c0e84beb48e Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 15 Jun 2017 15:22:06 +0200 Subject: command: add all options to property->option bridge Before this, options with co->data==NULL (i.e. no storage) were not added to the bridge (except alias options). There are a few options which might make sense to allow via the bridge ("profile" and "include"). So allow them. In command_init(), we merely remove the co->data check, the rest of the diff is due to switching the if/else branches for convenience. We also must explicitly error on M_PROPERTY_GET if co->data==NULL. All other cases check it in some way. Explicitly exclude options from the property bridge, which would be added due this, and the result would be pointless. --- options/m_option.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'options/m_option.h') diff --git a/options/m_option.h b/options/m_option.h index 8f4e5e6a5c..78db2b5c85 100644 --- a/options/m_option.h +++ b/options/m_option.h @@ -693,7 +693,7 @@ extern const char m_option_path_separator; #define OPT_PRINT(optname, fn) \ {.name = optname, \ - .flags = M_OPT_FIXED | M_OPT_NOCFG | M_OPT_PRE_PARSE, \ + .flags = M_OPT_FIXED | M_OPT_NOCFG | M_OPT_PRE_PARSE | M_OPT_NOPROP, \ .type = &m_option_type_print_fn, \ .priv = MP_EXPECT_TYPE(m_opt_print_fn, fn), \ .offset = -1} @@ -726,6 +726,6 @@ extern const char m_option_path_separator; // "--optname" doesn't exist, but inform the user about a replacement with msg. #define OPT_REMOVED(optname, msg) \ {.name = optname, .type = &m_option_type_removed, .priv = msg, \ - .deprecation_message = "", .offset = -1} + .deprecation_message = "", .flags = M_OPT_NOPROP, .offset = -1} #endif /* MPLAYER_M_OPTION_H */ -- cgit v1.2.3