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

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Wed Apr 16 08:41:53 PDT 2014


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

--- Comment #16 from Xavier Claessens <xclaesse at gmail.com> ---
(In reply to comment #15)
> (In reply to comment #14)
> > Instead of having that static assert everywhere, I would just put it just
> > next to the TpHandle typedef. We are never going to make TpHandle anything
> > else than 32 bits.
> 
> TpHandle is already not guaranteed to be 32-bit. It's a guint, not a
> guint32, because that was dbus-glib's API.
> 
> If you want to *change* TpHandle to a guint32 in Tp1, we could do that...
> then if the static assertion fails on some platform (which is unlikely,
> tbh), we have to be very careful at the telepathy-glib <-> dbus-glib
> boundary, which is non-type-safe.
> 
> That's probably the best approach despite the lack of type-safety - we're
> trying to eradicate GArray<guint> from our API in any case, and the static
> assertion will at least give us some early-warning.

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? 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.

-- 
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