From f225b5fc005dda92902343e0ec9de8d5b82d89c1 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 21 Feb 2014 13:18:50 +0100 Subject: command: don't use option name in properties Some code accessed m_option.name to get the property name. (Maybe only show_property_osd() had a significant use of it.) Remove that, and remove setting names and dummy names as well. The old code usually assumed that the name was set, and show_property_osd() used it to get the proper name of deprecated aliases. The "vf" property was listed as "vf*". Not sure why that was done, but it works without anyway. --- options/m_property.c | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) (limited to 'options/m_property.c') diff --git a/options/m_property.c b/options/m_property.c index 308bed55e0..225296db89 100644 --- a/options/m_property.c +++ b/options/m_property.c @@ -37,7 +37,6 @@ const struct m_option_type m_option_type_dummy = { .name = "Unknown", - .flags = M_OPT_TYPE_ALLOW_WILDCARD, // make "vf*" property work }; struct legacy_prop { @@ -395,10 +394,7 @@ int m_property_read_sub(const struct m_sub_property *props, int action, void *ar { switch (action) { case M_PROPERTY_GET_TYPE: - *(struct m_option *)arg = (struct m_option){ - .name = "", - .type = CONF_TYPE_STRING, - }; + *(struct m_option *)arg = (struct m_option){.type = CONF_TYPE_STRING}; return M_PROPERTY_OK; case M_PROPERTY_GET: case M_PROPERTY_PRINT: { @@ -411,7 +407,7 @@ int m_property_read_sub(const struct m_sub_property *props, int action, void *ar const struct m_sub_property *prop = &props[n]; if (prop->unavailable) continue; - struct m_option type = { .name = "", .type = prop->type, }; + struct m_option type = {.type = prop->type}; char *s = m_option_print(&type, &prop->value); ta_xasprintf_append(&res, "%s=%s\n", prop->name, s); talloc_free(s); @@ -432,7 +428,7 @@ int m_property_read_sub(const struct m_sub_property *props, int action, void *ar return M_PROPERTY_UNKNOWN; if (prop->unavailable) return M_PROPERTY_UNAVAILABLE; - struct m_option type = { .name = "", .type = prop->type, }; + struct m_option type = {.type = prop->type}; switch (ka->action) { case M_PROPERTY_GET: { memset(ka->arg, 0, type.type->size); @@ -462,10 +458,7 @@ int m_property_read_list(int action, void *arg, int count, { switch (action) { case M_PROPERTY_GET_TYPE: - *(struct m_option *)arg = (struct m_option){ - .name = "", - .type = CONF_TYPE_STRING, - }; + *(struct m_option *)arg = (struct m_option){.type = CONF_TYPE_STRING}; return M_PROPERTY_OK; case M_PROPERTY_GET: case M_PROPERTY_PRINT: { @@ -489,10 +482,7 @@ int m_property_read_list(int action, void *arg, int count, if (strcmp(ka->key, "count") == 0) { switch (ka->action) { case M_PROPERTY_GET_TYPE: { - struct m_option opt = { - .name = "", - .type = CONF_TYPE_INT, - }; + struct m_option opt = {.type = CONF_TYPE_INT}; *(struct m_option *)ka->arg = opt; return M_PROPERTY_OK; } -- cgit v1.2.3