[Bug 27740] WockyNodeTree and friends

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Mon Apr 19 18:59:19 CEST 2010


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

Will Thompson <will.thompson at collabora.co.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Status Whiteboard|                            |review-

--- Comment #1 from Will Thompson <will.thompson at collabora.co.uk> 2010-04-19 09:59:19 PDT ---
+
+/* Slightly evil macro that tests that two stanzas are equal without regarding
+ * their id, except that if one has an id and the other does not this is not
+ * considered a difference. It modifies the stanzas because I am lazy.
  */
-#define test_assert_stanzas_equal(s1, s2) \
+#define test_assert_stanzas_equal_no_id(s1, s2) \

The change here is adding "without regarding their id", and that's not true.
The bit after the comma explains exactly how IDs are treated. So I don't think
this improves the comment.

+wocky_xmpp_node_new (const char *name, const gchar *ns)
 {
   WockyXmppNode *result = g_slice_new0 (WockyXmppNode);

   result->name = g_strdup (name);
+  result->ns = (ns != NULL) ? g_quark_from_string (ns) : 0;

g_quark_from_string() is NULL-safe.


@@ -0,0 +1,85 @@
+/*
+ * wocky-node-tree.c - Source for WockyNodeTree
+ * Copyright (C) 2006 Collabora Ltd.

+ * wocky-node-tree.h - Header for WockyNodeTree
+ * Copyright (C) 2006,2010 Collabora Ltd.

I find that very hard to believe.

6af7e30332 adds:

+WockyNodeTree *wocky_node_tree_build (WockyNodeBuildTag first_tag,
+    ...) G_GNUC_NULL_TERMINATED;
+
+WockyNodeTree * wocky_node_tree_build_va (va_list ap);
+

but they're not implemented anywhere afaict.


+void
+wocky_xmpp_node_add_build (WockyXmppNode *node,
+    WockyNodeBuildTag first_tag,
+    ...)
+{
+  va_list ap;
+
+  va_start (ap, first_tag);
+  wocky_xmpp_node_add_build_va (node, ap);
+  va_end (ap);
+}


Doesn't this mean you're not passing first_tag to _build_va?


+/**
+ * wocky_node_add_build:
+ * @node: The node under which to add a new subtree
+ * @first_tag: The build tag for the first node
+ * @Varargs: the description of the stanza to build,
+ *  terminated with %NULL
+ *
+ * Add a node subtree to an existing parent node

There should be a full stop at the end of this sentence.

+ * Example:
+ * <example><programlisting>
+ * wocky_node_add_build (node,
+ *    '(', "body",
+ *        '$', "Telepathy rocks!",
+ *    ')',
+ *   NULL);
+ * </programlisting></example>
+ *
+ * <!-- -->* adds the following under the given node
+ * <body>
+ *    Telepathy rocks!
+ * </body>
+ * *<!-- -->/
+ * </programlisting></example>
+ *
+ */

You close the <programlisting> and <example> twice. You can use |[ ... ]| as an
abbreviation. I think the listing should end at the end of the C code, and the
XML could be in its own block. <programlisting language="xml"> ?

-- 
Configure bugmail: https://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