about summary refs log tree commit diff
path: root/src/libnm-core-impl/nm-setting-tun.c
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2024-01-25 09:46:18 +0100
committerMichael Biebl <biebl@debian.org>2024-01-25 09:46:18 +0100
commit70e18d99b8e3e77bb37e218d7ac582130156f8ef (patch)
treed40c587e6d3f0e094ff558e415f1bb9803643214 /src/libnm-core-impl/nm-setting-tun.c
parentd4d8b2b91f7ba000d97a8b2aab48c85000c11314 (diff)
New upstream version 1.45.90 upstream/1.45.90
Diffstat (limited to 'src/libnm-core-impl/nm-setting-tun.c')
-rw-r--r--src/libnm-core-impl/nm-setting-tun.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/libnm-core-impl/nm-setting-tun.c b/src/libnm-core-impl/nm-setting-tun.c
index ec095155..05460104 100644
--- a/src/libnm-core-impl/nm-setting-tun.c
+++ b/src/libnm-core-impl/nm-setting-tun.c
@@ -46,20 +46,17 @@ typedef struct {
  * Tunnel Settings
  */
 struct _NMSettingTun {
-    NMSetting parent;
-    /* In the past, this struct was public API. Preserve ABI! */
+    NMSetting           parent;
+    NMSettingTunPrivate _priv;
 };
 
 struct _NMSettingTunClass {
     NMSettingClass parent;
-    /* In the past, this struct was public API. Preserve ABI! */
-    gpointer padding[4];
 };
 
 G_DEFINE_TYPE(NMSettingTun, nm_setting_tun, NM_TYPE_SETTING)
 
-#define NM_SETTING_TUN_GET_PRIVATE(o) \
-    (G_TYPE_INSTANCE_GET_PRIVATE((o), NM_TYPE_SETTING_TUN, NMSettingTunPrivate))
+#define NM_SETTING_TUN_GET_PRIVATE(o) _NM_GET_PRIVATE(o, NMSettingTun, NM_IS_SETTING_TUN, NMSetting)
 
 /*****************************************************************************/
 
@@ -223,8 +220,6 @@ nm_setting_tun_class_init(NMSettingTunClass *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(NMSettingTunPrivate));
-
     object_class->get_property = _nm_setting_property_get_property_direct;
     object_class->set_property = _nm_setting_property_set_property_direct;
 
@@ -265,7 +260,8 @@ nm_setting_tun_class_init(NMSettingTunClass *klass)
                                               PROP_OWNER,
                                               NM_SETTING_PARAM_INFERRABLE,
                                               NMSettingTunPrivate,
-                                              owner);
+                                              owner,
+                                              .direct_string_allow_empty = TRUE);
 
     /**
      * NMSettingTun:group:
@@ -281,7 +277,8 @@ nm_setting_tun_class_init(NMSettingTunClass *klass)
                                               PROP_GROUP,
                                               NM_SETTING_PARAM_INFERRABLE,
                                               NMSettingTunPrivate,
-                                              group);
+                                              group,
+                                              .direct_string_allow_empty = TRUE);
 
     /**
      * NMSettingTun:pi:
@@ -342,5 +339,5 @@ nm_setting_tun_class_init(NMSettingTunClass *klass)
                              NM_META_SETTING_TYPE_TUN,
                              NULL,
                              properties_override,
-                             NM_SETT_INFO_PRIVATE_OFFSET_FROM_CLASS);
+                             G_STRUCT_OFFSET(NMSettingTun, _priv));
 }