[asterisk-commits] eliel: branch eliel/data_retrieval r186290 - /team/eliel/data_retrieval/main/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Apr 3 09:36:58 CDT 2009


Author: eliel
Date: Fri Apr  3 09:36:55 2009
New Revision: 186290

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=186290
Log:
Try to avoid casting.

Modified:
    team/eliel/data_retrieval/main/data.c

Modified: team/eliel/data_retrieval/main/data.c
URL: http://svn.digium.com/svn-view/asterisk/team/eliel/data_retrieval/main/data.c?view=diff&rev=186290&r1=186289&r2=186290
==============================================================================
--- team/eliel/data_retrieval/main/data.c (original)
+++ team/eliel/data_retrieval/main/data.c Fri Apr  3 09:36:55 2009
@@ -410,9 +410,9 @@
  * \retval NULL on error.
  * \retval A pointer to the last allocated node.
  */
-static struct ast_xml_node *data_xml_node_create(struct ast_data_node *root_node, const char *path)
-{
-	struct ast_xml_node *node, *child;
+static struct ast_xml_node *data_xml_node_create(struct ast_data_node *root, const char *path)
+{
+	struct ast_xml_node *node, *child, *root_node = (struct ast_xml_node *) root;
 	char *rpath, *node_name;
 
 	if (!root_node || !path) {
@@ -431,12 +431,12 @@
 	}
 
 	/* check the name and continue. */
-	if (strcasecmp(ast_xml_node_get_name((struct ast_xml_node *) root_node), node_name)) {
+	if (strcasecmp(ast_xml_node_get_name(root_node), node_name)) {
 		ast_log(LOG_ERROR, "Invalid path, you already have a root node named %s\n",
-				ast_xml_node_get_name((struct ast_xml_node *) root_node));
-		return NULL;
-	}
-	node = (struct ast_xml_node *) root_node;
+				ast_xml_node_get_name(root_node));
+		return NULL;
+	}
+	node = root_node;
 
 	node_name = next_node_name(&rpath);
 	while (node_name) {




More information about the asterisk-commits mailing list