pidgin: dc089964: There's no reason for these to not be co...

markdoliner at pidgin.im markdoliner at pidgin.im
Tue Feb 3 14:00:39 EST 2009


-----------------------------------------------------------------
Revision: dc0899640f2cbdc61ae620164e75040af4cc518e
Ancestor: e7bbccbdd28ee480316e5ea52820fcf82963ba2c
Author: markdoliner at pidgin.im
Date: 2009-02-03T18:56:17
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/dc0899640f2cbdc61ae620164e75040af4cc518e

Modified files:
        ChangeLog.API libpurple/xmlnode.c libpurple/xmlnode.h

ChangeLog: 

There's no reason for these to not be const is there?  This doesn't
break API compatibility in my mind.  Does anyone think it does?

-------------- next part --------------
============================================================
--- ChangeLog.API	49cd1ef7e59da431e4b50328d9b83fa0e50b9b91
+++ ChangeLog.API	28096e8e2d536152bc5831d92228e2a4e4569373
@@ -6,6 +6,8 @@ version 2.5.5 (??/??/2009):
 		* purple_status_type_new now defaults "saveable" to TRUE.
 		  This was necessary in order to maintain the current behavior
 		  while fixing non-saveable statuses not to be saved.
+		* xmlnode_get_prefix, xmlnode_to_str and xmlnode_to_formatted_str
+		  now all take a const xmlnode* instead of an xmlnode*
 
 version 2.5.4 (01/12/2009):
 	perl:
============================================================
--- libpurple/xmlnode.c	8450c70dd642176ba737edf52c09242716190d47
+++ libpurple/xmlnode.c	90698253f9e15bd5a840e8ddd792f60c0e1cfc0c
@@ -303,7 +303,7 @@ void xmlnode_set_prefix(xmlnode *node, c
 	node->prefix = g_strdup(prefix);
 }
 
-const char *xmlnode_get_prefix(xmlnode *node)
+const char *xmlnode_get_prefix(const xmlnode *node)
 {
 	g_return_val_if_fail(node != NULL, NULL);
 	return node->prefix;
@@ -443,11 +443,11 @@ static char *
 }
 
 static char *
-xmlnode_to_str_helper(xmlnode *node, int *len, gboolean formatting, int depth)
+xmlnode_to_str_helper(const xmlnode *node, int *len, gboolean formatting, int depth)
 {
 	GString *text = g_string_new("");
 	const char *prefix;
-	xmlnode *c;
+	const xmlnode *c;
 	char *node_name, *esc, *esc2, *tab = NULL;
 	gboolean need_end = FALSE, pretty = formatting;
 
@@ -537,13 +537,13 @@ char *
 }
 
 char *
-xmlnode_to_str(xmlnode *node, int *len)
+xmlnode_to_str(const xmlnode *node, int *len)
 {
 	return xmlnode_to_str_helper(node, len, FALSE, 0);
 }
 
 char *
-xmlnode_to_formatted_str(xmlnode *node, int *len)
+xmlnode_to_formatted_str(const xmlnode *node, int *len)
 {
 	char *xml, *xml_with_declaration;
 
============================================================
--- libpurple/xmlnode.h	f73fde22673b21debb1d446f81d715725367b377
+++ libpurple/xmlnode.h	86ca24666dcb3ff65d00994e6694dfe1109c1085
@@ -243,7 +243,7 @@ void xmlnode_set_prefix(xmlnode *node, c
  * @param node The node to get the prefix from
  * @return The prefix of this node
  */
-const char *xmlnode_get_prefix(xmlnode *node);
+const char *xmlnode_get_prefix(const xmlnode *node);
 
 /**
  * Returns the node in a string of xml.
@@ -254,7 +254,7 @@ const char *xmlnode_get_prefix(xmlnode *
  * @return The node represented as a string.  You must
  *         g_free this string when finished using it.
  */
-char *xmlnode_to_str(xmlnode *node, int *len);
+char *xmlnode_to_str(const xmlnode *node, int *len);
 
 /**
  * Returns the node in a string of human readable xml.
@@ -266,7 +266,7 @@ char *xmlnode_to_str(xmlnode *node, int 
  *         tab and new line characters.  You must
  *         g_free this string when finished using it.
  */
-char *xmlnode_to_formatted_str(xmlnode *node, int *len);
+char *xmlnode_to_formatted_str(const xmlnode *node, int *len);
 
 /**
  * Creates a node from a string of XML.  Calling this on the


More information about the Commits mailing list