Re: [xml] xmlHashScan and *data argument

On Sun, Oct 19, 2003 at 11:31:54PM +0200, Melvyn Sopacua wrote:
Content-Description: signed data
On Sunday 19 October 2003 23:01, Daniel Veillard wrote:
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.

Ehm - then I don't know why your own code in valid.c works.

  I don't see the point. I just looked at your mail, and if the first version
works, then obviously the second version cannot work.

How is the second version different from:

  I dunno. So then your first version should not work, but you reported it
as "working", but you can't obviously have both "working".

Further investigation shows that xmlSchemaTypeDump in xmlschema.c indeed has 
the argument order you list and swapping the arguments in my function works.

  Okay, normal. There is actually  3rd argument passed if you look at the
declaration of xmlHashScanner() in libxml/hash.h


Daniel Veillard      | Red Hat Network
veillard redhat com  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

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