From 13033ce2c4e05eaf031c09a4d41f3db9512af9c0 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 13 Nov 2014 17:25:59 +0100 Subject: command: make sub-properties more flexible This makes it work with all kind of types, instead of just some simple ones. --- options/m_property.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'options/m_property.h') diff --git a/options/m_property.h b/options/m_property.h index 78b3292fba..b7dbcfb378 100644 --- a/options/m_property.h +++ b/options/m_property.h @@ -174,7 +174,7 @@ struct m_sub_property { // property's name. const char *name; // Type of the data stored in the value member. See m_option. - const struct m_option_type *type; + struct m_option type; // Data returned by the sub-property. m_property_read_sub() will make a // copy of this if needed. It will never write or free the data. union m_option_value value; @@ -184,13 +184,13 @@ struct m_sub_property { // Convenience macros which can be used as part of a sub_property entry. #define SUB_PROP_INT(i) \ - .type = CONF_TYPE_INT, .value = {.int_ = (i)} + .type = {.type = CONF_TYPE_INT}, .value = {.int_ = (i)} #define SUB_PROP_STR(s) \ - .type = CONF_TYPE_STRING, .value = {.string = (char *)(s)} + .type = {.type = CONF_TYPE_STRING}, .value = {.string = (char *)(s)} #define SUB_PROP_FLOAT(f) \ - .type = CONF_TYPE_FLOAT, .value = {.float_ = (f)} + .type = {.type = CONF_TYPE_FLOAT}, .value = {.float_ = (f)} #define SUB_PROP_FLAG(f) \ - .type = CONF_TYPE_FLAG, .value = {.flag = (f)} + .type = {.type = CONF_TYPE_FLAG}, .value = {.flag = (f)} int m_property_read_sub(const struct m_sub_property *props, int action, void *arg); -- cgit v1.2.3