diff options
author | Thomas Haller <thaller@redhat.com> | 2015-02-22 11:55:31 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2015-03-12 18:12:26 +0100 |
commit | 093f6d477bc86d4e607b3f3299ba4fbc2e7bc104 (patch) | |
tree | 7364e03a83b36bb19ce16800103c6eeff7a6c229 /src | |
parent | b66deb67faa09597a8b6e52bbf07c39622220f38 (diff) | |
download | NetworkManager-093f6d477bc86d4e607b3f3299ba4fbc2e7bc104.tar.gz |
trivial: rename nm_utils_ascii_str_to_int64() to _nm_utils_ascii_str_to_int64()
Diffstat (limited to 'src')
-rw-r--r-- | src/NetworkManagerUtils.c | 4 | ||||
-rw-r--r-- | src/NetworkManagerUtils.h | 2 | ||||
-rw-r--r-- | src/dhcp-manager/nm-dhcp-listener.c | 2 | ||||
-rw-r--r-- | src/platform/nm-linux-platform.c | 6 | ||||
-rw-r--r-- | src/platform/nm-platform.c | 2 | ||||
-rw-r--r-- | src/settings/plugins/ibft/reader.c | 4 | ||||
-rw-r--r-- | src/settings/plugins/ifcfg-rh/reader.c | 6 | ||||
-rw-r--r-- | src/settings/plugins/ifcfg-rh/shvar.c | 4 | ||||
-rw-r--r-- | src/settings/plugins/ifnet/connection_parser.c | 8 | ||||
-rw-r--r-- | src/settings/plugins/keyfile/reader.c | 2 | ||||
-rw-r--r-- | src/tests/test-general.c | 4 |
11 files changed, 22 insertions, 22 deletions
diff --git a/src/NetworkManagerUtils.c b/src/NetworkManagerUtils.c index 67633bccef..5b772fccd8 100644 --- a/src/NetworkManagerUtils.c +++ b/src/NetworkManagerUtils.c @@ -1798,7 +1798,7 @@ nm_utils_cmp_connection_by_autoconnect_priority (NMConnection **a, NMConnection return 0; } -/* nm_utils_ascii_str_to_int64: +/* _nm_utils_ascii_str_to_int64: * * A wrapper for g_ascii_strtoll, that checks whether the whole string * can be successfully converted to a number and is within a given @@ -1813,7 +1813,7 @@ nm_utils_cmp_connection_by_autoconnect_priority (NMConnection **a, NMConnection * white space. **/ gint64 -nm_utils_ascii_str_to_int64 (const char *str, guint base, gint64 min, gint64 max, gint64 fallback) +_nm_utils_ascii_str_to_int64 (const char *str, guint base, gint64 min, gint64 max, gint64 fallback) { gint64 v; size_t len; diff --git a/src/NetworkManagerUtils.h b/src/NetworkManagerUtils.h index 25b3e27a0d..adc3d563bb 100644 --- a/src/NetworkManagerUtils.h +++ b/src/NetworkManagerUtils.h @@ -163,7 +163,7 @@ int nm_utils_cmp_connection_by_autoconnect_priority (NMConnection **a, NMConnect void nm_utils_log_connection_diff (NMConnection *connection, NMConnection *diff_base, guint32 level, guint64 domain, const char *name, const char *prefix); -gint64 nm_utils_ascii_str_to_int64 (const char *str, guint base, gint64 min, gint64 max, gint64 fallback); +gint64 _nm_utils_ascii_str_to_int64 (const char *str, guint base, gint64 min, gint64 max, gint64 fallback); #define NM_UTILS_UUID_NS "b425e9fb-7598-44b4-9e3b-5a2e3aaa4905" diff --git a/src/dhcp-manager/nm-dhcp-listener.c b/src/dhcp-manager/nm-dhcp-listener.c index bb29717a97..f1accf4655 100644 --- a/src/dhcp-manager/nm-dhcp-listener.c +++ b/src/dhcp-manager/nm-dhcp-listener.c @@ -132,7 +132,7 @@ handle_event (DBusGProxy *proxy, } pid_str = get_option (options, "pid"); - pid = nm_utils_ascii_str_to_int64 (pid_str, 10, 0, G_MAXINT32, -1); + pid = _nm_utils_ascii_str_to_int64 (pid_str, 10, 0, G_MAXINT32, -1); if (pid == -1) { nm_log_warn (LOGD_DHCP, "DHCP event: couldn't convert PID '%s' to an integer", pid_str ? pid_str : "(null)"); goto out; diff --git a/src/platform/nm-linux-platform.c b/src/platform/nm-linux-platform.c index e1887e5a4b..12f7741c3e 100644 --- a/src/platform/nm-linux-platform.c +++ b/src/platform/nm-linux-platform.c @@ -3025,7 +3025,7 @@ tun_get_properties (NMPlatform *platform, int ifindex, NMPlatformTunProperties * val = nm_platform_sysctl_get (path); g_free (path); if (val) { - props->owner = nm_utils_ascii_str_to_int64 (val, 10, -1, G_MAXINT64, -1); + props->owner = _nm_utils_ascii_str_to_int64 (val, 10, -1, G_MAXINT64, -1); if (errno) success = FALSE; g_free (val); @@ -3036,7 +3036,7 @@ tun_get_properties (NMPlatform *platform, int ifindex, NMPlatformTunProperties * val = nm_platform_sysctl_get (path); g_free (path); if (val) { - props->group = nm_utils_ascii_str_to_int64 (val, 10, -1, G_MAXINT64, -1); + props->group = _nm_utils_ascii_str_to_int64 (val, 10, -1, G_MAXINT64, -1); if (errno) success = FALSE; g_free (val); @@ -3049,7 +3049,7 @@ tun_get_properties (NMPlatform *platform, int ifindex, NMPlatformTunProperties * if (val) { gint64 flags; - flags = nm_utils_ascii_str_to_int64 (val, 16, 0, G_MAXINT64, 0); + flags = _nm_utils_ascii_str_to_int64 (val, 16, 0, G_MAXINT64, 0); if (!errno) { #ifndef IFF_MULTI_QUEUE const int IFF_MULTI_QUEUE = 0x0100; diff --git a/src/platform/nm-platform.c b/src/platform/nm-platform.c index cbf2c8cd61..87d983f000 100644 --- a/src/platform/nm-platform.c +++ b/src/platform/nm-platform.c @@ -322,7 +322,7 @@ nm_platform_sysctl_get_int_checked (const char *path, guint base, gint64 min, gi return fallback; } - ret = nm_utils_ascii_str_to_int64 (value, base, min, max, fallback); + ret = _nm_utils_ascii_str_to_int64 (value, base, min, max, fallback); g_free (value); return ret; } diff --git a/src/settings/plugins/ibft/reader.c b/src/settings/plugins/ibft/reader.c index e3a0168a6c..9f95123282 100644 --- a/src/settings/plugins/ibft/reader.c +++ b/src/settings/plugins/ibft/reader.c @@ -431,7 +431,7 @@ is_ibft_vlan_device (const GPtrArray *block) /* VLAN 0 is normally a valid VLAN ID, but in the iBFT case it * means "no VLAN". */ - if (nm_utils_ascii_str_to_int64 (s_vlan_id, 10, 1, 4095, -1) != -1) + if (_nm_utils_ascii_str_to_int64 (s_vlan_id, 10, 1, 4095, -1) != -1) return TRUE; } return FALSE; @@ -458,7 +458,7 @@ vlan_setting_add_from_block (const GPtrArray *block, g_assert (vlan_id_str); /* VLAN 0 is normally a valid VLAN ID, but in the iBFT case it means "no VLAN" */ - vlan_id = nm_utils_ascii_str_to_int64 (vlan_id_str, 10, 1, 4095, -1); + vlan_id = _nm_utils_ascii_str_to_int64 (vlan_id_str, 10, 1, 4095, -1); if (vlan_id == -1) { g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION, "Invalid VLAN_ID '%s'", vlan_id_str); diff --git a/src/settings/plugins/ifcfg-rh/reader.c b/src/settings/plugins/ifcfg-rh/reader.c index c40fecf50b..febbd90ac6 100644 --- a/src/settings/plugins/ifcfg-rh/reader.c +++ b/src/settings/plugins/ifcfg-rh/reader.c @@ -503,7 +503,7 @@ read_one_ip4_route (shvarFile *ifcfg, /* Metric */ value = svGetValue (ifcfg, metric_tag, FALSE); if (value) { - metric = nm_utils_ascii_str_to_int64 (value, 10, 0, G_MAXUINT32, -1); + metric = _nm_utils_ascii_str_to_int64 (value, 10, 0, G_MAXUINT32, -1); if (metric < 0) { g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION, "Invalid IP4 route metric '%s'", value); @@ -3344,7 +3344,7 @@ make_wireless_setting (shvarFile *ifcfg, value = svGetValue (ifcfg, "CHANNEL", FALSE); if (value) { errno = 0; - chan = nm_utils_ascii_str_to_int64 (value, 10, 1, 196, 0); + chan = _nm_utils_ascii_str_to_int64 (value, 10, 1, 196, 0); if (errno || (chan == 0)) { g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION, "Invalid wireless channel '%s'", value); @@ -4889,7 +4889,7 @@ devtimeout_from_file (const char *filename) devtimeout_str = svGetValue (ifcfg, "DEVTIMEOUT", FALSE); if (devtimeout_str) { - devtimeout = nm_utils_ascii_str_to_int64 (devtimeout_str, 10, 0, G_MAXUINT, 0); + devtimeout = _nm_utils_ascii_str_to_int64 (devtimeout_str, 10, 0, G_MAXUINT, 0); g_free (devtimeout_str); } else devtimeout = 0; diff --git a/src/settings/plugins/ifcfg-rh/shvar.c b/src/settings/plugins/ifcfg-rh/shvar.c index 5f3d173b2a..812f83aca8 100644 --- a/src/settings/plugins/ifcfg-rh/shvar.c +++ b/src/settings/plugins/ifcfg-rh/shvar.c @@ -321,7 +321,7 @@ svTrueValue (shvarFile *s, const char *key, gboolean def) * @max: the maximum for range-check * @fallback: the fallback value in any error case * - * Reads a value @key and converts it to an integer using nm_utils_ascii_str_to_int64(). + * Reads a value @key and converts it to an integer using _nm_utils_ascii_str_to_int64(). * In case of error, @errno will be set and @fallback returned. */ gint64 svGetValueInt64 (shvarFile *s, const char *key, guint base, gint64 min, gint64 max, gint64 fallback) @@ -336,7 +336,7 @@ svGetValueInt64 (shvarFile *s, const char *key, guint base, gint64 min, gint64 m return fallback; } - result = nm_utils_ascii_str_to_int64 (tmp, base, min, max, fallback); + result = _nm_utils_ascii_str_to_int64 (tmp, base, min, max, fallback); errsv = errno; if (errsv != 0) PARSE_WARNING ("Error reading '%s' value '%s' as integer (%d)", key, tmp, errsv); diff --git a/src/settings/plugins/ifnet/connection_parser.c b/src/settings/plugins/ifnet/connection_parser.c index 41baf31507..888ee589ad 100644 --- a/src/settings/plugins/ifnet/connection_parser.c +++ b/src/settings/plugins/ifnet/connection_parser.c @@ -706,13 +706,13 @@ make_ip4_setting (NMConnection *connection, GError *local = NULL; if ((metric_str = ifnet_get_data (conn_name, "metric")) != NULL) { - metric = nm_utils_ascii_str_to_int64 (metric_str, 10, 0, G_MAXUINT32, -1); + metric = _nm_utils_ascii_str_to_int64 (metric_str, 10, 0, G_MAXUINT32, -1); } else { metric_str = ifnet_get_global_data ("metric"); if (metric_str) { stripped = g_strdup (metric_str); strip_string (stripped, '"'); - metric = nm_utils_ascii_str_to_int64 (metric_str, 10, 0, G_MAXUINT32, -1); + metric = _nm_utils_ascii_str_to_int64 (metric_str, 10, 0, G_MAXUINT32, -1); g_free (stripped); } else metric = -1; @@ -846,13 +846,13 @@ make_ip6_setting (NMConnection *connection, /* metric is not per routes configuration right now * global metric is also supported (metric="x") */ if ((metric_str = ifnet_get_data (conn_name, "metric")) != NULL) - metric = nm_utils_ascii_str_to_int64 (metric_str, 10, 0, G_MAXUINT32, -1); + metric = _nm_utils_ascii_str_to_int64 (metric_str, 10, 0, G_MAXUINT32, -1); else { metric_str = ifnet_get_global_data ("metric"); if (metric_str) { stripped = g_strdup (metric_str); strip_string (stripped, '"'); - metric = nm_utils_ascii_str_to_int64 (metric_str, 10, 0, G_MAXUINT32, -1); + metric = _nm_utils_ascii_str_to_int64 (metric_str, 10, 0, G_MAXUINT32, -1); g_free (stripped); } else metric = 1; diff --git a/src/settings/plugins/keyfile/reader.c b/src/settings/plugins/keyfile/reader.c index bb9667b59d..8f50b4bf4f 100644 --- a/src/settings/plugins/keyfile/reader.c +++ b/src/settings/plugins/keyfile/reader.c @@ -1145,7 +1145,7 @@ read_one_setting_value (NMSetting *setting, gint64 int_val; tmp_str = nm_keyfile_plugin_kf_get_value (info->keyfile, setting_name, key, NULL); - int_val = nm_utils_ascii_str_to_int64 (tmp_str, 10, G_MININT64, G_MAXINT64, 0); + int_val = _nm_utils_ascii_str_to_int64 (tmp_str, 10, G_MININT64, G_MAXINT64, 0); errsv = errno; if (errsv) nm_log_warn (LOGD_SETTINGS, "Invalid int64 value (%s)", tmp_str); diff --git a/src/tests/test-general.c b/src/tests/test-general.c index 21533cc743..be1ee5cbab 100644 --- a/src/tests/test-general.c +++ b/src/tests/test-general.c @@ -38,7 +38,7 @@ test_nm_utils_ascii_str_to_int64_check (const char *str, guint base, gint64 min, gint64 v; errno = 1; - v = nm_utils_ascii_str_to_int64 (str, base, min, max, fallback); + v = _nm_utils_ascii_str_to_int64 (str, base, min, max, fallback); g_assert_cmpint (errno, ==, exp_errno); g_assert_cmpint (v, ==, exp_val); } @@ -893,7 +893,7 @@ main (int argc, char **argv) { nmtst_init_with_logging (&argc, &argv, NULL, "ALL"); - g_test_add_func ("/general/nm_utils_ascii_str_to_int64", test_nm_utils_ascii_str_to_int64); + g_test_add_func ("/general/_nm_utils_ascii_str_to_int64", test_nm_utils_ascii_str_to_int64); g_test_add_func ("/general/nm_utils_ip6_address_clear_host_address", test_nm_utils_ip6_address_clear_host_address); g_test_add_func ("/general/nm_utils_log_connection_diff", test_nm_utils_log_connection_diff); |