From 8e67206550b27bb8c4f2d5f9a2a801cdf6f9bc7c Mon Sep 17 00:00:00 2001 From: Ralf Habacker Date: Sun, 22 Nov 2015 17:00:51 +0100 Subject: [PATCH 7/7] Fix warning: "pointer targets in assignment differ in signedness [-Wpointer-sign]". Bug: https://bugs.freedesktop.org/show_bug.cgi?id=93069 --- dbus/dbus-marshal-basic.c | 2 +- dbus/dbus-marshal-header.c | 4 ++-- dbus/dbus-marshal-recursive.c | 6 +++--- dbus/dbus-marshal-validate.c | 14 +++++++------- dbus/dbus-sysdeps-win.c | 2 +- tools/dbus-spam.c | 2 +- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/dbus/dbus-marshal-basic.c b/dbus/dbus-marshal-basic.c index ccf33c0..3122bad 100644 --- a/dbus/dbus-marshal-basic.c +++ b/dbus/dbus-marshal-basic.c @@ -1560,7 +1560,7 @@ swap_test_array (void *array, if (!_dbus_marshal_write_basic (&str, pos, DBUS_TYPE_UINT32, &v_UINT32, \ byte_order, &next)) \ _dbus_assert_not_reached ("no memory"); \ - v_ARRAY_##typename = literal; \ + v_ARRAY_##typename = (typename *) literal; \ if (!_dbus_marshal_write_fixed_multi (&str, next, DBUS_TYPE_##typename, \ &v_ARRAY_##typename, _DBUS_N_ELEMENTS(literal), \ byte_order, NULL)) \ diff --git a/dbus/dbus-marshal-header.c b/dbus/dbus-marshal-header.c index 48151c6..73a6152 100644 --- a/dbus/dbus-marshal-header.c +++ b/dbus/dbus-marshal-header.c @@ -1458,7 +1458,7 @@ _dbus_header_toggle_flag (DBusHeader *header, dbus_uint32_t flag, dbus_bool_t value) { - unsigned char *flags_p; + char *flags_p; flags_p = _dbus_string_get_data_len (&header->data, FLAGS_OFFSET, 1); @@ -1479,7 +1479,7 @@ dbus_bool_t _dbus_header_get_flag (DBusHeader *header, dbus_uint32_t flag) { - const unsigned char *flags_p; + const char *flags_p; flags_p = _dbus_string_get_const_data_len (&header->data, FLAGS_OFFSET, 1); diff --git a/dbus/dbus-marshal-recursive.c b/dbus/dbus-marshal-recursive.c index af0bee4..381cbc6 100644 --- a/dbus/dbus-marshal-recursive.c +++ b/dbus/dbus-marshal-recursive.c @@ -341,8 +341,8 @@ void _dbus_type_signature_next (const char *type_str, int *type_pos) { - const unsigned char *p; - const unsigned char *start; + const char *p; + const char *start; _dbus_assert (type_str != NULL); _dbus_assert (type_pos != NULL); @@ -855,7 +855,7 @@ _dbus_type_reader_read_raw (const DBusTypeReader *reader, { _dbus_assert (!reader->klass->types_only); - *value_location = _dbus_string_get_const_data_len (reader->value_str, + *value_location = (unsigned char *) _dbus_string_get_const_data_len (reader->value_str, reader->value_pos, 0); } diff --git a/dbus/dbus-marshal-validate.c b/dbus/dbus-marshal-validate.c index 7554a3a..93e6c25 100644 --- a/dbus/dbus-marshal-validate.c +++ b/dbus/dbus-marshal-validate.c @@ -52,8 +52,8 @@ _dbus_validate_signature_with_reason (const DBusString *type_str, int type_pos, int len) { - const unsigned char *p; - const unsigned char *end; + const char *p; + const char *end; int last; int struct_depth; int array_depth; @@ -725,7 +725,7 @@ _dbus_validate_body_with_reason (const DBusString *expected_signature, _dbus_type_reader_init_types_only (&reader, expected_signature, expected_signature_start); - p = _dbus_string_get_const_data_len (value_str, value_pos, len); + p = (unsigned char *) _dbus_string_get_const_data_len (value_str, value_pos, len); end = p + len; validity = validate_body_helper (&reader, byte_order, TRUE, 0, p, end, &p); @@ -800,7 +800,7 @@ _dbus_validate_path (const DBusString *str, if (len == 0) return FALSE; - s = _dbus_string_get_const_data (str) + start; + s = (unsigned char *) _dbus_string_get_const_data (str) + start; end = s + len; if (*s != '/') @@ -941,7 +941,7 @@ _dbus_validate_interface (const DBusString *str, return FALSE; last_dot = NULL; - iface = _dbus_string_get_const_data (str) + start; + iface = (unsigned char *) _dbus_string_get_const_data (str) + start; end = iface + len; s = iface; @@ -1015,7 +1015,7 @@ _dbus_validate_member (const DBusString *str, if (len == 0) return FALSE; - member = _dbus_string_get_const_data (str) + start; + member = (unsigned char *) _dbus_string_get_const_data (str) + start; end = member + len; s = member; @@ -1107,7 +1107,7 @@ _dbus_validate_bus_name_full (const DBusString *str, return FALSE; last_dot = NULL; - iface = _dbus_string_get_const_data (str) + start; + iface = (unsigned char *) _dbus_string_get_const_data (str) + start; end = iface + len; s = iface; diff --git a/dbus/dbus-sysdeps-win.c b/dbus/dbus-sysdeps-win.c index 703a86f..4e7e76d 100644 --- a/dbus/dbus-sysdeps-win.c +++ b/dbus/dbus-sysdeps-win.c @@ -600,8 +600,8 @@ _dbus_write_socket_two (DBusSocket fd, _dbus_assert (len2 >= 0); - data1 = _dbus_string_get_const_data_len (buffer1, start1, len1); + data1 = _dbus_string_get_const_data_len (buffer1, start1, len1); if (buffer2 != NULL) data2 = _dbus_string_get_const_data_len (buffer2, start2, len2); else diff --git a/tools/dbus-spam.c b/tools/dbus-spam.c index c78d8ea..066de0b 100644 --- a/tools/dbus-spam.c +++ b/tools/dbus-spam.c @@ -245,7 +245,7 @@ dbus_test_tool_spam (int argc, char **argv) n_random_sizes++; } - random_sizes = dbus_new0 (int, n_random_sizes); + random_sizes = (unsigned int *) dbus_new0 (int, n_random_sizes); if (random_sizes == NULL) tool_oom ("allocating array of message lengths"); -- 1.8.4.5