dbus: make data pointer for properties read-only

This commit is contained in:
Lennart Poettering 2010-04-10 17:39:36 +02:00
parent 6f4706b79e
commit b9f49ee478
2 changed files with 3 additions and 3 deletions

4
dbus.c
View File

@ -697,7 +697,7 @@ DBusHandlerResult bus_default_message_handler(Manager *m, DBusMessage *message,
if (!dbus_message_iter_open_container(&iter, DBUS_TYPE_VARIANT, p->signature, &sub))
goto oom;
if ((r = p->append(m, &sub, property, p->data)) < 0) {
if ((r = p->append(m, &sub, property, (void*) p->data)) < 0) {
if (r == -ENOMEM)
goto oom;
@ -739,7 +739,7 @@ DBusHandlerResult bus_default_message_handler(Manager *m, DBusMessage *message,
!dbus_message_iter_open_container(&sub2, DBUS_TYPE_VARIANT, p->signature, &sub3))
goto oom;
if ((r = p->append(m, &sub3, p->property, p->data)) < 0) {
if ((r = p->append(m, &sub3, p->property, (void*) p->data)) < 0) {
if (r == -ENOMEM)
goto oom;

2
dbus.h
View File

@ -33,7 +33,7 @@ typedef struct BusProperty {
const char *property; /* name of the property */
BusPropertyCallback append; /* Function that is called to serialize this property */
const char *signature;
void *data; /* The data of this property */
const void *data; /* The data of this property */
} BusProperty;
#define BUS_PROPERTIES_INTERFACE \