Re: [xml] Warnings on LibXML

Date view Thread view Subject view Author view

From: Daniel Veillard (Daniel.Veillard@w3.org)
Date: Mon Sep 25 2000 - 10:15:36 EDT


On Mon, Sep 25, 2000 at 10:39:05AM -0300, Nilo S. Mismetti wrote:
> Daniel,
>
> We use LibXML under (sorry) MS VC 6.0 and we need to fix some constructs
> that cause this compiler to issue warnings. Those fixes are cosmetic but..
>
> Attached are the patches.

  Okay, I think they are not relative to 2.2.3, I have tried to integrate
them anyway. Also providing contextual patches makes my life easier.

> BTW: What compiler is used to develop libxml? This compiler does not
> generate those warnings?

I usually stick to:
  gcc -Wall -pedantic -O2 -g

  Gnu C compile with all warnings enabled.

> *HTMLparser.c
> 1254c1254
> < if (html40EntitiesTable[i].value == c) {
> ---
> > if ((unsigned int)html40EntitiesTable[i].value == c) {
> 1260c1260
> < if (html40EntitiesTable[i].value > c)
> ---
> > if ((unsigned int)html40EntitiesTable[i].value > c)
> 2673c2673
> < atts = (const xmlChar **) xmlRealloc(atts, maxatts * sizeof(xmlChar *));
> ---
> > atts = (const xmlChar **) xmlRealloc((void *) atts, maxatts * sizeof(xmlChar *));
> *parser.c
> 7876c7876
> < atts = (const xmlChar **) xmlRealloc(atts,
> ---
> > atts = (const xmlChar **) xmlRealloc((void *) atts,
> 7929c7929
> < xmlFree(atts);
> ---
> > xmlFree((void *) atts);

 Okay ... I don't really understand why MSC is unhappy there, but this
should not be a problem.

> *tree.c
> 3946c3946
> < if (len > buf->use) return(-1);
> ---
> > if (len > (int)(buf->use)) return(-1);

 I rather changed the signature to
 xmlBufferShrink(xmlBufferPtr buf, unsigned int len)
 
> 3969c3969
> < if (len <= buf->use) return(0);
> ---
> > if (len <= (int) (buf->use)) return(0);

  Same here
  xmlBufferGrow(xmlBufferPtr buf, unsigned int len)

> 4057c4057
> < if(size < buf->size)
> ---
> > if(size < (int) buf->size)
> 4120c4120
> < if(needSize > buf->size){
> ---
> > if(needSize > (int) buf->size){
> 4165c4165
> < if(needSize > buf->size){
> ---
> > if(needSize > (int) buf->size){

  Okay I have tried to clean them up too, by by changing
stuff to unsigned int where required.

    thanks for the patch,

Daniel

-- 
Daniel.Veillard@w3.org | W3C, INRIA Rhone-Alpes  | Today's Bookmarks :
Tel : +33 476 615 257  | 655, avenue de l'Europe | Linux XML libxml WWW
Fax : +33 476 615 207  | 38330 Montbonnot FRANCE | Gnome rpm2html rpmfind
 http://www.w3.org/People/all#veillard%40w3.org  | RPM badminton Kaffe
----
Message from the list xml@rpmfind.net
Archived at : http://xmlsoft.org/messages/
to unsubscribe: echo "unsubscribe xml" | mail  majordomo@rpmfind.net


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Mon Sep 25 2000 - 10:43:46 EDT