From f8fb670c6fbe23907365516c421eb475ae4cbcb3 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Mon, 16 May 2016 13:16:49 +0200 Subject: [PATCH] platform: declare nmp_utils_ip_config_source_*() functions as const --- src/platform/nm-platform-utils.c | 5 +---- 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__ */