diff options
author | Thomas Haller <thaller@redhat.com> | 2016-05-16 13:16:49 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2016-05-16 13:16:49 +0200 |
commit | f8fb670c6fbe23907365516c421eb475ae4cbcb3 (patch) | |
tree | 31c50a1176a65600831ae7aa84419951eceb392e | |
parent | 5847e70fd68c33ea65b8ae17f2599ea016a0c429 (diff) | |
download | NetworkManager-f8fb670c6fbe23907365516c421eb475ae4cbcb3.tar.gz |
platform: declare nmp_utils_ip_config_source_*() functions as const
-rw-r--r-- | src/platform/nm-platform-utils.c | 5 | ||||
-rw-r--r-- | src/platform/nm-platform-utils.h | 8 |
2 files changed, 5 insertions, 8 deletions
diff --git a/src/platform/nm-platform-utils.c b/src/platform/nm-platform-utils.c index 7fb4b95553..8aa93ed81d 100644 --- a/src/platform/nm-platform-utils.c +++ b/src/platform/nm-platform-utils.c @@ -457,11 +457,8 @@ nmp_utils_ip_config_source_coerce_to_rtprot (NMIPConfigSource source) if (source <= NM_IP_CONFIG_SOURCE_UNKNOWN) return RTPROT_UNSPEC; - if (source <= _NM_IP_CONFIG_SOURCE_RTPROT_LAST) { - nm_assert (NM_IS_IP_CONFIG_SOURCE_RTPROT (source)); + if (source <= _NM_IP_CONFIG_SOURCE_RTPROT_LAST) return source - 1; - } else - nm_assert (!NM_IS_IP_CONFIG_SOURCE_RTPROT (source)); switch (source) { case NM_IP_CONFIG_SOURCE_KERNEL: diff --git a/src/platform/nm-platform-utils.h b/src/platform/nm-platform-utils.h index df7abcef89..456c08652d 100644 --- a/src/platform/nm-platform-utils.h +++ b/src/platform/nm-platform-utils.h @@ -54,10 +54,10 @@ const char *nmp_utils_udev_get_driver (GUdevDevice *device); gboolean nmp_utils_device_exists (const char *name); -NMIPConfigSource nmp_utils_ip_config_source_from_rtprot (guint8 rtprot); -guint8 nmp_utils_ip_config_source_coerce_to_rtprot (NMIPConfigSource source); -NMIPConfigSource nmp_utils_ip_config_source_coerce_from_rtprot (NMIPConfigSource source); -NMIPConfigSource nmp_utils_ip_config_source_round_trip_rtprot (NMIPConfigSource source); +NMIPConfigSource nmp_utils_ip_config_source_from_rtprot (guint8 rtprot) _nm_const; +guint8 nmp_utils_ip_config_source_coerce_to_rtprot (NMIPConfigSource source) _nm_const; +NMIPConfigSource nmp_utils_ip_config_source_coerce_from_rtprot (NMIPConfigSource source) _nm_const; +NMIPConfigSource nmp_utils_ip_config_source_round_trip_rtprot (NMIPConfigSource source) _nm_const; const char * nmp_utils_ip_config_source_to_string (NMIPConfigSource source, char *buf, gsize len); #endif /* __NM_PLATFORM_UTILS_H__ */ |