pidgin: bedd1503: Minor changes... mostly whitespace relat...

markdoliner at pidgin.im markdoliner at pidgin.im
Tue May 6 04:10:46 EDT 2008


-----------------------------------------------------------------
Revision: bedd15033893c160df2e861d26520e1ef6afd895
Ancestor: db15574205f27c2eecbe6cd3d05dd004cf75050f
Author: markdoliner at pidgin.im
Date: 2008-05-05T09:22:46
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/bedd15033893c160df2e861d26520e1ef6afd895

Modified files:
        libpurple/protocols/oscar/family_admin.c
        libpurple/protocols/oscar/family_bart.c
        libpurple/protocols/oscar/family_chat.c
        libpurple/protocols/oscar/family_feedbag.c
        libpurple/protocols/oscar/family_icbm.c
        libpurple/protocols/oscar/family_icq.c
        libpurple/protocols/oscar/family_locate.c
        libpurple/protocols/oscar/family_odir.c
        libpurple/protocols/oscar/family_oservice.c
        libpurple/protocols/oscar/family_userlookup.c
        libpurple/protocols/oscar/flap_connection.c
        libpurple/protocols/oscar/oscar.h

ChangeLog: 

Minor changes... mostly whitespace related.
Also changed some functions in family_admin.c to be void instead of
returning the same int every time, and fixed a tiny memleak in
family_admin.c.  Oh, I think there was a variable in family_icbm.c
that was being redeclared inside of a block--functionally it was fine,
but it could have led to confusion.

-------------- next part --------------
============================================================
--- libpurple/protocols/oscar/family_admin.c	108fde5f44c81b32143f4def89df0bf144a21d54
+++ libpurple/protocols/oscar/family_admin.c	89a01fc431a04b4125097547a90c7b6471ff97af
@@ -28,16 +28,15 @@
 
 #include "oscar.h"
 
-/*
+/**
  * Subtype 0x0002 - Request a bit of account info.
  *
  * Info should be one of the following:
  * 0x0001 - Screen name formatting
  * 0x0011 - Email address
  * 0x0013 - Unknown
- *
  */
-int
+void
 aim_admin_getinfo(OscarData *od, FlapConnection *conn, guint16 info)
 {
 	ByteStream bs;
@@ -48,22 +47,19 @@ aim_admin_getinfo(OscarData *od, FlapCon
 	byte_stream_put16(&bs, info);
 	byte_stream_put16(&bs, 0x0000);
 
-	snacid = aim_cachesnac(od, 0x0007, 0x0002, 0x0000, NULL, 0);	
-	flap_connection_send_snac(od, conn, 0x0007, 0x0002, 0x0000, snacid, &bs);	
+	snacid = aim_cachesnac(od, 0x0007, 0x0002, 0x0000, NULL, 0);
+	flap_connection_send_snac(od, conn, 0x0007, 0x0002, 0x0000, snacid, &bs);
 
 	byte_stream_destroy(&bs);
-
-	return 0;
 }
 
-/*
+/**
  * Subtypes 0x0003 and 0x0005 - Parse account info.
  *
  * Called in reply to both an information request (subtype 0x0002) and
  * an information change (subtype 0x0004).
- *
  */
-static int
+static void
 infochange(OscarData *od, FlapConnection *conn, aim_module_t *mod, FlapFrame *frame, aim_modsnac_t *snac, ByteStream *bs)
 {
 	aim_rxcallback_t userfunc;
@@ -112,15 +108,12 @@ infochange(OscarData *od, FlapConnection
 	g_free(sn);
 	g_free(url);
 	g_free(email);
-
-	return 1;
 }
 
-/*
+/**
  * Subtype 0x0004 - Set screenname formatting.
- *
  */
-int
+void
 aim_admin_setnick(OscarData *od, FlapConnection *conn, const char *newnick)
 {
 	ByteStream bs;
@@ -138,15 +131,12 @@ aim_admin_setnick(OscarData *od, FlapCon
 	flap_connection_send_snac(od, conn, 0x0007, 0x0004, 0x0000, snacid, &bs);
 
 	byte_stream_destroy(&bs);
-
-	return 0;
 }
 
-/*
+/**
  * Subtype 0x0004 - Change password.
- *
  */
-int
+void
 aim_admin_changepasswd(OscarData *od, FlapConnection *conn, const char *newpw, const char *curpw)
 {
 	ByteStream bs;
@@ -167,14 +157,13 @@ aim_admin_changepasswd(OscarData *od, Fl
 	snacid = aim_cachesnac(od, 0x0007, 0x0004, 0x0000, NULL, 0);
 	flap_connection_send_snac(od, conn, 0x0007, 0x0004, 0x0000, snacid, &bs);
 
-	return 0;
+	byte_stream_destroy(&bs);
 }
 
-/*
+/**
  * Subtype 0x0004 - Change email address.
- *
  */
-int
+void
 aim_admin_setemail(OscarData *od, FlapConnection *conn, const char *newemail)
 {
 	ByteStream bs;
@@ -192,8 +181,6 @@ aim_admin_setemail(OscarData *od, FlapCo
 	flap_connection_send_snac(od, conn, 0x0007, 0x0004, 0x0000, snacid, &bs);
 
 	byte_stream_destroy(&bs);
-
-	return 0;
 }
 
 /*
@@ -210,9 +197,8 @@ aim_admin_reqconfirm(OscarData *od, Flap
 	aim_genericreq_n(od, conn, 0x0007, 0x0006);
 }
 
-/*
+/**
  * Subtype 0x0007 - Account confirmation request acknowledgement.
- *
  */
 static int
 accountconfirm(OscarData *od, FlapConnection *conn, aim_module_t *mod, FlapFrame *frame, aim_modsnac_t *snac, ByteStream *bs)
@@ -238,9 +224,10 @@ snachandler(OscarData *od, FlapConnectio
 static int
 snachandler(OscarData *od, FlapConnection *conn, aim_module_t *mod, FlapFrame *frame, aim_modsnac_t *snac, ByteStream *bs)
 {
-	if ((snac->subtype == 0x0003) || (snac->subtype == 0x0005))
-		return infochange(od, conn, mod, frame, snac, bs);
-	else if (snac->subtype == 0x0007)
+	if ((snac->subtype == 0x0003) || (snac->subtype == 0x0005)) {
+		infochange(od, conn, mod, frame, snac, bs);
+		return 1;
+	} else if (snac->subtype == 0x0007)
 		return accountconfirm(od, conn, mod, frame, snac, bs);
 
 	return 0;
============================================================
--- libpurple/protocols/oscar/family_bart.c	8e103e55d57f0dbf5aeb9d04d5aad0b94f5796fc
+++ libpurple/protocols/oscar/family_bart.c	cb5cc9d9af48ff07263507cc2104be85b6909dd2
@@ -57,9 +57,9 @@ aim_bart_upload(OscarData *od, const gui
 
 	snacid = aim_cachesnac(od, 0x0010, 0x0002, 0x0000, NULL, 0);
 	flap_connection_send_snac(od, conn, 0x0010, 0x0002, 0x0000, snacid, &bs);
-	
+
 	byte_stream_destroy(&bs);
-	
+
 	return 0;
 }
 
============================================================
--- libpurple/protocols/oscar/family_chat.c	dc0c240cb692a2d53d4351f732dbb844da738e62
+++ libpurple/protocols/oscar/family_chat.c	3942a5426342e2708443347d6d8f9e4173c9cd4d
@@ -435,7 +435,7 @@ aim_chat_send_im(OscarData *od, FlapConn
 	flap_connection_send_snac(od, conn, 0x000e, 0x0005, 0x0000, snacid, &bs);
 
 	byte_stream_destroy(&bs);
-	
+
 	return 0;
 }
 
============================================================
--- libpurple/protocols/oscar/family_feedbag.c	2d62f5dfc27d4e60c0d78d3fadb45dc59ecde53e
+++ libpurple/protocols/oscar/family_feedbag.c	fefde7da7267cad0bdeebc4dbf17f2266ff46d8e
@@ -1690,7 +1690,7 @@ int aim_ssi_sendauth(OscarData *od, char
 	if (!od || !(conn = flap_connection_findbygroup(od, SNAC_FAMILY_FEEDBAG)) || !sn)
 		return -EINVAL;
 
-	byte_stream_new(&bs, 1+strlen(sn)+2+(msg ? strlen(msg)+1 : 0)+2);
+	byte_stream_new(&bs, 1+strlen(sn) + 2+(msg ? strlen(msg)+1 : 0) + 2);
 
 	/* Screen name */
 	byte_stream_put8(&bs, strlen(sn));
@@ -1764,7 +1764,7 @@ int aim_ssi_sendauthrequest(OscarData *o
 	if (!od || !(conn = flap_connection_findbygroup(od, SNAC_FAMILY_FEEDBAG)) || !sn)
 		return -EINVAL;
 
-	byte_stream_new(&bs, 1+strlen(sn) + 2+(msg ? (strlen(msg)+1) : 0) + 2);
+	byte_stream_new(&bs, 1+strlen(sn) + 2+(msg ? strlen(msg)+1 : 0) + 2);
 
 	/* Screen name */
 	byte_stream_put8(&bs, strlen(sn));
@@ -1864,7 +1864,7 @@ int aim_ssi_sendauthreply(OscarData *od,
 	flap_connection_send_snac(od, conn, SNAC_FAMILY_FEEDBAG, SNAC_SUBTYPE_FEEDBAG_SENDAUTHREP, 0x0000, snacid, &bs);
 
 	byte_stream_destroy(&bs);
-	
+
 	return 0;
 }
 
============================================================
--- libpurple/protocols/oscar/family_icbm.c	5c10bda2378a17eb5e4c6d2d0bb0e74b25fb81a9
+++ libpurple/protocols/oscar/family_icbm.c	d5f74e00f7181340ec90ee2313f6b8171f6b9bb5
@@ -184,9 +184,9 @@ int aim_im_setparams(OscarData *od, stru
 
 	snacid = aim_cachesnac(od, 0x0004, 0x0002, 0x0000, NULL, 0);
 	flap_connection_send_snac(od, conn, 0x0004, 0x0002, 0x0000, snacid, &bs);
-	
+
 	byte_stream_destroy(&bs);
-	
+
 	return 0;
 }
 
@@ -520,7 +520,7 @@ int aim_im_sendch2_chatinvite(OscarData 
 	aim_tlvlist_free(outer_tlvlist);
 
 	flap_connection_send_snac(od, conn, 0x0004, 0x0006, 0x0000, snacid, &bs);
-	
+
 	byte_stream_destroy(&bs);
 
 	return 0;
@@ -592,7 +592,7 @@ int aim_im_sendch2_icon(OscarData *od, c
 	flap_connection_send_snac(od, conn, 0x0004, 0x0006, 0x0000, snacid, &bs);
 
 	byte_stream_destroy(&bs);
-	
+
 	return 0;
 }
 
@@ -685,7 +685,7 @@ int aim_im_sendch2_rtfmsg(OscarData *od,
 	flap_connection_send_snac(od, conn, 0x0004, 0x0006, 0x0000, snacid, &bs);
 
 	byte_stream_destroy(&bs);
-	
+
 	return 0;
 }
 
@@ -728,7 +728,7 @@ aim_im_sendch2_cancel(PeerConnection *pe
 	aim_tlvlist_write(&hdrbs, &inner_tlvlist);
 
 	aim_tlvlist_add_raw(&outer_tlvlist, 0x0005, byte_stream_curpos(&hdrbs), hdrbs.data);
-	g_free(hdrbs.data);
+	byte_stream_destroy(&hdrbs);
 
 	aim_tlvlist_write(&bs, &outer_tlvlist);
 
@@ -772,7 +772,7 @@ aim_im_sendch2_connected(PeerConnection 
 
 	flap_connection_send_snac(od, conn, 0x0004, 0x0006, 0x0000, snacid, &bs);
 
-	byte_stream_destroy(&bs);	
+	byte_stream_destroy(&bs);
 }
 
 /**
@@ -945,20 +945,20 @@ aim_im_sendch2_sendfile_requestdirect(Os
 
 	if (filename != NULL)
 	{
-		ByteStream bs;
+		ByteStream inner_bs;
 
 		/* Begin TLV t(2711) */
-		byte_stream_new(&bs, 2+2+4+strlen(filename)+1);
-		byte_stream_put16(&bs, (numfiles > 1) ? 0x0002 : 0x0001);
-		byte_stream_put16(&bs, numfiles);
-		byte_stream_put32(&bs, size);
+		byte_stream_new(&inner_bs, 2+2+4+strlen(filename)+1);
+		byte_stream_put16(&inner_bs, (numfiles > 1) ? 0x0002 : 0x0001);
+		byte_stream_put16(&inner_bs, numfiles);
+		byte_stream_put32(&inner_bs, size);
 
 		/* Filename - NULL terminated, for some odd reason */
-		byte_stream_putstr(&bs, filename);
-		byte_stream_put8(&bs, 0x00);
+		byte_stream_putstr(&inner_bs, filename);
+		byte_stream_put8(&inner_bs, 0x00);
 
-		aim_tlvlist_add_raw(&inner_tlvlist, 0x2711, bs.len, bs.data);
-		byte_stream_destroy(&bs);
+		aim_tlvlist_add_raw(&inner_tlvlist, 0x2711, inner_bs.len, inner_bs.data);
+		byte_stream_destroy(&inner_bs);
 		/* End TLV t(2711) */
 	}
 
@@ -1163,7 +1163,7 @@ int aim_im_sendch2_geticqaway(OscarData 
 	flap_connection_send_snac(od, conn, 0x0004, 0x0006, 0x0000, snacid, &bs);
 
 	byte_stream_destroy(&bs);
-	
+
 	return 0;
 }
 
@@ -1232,7 +1232,7 @@ int aim_im_sendch4(OscarData *od, const 
 	flap_connection_send_snac(od, conn, 0x0004, 0x0006, 0x0000, snacid, &bs);
 
 	byte_stream_destroy(&bs);
-	
+
 	return 0;
 }
 
@@ -2339,7 +2339,7 @@ int aim_im_denytransfer(OscarData *od, c
 	aim_tlvlist_free(tlvlist);
 
 	flap_connection_send_snac(od, conn, 0x0004, 0x000b, 0x0000, snacid, &bs);
-	
+
 	byte_stream_destroy(&bs);
 
 	return 0;
@@ -2716,7 +2716,7 @@ int aim_im_sendmtn(OscarData *od, guint1
 	flap_connection_send_snac(od, conn, 0x0004, 0x0014, 0x0000, snacid, &bs);
 
 	byte_stream_destroy(&bs);
-	
+
 	return 0;
 }
 
============================================================
--- libpurple/protocols/oscar/family_icq.c	058eed88c66bcd71aeef29362f8e9a6cc22645ab
+++ libpurple/protocols/oscar/family_icq.c	71dcf9f9388f3658e6e85bd50e5ed288509b63d1
@@ -260,9 +260,9 @@ int aim_icq_getalias(OscarData *od, cons
 	byte_stream_putle32(&bs, atoi(uin));
 
 	flap_connection_send_snac(od, conn, 0x0015, 0x0002, 0x0000, snacid, &bs);
-	
+
 	byte_stream_destroy(&bs);
-	
+
 	/* Keep track of this request and the ICQ number and request ID */
 	info = (struct aim_icq_info *)g_new0(struct aim_icq_info, 1);
 	info->reqid = snacid;
@@ -343,9 +343,9 @@ int aim_icq_sendxmlreq(OscarData *od, co
 	byte_stream_putraw(&bs, (guint8 *)xml, strlen(xml) + 1);
 
 	flap_connection_send_snac(od, conn, 0x0015, 0x0002, 0x0000, snacid, &bs);
-	
+
 	byte_stream_destroy(&bs);
-	
+
 	return 0;
 }
 #endif
============================================================
--- libpurple/protocols/oscar/family_locate.c	8bb1a169ca0d4a0964a4d1d3873ea9cd39551e74
+++ libpurple/protocols/oscar/family_locate.c	0c30e6b2355895465c5bfb851c703a59e6211ddd
@@ -1353,7 +1353,7 @@ aim_locate_setinterests(OscarData *od, c
 	aim_tlvlist_free(tlvlist);
 
 	flap_connection_send_snac(od, conn, 0x0002, 0x000f, 0x0000, snacid, &bs);
-	
+
 	byte_stream_destroy(&bs);
 	return 0;
 }
============================================================
--- libpurple/protocols/oscar/family_odir.c	84e44db313de45461ac3873dd71873d411f78977
+++ libpurple/protocols/oscar/family_odir.c	3dd56e62e51fa758640fad54e1a41993dd973a65
@@ -130,7 +130,7 @@ int aim_odir_name(OscarData *od, const c
 	flap_connection_send_snac(od, conn, 0x000f, 0x0002, 0x0000, snacid, &bs);
 
 	byte_stream_destroy(&bs);
-	
+
 	return 0;
 }
 
@@ -165,9 +165,9 @@ int aim_odir_interest(OscarData *od, con
 
 	snacid = aim_cachesnac(od, 0x000f, 0x0002, 0x0000, NULL, 0);
 	flap_connection_send_snac(od, conn, 0x000f, 0x0002, 0x0000, snacid, &bs);
-	
+
 	byte_stream_destroy(&bs);
-	
+
 	return 0;
 }
 
============================================================
--- libpurple/protocols/oscar/family_oservice.c	33c8f853c52bcaf6a77249caec571f8c0a358dcd
+++ libpurple/protocols/oscar/family_oservice.c	dd2ae5eb03d218c23ab00997ad1e8543619483b2
@@ -56,7 +56,7 @@ aim_clientready(OscarData *od, FlapConne
 
 	snacid = aim_cachesnac(od, 0x0001, 0x0002, 0x0000, NULL, 0);
 	flap_connection_send_snac(od, conn, 0x0001, 0x0002, 0x0000, snacid, &bs);
-	
+
 	byte_stream_destroy(&bs);
 }
 
@@ -150,7 +150,7 @@ aim_chat_join(OscarData *od, guint16 exc
 	flap_connection_send_snac(od, conn, 0x0001, 0x0004, 0x0000, snacid, &bs);
 
 	byte_stream_destroy(&bs);
-	
+
 	return 0;
 }
 
@@ -392,7 +392,7 @@ aim_srv_rates_addparam(OscarData *od, Fl
 	snacid = aim_cachesnac(od, 0x0001, 0x0008, 0x0000, NULL, 0);
 	flap_connection_send_snac(od, conn, 0x0001, 0x0008, 0x0000, snacid, &bs);
 
-	byte_stream_destroy(&bs);	
+	byte_stream_destroy(&bs);
 }
 
 /* Subtype 0x0009 - Delete Rate Parameter */
@@ -415,7 +415,7 @@ aim_srv_rates_delparam(OscarData *od, Fl
 	snacid = aim_cachesnac(od, 0x0001, 0x0009, 0x0000, NULL, 0);
 	flap_connection_send_snac(od, conn, 0x0001, 0x0009, 0x0000, snacid, &bs);
 
-	byte_stream_destroy(&bs);	
+	byte_stream_destroy(&bs);
 }
 
 /* Subtype 0x000a - Rate Change */
@@ -865,7 +865,7 @@ aim_srv_setextrainfo(OscarData *od,
 	flap_connection_send_snac(od, conn, 0x0001, 0x001e, 0x0000, snacid, &bs);
 
 	byte_stream_destroy(&bs);
-	
+
 	return 0;
 }
 
@@ -1016,7 +1016,7 @@ aim_sendmemblock(OscarData *od, FlapConn
 	flap_connection_send_snac(od, conn, 0x0001, 0x0020, 0x0000, snacid, &bs);
 
 	byte_stream_destroy(&bs);
-	
+
 	return 0;
 }
 
============================================================
--- libpurple/protocols/oscar/family_userlookup.c	b59824ef432d65c84658fd72b55086d92f77dcf7
+++ libpurple/protocols/oscar/family_userlookup.c	63f4e4bcac77e352ae94c5bea4f162583f56d3ae
@@ -78,7 +78,7 @@ int aim_search_address(OscarData *od, co
 	flap_connection_send_snac(od, conn, 0x000a, 0x0002, 0x0000, snacid, &bs);
 
 	byte_stream_destroy(&bs);
-	
+
 	return 0;
 }
 
============================================================
--- libpurple/protocols/oscar/flap_connection.c	098ea79fdd811fb96c8dec0b48771b204aaf7a02
+++ libpurple/protocols/oscar/flap_connection.c	69da2f97835ed1dd67702a750d8e60a22a354bca
@@ -115,7 +115,7 @@ static gboolean flap_connection_send_que
 	conn = data;
 	gettimeofday(&now, NULL);
 
-	purple_debug_info("oscar", "Attempting to send %i queued SNACs for %p\n", g_queue_get_length(conn->queued_snacs), conn);
+	purple_debug_info("oscar", "Attempting to send %u queued SNACs for %p\n", g_queue_get_length(conn->queued_snacs), conn);
 	while (!g_queue_is_empty(conn->queued_snacs))
 	{
 		QueuedSnac *queued_snac;
@@ -201,7 +201,7 @@ flap_connection_send_snac(OscarData *od,
 			rateclass->last.tv_usec = now.tv_usec;
 		}
 	} else {
-		purple_debug_warning("oscar", "No rate class found for family %u subtype %u\n", family, subtype);
+		purple_debug_warning("oscar", "No rate class found for family %hu subtype %hu\n", family, subtype);
 	}
 
 	if (enqueue)
============================================================
--- libpurple/protocols/oscar/oscar.h	6fcd924bf832e3a91a72dd73004516a4d2440015
+++ libpurple/protocols/oscar/oscar.h	f57d26005eb8d07a8678f4fc5b897d31b0100d3a
@@ -1350,11 +1350,11 @@ void aim_sendcookie(OscarData *, FlapCon
 
 /* 0x0017 - family_auth.c */
 void aim_sendcookie(OscarData *, FlapConnection *, const guint16 length, const guint8 *);
-int aim_admin_changepasswd(OscarData *, FlapConnection *, const char *newpw, const char *curpw);
+void aim_admin_changepasswd(OscarData *, FlapConnection *, const char *newpw, const char *curpw);
 void aim_admin_reqconfirm(OscarData *od, FlapConnection *conn);
-int aim_admin_getinfo(OscarData *od, FlapConnection *conn, guint16 info);
-int aim_admin_setemail(OscarData *od, FlapConnection *conn, const char *newemail);
-int aim_admin_setnick(OscarData *od, FlapConnection *conn, const char *newnick);
+void aim_admin_getinfo(OscarData *od, FlapConnection *conn, guint16 info);
+void aim_admin_setemail(OscarData *od, FlapConnection *conn, const char *newemail);
+void aim_admin_setnick(OscarData *od, FlapConnection *conn, const char *newnick);
 
 
 


More information about the Commits mailing list