changeset 12429:59207955adc2

[gaim-migrate @ 14736] There are quite a few cases of empty if blocks for various aim_tlv_gettlv() calls. These calls exist in the code as documentation of various TLVs seen in the wild, but unhandled in Gaim for whatever reason. I'm changing them so the compiler is happy. This way, we can get quite a few useful warnings by turning on -Wextra. committer: Tailor Script <tailor@pidgin.im>
author Richard Laager <rlaager@wiktel.com>
date Fri, 09 Dec 2005 04:05:04 +0000
parents 9a0a6e74aafd
children cc4c4477ea82
files src/protocols/oscar/auth.c src/protocols/oscar/chat.c src/protocols/oscar/chatnav.c src/protocols/oscar/im.c
diffstat 4 files changed, 97 insertions(+), 47 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocols/oscar/auth.c	Fri Dec 09 03:42:47 2005 +0000
+++ b/src/protocols/oscar/auth.c	Fri Dec 09 04:05:04 2005 +0000
@@ -387,8 +387,12 @@
 		info->latestbeta.info = aim_tlv_getstr(tlvlist, 0x0042, 1);
 	if (aim_tlv_gettlv(tlvlist, 0x0043, 1))
 		info->latestbeta.name = aim_tlv_getstr(tlvlist, 0x0043, 1);
-	if (aim_tlv_gettlv(tlvlist, 0x0048, 1))
-		; /* beta serial */
+
+#if 0
+	if (aim_tlv_gettlv(tlvlist, 0x0048, 1)) {
+		/* beta serial */
+	}
+#endif
 
 	if (aim_tlv_gettlv(tlvlist, 0x0044, 1))
 		info->latestrelease.build = aim_tlv_get32(tlvlist, 0x0044, 1);
@@ -398,8 +402,12 @@
 		info->latestrelease.info = aim_tlv_getstr(tlvlist, 0x0046, 1);
 	if (aim_tlv_gettlv(tlvlist, 0x0047, 1))
 		info->latestrelease.name = aim_tlv_getstr(tlvlist, 0x0047, 1);
-	if (aim_tlv_gettlv(tlvlist, 0x0049, 1))
-		; /* lastest release serial */
+
+#if 0
+	if (aim_tlv_gettlv(tlvlist, 0x0049, 1)) {
+		/* lastest release serial */
+	}
+#endif
 
 	/*
 	 * URL to change password.
@@ -407,11 +415,14 @@
 	if (aim_tlv_gettlv(tlvlist, 0x0054, 1))
 		info->chpassurl = aim_tlv_getstr(tlvlist, 0x0054, 1);
 
+#if 0
 	/*
 	 * Unknown.  Seen on an @mac.com screen name with value of 0x003f
 	 */
-	if (aim_tlv_gettlv(tlvlist, 0x0055, 1))
-		;
+	if (aim_tlv_gettlv(tlvlist, 0x0055, 1)) {
+		/* Unhandled */
+	}
+#endif
 
 	sess->authinfo = info;
 
--- a/src/protocols/oscar/chat.c	Fri Dec 09 03:42:47 2005 +0000
+++ b/src/protocols/oscar/chat.c	Fri Dec 09 04:05:04 2005 +0000
@@ -214,11 +214,14 @@
 	if (aim_tlv_gettlv(tlvlist, 0x00d3, 1))
 		roomdesc = aim_tlv_getstr(tlvlist, 0x00d3, 1);
 
+#if 0
 	/*
 	 * Type 0x000d4: Unknown (flag only)
 	 */
-	if (aim_tlv_gettlv(tlvlist, 0x000d4, 1))
-		;
+	if (aim_tlv_gettlv(tlvlist, 0x000d4, 1)) {
+		/* Unhandled */
+	}
+#endif
 
 	/* 
 	 * Type 0x00d5: Unknown. (1 byte)
@@ -226,30 +229,35 @@
 	if (aim_tlv_gettlv(tlvlist, 0x00d5, 1))
 		unknown_d5 = aim_tlv_get8(tlvlist, 0x00d5, 1);
 
-
+#if 0
 	/*
 	 * Type 0x00d6: Encoding 1 ("us-ascii")
 	 */
-	if (aim_tlv_gettlv(tlvlist, 0x000d6, 1))
-		;
-	
+	if (aim_tlv_gettlv(tlvlist, 0x000d6, 1)) {
+		/* Unhandled */
+	}
+
 	/*
 	 * Type 0x00d7: Language 1 ("en")
 	 */
-	if (aim_tlv_gettlv(tlvlist, 0x000d7, 1))
-		;
+	if (aim_tlv_gettlv(tlvlist, 0x000d7, 1)) {
+		/* Unhandled */
+	}
 
 	/*
 	 * Type 0x00d8: Encoding 2 ("us-ascii")
 	 */
-	if (aim_tlv_gettlv(tlvlist, 0x000d8, 1))
-		;
+	if (aim_tlv_gettlv(tlvlist, 0x000d8, 1)) {
+		/* Unhandled */
+	}
 	
 	/*
 	 * Type 0x00d9: Language 2 ("en")
 	 */
-	if (aim_tlv_gettlv(tlvlist, 0x000d9, 1))
-		;
+	if (aim_tlv_gettlv(tlvlist, 0x000d9, 1)) {
+		/* Unhandled */
+	}
+#endif
 
 	/*
 	 * Type 0x00da: Maximum visible message length
@@ -491,12 +499,15 @@
 		aim_info_extract(sess, &tbs, &userinfo);
 	}
 
+#if 0
 	/*
 	 * Type 0x0001: If present, it means it was a message to the 
 	 * room (as opposed to a whisper).
 	 */
-	if (aim_tlv_gettlv(otl, 0x0001, 1))
-		;
+	if (aim_tlv_gettlv(otl, 0x0001, 1)) {
+		/* Unhandled */
+	}
+#endif
 
 	/*
 	 * Type 0x0005: Message Block.  Conains more TLVs.
--- a/src/protocols/oscar/chatnav.c	Fri Dec 09 03:42:47 2005 +0000
+++ b/src/protocols/oscar/chatnav.c	Fri Dec 09 04:05:04 2005 +0000
@@ -120,26 +120,31 @@
 		exchanges[curexchange-1].number = aimbs_get16(&tbs);
 		innerlist = aim_tlvlist_read(&tbs);
 
+#if 0
 		/*
 		 * Type 0x000a: Unknown.
 		 *
 		 * Usually three bytes: 0x0114 (exchange 1) or 0x010f (others).
 		 *
 		 */
-		if (aim_tlv_gettlv(innerlist, 0x000a, 1))
-			;
+		if (aim_tlv_gettlv(innerlist, 0x000a, 1)) {
+			/* Unhandled */
+		}
 
 		/*
 		 * Type 0x000d: Unknown.
 		 */
-		if (aim_tlv_gettlv(innerlist, 0x000d, 1))
-			;
+		if (aim_tlv_gettlv(innerlist, 0x000d, 1)) {
+			/* Unhandled */
+		}
 
 		/*
 		 * Type 0x0004: Unknown
 		 */
-		if (aim_tlv_gettlv(innerlist, 0x0004, 1))
-			;
+		if (aim_tlv_gettlv(innerlist, 0x0004, 1)) {
+			/* Unhandled */
+		}
+#endif
 
 		/*
 		 * Type 0x0002: Unknown
@@ -164,29 +169,35 @@
 		if (aim_tlv_gettlv(innerlist, 0x00c9, 1))
 			exchanges[curexchange-1].flags = aim_tlv_get16(innerlist, 0x00c9, 1);
 
+#if 0
 		/*
 		 * Type 0x00ca: Creation Date
 		 */
-		if (aim_tlv_gettlv(innerlist, 0x00ca, 1))
-			;
+		if (aim_tlv_gettlv(innerlist, 0x00ca, 1)) {
+			/* Unhandled */
+		}
 
 		/*
 		 * Type 0x00d0: Mandatory Channels?
 		 */
-		if (aim_tlv_gettlv(innerlist, 0x00d0, 1))
-			;
+		if (aim_tlv_gettlv(innerlist, 0x00d0, 1)) {
+			/* Unhandled */
+		}
 
 		/*
 		 * Type 0x00d1: Maximum Message length
 		 */
-		if (aim_tlv_gettlv(innerlist, 0x00d1, 1))
-			;
+		if (aim_tlv_gettlv(innerlist, 0x00d1, 1)) {
+			/* Unhandled */
+		}
 
 		/*
 		 * Type 0x00d2: Maximum Occupancy?
 		 */
-		if (aim_tlv_gettlv(innerlist, 0x00d2, 1))	
-			;
+		if (aim_tlv_gettlv(innerlist, 0x00d2, 1)) {	
+			/* Unhandled */
+		}
+#endif
 
 		/*
 		 * Type 0x00d3: Exchange Description
@@ -196,11 +207,14 @@
 		else
 			exchanges[curexchange-1].name = NULL;
 
+#if 0
 		/*
 		 * Type 0x00d4: Exchange Description URL
 		 */
-		if (aim_tlv_gettlv(innerlist, 0x00d4, 1))	
-			;
+		if (aim_tlv_gettlv(innerlist, 0x00d4, 1)) {
+			/* Unhandled */
+		}
+#endif
 
 		/*
 		 * Type 0x00d5: Creation Permissions
@@ -247,12 +261,15 @@
 			exchanges[curexchange-1].lang2 = aim_tlv_getstr(innerlist, 0x00d9, 1);
 		else
 			exchanges[curexchange-1].lang2 = NULL;
-		      
+
+#if 0
 		/*
 		 * Type 0x00da: Unknown
 		 */
-		if (aim_tlv_gettlv(innerlist, 0x00da, 1))	
-			;
+		if (aim_tlv_gettlv(innerlist, 0x00da, 1)) {
+			/* Unhandled */
+		}
+#endif
 
 		aim_tlvlist_free(&innerlist);
 	}
--- a/src/protocols/oscar/im.c	Fri Dec 09 03:42:47 2005 +0000
+++ b/src/protocols/oscar/im.c	Fri Dec 09 04:05:04 2005 +0000
@@ -1436,12 +1436,20 @@
 			args->charsubset = sec->charsubset;
 
 			/* Set up the simple flags */
-			if (args->charsubset == 0x0000)
-				; /* standard subencoding? */
-			else if (args->charsubset == 0x000b)
-				args->icbmflags |= AIM_IMFLAGS_SUBENC_MACINTOSH;
-			else if (args->charsubset == 0xffff)
-				; /* no subencoding */
+			switch (args->charsubset)
+			{
+				case 0x0000:
+					/* standard subencoding? */
+					break;
+				case 0x000b:
+					args->icbmflags |= AIM_IMFLAGS_SUBENC_MACINTOSH;
+					break;
+				case 0xffff:
+					/* no subencoding */
+					break;
+				default:
+					break;
+			}
 
 			args->msg = sec->data;
 			args->msglen = sec->datalen;
@@ -1934,6 +1942,7 @@
 	if (aim_tlv_gettlv(list2, 0x000e, 1))
 		args.language = aim_tlv_getstr(list2, 0x000e, 1);
 
+#if 0
 	/*
 	 * Unknown -- no value
 	 *
@@ -1942,8 +1951,10 @@
 	 */
 	 /* I don't think this indicates a direct transfer; this flag is
 	  * also present in a stage 1 proxied file send request -- Jonathan */
-	if (aim_tlv_gettlv(list2, 0x000f, 1))
-		;
+	if (aim_tlv_gettlv(list2, 0x000f, 1)) {
+		/* Unhandled */
+	}
+#endif
 
 	/*
 	 * Flag meaning we should proxy the file transfer through an AIM server