dbus: Fix reading and writing some values and make it more robust
Values are passed to variadic functions as pointers to the value, so
the size of the type is very important. There was one mistake passing
a float
when the callee expects a double
. The rest was mostly OK,
as dbus_bool_t
maps to a 32 bits unsigned integer and we used X's
Bool
reduces to a plain int
which is almost guaranteed to be 32
bits on the platforms where Compiz runs, and signedness doesn't matter
for boolean values. The same applies for dbus_int32_t
for which we
also passed a plain int
.
However, consistently using DBus' own types reduces the risk of
problems, as well as being formally more correct. I did not change all
uses of char*
but the ones using a temporary variable where a
DBusBasicValue
container was already available though, because they
map to the exact same type in DBus.