From 8dd04cb4b23f73d8c17e4c97d78eea04d1a2f528 Mon Sep 17 00:00:00 2001 From: Ralf Habacker Date: Sun, 22 Nov 2015 16:57:16 +0100 Subject: [PATCH] Fix several -Wpointer-sign warnings in test_hex_roundtrip() and related types. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=93069 Reviewed-by: Simon McVittie --- dbus/dbus-string-util.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/dbus/dbus-string-util.c b/dbus/dbus-string-util.c index 3babc0534..5b09a6952 100644 --- a/dbus/dbus-string-util.c +++ b/dbus/dbus-string-util.c @@ -120,8 +120,8 @@ _dbus_string_find_byte_backward (const DBusString *str, #include static void -test_hex_roundtrip (const unsigned char *data, - int len) +test_hex_roundtrip (const char *data, + int len) { DBusString orig; DBusString encoded; @@ -170,8 +170,8 @@ test_hex_roundtrip (const unsigned char *data, _dbus_string_free (&decoded); } -typedef void (* TestRoundtripFunc) (const unsigned char *data, - int len); +typedef void (* TestRoundtripFunc) (const char *data, + int len); static void test_roundtrips (TestRoundtripFunc func) { @@ -200,13 +200,13 @@ test_roundtrips (TestRoundtripFunc func) i = 0; while (i < _DBUS_N_ELEMENTS (buf)) { - buf[i] = i; + buf[i] = (i & 0xff); ++i; } i = 0; while (i < _DBUS_N_ELEMENTS (buf)) { - (* func) (buf, i); + (* func) ((const char *) buf, i); ++i; } } -- 2.47.3