nm-setting-bridge: hide GObject structs from public API and embed private data
Hide the object and class structures from public API. This is an API and ABI break, but of something that is very likely unused. This is mainly done to embed the private structure in the object itself. This has benefits for performance and debugability.
This commit is contained in:
@@ -63,9 +63,23 @@ typedef struct {
|
||||
bool stp:1;
|
||||
} NMSettingBridgePrivate;
|
||||
|
||||
/**
|
||||
* NMSettingBridge:
|
||||
*
|
||||
* Bridging Settings
|
||||
*/
|
||||
struct _NMSettingBridge {
|
||||
NMSetting parent;
|
||||
NMSettingBridgePrivate _priv;
|
||||
};
|
||||
|
||||
struct _NMSettingBridgeClass {
|
||||
NMSettingClass parent;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE (NMSettingBridge, nm_setting_bridge, NM_TYPE_SETTING)
|
||||
|
||||
#define NM_SETTING_BRIDGE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_BRIDGE, NMSettingBridgePrivate))
|
||||
#define NM_SETTING_BRIDGE_GET_PRIVATE(self) _NM_GET_PRIVATE (self, NMSettingBridge, NM_IS_SETTING_BRIDGE, NMSetting)
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
@@ -1182,8 +1196,6 @@ nm_setting_bridge_class_init (NMSettingBridgeClass *klass)
|
||||
NMSettingClass *setting_class = NM_SETTING_CLASS (klass);
|
||||
GArray *properties_override = _nm_sett_info_property_override_create_array ();
|
||||
|
||||
g_type_class_add_private (klass, sizeof (NMSettingBridgePrivate));
|
||||
|
||||
object_class->get_property = get_property;
|
||||
object_class->set_property = set_property;
|
||||
object_class->finalize = finalize;
|
||||
|
@@ -39,21 +39,7 @@ G_BEGIN_DECLS
|
||||
#define NM_BRIDGE_VLAN_VID_MIN 1
|
||||
#define NM_BRIDGE_VLAN_VID_MAX 4094
|
||||
|
||||
/**
|
||||
* NMSettingBridge:
|
||||
*
|
||||
* Bridging Settings
|
||||
*/
|
||||
struct _NMSettingBridge {
|
||||
NMSetting parent;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
NMSettingClass parent;
|
||||
|
||||
/*< private >*/
|
||||
gpointer padding[4];
|
||||
} NMSettingBridgeClass;
|
||||
typedef struct _NMSettingBridgeClass NMSettingBridgeClass;
|
||||
|
||||
typedef struct _NMBridgeVlan NMBridgeVlan;
|
||||
|
||||
|
Reference in New Issue
Block a user