cpw.darkrain42.xmpp.bosh: e8226685: Whitespace and formatting changes
paul at darkrain42.org
paul at darkrain42.org
Sat Jan 17 23:56:59 EST 2009
-----------------------------------------------------------------
Revision: e8226685c61c21229a3a38369e5ea046afb3a4dc
Ancestor: 46d81b2ed3483f8adbf71962d0bddeb12361dbf2
Author: paul at darkrain42.org
Date: 2008-11-22T00:42:56
Branch: im.pidgin.cpw.darkrain42.xmpp.bosh
URL: http://d.pidgin.im/viewmtn/revision/info/e8226685c61c21229a3a38369e5ea046afb3a4dc
Modified files:
libpurple/protocols/jabber/caps.c
ChangeLog:
Whitespace and formatting changes
-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/caps.c 0b6b53a4b2ce67f3c1a07a9e7039939c8ef56e82
+++ libpurple/protocols/jabber/caps.c 404f06c2bbf140a2d61a7e904a34cd825bc7d8f4
@@ -702,34 +702,36 @@ JabberCapsClientInfo *jabber_caps_parse_
return info;
}
-static gint jabber_caps_xdata_field_compare(gconstpointer a, gconstpointer b) {
- const JabberDataFormField *ac;
- const JabberDataFormField *bc;
-
- ac = a;
- bc = b;
-
+static gint jabber_caps_xdata_field_compare(gconstpointer a, gconstpointer b)
+{
+ const JabberDataFormField *ac = a;
+ const JabberDataFormField *bc = b;
+
return strcmp(ac->var, bc->var);
}
-static GList *jabber_caps_xdata_get_fields(const xmlnode *x) {
- GList *fields = 0;
+static GList* jabber_caps_xdata_get_fields(const xmlnode *x)
+{
+ GList *fields = NULL;
xmlnode *field;
- xmlnode *value;
- JabberDataFormField *xdatafield;
-
- if(!x) return 0;
-
- for(field = xmlnode_get_child(x, "field"); field != 0; field = xmlnode_get_next_twin(field)) {
- xdatafield = g_new0(JabberDataFormField, 1);
+
+ if (!x)
+ return NULL;
+
+ for (field = xmlnode_get_child(x, "field"); field; field = xmlnode_get_next_twin(field)) {
+ xmlnode *value;
+ JabberDataFormField *xdatafield = g_new0(JabberDataFormField, 1);
xdatafield->var = g_strdup(xmlnode_get_attrib(field, "var"));
- for(value = xmlnode_get_child(field, "value"); value != 0; value = xmlnode_get_next_twin(value)) {
+
+ for (value = xmlnode_get_child(field, "value"); value; value = xmlnode_get_next_twin(value)) {
gchar *val = xmlnode_get_data(value);
xdatafield->values = g_list_append(xdatafield->values, val);
}
+
xdatafield->values = g_list_sort(xdatafield->values, (GCompareFunc)strcmp);
fields = g_list_append(fields, xdatafield);
- }
+ }
+
fields = g_list_sort(fields, jabber_caps_xdata_field_compare);
return fields;
}
@@ -786,7 +788,7 @@ gchar *jabber_caps_calculate_hash(Jabber
GList *value;
JabberDataFormField *field = (JabberDataFormField*)fields->data;
- if(strcmp(field->var, "FORM_TYPE")) {
+ if (strcmp(field->var, "FORM_TYPE")) {
/* Append the "var" attribute */
verification = jabber_caps_verification_append(verification, field->var);
/* Append <value/> element's cdata */
More information about the Commits
mailing list