summaryrefslogtreecommitdiff
path: root/dbus/dbus-string.h
diff options
context:
space:
mode:
authorRalf Habacker <ralf.habacker@freenet.de>2015-11-24 12:07:38 +0100
committerRalf Habacker <ralf.habacker@freenet.de>2015-11-24 12:26:00 +0100
commitd2b8b8611e0e707b113b25874d027966a34fee35 (patch)
treeb154a30dcf78e2771bc78cafcb29231058fe5c49 /dbus/dbus-string.h
parent0ccafbd1730c2e994600b21ec57dd821f32e85a0 (diff)
downloaddbus-d2b8b8611e0e707b113b25874d027966a34fee35.tar.gz
Fix warning: "pointer targets in assignment differ in signedness [-Wpointer-sign]".
The warnings are fixed by adding functions to dbus string name space returning unsigned char pointer, which avoids the need to use casts. Bug: https://bugs.freedesktop.org/attachment.cgi?id=93069 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Diffstat (limited to 'dbus/dbus-string.h')
-rw-r--r--dbus/dbus-string.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/dbus/dbus-string.h b/dbus/dbus-string.h
index adf709bd..44ce5d27 100644
--- a/dbus/dbus-string.h
+++ b/dbus/dbus-string.h
@@ -362,6 +362,24 @@ dbus_bool_t _dbus_string_validate_nul (const DBusString *str,
void _dbus_string_zero (DBusString *str);
+static inline unsigned char *
+_dbus_string_get_udata_len (DBusString *str, int start, int len)
+{
+ return (unsigned char *) _dbus_string_get_data_len (str, start, len);
+}
+
+static inline const unsigned char *
+_dbus_string_get_const_udata (const DBusString *str)
+{
+ return (const unsigned char *) _dbus_string_get_const_data (str);
+}
+
+static inline const unsigned char *
+_dbus_string_get_const_udata_len (const DBusString *str, int start, int len)
+{
+ return (const unsigned char *) _dbus_string_get_const_data_len (str, start, len);
+}
+
/**
* We allocate 1 byte for nul termination, plus 7 bytes for possible
* align_offset, so we always need 8 bytes on top of the string's