cpw.darkrain42.xmpp.bosh: 6a0655f6: Fix compilation errors and many warnings

paul at darkrain42.org paul at darkrain42.org
Sat Jan 17 23:56:09 EST 2009


-----------------------------------------------------------------
Revision: 6a0655f6e6ee12ccc2502829134b86662f3bf9c6
Ancestor: 3a809929c2e6e336e8a8bbaf89f00b9418548bcb
Author: paul at darkrain42.org
Date: 2008-11-20T23:58:17
Branch: im.pidgin.cpw.darkrain42.xmpp.bosh
URL: http://d.pidgin.im/viewmtn/revision/info/6a0655f6e6ee12ccc2502829134b86662f3bf9c6

Modified files:
        libpurple/protocols/jabber/caps.c
        libpurple/protocols/jabber/caps.h
        libpurple/protocols/jabber/disco.c
        libpurple/protocols/jabber/jabber.c
        libpurple/protocols/jabber/jabber.h
        libpurple/protocols/jabber/libxmpp.c
        libpurple/protocols/jabber/message.c
        libpurple/protocols/jabber/message.h

ChangeLog: 

Fix compilation errors and many warnings

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/caps.c	2f5eea25fd9ee0b9eaa06d65bd718524f748647b
+++ libpurple/protocols/jabber/caps.c	5b626ca36f99f9c61c4a02b8648944f2e726c319
@@ -25,9 +25,9 @@
 #include "caps.h"
 #include "cipher.h"
 #include <string.h>
-#include "internal.h"
+#include "iq.h"
+#include "presence.h"
 #include "util.h"
-#include "iq.h"
 
 #define JABBER_CAPS_FILENAME "xmpp-caps.xml"
 
@@ -90,6 +90,7 @@ static void jabber_caps_destroy_value(gp
 	g_free(valuestruct);
 }
 
+#if 0
 static void jabber_caps_ext_destroy_value(gpointer value) {
 	JabberCapsValueExt *valuestruct = value;
 	while(valuestruct->identities) {
@@ -107,13 +108,13 @@ static void jabber_caps_ext_destroy_valu
 	}
 	g_free(valuestruct);
 }
+#endif
 
 static void jabber_caps_load(void);
 
 void jabber_caps_init(void) {
 	capstable = g_hash_table_new_full(jabber_caps_hash, jabber_caps_compare, jabber_caps_destroy_key, jabber_caps_destroy_value);
 	jabber_caps_load();
-	jabber_caps_calculate_own_hash();
 }
 
 static void jabber_caps_load(void) {
@@ -236,6 +237,7 @@ static void jabber_caps_store(void) {
 	g_free(str);
 }
 
+#if 0
 /* this function assumes that all information is available locally */
 static JabberCapsClientInfo *jabber_caps_collect_info(const char *node, const char *ver, GList *ext) {
 	JabberCapsClientInfo *result;
@@ -298,6 +300,7 @@ static JabberCapsClientInfo *jabber_caps
 #endif
 	return result;
 }
+#endif
 
 void jabber_caps_free_clientinfo(JabberCapsClientInfo *clientinfo) {
 	if(!clientinfo)
@@ -415,6 +418,7 @@ static void jabber_caps_ext_iqcb(JabberS
 	jabber_caps_get_info_check_completion(userdata);
 }
 #endif
+
 static void jabber_caps_client_iqcb(JabberStream *js, xmlnode *packet, gpointer data) {
 	/* collect data and fetch all exts */
 	xmlnode *query = xmlnode_get_child_with_namespace(packet, "query",
@@ -427,10 +431,14 @@ static void jabber_caps_client_iqcb(Jabb
 		// check hash
 		JabberCapsClientInfo *info = jabber_caps_parse_client_info(query);
 		gchar *hash = 0;
+		JabberCapsValue *value;
+		JabberCapsKey *key;
+		xmlnode *child;
+
 		if (!strcmp(userdata->hash, "sha-1")) {
-			hash = jabber_caps_calcualte_hash(info, "sha1");
+			hash = jabber_caps_calculate_hash(info, "sha1");
 		} else if (!strcmp(userdata->hash, "md5")) {
-			hash = jabber_caps_calcualte_hash(info, "md5");
+			hash = jabber_caps_calculate_hash(info, "md5");
 		} else {
 			// clean up
 			return;	
@@ -451,10 +459,9 @@ static void jabber_caps_client_iqcb(Jabb
 		
 		g_free(hash);
 		
-		JabberCapsValue *value = g_new0(JabberCapsValue, 1);
-		JabberCapsKey *key = g_new0(JabberCapsKey, 1);
-		xmlnode *child;
-		GList *iter;
+		value = g_new0(JabberCapsValue, 1);
+		key = g_new0(JabberCapsKey, 1);
+
 #if 0
 		value->ext = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, jabber_caps_ext_destroy_value);
 #endif
@@ -523,6 +530,7 @@ static void jabber_caps_client_iqcb(Jabb
 
 	jabber_caps_get_info_check_completion(userdata);
 #endif
+	}
 }
 
 void jabber_caps_get_info(JabberStream *js, const char *who, const char *node, const char *ver, const char *hash, jabber_caps_get_info_cb cb, gpointer user_data) {
@@ -612,6 +620,7 @@ static gint jabber_caps_jabber_identity_
 	}
 }
 
+#if 0
 static gint jabber_caps_jabber_feature_compare(gconstpointer a, gconstpointer b) {
 	const JabberFeature *ac;
 	const JabberFeature *bc;
@@ -621,6 +630,7 @@ static gint jabber_caps_jabber_feature_c
 	
 	return strcmp(ac->namespace, bc->namespace);
 }
+#endif
 
 static gint jabber_caps_string_compare(gconstpointer a, gconstpointer b) {
 	const gchar *ac;
@@ -632,7 +642,7 @@ static gint jabber_caps_string_compare(g
 	return strcmp(ac, bc);
 }
 
-gchar *jabber_caps_get_formtype(const xmlnode *x) {
+static gchar *jabber_caps_get_formtype(const xmlnode *x) {
 	xmlnode *formtypefield;
 	formtypefield = xmlnode_get_child(x, "field");
 	while (formtypefield && strcmp(xmlnode_get_attrib(formtypefield, "var"), "FORM_TYPE")) formtypefield = xmlnode_get_next_twin(formtypefield);
@@ -658,11 +668,12 @@ JabberCapsClientInfo *jabber_caps_parse_
 
 JabberCapsClientInfo *jabber_caps_parse_client_info(xmlnode *query) {
 	xmlnode *child;
-	
+	JabberCapsClientInfo *info;
+
 	if (!query) return 0;
 	if (strcmp(query->xmlns,"http://jabber.org/protocol/disco#info")) return 0;
 	
-	JabberCapsClientInfo *info = g_new0(JabberCapsClientInfo, 1);
+	info = g_new0(JabberCapsClientInfo, 1);
 	
 	for(child = query->child; child; child = child->next) {
 		if (!strcmp(child->name,"identity")) {
@@ -704,7 +715,7 @@ static gint jabber_caps_xdata_field_comp
 	return strcmp(ac->var, bc->var);
 }
 
-GList *jabber_caps_xdata_get_fields(const xmlnode *x) {
+static GList *jabber_caps_xdata_get_fields(const xmlnode *x) {
 	GList *fields = 0;
 	xmlnode *field;
 	xmlnode *value;
@@ -726,14 +737,14 @@ GList *jabber_caps_xdata_get_fields(cons
 	return fields;
 }
 
-gchar *jabber_caps_verification_append(gchar *verification_string, gchar *string) {
+static gchar *jabber_caps_verification_append(gchar *verification_string, gchar *string) {
 	gchar *verification;
 	verification = g_strconcat(verification_string, string, "<", NULL);
 	g_free(verification_string);
 	return verification;
 }
 
-gchar *jabber_caps_calcualte_hash(JabberCapsClientInfo *info, const char *hash) {
+gchar *jabber_caps_calculate_hash(JabberCapsClientInfo *info, const char *hash) {
 	GList *identities;
 	GList *features;
 	GList *xdata;
@@ -843,7 +854,7 @@ void jabber_caps_calculate_own_hash(Jabb
 	info->forms = 0;
 	
 	if (caps_hash) g_free(caps_hash);
-	caps_hash = jabber_caps_calcualte_hash(info, "sha1");
+	caps_hash = jabber_caps_calculate_hash(info, "sha1");
 	g_free(info);
 	g_list_free(features);
 }
============================================================
--- libpurple/protocols/jabber/caps.h	419d29a59e33ea29488431dcc6e855d43f1024b7
+++ libpurple/protocols/jabber/caps.h	8d3932473e0e673b040137f43bcf275d4dca521a
@@ -79,21 +79,21 @@ JabberCapsClientInfo *jabber_caps_parse_
  *	@return		The base64 encoded SHA-1 hash; needs to be freed if not needed 
  *				any furthermore. 
  */
-gchar *jabber_caps_calcualte_hash(JabberCapsClientInfo *info, const char *hash);
+gchar *jabber_caps_calculate_hash(JabberCapsClientInfo *info, const char *hash);
 
 /**
- *  Calcualte SHA1 hash for own featureset.
+ *  Calculate SHA1 hash for own featureset.
  */
-void jabber_caps_calculate_own_hash();
+void jabber_caps_calculate_own_hash(JabberStream *js);
 
 /** Get the current caps hash.
  * 	@ret hash
 **/
-const gchar* jabber_caps_get_own_hash();
+const gchar* jabber_caps_get_own_hash(void);
 
 /**
  *  Broadcast a new calculated hash using a <presence> stanza.
  */
-void jabber_caps_broadcast_change();
+void jabber_caps_broadcast_change(void);
 
 #endif /* _PURPLE_JABBER_CAPS_H_ */
============================================================
--- libpurple/protocols/jabber/disco.c	ef9882fc4f41272a7861994734153c939f9654af
+++ libpurple/protocols/jabber/disco.c	4bf59bce2e3d4d1fb99d747d8e16ad62f320ee0d
@@ -97,7 +97,7 @@ void jabber_disco_info_parse(JabberStrea
 
 		xmlnode *in_query;
 		const char *node = NULL;
-		const char *node_uri = NULL;
+		char *node_uri = NULL;
 		
 		// create custom caps node URI
 		node_uri = g_strconcat(CAPS0115_NODE, "#", jabber_caps_get_own_hash(), NULL);
@@ -120,7 +120,7 @@ void jabber_disco_info_parse(JabberStrea
 
 
 		if(!node || !strcmp(node, node_uri)) {
-			GList *identities;
+			GList *features, *identities;
 			for(identities = jabber_identities; identities; identities = identities->next) {
 				JabberIdentity *ident = (JabberIdentity*)identities->data;
 				identity = xmlnode_new_child(query, "identity");
@@ -128,7 +128,6 @@ void jabber_disco_info_parse(JabberStrea
 				xmlnode_set_attrib(identity, "type", ident->type);
 				if (ident->name != 0) xmlnode_set_attrib(identity, "name", ident->name);
 			}
-			GList *features;
 			for(features = jabber_features; features; features = features->next) {
 				JabberFeature *feat = (JabberFeature*)features->data;
 				if(feat->is_enabled == NULL || feat->is_enabled(js, feat->namespace) == TRUE) {
============================================================
--- libpurple/protocols/jabber/jabber.c	f85eedc3656543b4e7d395d437a6bd520906d896
+++ libpurple/protocols/jabber/jabber.c	586480e6466228d724430f8d5360880c84903048
@@ -2561,7 +2561,7 @@ jabber_ipc_contact_has_feature(gchar *fu
 	if (!caps_info) return FALSE;
 	capabilities = g_hash_table_lookup(capstable, caps_info);
 	
-	if (g_list_find_custom(capabilities->features, feature, strcmp) == NULL) return FALSE ;
+	if (g_list_find_custom(capabilities->features, feature, (GCompareFunc)strcmp) == NULL) return FALSE ;
 	return TRUE;
 }
 
============================================================
--- libpurple/protocols/jabber/jabber.h	563b9c0c9a4e7487518b8c3a47c61dae3ef6de17
+++ libpurple/protocols/jabber/jabber.h	22f47b9efbc1a1013b7bb8c0cb25ec33e0c27ac2
@@ -278,6 +278,7 @@ extern GHashTable *jabber_contact_info; 
 
 extern GHashTable *jabber_contact_info; /* char * -> JabberCapsKey */
 
+void jabber_stream_features_parse(JabberStream *js, xmlnode *packet);
 void jabber_process_packet(JabberStream *js, xmlnode **packet);
 void jabber_send(JabberStream *js, xmlnode *data);
 void jabber_send_raw(JabberStream *js, const char *data, int len);
============================================================
--- libpurple/protocols/jabber/libxmpp.c	d42eb7636f94ae402ce341cff295a0f7d814be54
+++ libpurple/protocols/jabber/libxmpp.c	86de7e5afa868b456ad92c14cc8dcdc290c7928e
@@ -283,7 +283,7 @@ init_plugin(PurplePlugin *plugin)
 
 	jabber_add_feature(AVATARNAMESPACEMETA, jabber_pep_namespace_only_when_pep_enabled_cb);
 	jabber_add_feature(AVATARNAMESPACEDATA, jabber_pep_namespace_only_when_pep_enabled_cb);
-	jabber_add_feature(http://www.xmpp.org/extensions/xep-0224.html#ns",
+	jabber_add_feature("http://www.xmpp.org/extensions/xep-0224.html#ns",
 					   jabber_buzz_isenabled);
 	jabber_add_feature(XEP_0231_NAMESPACE, jabber_custom_smileys_isenabled);
 
============================================================
--- libpurple/protocols/jabber/message.c	952b970189b1832d020bff1225ed4e9c2bfeca35
+++ libpurple/protocols/jabber/message.c	f8f53a281cd1b5109b61753a1b593885944ebe58
@@ -1240,8 +1240,7 @@ gboolean jabber_buzz_isenabled(JabberStr
 	return js->allowBuzz;
 }
 
-gboolean jabber_custom_smileys_isenabled(JabberStream *js, const gchar *shortname,
-										 const gchar *namespace)
+gboolean jabber_custom_smileys_isenabled(JabberStream *js, const gchar *namespace)
 {
 	const PurpleConnection *gc = js->gc;
 	PurpleAccount *account = purple_connection_get_account(gc);
============================================================
--- libpurple/protocols/jabber/message.h	279089818245375743b1025f9953402362c12537
+++ libpurple/protocols/jabber/message.h	f988eee57a6bfefc49ec9e3282dbb2bf202bff1d
@@ -80,7 +80,6 @@ gboolean jabber_buzz_isenabled(JabberStr
 
 gboolean jabber_buzz_isenabled(JabberStream *js, const gchar *namespace);
 
-gboolean jabber_custom_smileys_isenabled(JabberStream *js, const gchar *shortname,
-										 const gchar *namespace);
+gboolean jabber_custom_smileys_isenabled(JabberStream *js, const const gchar *namespace);
 
 #endif /* _PURPLE_JABBER_MESSAGE_H_ */


More information about the Commits mailing list