Kevin,<br>Maybe we can discuss if it makes sense to do those typedefs (ast_xml_text and ast_xml_attr). But the casting is being done on ->AST_XML_NAME (actually on node->name this is because of a signedness warning) and not when working with the typedefs ast_xml_attr and ast_xml_text.<br>
->name is defined as xmlChar * (libxml2 implementation, maybe 'unsigned char *' ??? didn't check it...).<br><br>To avoid this inline casting we can create a MACRO definition like NAME(a) ((const char *)a->name) and move all to this type of coding like:<br>
NEXT(a) (a->next)<br>PREV(a) (a->prev)<br>CHILD(a) (a->children)<br>(I have started coding with this approach but I think is harder to understand (??))<br><br>Hope this help you understand the problem to find (if it exists) a better solution.<br>
<br>Eliel<br><br><div class="gmail_quote">On Tue, Oct 28, 2008 at 10:32 AM, Kevin P. Fleming <span dir="ltr"><<a href="mailto:kpfleming@digium.com">kpfleming@digium.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
SVN commits to the Asterisk project wrote:<br>
<br>
> - Cast to (const char *) where we are talking about a constant value.<br>
<br>
It concerns me a bit that all this casting is being done; you've<br>
typedef'd 'char' and 'const char' with ast_xml_attr and ast_xml_text<br>
names, and then nearly every time you use the variables defined with<br>
these types you have to cast them to their underlying types.<br>
<br>
What is the value of having the typedefs in this situation?<br>
<br>
--<br>
Kevin P. Fleming<br>
Director of Software Technologies<br>
Digium, Inc. - "The Genuine Asterisk Experience" (TM)<br>
<br>
_______________________________________________<br>
--Bandwidth and Colocation Provided by <a href="http://www.api-digital.com--" target="_blank">http://www.api-digital.com--</a><br>
<br>
asterisk-dev mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
<a href="http://lists.digium.com/mailman/listinfo/asterisk-dev" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-dev</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>Eliel Sardaņons<br>