summary refs log tree commit diff
path: root/src/libnm-core-impl/nm-setting.c
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2022-11-18 17:48:09 +0100
committerMichael Biebl <biebl@debian.org>2022-11-18 17:48:09 +0100
commit913bcb40f6c699f8a38351c69e7ea263fe78f71f (patch)
tree79508469b79e31338d898459da15070e2a62b049 /src/libnm-core-impl/nm-setting.c
parent9f101839d9e64df832e9e43c5181887369c46a7e (diff)
New upstream version 1.40.4 upstream/1.40.4
Diffstat (limited to 'src/libnm-core-impl/nm-setting.c')
-rw-r--r--src/libnm-core-impl/nm-setting.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/libnm-core-impl/nm-setting.c b/src/libnm-core-impl/nm-setting.c
index 35070bae..b6f72137 100644
--- a/src/libnm-core-impl/nm-setting.c
+++ b/src/libnm-core-impl/nm-setting.c
@@ -30,6 +30,20 @@
 
 /*****************************************************************************/
 
+/*
+ * We use literal numbers in the header (as opposed to e.g.
+ * (1 << (1 + G_PARAM_USER_SHIFT))), because g-ir-scanner sometimes gets
+ * confused by unknown tokens and silently treats them as zero:
+ * https://gitlab.gnome.org/GNOME/gobject-introspection/-/merge_requests/366
+ */
+
+G_STATIC_ASSERT(G_PARAM_USER_SHIFT == 8);
+G_STATIC_ASSERT(NM_SETTING_PARAM_REQUIRED == (1 << (1 + G_PARAM_USER_SHIFT)));
+G_STATIC_ASSERT(NM_SETTING_PARAM_SECRET == (1 << (2 + G_PARAM_USER_SHIFT)));
+G_STATIC_ASSERT(NM_SETTING_PARAM_FUZZY_IGNORE == (1 << (3 + G_PARAM_USER_SHIFT)));
+
+/*****************************************************************************/
+
 typedef struct {
     GHashTable  *hash;
     const char **names;
@@ -3847,7 +3861,7 @@ nm_setting_option_clear_by_name(NMSetting *setting, NMUtilsPredicateStr predicat
  * Returns: (transfer none): the #GVariant or %NULL if the option
  *   is not set.
  *
- * Since: 1.26.
+ * Since: 1.26
  */
 GVariant *
 nm_setting_option_get(NMSetting *setting, const char *opt_name)