make _dbus_type_to_string public?

Thiago Macieira thiago at kde.org
Tue Jan 7 09:15:59 PST 2014


On sexta-feira, 3 de janeiro de 2014 11:58:10, Simon McVittie wrote:
> [1] the main gap in my own knowledge is that I can never remember which
>     of the 64-bit integers is signed and which is unsigned (for the
>     record, "x" is signed and "t" is unsigned)

We should have used x and y instead of x and t, to match the C++ mangling:

$ c++filt -t x y
long long
unsigned long long

At the very least it would be easy to decode the types using the c++filt 
command-line tool and the abi::__cxa_demangle function already built in the 
standard C++ library.

It's a little saner because the signed ones use the expected letters and the 
unsigned ones are just the next letter (except for the chars):

					C++					D-Bus
				signed	unsigned	signed	unsigned
char / 8-bit		a		h		 			y
short / 16-bit		s		t			n		q
int / 32-bit		i		j			i		u
long				l		m
long long / 64-bit	x		y			x		t
__int128			n		o

				C++		D-Bus
bool			b		b
float			f		f (non-standard)
double			d		d
long double		e
__float128		g

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel Open Source Technology Center
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/dbus/attachments/20140107/1bea3592/attachment-0001.pgp>


More information about the dbus mailing list