diff libpurple/protocols/jabber/buddy.c @ 21015:787b3897ba9f

Patch from Andrew Gaul to constify a bunch of static variables to reduce the amount of writable memory +08108000 12K rwx-- /local/local/bin/pidgin -08107000 16K rwx-- /local/local/bin/pidgin +005bf000 20K rwx-- /local/local/lib/libpurple.so.0.2.1 -005be000 24K rwx-- /local/local/lib/libpurple.so.0.2.1
author Ka-Hing Cheung <khc@hxbc.us>
date Fri, 26 Oct 2007 04:59:23 +0000
parents c1d3d25e8c49
children 0d6e582f2679
line wrap: on
line diff
--- a/libpurple/protocols/jabber/buddy.c	Fri Oct 26 00:13:18 2007 +0000
+++ b/libpurple/protocols/jabber/buddy.c	Fri Oct 26 04:59:23 2007 +0000
@@ -279,7 +279,7 @@
 	char *tag;			/* tag text */
 	char *ptag;			/* parent tag "path" text */
 	char *url;			/* vCard display format if URL */
-} vcard_template_data[] = {
+} const vcard_template_data[] = {
 	{N_("Full Name"),          NULL, TRUE, TRUE, "FN",        NULL,  NULL},
 	{N_("Family Name"),        NULL, TRUE, TRUE, "FAMILY",    "N",   NULL},
 	{N_("Given Name"),         NULL, TRUE, TRUE, "GIVEN",     "N",   NULL},
@@ -311,7 +311,7 @@
 struct tag_attr {
 	char *attr;
 	char *value;
-} vcard_tag_attr_list[] = {
+} const vcard_tag_attr_list[] = {
 	{"prodid",   "-//HandGen//NONSGML vGen v1.0//EN"},
 	{"version",  "2.0",                             },
 	{"xmlns",    "vcard-temp",                      },
@@ -337,7 +337,7 @@
 	 * from the vCard template struct.
 	 */
 	if(parent_tag == NULL) {
-		struct vcard_template *vc_tp = vcard_template_data;
+		const struct vcard_template *vc_tp = vcard_template_data;
 
 		while(vc_tp->label != NULL) {
 			if(strcmp(vc_tp->tag, new_tag) == 0) {
@@ -395,7 +395,7 @@
 	JabberIq *iq;
 	JabberStream *js = gc->proto_data;
 	xmlnode *vc_node;
-	struct tag_attr *tag_attr;
+	const struct tag_attr *tag_attr;
 
 	/* if we have't grabbed the remote vcard yet, we can't
 	 * assume that what we have here is correct */
@@ -614,7 +614,7 @@
 	const char *text;
 	char *p;
 	const struct vcard_template *vc_tp;
-	struct tag_attr *tag_attr;
+	const struct tag_attr *tag_attr;
 
 	vc_node = xmlnode_new("vCard");