[Bug 25493] GTalk-compatible file transfers are not implemented

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Thu Mar 25 16:25:41 CET 2010


http://bugs.freedesktop.org/show_bug.cgi?id=25493





--- Comment #20 from Simon McVittie <simon.mcvittie at collabora.co.uk>  2010-03-25 08:25:40 PST ---
Strict aliasing
===============

<http://git.collabora.co.uk/?p=user/kakaroto/telepathy-gabble.git;a=commitdiff;h=05d39c74f81e3a7>
+  union {
+    gpointer ptr;
+    GTalkFileCollection *self;
+  };

While very nice to use, this feature (anonymous unions) is unfortunately a gcc
extension. Please be portable by giving the union a name (union {...} self;)
and using data->self.ptr, data->self.self (perhaps rename the
GTalkFileCollection member to fc, so it's data->self.fc).

To be honest I'd be inclined to just make it:

    /* really a GTalkFileCollection, but, strict aliasing */
    gpointer self;

and use data->self where a gpointer would be acceptable (probably most places -
remember that you can pass a gpointer to a function expecting a typed pointer,
or assign a gpointer to a typed pointer variable), or

    GTalkFileCollection *self = data->self;

    blah_blah (self->priv->bees);

in places where that won't work.

Similarly, in the next patch:

> +        while (g_hash_table_iter_next (&iter, NULL, &value))
>            {
> +            c = value;
>              gabble_jingle_content_parse_transport_info (c, node, error);

you can just pass @value to g_j_c_p_t_i, and delete @c altogether?

For the future
==============

+  /* the weakref to the channel here is held through the GList *channels */

A more concise wording (which also works for strong refs) would be "borrowed
from @channels".

+  /* GList of weakreffed GabbleFileTransferChannel */
+  /* GHashTable of GabbleFileTransferChannel => GINT_TO_POINTER (gboolean) */

You don't need to repeat the container type, which is obvious from the
declaration - only the types/ownerships of the contents, which aren't.


-- 
Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.



More information about the telepathy-bugs mailing list