[guus@debian.org: Bug#290306: dbus-1-dev: silly typedefs]

Havoc Pennington hp@redhat.com
Thu Jan 13 11:31:37 PST 2005


On Thu, 2005-01-13 at 19:44 +0100, Sjoerd Simons wrote:
> 
> The file dbus-types.h contains very silly typedefs that will probably
> break on any architecture where an int does not have the same size or
> signedness as on i386:
> 
> typedef unsigned int   dbus_bool_t;
> typedef unsigned short dbus_uint16_t;
> typedef short          dbus_int16_t;
> typedef unsigned int   dbus_uint32_t;
> typedef int            dbus_int32_t;
> typedef dbus_uint32_t  dbus_unichar_t;

When porting to an arch where these are wrong we'd just move them to
dbus-arch-deps.h and determine them at configure time, as dbus_int64_t
already is.

> It also introduces its own types, while there are perfectly well defined
> and standardised types that do exactly what dbus needs in stdint.h
> (int16_t, uint16_t, etc.) and stdbool.h (bool). At best DBus's
> proprietary typedefs will confuse a programmer, and in the worst case it
> will break on other architectures.

These aren't portable enough yet. Programmers can assume that uint16_t
is the same as dbus_uint16_t though.

Havoc





More information about the dbus mailing list