summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFelipe Sateler <fsateler@users.noreply.github.com>2016-08-23 06:29:30 -0300
committerEvgeny Vereshchagin <evvers@ya.ru>2016-08-23 12:29:30 +0300
commit8dec4a9d2d8301102e12f8cf1d9a646e685fb1ea (patch)
treeb94871d30fefafd78887efa2b35b92d1ff5a79e6 /src
parent83f12b27d14853e7c89a326f7cd31a6c739d378e (diff)
core,network: Use const qualifiers for block-local variables in macro functions (#4019)
Prevents discard-qualifiers warnings when the passed variable was const
Diffstat (limited to 'src')
-rw-r--r--src/core/selinux-access.h2
-rw-r--r--src/core/unit.h2
-rw-r--r--src/network/networkd-link.h2
-rw-r--r--src/network/networkd-netdev.h2
4 files changed, 4 insertions, 4 deletions
diff --git a/src/core/selinux-access.h b/src/core/selinux-access.h
index 8f1f058a32..f46370d020 100644
--- a/src/core/selinux-access.h
+++ b/src/core/selinux-access.h
@@ -33,7 +33,7 @@ int mac_selinux_generic_access_check(sd_bus_message *message, const char *path,
#define mac_selinux_unit_access_check(unit, message, permission, error) \
({ \
- Unit *_unit = (unit); \
+ const Unit *_unit = (unit); \
mac_selinux_generic_access_check((message), _unit->source_path ?: _unit->fragment_path, (permission), (error)); \
})
diff --git a/src/core/unit.h b/src/core/unit.h
index 53875653d7..f7a65782f1 100644
--- a/src/core/unit.h
+++ b/src/core/unit.h
@@ -639,7 +639,7 @@ void unit_notify_user_lookup(Unit *u, uid_t uid, gid_t gid);
#define log_unit_full(unit, level, error, ...) \
({ \
- Unit *_u = (unit); \
+ const Unit *_u = (unit); \
_u ? log_object_internal(level, error, __FILE__, __LINE__, __func__, _u->manager->unit_log_field, _u->id, ##__VA_ARGS__) : \
log_internal(level, error, __FILE__, __LINE__, __func__, ##__VA_ARGS__); \
})
diff --git a/src/network/networkd-link.h b/src/network/networkd-link.h
index 2809b1fe0b..05b2a2b323 100644
--- a/src/network/networkd-link.h
+++ b/src/network/networkd-link.h
@@ -186,7 +186,7 @@ DEFINE_TRIVIAL_CLEANUP_FUNC(Link*, link_unref);
#define log_link_full(link, level, error, ...) \
({ \
- Link *_l = (link); \
+ const Link *_l = (link); \
_l ? log_object_internal(level, error, __FILE__, __LINE__, __func__, "INTERFACE=", _l->ifname, ##__VA_ARGS__) : \
log_internal(level, error, __FILE__, __LINE__, __func__, ##__VA_ARGS__); \
}) \
diff --git a/src/network/networkd-netdev.h b/src/network/networkd-netdev.h
index b92a973b85..09863e72b4 100644
--- a/src/network/networkd-netdev.h
+++ b/src/network/networkd-netdev.h
@@ -180,7 +180,7 @@ const struct ConfigPerfItem* network_netdev_gperf_lookup(const char *key, unsign
#define log_netdev_full(netdev, level, error, ...) \
({ \
- NetDev *_n = (netdev); \
+ const NetDev *_n = (netdev); \
_n ? log_object_internal(level, error, __FILE__, __LINE__, __func__, "INTERFACE=", _n->ifname, ##__VA_ARGS__) : \
log_internal(level, error, __FILE__, __LINE__, __func__, ##__VA_ARGS__); \
})