diff --git a/clients/cli/utils.c b/clients/cli/utils.c index ff41019d9..0f823b5c9 100644 --- a/clients/cli/utils.c +++ b/clients/cli/utils.c @@ -64,14 +64,14 @@ _meta_type_nmc_generic_info_get_nested (const NMMetaAbstractInfo *abstract_info, return (const NMMetaAbstractInfo *const*) info->nested; } -static const char * +static gconstpointer _meta_type_nmc_generic_info_get_fcn (const NMMetaEnvironment *environment, gpointer environment_user_data, const NMMetaAbstractInfo *abstract_info, gpointer target, NMMetaAccessorGetType get_type, NMMetaAccessorGetFlags get_flags, - char **out_to_free) + gpointer *out_to_free) { const NmcMetaGenericInfo *info = (const NmcMetaGenericInfo *) abstract_info; diff --git a/clients/cli/utils.h b/clients/cli/utils.h index 2c295be7e..bc206f253 100644 --- a/clients/cli/utils.h +++ b/clients/cli/utils.h @@ -104,13 +104,13 @@ struct _NmcMetaGenericInfo { const NMMetaType *meta_type; const char *name; const NmcMetaGenericInfo *const*nested; - const char *(*get_fcn) (const NMMetaEnvironment *environment, - gpointer environment_user_data, - const NmcMetaGenericInfo *info, - gpointer target, - NMMetaAccessorGetType get_type, - NMMetaAccessorGetFlags get_flags, - char **out_to_free); + gconstpointer (*get_fcn) (const NMMetaEnvironment *environment, + gpointer environment_user_data, + const NmcMetaGenericInfo *info, + gpointer target, + NMMetaAccessorGetType get_type, + NMMetaAccessorGetFlags get_flags, + gpointer *out_to_free); }; #define NMC_META_GENERIC(n, ...) \ diff --git a/clients/common/nm-meta-setting-desc.c b/clients/common/nm-meta-setting-desc.c index 0d602a595..a41e19e4e 100644 --- a/clients/common/nm-meta-setting-desc.c +++ b/clients/common/nm-meta-setting-desc.c @@ -6632,32 +6632,37 @@ _meta_type_property_info_get_name (const NMMetaAbstractInfo *abstract_info) return ((const NMMetaPropertyInfo *) abstract_info)->property_name; } -static const char * +static gconstpointer _meta_type_setting_info_editor_get_fcn (const NMMetaEnvironment *environment, gpointer environment_user_data, const NMMetaAbstractInfo *abstract_info, gpointer target, NMMetaAccessorGetType get_type, NMMetaAccessorGetFlags get_flags, - char **out_to_free) + gpointer *out_to_free) { nm_assert (out_to_free && !out_to_free); g_return_val_if_reached (NULL); } -static const char * +static gconstpointer _meta_type_property_info_get_fcn (const NMMetaEnvironment *environment, gpointer environment_user_data, const NMMetaAbstractInfo *abstract_info, gpointer target, NMMetaAccessorGetType get_type, NMMetaAccessorGetFlags get_flags, - char **out_to_free) + gpointer *out_to_free) { const NMMetaPropertyInfo *info = (const NMMetaPropertyInfo *) abstract_info; nm_assert (out_to_free && !out_to_free); + if (!NM_IN_SET (get_type, + NM_META_ACCESSOR_GET_TYPE_PARSABLE, + NM_META_ACCESSOR_GET_TYPE_PRETTY)) + return NULL; + return (*out_to_free = info->property_type->get_fcn (environment, environment_user_data, info, target, get_type, get_flags)); diff --git a/clients/common/nm-meta-setting-desc.h b/clients/common/nm-meta-setting-desc.h index 352d447a5..2b35f1c10 100644 --- a/clients/common/nm-meta-setting-desc.h +++ b/clients/common/nm-meta-setting-desc.h @@ -149,13 +149,13 @@ struct _NMMetaType { const NMMetaAbstractInfo *const*(*get_nested) (const NMMetaAbstractInfo *abstract_info, guint *out_len, gpointer *out_to_free); - const char *(*get_fcn) (const NMMetaEnvironment *environment, - gpointer environment_user_data, - const NMMetaAbstractInfo *info, - gpointer target, - NMMetaAccessorGetType get_type, - NMMetaAccessorGetFlags get_flags, - char **out_to_free); + gconstpointer (*get_fcn) (const NMMetaEnvironment *environment, + gpointer environment_user_data, + const NMMetaAbstractInfo *info, + gpointer target, + NMMetaAccessorGetType get_type, + NMMetaAccessorGetFlags get_flags, + gpointer *out_to_free); }; struct _NMMetaAbstractInfo {