dbertoni    01/09/25 14:13:17

  Modified:    c/src/XMLSupport FormatterToDOM.cpp FormatterToHTML.cpp
                        FormatterToHTML.hpp FormatterToXML.cpp
                        FormatterToXML.hpp FormatterTreeWalker.cpp
  Log:
  32/64-bit fixes.
  
  Revision  Changes    Path
  1.17      +2 -2      xml-xalan/c/src/XMLSupport/FormatterToDOM.cpp
  
  Index: FormatterToDOM.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XMLSupport/FormatterToDOM.cpp,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- FormatterToDOM.cpp        2001/06/29 18:45:47     1.16
  +++ FormatterToDOM.cpp        2001/09/25 21:13:17     1.17
  @@ -386,8 +386,8 @@
                        const PrefixResolver&   thePrefixResolver,
                        XalanDOMString&                 thePrefix)
   {
  -     const unsigned int      theLength = length(theName);
  -     const unsigned int      theColonIndex = indexOf(theName, 
XalanUnicode::charColon);
  +     const XalanDOMString::size_type         theLength = length(theName);
  +     const XalanDOMString::size_type         theColonIndex = 
indexOf(theName, XalanUnicode::charColon);
   
        if (theColonIndex == theLength)
        {
  
  
  
  1.62      +18 -18    xml-xalan/c/src/XMLSupport/FormatterToHTML.cpp
  
  Index: FormatterToHTML.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XMLSupport/FormatterToHTML.cpp,v
  retrieving revision 1.61
  retrieving revision 1.62
  diff -u -r1.61 -r1.62
  --- FormatterToHTML.cpp       2001/09/14 15:38:29     1.61
  +++ FormatterToHTML.cpp       2001/09/25 21:13:17     1.62
  @@ -148,7 +148,7 @@
        m_attrCharsMap[XalanUnicode::charLessThanSign] = 0;
        m_attrCharsMap[XalanUnicode::charGreaterThanSign] = 0;
   
  -     for(unsigned int i = 160; i < SPECIALSSIZE; i++)
  +     for(XalanDOMString::size_type i = 160; i < SPECIALSSIZE; i++)
        {
                m_attrCharsMap[i] = 'S';
        }
  @@ -652,8 +652,8 @@
   
   void
   FormatterToHTML::writeCharacters(
  -                     const XalanDOMChar*             theString,
  -                     unsigned int                    theLength)
  +                     const XalanDOMChar*                     theString,
  +                     XalanDOMString::size_type       theLength)
   {
        assert(theString != 0);
   
  @@ -662,7 +662,7 @@
                theLength = length(theString);
        }
   
  -     for (unsigned int i = 0; i < theLength; ++i) 
  +     for (XalanDOMString::size_type i = 0; i < theLength; ++i) 
        {
                const XalanDOMChar      ch = theString[i];
   
  @@ -679,7 +679,7 @@
                        if (m_isUTF8 == true && 0xd800 <= ch && ch < 0xdc00)
                        {
                                // UTF-16 surrogate
  -                             unsigned int    next = 0;
  +                             XalanDOMChar    next = 0;
   
                                if (i + 1 >= theLength) 
                                {
  @@ -694,7 +694,7 @@
                                                
throwInvalidUTF16SurrogateException(ch, next);
                                        }
   
  -                                     next = ((ch - 0xd800) << 10) + next - 
0xdc00 + 0x00010000;
  +                                     next = XalanDOMChar(((ch - 0xd800) << 
10) + next - 0xdc00 + 0x00010000);
                                }
   
                                writeNumberedEntityReference(next);
  @@ -719,9 +719,9 @@
   {
        assert(theString != 0);
   
  -    const unsigned int       theLength = length(theString);
  +    const XalanDOMString::size_type          theLength = length(theString);
   
  -    for (unsigned int i = 0;  i < theLength;  i ++)
  +    for (XalanDOMString::size_type i = 0;  i < theLength;  i ++)
       {
                const XalanDOMChar      ch = theString[i];
   
  @@ -741,7 +741,7 @@
                        {
                                // UTF-16 surrogate
   
  -                             unsigned int next = 0;
  +                             XalanDOMChar    next = 0;
   
                                if (i + 1 >= theLength) 
                                {
  @@ -756,7 +756,7 @@
                                                
throwInvalidUTF16SurrogateException(ch, next);
                                        }
   
  -                                     next = ((ch - 0xd800) << 10) + next 
-0xdc00 + 0x00010000;
  +                                     next = XalanDOMChar(((ch - 0xd800) << 
10) + next -0xdc00 + 0x00010000);
                                }
   
                                accumContent(XalanUnicode::charAmpersand);
  @@ -788,11 +788,11 @@
   void
   FormatterToHTML::copyEntityIntoBuffer(const XalanDOMChar*    s)
   {
  -     const unsigned int      len = length(s);
  +     const XalanDOMString::size_type         len = length(s);
   
       accumContent(XalanUnicode::charAmpersand);
   
  -    for(unsigned int i = 0; i < len; ++i)
  +    for(XalanDOMString::size_type i = 0; i < len; ++i)
       {
                accumContent(s[i]);
       }
  @@ -805,11 +805,11 @@
   void
   FormatterToHTML::copyEntityIntoBuffer(const XalanDOMString&          s)
   {
  -     const unsigned int      len = length(s);
  +     const XalanDOMString::size_type         len = length(s);
   
       accumContent(XalanUnicode::charAmpersand);
   
  -    for(unsigned int i = 0; i < len; ++i)
  +    for(XalanDOMString::size_type i = 0; i < len; ++i)
       {
                accumContent(charAt(s, i));
       }
  @@ -873,9 +873,9 @@
        // causing damage.      If the URL is already properly escaped, in 
theory, this 
        // function should not change the string value.
   
  -     const unsigned int      len = length(theString);
  +     const XalanDOMString::size_type         len = length(theString);
   
  -    for (unsigned int i = 0; i < len; ++i)
  +    for (XalanDOMString::size_type i = 0; i < len; ++i)
       {
                const XalanDOMChar      ch = theString[i];
   
  @@ -1060,8 +1060,8 @@
   
        if (m_prefixResolver != 0)
        {
  -             const unsigned int      theLength = length(theElementName);
  -             const unsigned int      theColonIndex = indexOf(theElementName, 
XalanUnicode::charColon);
  +             const XalanDOMString::size_type         theLength = 
length(theElementName);
  +             const XalanDOMString::size_type         theColonIndex = 
indexOf(theElementName, XalanUnicode::charColon);
   
                const XalanDOMString*   thePrefix = &s_emptyString;
   
  
  
  
  1.28      +8 -8      xml-xalan/c/src/XMLSupport/FormatterToHTML.hpp
  
  Index: FormatterToHTML.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XMLSupport/FormatterToHTML.hpp,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- FormatterToHTML.hpp       2001/09/14 15:38:29     1.27
  +++ FormatterToHTML.hpp       2001/09/25 21:13:17     1.28
  @@ -58,7 +58,7 @@
   #define FORMATTERTOHTML_HEADER_GUARD_1357924680
   
   /**
  - * $Id: FormatterToHTML.hpp,v 1.27 2001/09/14 15:38:29 dbertoni Exp $
  + * $Id: FormatterToHTML.hpp,v 1.28 2001/09/25 21:13:17 dbertoni Exp $
    * 
    * $State: Exp $
    * 
  @@ -172,11 +172,11 @@
   
        virtual bool
        accumDefaultEntity(
  -                     XalanDOMChar            ch,
  -                     unsigned int            i,
  -                     const XalanDOMChar      chars[],
  -                     unsigned int            len,
  -                     bool                            escLF);
  +                     XalanDOMChar                            ch,
  +                     XalanDOMString::size_type       i,
  +                     const XalanDOMChar                      chars[],
  +                     XalanDOMString::size_type       len,
  +                     bool                                            escLF);
   
        // These methods are inherited from FormatterListener ...
   
  @@ -305,8 +305,8 @@
   
        void
        writeCharacters(
  -                     const XalanDOMChar*             theString,
  -                     unsigned int                    theLength = 
unsigned(-1));
  +                     const XalanDOMChar*                     theString,
  +                     XalanDOMString::size_type       theLength = 
XalanDOMString::npos);
   
   private:
   
  
  
  
  1.52      +22 -22    xml-xalan/c/src/XMLSupport/FormatterToXML.cpp
  
  Index: FormatterToXML.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XMLSupport/FormatterToXML.cpp,v
  retrieving revision 1.51
  retrieving revision 1.52
  diff -u -r1.51 -r1.52
  --- FormatterToXML.cpp        2001/07/08 18:16:12     1.51
  +++ FormatterToXML.cpp        2001/09/25 21:13:17     1.52
  @@ -324,10 +324,10 @@
   {
        memset(m_attrCharsMap, 0, sizeof(m_attrCharsMap));
   
  -     const unsigned int      nSpecials = length(m_attrSpecialChars);
  +     const XalanDOMString::size_type         nSpecials = 
length(m_attrSpecialChars);
   
        {
  -             for(unsigned int i = 0; i < nSpecials; ++i)
  +             for(XalanDOMString::size_type i = 0; i < nSpecials; ++i)
                {
                        m_attrCharsMap[charAt(m_attrSpecialChars, i)] = 'S';
                }
  @@ -728,7 +728,7 @@
   void
   FormatterToXML::throwInvalidUTF16SurrogateException(
                        XalanDOMChar    ch,
  -                     unsigned int    next)
  +                     XalanDOMChar    next)
   {
        const XalanDOMString    theMessage(TranscodeFromLocalCodePage("Invalid 
UTF-16 surrogate detected: ") +
                                                                           
UnsignedLongToHexDOMString(ch) +
  @@ -742,18 +742,18 @@
   
   void
   FormatterToXML::accumDefaultEscape(
  -                     XalanDOMChar            ch,
  -                     unsigned int            i,
  -                     const XalanDOMChar      chars[],
  -                     unsigned int            len,
  -                     bool                            escLF)
  +                     XalanDOMChar                            ch,
  +                     XalanDOMString::size_type       i,
  +                     const XalanDOMChar                      chars[],
  +                     XalanDOMString::size_type       len,
  +                     bool                                            escLF)
   {
        if(!accumDefaultEntity(ch, i, chars, len, escLF))
        {
                if (0xd800 <= ch && ch < 0xdc00) 
                {
                        // UTF-16 surrogate
  -                     unsigned int next = 0;
  +                     XalanDOMChar    next = 0;
   
                        if (i + 1 >= len) 
                        {
  @@ -768,7 +768,7 @@
                                        throwInvalidUTF16SurrogateException(ch, 
next);
                                }
   
  -                             next = ((ch - 0xd800u) << 10) + next - 0xdc00u 
+ 0x00010000u;
  +                             next = XalanDOMChar(((ch - 0xd800u) << 10) + 
next - 0xdc00u + 0x00010000u);
                        }
   
                        writeNumberedEntityReference(next);
  @@ -791,11 +791,11 @@
   
   bool
   FormatterToXML::accumDefaultEntity(
  -                     XalanDOMChar            ch,
  -                     unsigned int            i,
  -                     const XalanDOMChar      chars[],
  -                     unsigned int            len,
  -                     bool                            escLF)
  +                     XalanDOMChar                            ch,
  +                     XalanDOMString::size_type       i,
  +                     const XalanDOMChar                      chars[],
  +                     XalanDOMString::size_type       len,
  +                     bool                                            escLF)
   {
        if (escLF == false &&
                XalanUnicode::charCR == ch &&
  @@ -1086,7 +1086,7 @@
                        accumName(XalanUnicode::charQuestionMark);
                        accumName(target);
   
  -                     const unsigned int      len = length(data);
  +                     const XalanDOMString::size_type         len = 
length(data);
   
                        if ( len > 0 && !isXMLWhitespace(data[0]))
                        {
  @@ -1181,9 +1181,9 @@
   void
   FormatterToXML::writeAttrString(const XalanDOMChar*          theString)
   {
  -    const unsigned int       len = length(theString);
  +    const XalanDOMString::size_type          len = length(theString);
   
  -    for (unsigned int i = 0;  i < len;  i ++) 
  +    for (XalanDOMString::size_type i = 0;  i < len;  i ++) 
       {
                const XalanDOMChar      ch = theString[i];
   
  @@ -1246,7 +1246,7 @@
                        if (0xd800u <= unsigned(c) && unsigned(c) < 0xdc00) 
                        {
                                // UTF-16 surrogate
  -                             unsigned int    next = 0;
  +                             XalanDOMChar    next = 0;
   
                                if (i + 1 >= end) 
                                {
  @@ -1261,7 +1261,7 @@
                                                
throwInvalidUTF16SurrogateException(c, next);
                                        }
   
  -                                     next = ((c - 0xd800) << 10) + next - 
0xdc00 + 0x00010000;
  +                                     next = XalanDOMChar(((c - 0xd800) << 
10) + next - 0xdc00 + 0x00010000);
                                }
   
                                writeNumberedEntityReference(next);
  @@ -1320,7 +1320,7 @@
                        else if (0xd800 <= c && c < 0xdc00)
                        {
                                // UTF-16 surrogate
  -                             unsigned int    next = 0;
  +                             XalanDOMChar    next = 0;
   
                                if (i + 1 >= end) 
                                {
  @@ -1335,7 +1335,7 @@
                                                
throwInvalidUTF16SurrogateException(c, next);
                                        }
   
  -                                     next = ((c - 0xd800) << 10) + next - 
0xdc00 + 0x00010000;
  +                                     next = XalanDOMChar(((c - 0xd800) << 
10) + next - 0xdc00 + 0x00010000);
                                }
   
                                writeNumberedEntityReference(next);
  
  
  
  1.35      +37 -37    xml-xalan/c/src/XMLSupport/FormatterToXML.hpp
  
  Index: FormatterToXML.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XMLSupport/FormatterToXML.hpp,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- FormatterToXML.hpp        2001/07/08 18:16:12     1.34
  +++ FormatterToXML.hpp        2001/09/25 21:13:17     1.35
  @@ -338,8 +338,8 @@
   
        typedef void (FormatterToXML::*AccumArrayFunctionType)(
                                                const XalanDOMChar[],
  -                                             unsigned int,
  -                                             unsigned int);
  +                                             XalanDOMString::size_type,
  +                                             XalanDOMString::size_type);
   
        typedef void (FormatterToXML::*FlushFunctionType)();
   
  @@ -418,9 +418,9 @@
         */
        void
        accumName(
  -                     const XalanDOMChar      chars[],
  -                     unsigned int            start,
  -                     unsigned int            length)
  +                     const XalanDOMChar                      chars[],
  +                     XalanDOMString::size_type       start,
  +                     XalanDOMString::size_type       length)
        {
                assert(m_accumNameArrayFunction != 0);
   
  @@ -436,9 +436,9 @@
         */
        void
        accumContent(
  -                     const XalanDOMChar      chars[],
  -                     unsigned int            start,
  -                     unsigned int            length)
  +                     const XalanDOMChar                      chars[],
  +                     XalanDOMString::size_type       start,
  +                     XalanDOMString::size_type       length)
        {
                assert(m_accumContentArrayFunction != 0);
   
  @@ -480,11 +480,11 @@
         */
        void
        accumDefaultEscape(
  -                     XalanDOMChar            ch,
  -                     unsigned int            i,
  -                     const XalanDOMChar      chars[],
  -                     unsigned int            len,
  -                     bool                            escLF);
  +                     XalanDOMChar                            ch,
  +                     XalanDOMString::size_type       i,
  +                     const XalanDOMChar                      chars[],
  +                     XalanDOMString::size_type       len,
  +                     bool                                            escLF);
   
        /**
         * Handle one of the default entities, return false if it 
  @@ -492,11 +492,11 @@
        */
        virtual bool
        accumDefaultEntity(
  -                     XalanDOMChar            ch,
  -                     unsigned int            i,
  -                     const XalanDOMChar      chars[],
  -                     unsigned int            len,
  -                     bool                            escLF);
  +                     XalanDOMChar                            ch,
  +                     XalanDOMString::size_type       i,
  +                     const XalanDOMChar                      chars[],
  +                     XalanDOMString::size_type       len,
  +                     bool                                            escLF);
   
        /**
         * Set the attribute characters what will require special mapping.
  @@ -560,10 +560,10 @@
         */
        virtual void
        writeNormalizedChars(
  -                     const XalanDOMChar      ch[],
  -                     unsigned int            start,
  -                     unsigned int            length,
  -                     bool                            isCData);
  +                     const XalanDOMChar                      ch[],
  +                     XalanDOMString::size_type       start,
  +                     XalanDOMString::size_type       length,
  +                     bool                                            
isCData);
   
        /**
         * Write a number into the buffer as an entity
  @@ -604,7 +604,7 @@
        static void
        throwInvalidUTF16SurrogateException(
                        XalanDOMChar    ch,
  -                     unsigned int    next);
  +                     XalanDOMChar    next);
   
        static bool
        isUTF16Surrogate(XalanDOMChar   ch)
  @@ -885,9 +885,9 @@
         */
        void
        accumNameArray(
  -                     const XalanDOMChar      chars[],
  -                     unsigned int            start,
  -                     unsigned int            length);
  +                     const XalanDOMChar                      chars[],
  +                     XalanDOMString::size_type       start,
  +                     XalanDOMString::size_type       length);
   
        /**
         * Append an array of wide character to the buffer.
  @@ -900,9 +900,9 @@
         */
        void
        accumContentArray(
  -                     const XalanDOMChar      chars[],
  -                     unsigned int            start,
  -                     unsigned int            length);
  +                     const XalanDOMChar                      chars[],
  +                     XalanDOMString::size_type       start,
  +                     XalanDOMString::size_type       length);
   
        /**
         * Append an array of wide character to the buffer.
  @@ -915,9 +915,9 @@
         */
        void
        accumArrayUTF(
  -                     const XalanDOMChar      chars[],
  -                     unsigned int            start,
  -                     unsigned int            length);
  +                     const XalanDOMChar                      chars[],
  +                     XalanDOMString::size_type       start,
  +                     XalanDOMString::size_type       length);
   
        /**
         * Append an array of wide character to the output.
  @@ -930,9 +930,9 @@
         */
        void
        accumArrayUTFDirect(
  -                     const XalanDOMChar      chars[],
  -                     unsigned int            start,
  -                     unsigned int            length);
  +                     const XalanDOMChar                      chars[],
  +                     XalanDOMString::size_type       start,
  +                     XalanDOMString::size_type       length);
   
        /**
         * Append a string to the buffer.
  @@ -1006,8 +1006,8 @@
         */
        void
        accumNormalizedPIData(
  -                     const XalanDOMChar*             theData,
  -                     unsigned int                    theLength);
  +                     const XalanDOMChar*                     theData,
  +                     XalanDOMString::size_type       theLength);
   
   
        // Data members...
  
  
  
  1.6       +6 -3      xml-xalan/c/src/XMLSupport/FormatterTreeWalker.cpp
  
  Index: FormatterTreeWalker.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XMLSupport/FormatterTreeWalker.cpp,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- FormatterTreeWalker.cpp   2001/05/02 17:02:06     1.5
  +++ FormatterTreeWalker.cpp   2001/09/25 21:13:17     1.6
  @@ -164,8 +164,9 @@
   
                        const XalanDOMString&   data = theTextNode->getData();
   
  -                     m_formatterListener.cdata(c_wstr(data),
  -                                                                       
length(data));
  +                     assert(length(data) == 
FormatterListener::size_type(length(data)));
  +
  +                     m_formatterListener.cdata(c_wstr(data), 
FormatterListener::size_type(length(data)));
                }
                break;
   
  @@ -179,8 +180,10 @@
   #endif
   
                        const XalanDOMString&   data = theTextNode->getData();
  +
  +                     assert(length(data) == 
FormatterListener::size_type(length(data)));
   
  -                     m_formatterListener.characters(c_wstr(data), 
length(data));
  +                     m_formatterListener.characters(c_wstr(data), 
FormatterListener::size_type(length(data)));
                }
                break;
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to