]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-bus: use UINT32_MAX
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 26 May 2022 23:16:46 +0000 (08:16 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 31 May 2022 18:41:15 +0000 (03:41 +0900)
src/libsystemd/sd-bus/bus-dump.c
src/libsystemd/sd-bus/bus-message.c
src/libsystemd/sd-bus/sd-bus.c

index 050eec3a7cd07322b30ac6971c2ac811cc8e609b..d67a170a2d9bb7bcd4581fd728ff660805f69414 100644 (file)
@@ -79,7 +79,7 @@ _public_ int sd_bus_message_dump(sd_bus_message *m, FILE *f, uint64_t flags) {
 
                 /* Display synthetic message serial number in a more readable
                  * format than UINT32_MAX */
-                if (BUS_MESSAGE_COOKIE(m) == 0xFFFFFFFFULL)
+                if (BUS_MESSAGE_COOKIE(m) == UINT32_MAX)
                         fprintf(f, " Cookie=-1");
                 else
                         fprintf(f, " Cookie=%" PRIu64, BUS_MESSAGE_COOKIE(m));
index fbc836aa43e2b40a9749477ea460c191d5e62f44..a157fab6fef5799201a2d0400b90e977d0a3723a 100644 (file)
@@ -406,7 +406,7 @@ static int message_append_reply_cookie(sd_bus_message *m, uint64_t cookie) {
                 return message_append_field_uint64(m, BUS_MESSAGE_HEADER_REPLY_SERIAL, cookie);
         else {
                 /* 64bit cookies are not supported on dbus1 */
-                if (cookie > 0xffffffffUL)
+                if (cookie > UINT32_MAX)
                         return -EOPNOTSUPP;
 
                 return message_append_field_uint32(m, BUS_MESSAGE_HEADER_REPLY_SERIAL, (uint32_t) cookie);
@@ -2913,7 +2913,7 @@ _public_ int sd_bus_message_seal(sd_bus_message *m, uint64_t cookie, uint64_t ti
         if (m->poisoned)
                 return -ESTALE;
 
-        if (cookie > 0xffffffffULL &&
+        if (cookie > UINT32_MAX &&
             !BUS_MESSAGE_IS_GVARIANT(m))
                 return -EOPNOTSUPP;
 
index c7a58e95cc45113ee636e423e488519640dbd89c..8a3ad7c151c5d2dfcdc2fa5ddc2abaeac9102dec 100644 (file)
@@ -1969,7 +1969,7 @@ int bus_seal_synthetic_message(sd_bus *b, sd_bus_message *m) {
          * pick a fixed, artificial one. We use UINT32_MAX rather
          * than UINT64_MAX since dbus1 only had 32bit identifiers,
          * even though kdbus can do 64bit. */
-        return sd_bus_message_seal(m, 0xFFFFFFFFULL, 0);
+        return sd_bus_message_seal(m, UINT32_MAX, 0);
 }
 
 static int bus_write_message(sd_bus *bus, sd_bus_message *m, size_t *idx) {