mirror of
https://github.com/morgan9e/systemd
synced 2026-04-15 00:47:10 +09:00
core,network: Use const qualifiers for block-local variables in macro functions (#4019)
Prevents discard-qualifiers warnings when the passed variable was const
This commit is contained in:
committed by
Evgeny Vereshchagin
parent
83f12b27d1
commit
8dec4a9d2d
@@ -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)); \
|
||||
})
|
||||
|
||||
|
||||
@@ -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__); \
|
||||
})
|
||||
|
||||
@@ -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__); \
|
||||
}) \
|
||||
|
||||
@@ -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__); \
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user