Re: [xml] XPath Fix (part 1)

On Tue, Mar 26, 2002 at 03:49:36PM -0000, Richard Jinks wrote:

Attached is the patch file for the first set of fixes for XPath.
As mentioned earlier, these cover -

I've added two new functions to trionan.c to check / set the sign of a
(VC++6 doesn't like double a=-0.0 as Bjorn suggested, so I put a function
to set it).
I've also made the mods to the XPath math functions so they return -0 in
correct places, and does floating point mods.
As a temporary fix, I've modified xmlXPatherror so that it doesn't report
the filename / line number

   Applied, but they're aren't very clean :-)

gcc -DHAVE_CONFIG_H -I. -I. -I. -I./include -I./include -g -O -pedantic -W -Wunused -Wimplicit -Wreturn-type 
-Wswitch -Wcomment -Wtrigraphs -Wformat -Wchar-subscripts -Wuninitialized -Wparentheses -Wshadow 
-Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes 
-Wnested-externs -Winline -Wredundant-decls -Wp,-MD,.deps/xpath.pp -c xpath.c -o xpath.o
xpath.c:4778:2: warning: C++ style comments are not allowed in ISO C89
xpath.c:4778:2: warning: (this will be reported only once per input file)
xpath.c:159: warning: no previous prototype for `xmlXPathGetSign'
xpath.c: In function `xmlXPatherror':
xpath.c:1278: warning: unused parameter `file'
xpath.c:1279: warning: unused parameter `line'

  I will have to do a bit of cleanup it seems ...

I generated the patch file by running "cvs -z3 diff -c" as suggested, and it
put the changes for both files in the one output file. Is this alright, or

  That's allright !

WRT the changes to trionan.c -
The two new functions (trio_get_sign() and trio_nzero()) are protected by
the #if defined (USE_IEEE754) guard.
I'm afraid that someone else will need to look into a more generic
implementation of these two functions as I can't get hold of any platforms
that don't go through this guard to test on.
My understanding of different hardware and floating point maths isn't good
enough to warrant trying
to guess what might work. I would need to call upon some outside assistance
to help with this.

  BTW trio is actually imported from a separate project, Bjorn is the
one maintaining this code.


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]