summaryrefslogtreecommitdiff
path: root/libnm-core/nm-setting-macsec.c
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2018-07-28 10:43:21 +0200
committerThomas Haller <thaller@redhat.com>2018-08-10 10:38:19 +0200
commit23adc373777d923de43626c028cbb1e0d649154a (patch)
tree38f5d74e575d0108df3ec70276bf36d32b92fbed /libnm-core/nm-setting-macsec.c
parent19ef103e39236c5a980955930a8e52be0ff69c95 (diff)
downloadNetworkManager-23adc373777d923de43626c028cbb1e0d649154a.tar.gz
libnm/trivial: cleanup variable names in settings' class-init functions
- Don't use @parent_class name. This local variable (and @object_class) is the class instance up-cast to the pointer types of the parents. The point here is not that it is the direct parent. The point is, that it's the NMSettingClass type. Also, it can only be used inconsistently, in face of NMSettingIP4Config, who's parent type is NMSettingIPConfig. Clearly, inside nm-setting-ip4-config.c we wouldn't want to use the "parent_class" name. Consistently rename @parent_class to @setting_class. - Also rename the pointer to the own class to @klass. "setting_class" is also the wrong name for that, because the right name would be something like "setting_6lowpan_class". However, "klass" is preferred over the latter, because we commonly create new GObject implementations by copying an existing one. Generic names like "klass" and "self" inside a type implementation make that simpler. - drop useless comments like /* virtual functions */ /* Properties */ It's better to logically and visually structure the code, and avoid trival remarks about that. They only end up being used inconsistently. If you even need a stronger visual separator, then an 80 char /****/ line should be preferred.
Diffstat (limited to 'libnm-core/nm-setting-macsec.c')
-rw-r--r--libnm-core/nm-setting-macsec.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/libnm-core/nm-setting-macsec.c b/libnm-core/nm-setting-macsec.c
index aca6d6cf70..c8969f068a 100644
--- a/libnm-core/nm-setting-macsec.c
+++ b/libnm-core/nm-setting-macsec.c
@@ -473,18 +473,19 @@ finalize (GObject *object)
}
static void
-nm_setting_macsec_class_init (NMSettingMacsecClass *setting_class)
+nm_setting_macsec_class_init (NMSettingMacsecClass *klass)
{
- GObjectClass *object_class = G_OBJECT_CLASS (setting_class);
- NMSettingClass *parent_class = NM_SETTING_CLASS (setting_class);
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+ NMSettingClass *setting_class = NM_SETTING_CLASS (klass);
- g_type_class_add_private (setting_class, sizeof (NMSettingMacsecPrivate));
+ g_type_class_add_private (klass, sizeof (NMSettingMacsecPrivate));
object_class->set_property = set_property;
object_class->get_property = get_property;
object_class->finalize = finalize;
- parent_class->verify = verify;
- parent_class->need_secrets = need_secrets;
+
+ setting_class->verify = verify;
+ setting_class->need_secrets = need_secrets;
/**
* NMSettingMacsec:parent: