Re: [xml] Build xml2 library on NEC SX



On Tue, Sep 16, 2003 at 01:28:49PM +0200, Thomas Schoenemeyer wrote:
Hi, 

for installing libxml2 on NEC SX systems, it is necessary to change following routines

  Hum, your patches are reversed and not contextual use 
     diff -c xxx.orig xxx
instead

1) nanohttp.c.

 diff nanohttp.c  nanohttp.c_orig
  532c532
<             int nsent = send(ctxt->fd, (char*)xmt_ptr + total_sent,
---
            int nsent = send(ctxt->fd, xmt_ptr + total_sent,

  Hum, send is really using a const pointer. That cast should not be
needed and 
    int send(int s, const void *msg, size_t len, int flags);

  Send should not modify the buffer passed by the application (that would
be a serious Posix breakage I think), the current code takes a
   const char * xmt_ptr
and calculate an offset from it, the pointer passed is still a 
const char * I think and it's surprizing that the compiler complains 
about this ...

  What's happen if you use
    int nsent = send(ctxt->fd, (const char *) xmt_ptr + total_sent,

2) xmlIO.c

diff xmlIO.c xmlIO.c_orig
431c431
<     items = fwrite((char*)&buffer[0], len, 1, (FILE *) context);
---
    items = fwrite(&buffer[0], len, 1, (FILE *) context);
[k209009 ds3 ~/libxml2-2.5.11]$

  Similar, buffer is a const char *, no cast should be needed,
fwrite should not modify the user buffer.

  Can you investigate this a little bit ?

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]