You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by an...@locus.apache.org on 2000/06/02 02:45:43 UTC

cvs commit: xml-xerces/c/src/dom AttrNSImpl.cpp DOMString.cpp DOMString.hpp DStringPool.cpp DocumentImpl.cpp ElementNSImpl.cpp

andyh       00/06/01 17:45:43

  Modified:    c/src/dom AttrNSImpl.cpp DOMString.cpp DOMString.hpp
                        DStringPool.cpp DocumentImpl.cpp ElementNSImpl.cpp
  Log:
  DOM Fixes:  DOMString::rawBuffer() now returns a const XMLCh * pointer.
  Two plain deletes changed to array deletes.
  
  Revision  Changes    Path
  1.5       +2 -2      xml-xerces/c/src/dom/AttrNSImpl.cpp
  
  Index: AttrNSImpl.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/dom/AttrNSImpl.cpp,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- AttrNSImpl.cpp	2000/04/27 16:48:31	1.4
  +++ AttrNSImpl.cpp	2000/06/02 00:45:42	1.5
  @@ -55,7 +55,7 @@
    */
   
   /*
  - * $Id: AttrNSImpl.cpp,v 1.4 2000/04/27 16:48:31 lehors Exp $
  + * $Id: AttrNSImpl.cpp,v 1.5 2000/06/02 00:45:42 andyh Exp $
    */
   
   #include "AttrNSImpl.hpp"
  @@ -159,7 +159,7 @@
           prefix.equals(xmlns) && !namespaceURI.equals(xmlnsURI))
           throw DOM_DOMException(DOM_DOMException::NAMESPACE_ERR, null);
   
  -    XMLCh *p = prefix.rawBuffer();
  +    const XMLCh *p = prefix.rawBuffer();
       for (int i = prefix.length(); --i >= 0;)
           if (*p++ == chColon)	//prefix is malformed
               throw DOM_DOMException(DOM_DOMException::NAMESPACE_ERR, null);
  
  
  
  1.17      +8 -2      xml-xerces/c/src/dom/DOMString.cpp
  
  Index: DOMString.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/dom/DOMString.cpp,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- DOMString.cpp	2000/05/09 00:22:29	1.16
  +++ DOMString.cpp	2000/06/02 00:45:42	1.17
  @@ -56,6 +56,10 @@
   
   /*
    * $Log: DOMString.cpp,v $
  + * Revision 1.17  2000/06/02 00:45:42  andyh
  + * DOM Fixes:  DOMString::rawBuffer() now returns a const XMLCh * pointer.
  + * Two plain deletes changed to array deletes.
  + *
    * Revision 1.16  2000/05/09 00:22:29  andyh
    * Memory Cleanup.  XMLPlatformUtils::Terminate() deletes all lazily
    * allocated memory; memory leak checking tools will no longer report
  @@ -168,7 +172,7 @@
       {
           fBufferLength = 0xcccc;
           fRefCount     = 0xcccc;
  -        delete this;
  +        delete [] this;  //  was allocated with new char[size] !
           XMLPlatformUtils::atomicDecrement(DOMString::gLiveStringDataCount);
       };
   };
  @@ -982,7 +986,7 @@
   
   
   
  -XMLCh *DOMString::rawBuffer() const
  +const XMLCh *DOMString::rawBuffer() const
   {
       XMLCh  *retP = 0;
       if (fHandle)
  
  
  
  1.12      +6 -1      xml-xerces/c/src/dom/DOMString.hpp
  
  Index: DOMString.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/dom/DOMString.hpp,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- DOMString.hpp	2000/03/02 19:53:52	1.11
  +++ DOMString.hpp	2000/06/02 00:45:42	1.12
  @@ -56,6 +56,10 @@
   
   /*
    * $Log: DOMString.hpp,v $
  + * Revision 1.12  2000/06/02 00:45:42  andyh
  + * DOM Fixes:  DOMString::rawBuffer() now returns a const XMLCh * pointer.
  + * Two plain deletes changed to array deletes.
  + *
    * Revision 1.11  2000/03/02 19:53:52  roddey
    * This checkin includes many changes done while waiting for the
    * 1.1.0 code to be finished. I can't list them all here, but a list is
  @@ -359,7 +363,7 @@
         *         a null being there, and do not add one, as several DOMStrings
         *         with different lengths may share the same raw buffer.
         */
  -    XMLCh       *rawBuffer() const;
  +    const XMLCh *rawBuffer() const;
   
       /**
         * Returns a copy of the string, transcoded to the local code page. The
  
  
  
  1.5       +10 -4     xml-xerces/c/src/dom/DStringPool.cpp
  
  Index: DStringPool.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/dom/DStringPool.cpp,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- DStringPool.cpp	2000/05/09 00:22:31	1.4
  +++ DStringPool.cpp	2000/06/02 00:45:42	1.5
  @@ -56,6 +56,10 @@
   
   /*
    * $Log: DStringPool.cpp,v $
  + * Revision 1.5  2000/06/02 00:45:42  andyh
  + * DOM Fixes:  DOMString::rawBuffer() now returns a const XMLCh * pointer.
  + * Two plain deletes changed to array deletes.
  + *
    * Revision 1.4  2000/05/09 00:22:31  andyh
    * Memory Cleanup.  XMLPlatformUtils::Terminate() deletes all lazily
    * allocated memory; memory leak checking tools will no longer report
  @@ -128,7 +132,7 @@
                              //   on spe->fString.
           }
       }
  -    delete fHashTable;
  +    delete [] fHashTable;
       fHashTable = 0;
   };
   
  @@ -158,9 +162,9 @@
       DStringPoolEntry    **pspe;
       DStringPoolEntry    *spe;
   
  -    XMLCh *inCharData = in.rawBuffer();
  -    int    inLength   = in.length();
  -    int    inHash     = XMLString::hashN(inCharData, inLength, fHashTableSize);
  +    const XMLCh *inCharData = in.rawBuffer();
  +    int          inLength   = in.length();
  +    int          inHash     = XMLString::hashN(inCharData, inLength, fHashTableSize);
   
       pspe = &fHashTable[inHash];
       while (*pspe != 0)
  
  
  
  1.25      +5 -5      xml-xerces/c/src/dom/DocumentImpl.cpp
  
  Index: DocumentImpl.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/dom/DocumentImpl.cpp,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- DocumentImpl.cpp	2000/05/13 03:51:17	1.24
  +++ DocumentImpl.cpp	2000/06/02 00:45:42	1.25
  @@ -55,7 +55,7 @@
    */
   
   /*
  - * $Id: DocumentImpl.cpp,v 1.24 2000/05/13 03:51:17 andyh Exp $
  + * $Id: DocumentImpl.cpp,v 1.25 2000/06/02 00:45:42 andyh Exp $
    */
   
   //
  @@ -423,9 +423,9 @@
   
   bool DocumentImpl::isXMLName(const DOMString &s)
   {
  -    XMLCh       *nam;
  -    int         length;
  -    int         i;
  +    const XMLCh   *nam;
  +    int           length;
  +    int           i;
   
       length = s.length();
       if (length == 0)
  @@ -673,7 +673,7 @@
   int DocumentImpl::indexofQualifiedName(const DOMString & qName)
   {
       //Check if s = prefix:localName, name or malformed
  -    XMLCh *qNameP = qName.rawBuffer();
  +    const XMLCh *qNameP = qName.rawBuffer();
       int qNameLen = qName.length();	//note: qName[qNameLen] may not be 0
       int index = -1, count = 0;
       for (int i = 0; i < qNameLen; ++i)
  
  
  
  1.5       +2 -2      xml-xerces/c/src/dom/ElementNSImpl.cpp
  
  Index: ElementNSImpl.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/dom/ElementNSImpl.cpp,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ElementNSImpl.cpp	2000/04/27 16:48:32	1.4
  +++ ElementNSImpl.cpp	2000/06/02 00:45:43	1.5
  @@ -55,7 +55,7 @@
    */
   
   /*
  - * $Id: ElementNSImpl.cpp,v 1.4 2000/04/27 16:48:32 lehors Exp $
  + * $Id: ElementNSImpl.cpp,v 1.5 2000/06/02 00:45:43 andyh Exp $
    */
   
   #include "ElementNSImpl.hpp"
  @@ -153,7 +153,7 @@
       if (prefix.equals(xml) && !namespaceURI.equals(xmlURI))
           throw DOM_DOMException(DOM_DOMException::NAMESPACE_ERR, null);
   
  -    XMLCh *p = prefix.rawBuffer();
  +    const XMLCh *p = prefix.rawBuffer();
       for (int i = prefix.length(); --i >= 0;)
           if (*p++ == chColon)	//prefix is malformed
               throw DOM_DOMException(DOM_DOMException::NAMESPACE_ERR, null);