summaryrefslogtreecommitdiffstats
path: root/src/libsystemd
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2022-05-27 01:16:46 +0200
committerYu Watanabe <watanabe.yu+github@gmail.com>2022-05-31 20:41:15 +0200
commit590a7385621d007211c43dbb15b19279fd523150 (patch)
tree299fad5632cb9ea01515619c49851a9600701262 /src/libsystemd
parentsd-bus: drop unnecessary cast (diff)
downloadsystemd-590a7385621d007211c43dbb15b19279fd523150.tar.xz
systemd-590a7385621d007211c43dbb15b19279fd523150.zip
sd-bus: use UINT32_MAX
Diffstat (limited to 'src/libsystemd')
-rw-r--r--src/libsystemd/sd-bus/bus-dump.c2
-rw-r--r--src/libsystemd/sd-bus/bus-message.c4
-rw-r--r--src/libsystemd/sd-bus/sd-bus.c2
3 files changed, 4 insertions, 4 deletions
diff --git a/src/libsystemd/sd-bus/bus-dump.c b/src/libsystemd/sd-bus/bus-dump.c
index 050eec3a7c..d67a170a2d 100644
--- a/src/libsystemd/sd-bus/bus-dump.c
+++ b/src/libsystemd/sd-bus/bus-dump.c
@@ -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));
diff --git a/src/libsystemd/sd-bus/bus-message.c b/src/libsystemd/sd-bus/bus-message.c
index fbc836aa43..a157fab6fe 100644
--- a/src/libsystemd/sd-bus/bus-message.c
+++ b/src/libsystemd/sd-bus/bus-message.c
@@ -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;
diff --git a/src/libsystemd/sd-bus/sd-bus.c b/src/libsystemd/sd-bus/sd-bus.c
index c7a58e95cc..8a3ad7c151 100644
--- a/src/libsystemd/sd-bus/sd-bus.c
+++ b/src/libsystemd/sd-bus/sd-bus.c
@@ -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) {