diff options
author | Thomas Haller <thaller@redhat.com> | 2017-06-07 14:43:58 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2017-06-26 10:13:33 +0200 |
commit | ca7360881454a35d903331b84bfb06c074d4997c (patch) | |
tree | 9f99f3b25774633d88a398864e47f95497077aa6 | |
parent | de6ea2d597a3a5dc9bfd301e43aa8628aeb83242 (diff) | |
download | NetworkManager-ca7360881454a35d903331b84bfb06c074d4997c.tar.gz |
clients: make meta data subtypes of NMObjBaseInst
Yes, this wastes 4 times an unused GType instance
in the class structure.
-rw-r--r-- | clients/cli/utils.h | 5 | ||||
-rw-r--r-- | clients/common/nm-meta-setting-desc.h | 17 |
2 files changed, 18 insertions, 4 deletions
diff --git a/clients/cli/utils.h b/clients/cli/utils.h index 1724d4391e..19145974ea 100644 --- a/clients/cli/utils.h +++ b/clients/cli/utils.h @@ -129,7 +129,10 @@ typedef enum { } G_STMT_END struct _NmcMetaGenericInfo { - const NMMetaType *meta_type; + union { + NMObjBaseInst parent; + const NMMetaType *meta_type; + }; NmcGenericInfoType info_type; const char *name; const char *name_header; diff --git a/clients/common/nm-meta-setting-desc.h b/clients/common/nm-meta-setting-desc.h index c1fd902210..e61b1fc4a6 100644 --- a/clients/common/nm-meta-setting-desc.h +++ b/clients/common/nm-meta-setting-desc.h @@ -20,6 +20,7 @@ #ifndef __NM_META_SETTING_DESC_H__ #define __NM_META_SETTING_DESC_H__ +#include "nm-utils/nm-obj.h" #include "nm-meta-setting.h" struct _NMDevice; @@ -284,7 +285,10 @@ enum { #define nm_meta_property_info_vpn_service_type (nm_meta_setting_infos_editor[NM_META_SETTING_TYPE_VPN].properties[_NM_META_PROPERTY_TYPE_VPN_SERVICE_TYPE]) struct _NMMetaPropertyInfo { - const NMMetaType *meta_type; + union { + NMObjBaseInst parent; + const NMMetaType *meta_type; + }; const NMMetaSettingInfoEditor *setting_info; @@ -316,7 +320,10 @@ typedef struct _NMMetaSettingValidPartItem { } NMMetaSettingValidPartItem; struct _NMMetaSettingInfoEditor { - const NMMetaType *meta_type; + union { + NMObjBaseInst parent; + const NMMetaType *meta_type; + }; const NMMetaSettingInfo *general; const char *alias; const char *pretty_name; @@ -341,6 +348,7 @@ struct _NMMetaSettingInfoEditor { }; struct _NMMetaType { + NMObjBaseClass parent; const char *type_name; const char *(*get_name) (const NMMetaAbstractInfo *abstract_info, gboolean for_header); @@ -364,7 +372,10 @@ struct _NMMetaType { }; struct _NMMetaAbstractInfo { - const NMMetaType *meta_type; + union { + NMObjBaseInst parent; + const NMMetaType *meta_type; + }; }; extern const NMMetaType nm_meta_type_setting_info_editor; |