Re: [xml] xmlHashScan and *data argument



On Sun, Oct 19, 2003 at 10:43:33PM +0200, Melvyn Sopacua wrote:
Content-Description: signed data
This works:
========================================================================
void printElementStructured(xmlElementPtr el)
[...]
This doesn't:
========================================================================
void printElementStructured(int *level, xmlElementPtr el)
{
[...]
      xmlHashScan(table, (xmlHashScanner) printElementStructured, &level);

 And you're surprised ?
 Your problem is the use of the C language apparently. You cannot expect
to shuffle arguments and have the compiler guess magically that your interface
changed and reorder arguments.
 xmlElementPtr is the first argument, changing it to the second one is
unlikely to work with any C compiler. Parameters are accessed by index
on the stack relative to the current function frame pointer, not by magic
name association.

Daniel

-- 
Daniel Veillard      | Red Hat Network https://rhn.redhat.com/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]