From f3bcc8508e36c13144c5122bf433a43c31c969eb Mon Sep 17 00:00:00 2001 From: Gaurav Gupta Date: Tue, 19 Jul 2022 11:40:34 +0530 Subject: [PATCH] dbus: fix 64-bit compiler warnings Fix 64-bit compiler warnings. Change-Id: I799a07c197a95d80a4fb33998ca113533ac4a54e Signed-off-by: Gaurav Gupta --- dbus/dbus-signals.c | 4 ++-- dbus/dbus-transport-kdbus.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dbus/dbus-signals.c b/dbus/dbus-signals.c index 68fbeb5..420aea5 100644 --- a/dbus/dbus-signals.c +++ b/dbus/dbus-signals.c @@ -847,7 +847,7 @@ bus_match_rule_parse_arg_match (MatchRule *rule, else { dbus_set_error (error, DBUS_ERROR_MATCH_RULE_INVALID, - "Key '%s' in match rule contains junk after argument number (%u). Only 'arg%upath' (for example) or 'arg0namespace' are valid", key, arg, arg); + "Key '%s' in match rule contains junk after argument number (%lu). Only 'arg%lupath' (for example) or 'arg0namespace' are valid", key, arg, arg); goto failed; } } @@ -865,7 +865,7 @@ bus_match_rule_parse_arg_match (MatchRule *rule, rule->args[arg] != NULL) { dbus_set_error (error, DBUS_ERROR_MATCH_RULE_INVALID, - "Argument %d matched more than once in match rule\n", key); + "Argument %s matched more than once in match rule\n", key); goto failed; } diff --git a/dbus/dbus-transport-kdbus.c b/dbus/dbus-transport-kdbus.c index 5bb82e5..9e7bdba 100755 --- a/dbus/dbus-transport-kdbus.c +++ b/dbus/dbus-transport-kdbus.c @@ -775,7 +775,7 @@ kdbus_write_msg_internal (DBusTransportKdbus *transport, ret_size = header_size + body_size; /* check whether we can and should use memfd */ - if ((dst_id != KDBUS_DST_ID_BROADCAST) && (ret_size > MEMFD_SIZE_THRESHOLD)) + if ((dst_id != KDBUS_DST_ID_BROADCAST) && ((uint64_t)ret_size > MEMFD_SIZE_THRESHOLD)) memfd = kdbus_acquire_memfd (); _dbus_message_get_unix_fds (message, &unix_fds, &fds_count); @@ -1051,7 +1051,7 @@ kdbus_write_msg_internal (DBusTransportKdbus *transport, { DBusString str; int size, ret, *fds; - unsigned n_fds; + int n_fds; char *data; /* check message size */ @@ -1096,7 +1096,7 @@ kdbus_write_msg_internal (DBusTransportKdbus *transport, _dbus_string_init_const_len (&str, data, ret); /* create DBusMessage from kmsg */ - *sync_reply = _dbus_decode_kmsg (&str, msg_reply->src_id, fds, n_fds); + *sync_reply = _dbus_decode_kmsg (&str, msg_reply->src_id, fds, (unsigned int)n_fds); if (*sync_reply == NULL) ret_size = -1; @@ -3820,7 +3820,7 @@ do_reading (DBusTransport *transport) if (!dbus_watch_get_enabled (kdbus_transport->read_watch)) return TRUE; - if (!_dbus_message_loader_get_unix_fds (transport->loader, &fds, &n_fds)) + if (!_dbus_message_loader_get_unix_fds (transport->loader, &fds, (unsigned int *)&n_fds)) { _dbus_verbose ("Out of memory reading file descriptors\n"); oom = TRUE; -- 2.7.4