diff options
| author | Michael Biebl <biebl@debian.org> | 2018-09-08 17:44:06 +0200 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2018-09-08 17:44:06 +0200 |
| commit | 8f7a3cbbdd0c0a48277c341dd3a8ec8743ae9735 (patch) | |
| tree | 4353551fcb59cc822c3cadf2f4888f70601e8fbf /libnm-util | |
| parent | caf1db9d6fbc056cc6c76a24574890f6c7895f3d (diff) | |
New upstream version 1.13.90 upstream/1.13.90
Diffstat (limited to 'libnm-util')
| -rw-r--r-- | libnm-util/crypto_nss.c | 17 | ||||
| -rw-r--r-- | libnm-util/meson.build | 7 | ||||
| -rw-r--r-- | libnm-util/nm-param-spec-specialized.c | 64 | ||||
| -rw-r--r-- | libnm-util/nm-setting-bond.c | 2 | ||||
| -rw-r--r-- | libnm-util/nm-setting-connection.c | 1 | ||||
| -rw-r--r-- | libnm-util/nm-setting-dcb.c | 14 | ||||
| -rw-r--r-- | libnm-util/nm-setting-dcb.h | 6 | ||||
| -rw-r--r-- | libnm-util/nm-setting-private.h | 6 | ||||
| -rw-r--r-- | libnm-util/nm-setting-vlan.c | 2 | ||||
| -rw-r--r-- | libnm-util/nm-setting.c | 12 | ||||
| -rw-r--r-- | libnm-util/nm-setting.h | 2 | ||||
| -rw-r--r-- | libnm-util/nm-utils.c | 18 | ||||
| -rw-r--r-- | libnm-util/tests/meson.build | 2 | ||||
| -rw-r--r-- | libnm-util/tests/test-crypto.c | 4 |
14 files changed, 78 insertions, 79 deletions
diff --git a/libnm-util/crypto_nss.c b/libnm-util/crypto_nss.c index b55af774..01bb28c3 100644 --- a/libnm-util/crypto_nss.c +++ b/libnm-util/crypto_nss.c @@ -441,10 +441,7 @@ crypto_verify_pkcs12 (const GByteArray *data, PK11SlotInfo *slot = NULL; SECStatus s; char *ucs2_password; - glong ucs2_chars = 0; -#ifndef WORDS_BIGENDIAN - guint16 *p; -#endif /* WORDS_BIGENDIAN */ + long ucs2_chars = 0; if (error) g_return_val_if_fail (*error == NULL, FALSE); @@ -470,10 +467,14 @@ crypto_verify_pkcs12 (const GByteArray *data, memset (ucs2_password, 0, ucs2_chars); g_free (ucs2_password); -#ifndef WORDS_BIGENDIAN - for (p = (guint16 *) pw.data; p < (guint16 *) (pw.data + pw.len); p++) - *p = GUINT16_SWAP_LE_BE (*p); -#endif /* WORDS_BIGENDIAN */ +#if __BYTE_ORDER == __LITTLE_ENDIAN + { + guint16 *p; + + for (p = (guint16 *) pw.data; p < (guint16 *) (pw.data + pw.len); p++) + *p = GUINT16_SWAP_LE_BE (*p); + } +#endif } else { /* NULL password */ pw.data = NULL; diff --git a/libnm-util/meson.build b/libnm-util/meson.build index 55df5501..da807bc6 100644 --- a/libnm-util/meson.build +++ b/libnm-util/meson.build @@ -102,7 +102,6 @@ deps = [ common_cflags = [ '-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM_UTIL', - '-DNMLOCALEDIR="@0@"'.format(nm_localedir), ] cflags = common_cflags + [ @@ -167,10 +166,10 @@ if enable_introspection ) endif -run_target( +test( 'check-local-exports-' + libnm_util_name, - command: [check_exports, libnm_util.full_path(), linker_script], - depends: libnm_util + check_exports, + args: [libnm_util.full_path(), linker_script], ) sources = files( diff --git a/libnm-util/nm-param-spec-specialized.c b/libnm-util/nm-param-spec-specialized.c index fc8d0318..dfc8ea98 100644 --- a/libnm-util/nm-param-spec-specialized.c +++ b/libnm-util/nm-param-spec-specialized.c @@ -38,7 +38,7 @@ struct _NMParamSpecSpecialized { /*****************************************************************************/ /* _gvalues_compare */ -static gint _gvalues_compare (const GValue *value1, const GValue *value2); +static int _gvalues_compare (const GValue *value1, const GValue *value2); static gboolean type_is_fixed_size (GType type, gsize *tsize) @@ -54,13 +54,13 @@ type_is_fixed_size (GType type, gsize *tsize) if (tsize) *tsize = sizeof (gboolean); return TRUE; case G_TYPE_LONG: - if (tsize) *tsize = sizeof (glong); + if (tsize) *tsize = sizeof (long); return TRUE; case G_TYPE_ULONG: if (tsize) *tsize = sizeof (gulong); return TRUE; case G_TYPE_INT: - if (tsize) *tsize = sizeof (gint); + if (tsize) *tsize = sizeof (int); return TRUE; case G_TYPE_UINT: if (tsize) *tsize = sizeof (guint); @@ -72,10 +72,10 @@ type_is_fixed_size (GType type, gsize *tsize) if (tsize) *tsize = sizeof (guint64); return TRUE; case G_TYPE_FLOAT: - if (tsize) *tsize = sizeof (gfloat); + if (tsize) *tsize = sizeof (float); return TRUE; case G_TYPE_DOUBLE: - if (tsize) *tsize = sizeof (gdouble); + if (tsize) *tsize = sizeof (double); return TRUE; default: return FALSE; @@ -84,15 +84,15 @@ type_is_fixed_size (GType type, gsize *tsize) #define FLOAT_FACTOR 0.00000001 -static gint +static int _gvalues_compare_fixed (const GValue *value1, const GValue *value2) { int ret = 0; switch (G_VALUE_TYPE (value1)) { case G_TYPE_CHAR: { - gchar val1 = g_value_get_schar (value1); - gchar val2 = g_value_get_schar (value2); + char val1 = g_value_get_schar (value1); + char val2 = g_value_get_schar (value2); if (val1 != val2) ret = val1 < val2 ? -1 : val1 > val2; break; @@ -112,8 +112,8 @@ _gvalues_compare_fixed (const GValue *value1, const GValue *value2) break; } case G_TYPE_LONG: { - glong val1 = g_value_get_long (value1); - glong val2 = g_value_get_long (value2); + long val1 = g_value_get_long (value1); + long val2 = g_value_get_long (value2); if (val1 != val2) ret = val1 < val2 ? -1 : val1 > val2; break; @@ -126,8 +126,8 @@ _gvalues_compare_fixed (const GValue *value1, const GValue *value2) break; } case G_TYPE_INT: { - gint val1 = g_value_get_int (value1); - gint val2 = g_value_get_int (value2); + int val1 = g_value_get_int (value1); + int val2 = g_value_get_int (value2); if (val1 != val2) ret = val1 < val2 ? -1 : val1 > val2; break; @@ -154,8 +154,8 @@ _gvalues_compare_fixed (const GValue *value1, const GValue *value2) break; } case G_TYPE_FLOAT: { - gfloat val1 = g_value_get_float (value1); - gfloat val2 = g_value_get_float (value2); + float val1 = g_value_get_float (value1); + float val2 = g_value_get_float (value2); float diff = val1 - val2; /* Can't use == or != here due to inexactness of FP */ @@ -164,8 +164,8 @@ _gvalues_compare_fixed (const GValue *value1, const GValue *value2) break; } case G_TYPE_DOUBLE: { - gdouble val1 = g_value_get_double (value1); - gdouble val2 = g_value_get_double (value2); + double val1 = g_value_get_double (value1); + double val2 = g_value_get_double (value2); double diff = val1 - val2; if (diff > FLOAT_FACTOR || diff < -FLOAT_FACTOR) @@ -179,7 +179,7 @@ _gvalues_compare_fixed (const GValue *value1, const GValue *value2) return ret; } -static gint +static int _gvalues_compare_string (const GValue *value1, const GValue *value2) { const char *str1 = g_value_get_string (value1); @@ -196,12 +196,12 @@ _gvalues_compare_string (const GValue *value1, const GValue *value2) return strcmp (str1, str2); } -static gint +static int _gvalues_compare_strv (const GValue *value1, const GValue *value2) { char **strv1; char **strv2; - gint ret; + int ret; guint i = 0; strv1 = (char **) g_value_get_boxed (value1); @@ -252,10 +252,10 @@ iterate_collection (const GValue *value, gpointer user_data) *list = g_slist_prepend (*list, _gvalue_dup (value)); } -static gint +static int _gvalues_compare_collection (const GValue *value1, const GValue *value2) { - gint ret; + int ret; guint len1; guint len2; GType value_type = dbus_g_type_get_collection_specialization (G_VALUE_TYPE (value1)); @@ -312,7 +312,7 @@ iterate_map (const GValue *key_val, typedef struct { GHashTable *hash2; - gint ret; + int ret; } CompareMapInfo; static void @@ -331,14 +331,14 @@ compare_one_map_item (gpointer key, gpointer val, gpointer user_data) info->ret = 1; } -static gint +static int _gvalues_compare_map (const GValue *value1, const GValue *value2) { GHashTable *hash1 = NULL; GHashTable *hash2 = NULL; guint len1; guint len2; - gint ret = 0; + int ret = 0; if (dbus_g_type_get_map_key_specialization (G_VALUE_TYPE (value1)) != G_TYPE_STRING) { g_warning ("Can not compare maps with '%s' for keys", @@ -371,7 +371,7 @@ _gvalues_compare_map (const GValue *value1, const GValue *value2) return ret; } -static gint +static int _gvalue_ip6_address_compare (const GValue *value1, const GValue *value2) { GValueArray *values1, *values2; @@ -379,7 +379,7 @@ _gvalue_ip6_address_compare (const GValue *value1, const GValue *value2) GByteArray *addr1, *addr2; guint32 prefix1, prefix2; GByteArray *gw1, *gw2; - gint ret = 0; + int ret = 0; int i; /* IP6 addresses are GValueArrays (see nm-dbus-glib-types.h) */ @@ -429,7 +429,7 @@ _gvalue_ip6_address_compare (const GValue *value1, const GValue *value2) return ret; } -static gint +static int _gvalue_ip6_route_compare (const GValue *value1, const GValue *value2) { GValueArray *values1, *values2; @@ -438,7 +438,7 @@ _gvalue_ip6_route_compare (const GValue *value1, const GValue *value2) GByteArray *next_hop1, *next_hop2; guint32 prefix1, prefix2; guint32 metric1, metric2; - gint ret = 0; + int ret = 0; int i; /* IP6 routes are GValueArrays (see nm-dbus-glib-types.h) */ @@ -491,7 +491,7 @@ _gvalue_ip6_route_compare (const GValue *value1, const GValue *value2) return ret; } -static gint +static int _gvalues_compare_struct (const GValue *value1, const GValue *value2) { /* value1 and value2 must contain the same type since @@ -508,12 +508,12 @@ _gvalues_compare_struct (const GValue *value1, const GValue *value2) } } -gint +int _gvalues_compare (const GValue *value1, const GValue *value2) { GType type1; GType type2; - gint ret; + int ret; if (value1 == value2) return 0; @@ -592,7 +592,7 @@ param_specialized_validate (GParamSpec *pspec, GValue *value) return changed; } -static gint +static int param_specialized_values_cmp (GParamSpec *pspec, const GValue *value1, const GValue *value2) diff --git a/libnm-util/nm-setting-bond.c b/libnm-util/nm-setting-bond.c index 5a9b9634..a54e93c3 100644 --- a/libnm-util/nm-setting-bond.c +++ b/libnm-util/nm-setting-bond.c @@ -222,7 +222,7 @@ nm_setting_bond_get_option (NMSettingBond *setting, static gboolean validate_int (const char *name, const char *value, const BondDefault *def) { - glong num; + long num; guint i; for (i = 0; i < strlen (value); i++) { diff --git a/libnm-util/nm-setting-connection.c b/libnm-util/nm-setting-connection.c index e51d2c91..c7da1aa4 100644 --- a/libnm-util/nm-setting-connection.c +++ b/libnm-util/nm-setting-connection.c @@ -912,7 +912,6 @@ compare_property (NMSetting *setting, && g_strcmp0 (prop_spec->name, NM_SETTING_CONNECTION_ID) == 0) return TRUE; - /* Otherwise chain up to parent to handle generic compare */ return NM_SETTING_CLASS (nm_setting_connection_parent_class)->compare_property (setting, other, prop_spec, flags); } diff --git a/libnm-util/nm-setting-dcb.c b/libnm-util/nm-setting-dcb.c index 2cd0bdaf..17a3a871 100644 --- a/libnm-util/nm-setting-dcb.c +++ b/libnm-util/nm-setting-dcb.c @@ -75,14 +75,14 @@ NM_SETTING_REGISTER_TYPE (NM_TYPE_SETTING_DCB) typedef struct { NMSettingDcbFlags app_fcoe_flags; - gint app_fcoe_priority; + int app_fcoe_priority; char * app_fcoe_mode; NMSettingDcbFlags app_iscsi_flags; - gint app_iscsi_priority; + int app_iscsi_priority; NMSettingDcbFlags app_fip_flags; - gint app_fip_priority; + int app_fip_priority; /* Priority Flow Control */ NMSettingDcbFlags pfc_flags; @@ -161,7 +161,7 @@ nm_setting_dcb_get_app_fcoe_flags (NMSettingDcb *setting) * * Since: 0.9.10 **/ -gint +int nm_setting_dcb_get_app_fcoe_priority (NMSettingDcb *setting) { g_return_val_if_fail (NM_IS_SETTING_DCB (setting), 0); @@ -209,7 +209,7 @@ nm_setting_dcb_get_app_iscsi_flags (NMSettingDcb *setting) * * Since: 0.9.10 **/ -gint +int nm_setting_dcb_get_app_iscsi_priority (NMSettingDcb *setting) { g_return_val_if_fail (NM_IS_SETTING_DCB (setting), 0); @@ -241,7 +241,7 @@ nm_setting_dcb_get_app_fip_flags (NMSettingDcb *setting) * * Since: 0.9.10 **/ -gint +int nm_setting_dcb_get_app_fip_priority (NMSettingDcb *setting) { g_return_val_if_fail (NM_IS_SETTING_DCB (setting), 0); @@ -665,7 +665,7 @@ check_uint_array (const guint *array, } static gboolean -check_priority (gint val, +check_priority (int val, NMSettingDcbFlags flags, const char *prop_name, GError **error) diff --git a/libnm-util/nm-setting-dcb.h b/libnm-util/nm-setting-dcb.h index 2757200e..04863545 100644 --- a/libnm-util/nm-setting-dcb.h +++ b/libnm-util/nm-setting-dcb.h @@ -130,14 +130,14 @@ NM_AVAILABLE_IN_0_9_10 NMSetting * nm_setting_dcb_new (void); NMSettingDcbFlags nm_setting_dcb_get_app_fcoe_flags (NMSettingDcb *setting); -gint nm_setting_dcb_get_app_fcoe_priority (NMSettingDcb *setting); +int nm_setting_dcb_get_app_fcoe_priority (NMSettingDcb *setting); const char * nm_setting_dcb_get_app_fcoe_mode (NMSettingDcb *setting); NMSettingDcbFlags nm_setting_dcb_get_app_iscsi_flags (NMSettingDcb *setting); -gint nm_setting_dcb_get_app_iscsi_priority (NMSettingDcb *setting); +int nm_setting_dcb_get_app_iscsi_priority (NMSettingDcb *setting); NMSettingDcbFlags nm_setting_dcb_get_app_fip_flags (NMSettingDcb *setting); -gint nm_setting_dcb_get_app_fip_priority (NMSettingDcb *setting); +int nm_setting_dcb_get_app_fip_priority (NMSettingDcb *setting); /* Priority Flow Control */ NMSettingDcbFlags nm_setting_dcb_get_priority_flow_control_flags (NMSettingDcb *setting); diff --git a/libnm-util/nm-setting-private.h b/libnm-util/nm-setting-private.h index e2e02398..9b8e9464 100644 --- a/libnm-util/nm-setting-private.h +++ b/libnm-util/nm-setting-private.h @@ -58,7 +58,7 @@ gboolean _nm_setting_type_is_base_type (GType type); guint32 _nm_setting_get_setting_priority (NMSetting *setting); GType _nm_setting_lookup_setting_type (const char *name); GType _nm_setting_lookup_setting_type_by_quark (GQuark error_quark); -gint _nm_setting_compare_priority (gconstpointer a, gconstpointer b); +int _nm_setting_compare_priority (gconstpointer a, gconstpointer b); gboolean _nm_setting_get_property (NMSetting *setting, const char *name, GValue *value); @@ -113,8 +113,8 @@ NMSettingVerifyResult _nm_setting_verify_deprecated_virtual_iface_name (const ch const char *setting_name, const char *setting_property, GQuark error_quark, - gint e_invalid_property, - gint e_missing_property, + int e_invalid_property, + int e_missing_property, GSList *all_settings, GError **error); diff --git a/libnm-util/nm-setting-vlan.c b/libnm-util/nm-setting-vlan.c index 3cddb3f9..f835e07f 100644 --- a/libnm-util/nm-setting-vlan.c +++ b/libnm-util/nm-setting-vlan.c @@ -174,7 +174,7 @@ static PriorityMap * priority_map_new_from_str (NMVlanPriorityMap map, const char *str) { PriorityMap *p = NULL; - gchar **t = NULL; + char **t = NULL; guint32 len; guint64 from, to; diff --git a/libnm-util/nm-setting.c b/libnm-util/nm-setting.c index c74d2d71..9147dfe1 100644 --- a/libnm-util/nm-setting.c +++ b/libnm-util/nm-setting.c @@ -270,7 +270,7 @@ _nm_setting_lookup_setting_type_by_quark (GQuark error_quark) return G_TYPE_INVALID; } -gint +int _nm_setting_compare_priority (gconstpointer a, gconstpointer b) { guint32 prio_a, prio_b; @@ -321,7 +321,7 @@ nm_setting_to_hash (NMSetting *setting, NMSettingHashFlags flags) property_specs = g_object_class_list_properties (G_OBJECT_GET_CLASS (setting), &n_property_specs); hash = g_hash_table_new_full (g_str_hash, g_str_equal, - (GDestroyNotify) g_free, destroy_gvalue); + g_free, destroy_gvalue); for (i = 0; i < n_property_specs; i++) { GParamSpec *prop_spec = property_specs[i]; @@ -466,7 +466,7 @@ nm_setting_duplicate (NMSetting *setting) return NM_SETTING (dup); } -static gint +static int find_setting_by_name (gconstpointer a, gconstpointer b) { NMSetting *setting = NM_SETTING (a); @@ -616,7 +616,7 @@ nm_setting_compare (NMSetting *a, { GParamSpec **property_specs; guint n_property_specs; - gint same = TRUE; + int same = TRUE; guint i; g_return_val_if_fail (NM_IS_SETTING (a), FALSE); @@ -1335,8 +1335,8 @@ _nm_setting_verify_deprecated_virtual_iface_name (const char *interface_name, const char *setting_name, const char *setting_property, GQuark error_quark, - gint e_invalid_property, - gint e_missing_property, + int e_invalid_property, + int e_missing_property, GSList *all_settings, GError **error) { diff --git a/libnm-util/nm-setting.h b/libnm-util/nm-setting.h index 1470a69b..d235efbd 100644 --- a/libnm-util/nm-setting.h +++ b/libnm-util/nm-setting.h @@ -182,7 +182,7 @@ typedef struct { GObjectClass parent; /* Virtual functions */ - gint (*verify) (NMSetting *setting, + int (*verify) (NMSetting *setting, GSList *all_settings, GError **error); diff --git a/libnm-util/nm-utils.c b/libnm-util/nm-utils.c index 2af9432f..054d69f4 100644 --- a/libnm-util/nm-utils.c +++ b/libnm-util/nm-utils.c @@ -295,8 +295,8 @@ nm_utils_ssid_to_utf8 (const GByteArray *ssid) g_return_val_if_fail (ssid != NULL, NULL); - if (g_utf8_validate ((const gchar *) ssid->data, ssid->len, NULL)) - return g_strndup ((const gchar *) ssid->data, ssid->len); + if (g_utf8_validate ((const char *) ssid->data, ssid->len, NULL)) + return g_strndup ((const char *) ssid->data, ssid->len); /* LANG may be a good encoding hint */ g_get_charset ((const char **)(&e1)); @@ -311,15 +311,15 @@ nm_utils_ssid_to_utf8 (const GByteArray *ssid) g_free (lang); } - converted = g_convert ((const gchar *) ssid->data, ssid->len, "UTF-8", e1, NULL, NULL, NULL); + converted = g_convert ((const char *) ssid->data, ssid->len, "UTF-8", e1, NULL, NULL, NULL); if (!converted && e2) - converted = g_convert ((const gchar *) ssid->data, ssid->len, "UTF-8", e2, NULL, NULL, NULL); + converted = g_convert ((const char *) ssid->data, ssid->len, "UTF-8", e2, NULL, NULL, NULL); if (!converted && e3) - converted = g_convert ((const gchar *) ssid->data, ssid->len, "UTF-8", e3, NULL, NULL, NULL); + converted = g_convert ((const char *) ssid->data, ssid->len, "UTF-8", e3, NULL, NULL, NULL); if (!converted) { - converted = g_convert_with_fallback ((const gchar *) ssid->data, ssid->len, + converted = g_convert_with_fallback ((const char *) ssid->data, ssid->len, "UTF-8", e1, "?", NULL, NULL, NULL); } @@ -330,11 +330,11 @@ nm_utils_ssid_to_utf8 (const GByteArray *ssid) */ /* Use the printable range of 0x20-0x7E */ - gchar *valid_chars = " !\"#$%&'()*+,-./0123456789:;<=>?@" + char *valid_chars = " !\"#$%&'()*+,-./0123456789:;<=>?@" "ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`" "abcdefghijklmnopqrstuvwxyz{|}~"; - converted = g_strndup ((const gchar *)ssid->data, ssid->len); + converted = g_strndup ((const char *)ssid->data, ssid->len); g_strcanon (converted, valid_chars, '?'); } @@ -491,7 +491,7 @@ nm_utils_gvalue_hash_dup (GHashTable *hash) g_return_val_if_fail (hash != NULL, NULL); table = g_hash_table_new_full (g_str_hash, g_str_equal, - (GDestroyNotify) g_free, + g_free, value_destroy); g_hash_table_foreach (hash, value_dup, table); diff --git a/libnm-util/tests/meson.build b/libnm-util/tests/meson.build index cf46ad14..49c35a51 100644 --- a/libnm-util/tests/meson.build +++ b/libnm-util/tests/meson.build @@ -7,7 +7,7 @@ deps = [ cflags = common_cflags + [ '-DNETWORKMANAGER_COMPILATION_TEST', -] + nm_build_cflags +] test = 'test-libnm-linking' diff --git a/libnm-util/tests/test-crypto.c b/libnm-util/tests/test-crypto.c index 61bd9774..af6028a5 100644 --- a/libnm-util/tests/test-crypto.c +++ b/libnm-util/tests/test-crypto.c @@ -383,8 +383,8 @@ main (int argc, char **argv) g_test_add_data_func ("/libnm/crypto/key/padding-8", "test2_key_and_cert.pem, 12345testing", test_key); - g_test_add_data_func ("/libnm/crypto/key/aes", - "test-aes-key.pem, test-aes-password", + g_test_add_data_func ("/libnm/crypto/key/aes-128", + "test-aes-128-key.pem, test-aes-password", test_key); g_test_add_data_func ("/libnm/crypto/PKCS#12/1", |