]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: constify several functions
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 3 Jul 2023 07:00:20 +0000 (16:00 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 3 Jul 2023 07:06:17 +0000 (16:06 +0900)
src/network/networkd-util.h

index f75fb1f8685c37bf592a71f6a8a826718e3e4b81..9c360f55264f2db1ce6d56b6e392a959cbe1a4d0 100644 (file)
@@ -70,7 +70,7 @@ int network_config_state_to_string_alloc(NetworkConfigState s, char **ret);
                                                                         \
                 t->state = (t->state & ~mask) | (value & mask);         \
         }                                                               \
-        static inline bool name##_exists(type *t) {                     \
+        static inline bool name##_exists(const type *t) {               \
                 assert(t);                                              \
                                                                         \
                 if ((t->state & (NETWORK_CONFIG_STATE_CONFIGURING |     \
@@ -90,7 +90,7 @@ int network_config_state_to_string_alloc(NetworkConfigState s, char **ret);
                                     NETWORK_CONFIG_STATE_REQUESTING,    \
                                     0);                                 \
         }                                                               \
-        static inline bool name##_is_requesting(type *t) {              \
+        static inline bool name##_is_requesting(const type *t) {        \
                 assert(t);                                              \
                 return FLAGS_SET(t->state, NETWORK_CONFIG_STATE_REQUESTING); \
         }                                                               \
@@ -115,7 +115,7 @@ int network_config_state_to_string_alloc(NetworkConfigState s, char **ret);
         static inline void name##_unmark(type *t) {                     \
                 name##_update_state(t, NETWORK_CONFIG_STATE_MARKED, 0); \
         }                                                               \
-        static inline bool name##_is_marked(type *t) {                  \
+        static inline bool name##_is_marked(const type *t) {            \
                 assert(t);                                              \
                 return FLAGS_SET(t->state, NETWORK_CONFIG_STATE_MARKED); \
         }                                                               \