]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
Fix several -Wpointer-sign warnings in test_hex_roundtrip() and related types.
authorRalf Habacker <ralf.habacker@freenet.de>
Sun, 22 Nov 2015 15:57:16 +0000 (16:57 +0100)
committerRalf Habacker <ralf.habacker@freenet.de>
Mon, 23 Nov 2015 12:27:26 +0000 (13:27 +0100)
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=93069
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
dbus/dbus-string-util.c

index 3babc0534dede73d8fb25bf8fedd54f87dad349d..5b09a695243afb6428ee355a7fe3950c0f1527e7 100644 (file)
@@ -120,8 +120,8 @@ _dbus_string_find_byte_backward (const DBusString  *str,
 #include <stdio.h>
 
 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;
       }
   }