[xml] Few Casts



Hi,

I added few casts. MS compiler won't convert a const object to a non-const
one without displaying a warning. I'm tired of those warnings :-)

Is that okay with everyone?

Ciao,
Igor


Index: DOCBparser.c
===================================================================
RCS file: /cvs/gnome/libxml2/DOCBparser.c,v
retrieving revision 1.40
diff -c -r1.40 DOCBparser.c
*** DOCBparser.c 18 Aug 2003 12:15:32 -0000 1.40
--- DOCBparser.c 28 Aug 2003 10:28:08 -0000
***************
*** 118,124 ****
      if (ctxt->nameNr >= ctxt->nameMax) {
          ctxt->nameMax *= 2;
          ctxt->nameTab = (const xmlChar * *)
!                          xmlRealloc(ctxt->nameTab,
                                      ctxt->nameMax *
                                      sizeof(ctxt->nameTab[0]));
          if (ctxt->nameTab == NULL) {
--- 118,124 ----
      if (ctxt->nameNr >= ctxt->nameMax) {
          ctxt->nameMax *= 2;
          ctxt->nameTab = (const xmlChar * *)
!                          xmlRealloc((xmlChar * *)ctxt->nameTab,
                                      ctxt->nameMax *
                                      sizeof(ctxt->nameTab[0]));
          if (ctxt->nameTab == NULL) {
Index: HTMLparser.c
===================================================================
RCS file: /cvs/gnome/libxml2/HTMLparser.c,v
retrieving revision 1.155
diff -c -r1.155 HTMLparser.c
*** HTMLparser.c 18 Aug 2003 12:15:32 -0000 1.155
--- HTMLparser.c 28 Aug 2003 10:28:10 -0000
***************
*** 78,84 ****
      if (ctxt->nameNr >= ctxt->nameMax) {
          ctxt->nameMax *= 2;
          ctxt->nameTab = (const xmlChar * *)
!                          xmlRealloc(ctxt->nameTab,
                                      ctxt->nameMax *
                                      sizeof(ctxt->nameTab[0]));
          if (ctxt->nameTab == NULL) {
--- 78,84 ----
      if (ctxt->nameNr >= ctxt->nameMax) {
          ctxt->nameMax *= 2;
          ctxt->nameTab = (const xmlChar * *)
!                          xmlRealloc((xmlChar * *)ctxt->nameTab,
                                      ctxt->nameMax *
                                      sizeof(ctxt->nameTab[0]));
          if (ctxt->nameTab == NULL) {
Index: parser.c
===================================================================
RCS file: /cvs/gnome/libxml2/parser.c,v
retrieving revision 1.283
diff -c -r1.283 parser.c
*** parser.c 20 Aug 2003 22:54:38 -0000 1.283
--- parser.c 28 Aug 2003 10:28:13 -0000
***************
*** 254,260 ****
      if (ctxt->nameNr >= ctxt->nameMax) {
          ctxt->nameMax *= 2;
          ctxt->nameTab = (const xmlChar * *)
!                   xmlRealloc(ctxt->nameTab,
                                      ctxt->nameMax *
                                      sizeof(ctxt->nameTab[0]));
          if (ctxt->nameTab == NULL) {
--- 254,260 ----
      if (ctxt->nameNr >= ctxt->nameMax) {
          ctxt->nameMax *= 2;
          ctxt->nameTab = (const xmlChar * *)
!                   xmlRealloc((xmlChar * *)ctxt->nameTab,
                                      ctxt->nameMax *
                                      sizeof(ctxt->nameTab[0]));
          if (ctxt->nameTab == NULL) {
Index: parserInternals.c
===================================================================
RCS file: /cvs/gnome/libxml2/parserInternals.c,v
retrieving revision 1.78
diff -c -r1.78 parserInternals.c
*** parserInternals.c 19 Aug 2003 15:01:26 -0000 1.78
--- parserInternals.c 28 Aug 2003 10:28:14 -0000
***************
*** 2360,2366 ****
          xmlFreeInputStream(input);
      }
      if (ctxt->spaceTab != NULL) xmlFree(ctxt->spaceTab);
!     if (ctxt->nameTab != NULL) xmlFree(ctxt->nameTab);
      if (ctxt->nodeTab != NULL) xmlFree(ctxt->nodeTab);
      if (ctxt->inputTab != NULL) xmlFree(ctxt->inputTab);
      if (ctxt->version != NULL) xmlFree((char *) ctxt->version);
--- 2360,2366 ----
          xmlFreeInputStream(input);
      }
      if (ctxt->spaceTab != NULL) xmlFree(ctxt->spaceTab);
!     if (ctxt->nameTab != NULL) xmlFree((xmlChar * *)ctxt->nameTab);
      if (ctxt->nodeTab != NULL) xmlFree(ctxt->nodeTab);
      if (ctxt->inputTab != NULL) xmlFree(ctxt->inputTab);
      if (ctxt->version != NULL) xmlFree((char *) ctxt->version);
***************
*** 2371,2377 ****
          xmlFree(ctxt->sax);
      if (ctxt->directory != NULL) xmlFree((char *) ctxt->directory);
      if (ctxt->vctxt.nodeTab != NULL) xmlFree(ctxt->vctxt.nodeTab);
!     if (ctxt->atts != NULL) xmlFree(ctxt->atts);
      if (ctxt->dict != NULL) xmlDictFree(ctxt->dict);
  #ifdef LIBXML_CATALOG_ENABLED
      if (ctxt->catalogs != NULL)
--- 2371,2377 ----
          xmlFree(ctxt->sax);
      if (ctxt->directory != NULL) xmlFree((char *) ctxt->directory);
      if (ctxt->vctxt.nodeTab != NULL) xmlFree(ctxt->vctxt.nodeTab);
!     if (ctxt->atts != NULL) xmlFree((xmlChar * *)ctxt->atts);
      if (ctxt->dict != NULL) xmlDictFree(ctxt->dict);
  #ifdef LIBXML_CATALOG_ENABLED
      if (ctxt->catalogs != NULL)




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