From e8af5634a52722108c6d3c7ef030210b3cb3e41e Mon Sep 17 00:00:00 2001 From: Ralf Habacker Date: Sun, 22 Nov 2015 19:33:08 +0100 Subject: [PATCH 3/4] Fix warning: "pointer targets in passing argument 2 of '_dbus_string_init_const_len' differ in signedness [-Wpointer-sign]". Bug: https://bugs.freedesktop.org/attachment.cgi?id=120019 --- dbus/dbus-marshal-basic.c | 6 +++--- dbus/dbus-marshal-byteswap.c | 2 +- dbus/dbus-marshal-validate.c | 8 ++++---- dbus/dbus-sha.c | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/dbus/dbus-marshal-basic.c b/dbus/dbus-marshal-basic.c index 855c869..6523166 100644 --- a/dbus/dbus-marshal-basic.c +++ b/dbus/dbus-marshal-basic.c @@ -706,7 +706,7 @@ marshal_len_followed_by_bytes (int marshal_as, else value_len = data_len + 1; /* value has a nul */ - _dbus_string_init_const_len (&value_str, value, value_len); + _dbus_string_init_const_len (&value_str, (char *) value, value_len); pos = insert_at; @@ -865,7 +865,7 @@ marshal_1_octets_array (DBusString *str, int pos; DBusString value_str; - _dbus_string_init_const_len (&value_str, value, n_elements); + _dbus_string_init_const_len (&value_str, (char *) value, n_elements); pos = insert_at; @@ -982,7 +982,7 @@ marshal_fixed_multi (DBusString *str, goto error; _dbus_string_init_const_len (&t, - (const unsigned char*) value, + (const char*) value, len_in_bytes); if (!_dbus_string_copy (&t, 0, diff --git a/dbus/dbus-marshal-byteswap.c b/dbus/dbus-marshal-byteswap.c index 985108a..feb52e7 100644 --- a/dbus/dbus-marshal-byteswap.c +++ b/dbus/dbus-marshal-byteswap.c @@ -161,7 +161,7 @@ byteswap_body_helper (DBusTypeReader *reader, sig_len = *p; ++p; - _dbus_string_init_const_len (&sig, p, sig_len); + _dbus_string_init_const_len (&sig, (char *) p, sig_len); p += (sig_len + 1); /* 1 for nul */ diff --git a/dbus/dbus-marshal-validate.c b/dbus/dbus-marshal-validate.c index 3a2b416..93e6c25 100644 --- a/dbus/dbus-marshal-validate.c +++ b/dbus/dbus-marshal-validate.c @@ -420,7 +420,7 @@ validate_body_helper (DBusTypeReader *reader, if (current_type == DBUS_TYPE_OBJECT_PATH) { DBusString str; - _dbus_string_init_const_len (&str, p, claimed_len); + _dbus_string_init_const_len (&str, (char *) p, claimed_len); if (!_dbus_validate_path (&str, 0, _dbus_string_get_length (&str))) return DBUS_INVALID_BAD_PATH; @@ -430,7 +430,7 @@ validate_body_helper (DBusTypeReader *reader, else if (current_type == DBUS_TYPE_STRING) { DBusString str; - _dbus_string_init_const_len (&str, p, claimed_len); + _dbus_string_init_const_len (&str, (char *) p, claimed_len); if (!_dbus_string_validate_utf8 (&str, 0, _dbus_string_get_length (&str))) return DBUS_INVALID_BAD_UTF8_IN_STRING; @@ -529,7 +529,7 @@ validate_body_helper (DBusTypeReader *reader, if (claimed_len + 1 > (unsigned long) (end - p)) return DBUS_INVALID_SIGNATURE_LENGTH_OUT_OF_BOUNDS; - _dbus_string_init_const_len (&str, p, claimed_len); + _dbus_string_init_const_len (&str, (char *) p, claimed_len); validity = _dbus_validate_signature_with_reason (&str, 0, _dbus_string_get_length (&str)); @@ -573,7 +573,7 @@ validate_body_helper (DBusTypeReader *reader, if (claimed_len + 1 > (unsigned long) (end - p)) return DBUS_INVALID_VARIANT_SIGNATURE_LENGTH_OUT_OF_BOUNDS; - _dbus_string_init_const_len (&sig, p, claimed_len); + _dbus_string_init_const_len (&sig, (char *) p, claimed_len); reason = _dbus_validate_signature_with_reason (&sig, 0, _dbus_string_get_length (&sig)); if (!(reason == DBUS_VALID)) diff --git a/dbus/dbus-sha.c b/dbus/dbus-sha.c index febfba2..5bd756b 100644 --- a/dbus/dbus-sha.c +++ b/dbus/dbus-sha.c @@ -524,7 +524,7 @@ check_sha_binary (const unsigned char *input, DBusString expected_str; DBusString results; - _dbus_string_init_const_len (&input_str, input, input_len); + _dbus_string_init_const_len (&input_str, (char *) input, input_len); _dbus_string_init_const (&expected_str, expected); if (!_dbus_string_init (&results)) -- 1.8.4.5