[Bug 77189] [next] make TpBaseConnection GVariant-based

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Wed Apr 16 08:47:07 PDT 2014


https://bugs.freedesktop.org/show_bug.cgi?id=77189

--- Comment #17 from Simon McVittie <simon.mcvittie at collabora.co.uk> ---
(In reply to comment #16)
> dbus_g_value_build_g_variant() does:
>   else if (type == G_TYPE_UINT)
>     return g_variant_new_uint32 (g_value_get_uint (value));
> 
> So we already lost in platforms where guint != guint32. No?

No, that's fine, as long as the *value* fits in 32 bits. (If it doesn't, it'll
be reduced modulo 2**32.)

> I would add that
> static assert that guint is 32bits and say "sorry, no telepathy for you" to
> any other platforms. I would be surprised glib itself works on them tbh.

Platforms where int < 32 bits are clearly obsolete; as a matter of policy, "the
GNU system" (i.e. mostly GNU libc, in practice) doesn't work on them either. I
think ignoring those is fine.

There are good practical reasons why platforms where int > 32 bits haven't
happened (if int is > 32 bits and char is 8 bits then there is either no C
primitive type of length 16, or none of length 32, because short can't be both)
so I'm happy with having a static assertion rather than actually fixing it, but
I don't really want our API to rely on "int will be exactly 32 bits long,
forever".

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the telepathy-bugs mailing list