You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by am...@apache.org on 2007/07/11 18:05:18 UTC

svn commit: r555320 [2/3] - in /xerces/c/trunk/src/xercesc: dom/impl/ framework/ framework/psvi/ internal/ parsers/ util/ util/FileManagers/ util/NetAccessors/WinSock/ util/regx/ validators/datatype/ validators/schema/ validators/schema/identity/ xincl...

Modified: xerces/c/trunk/src/xercesc/util/XMLBigDecimal.cpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/util/XMLBigDecimal.cpp?view=diff&rev=555320&r1=555319&r2=555320
==============================================================================
--- xerces/c/trunk/src/xercesc/util/XMLBigDecimal.cpp (original)
+++ xerces/c/trunk/src/xercesc/util/XMLBigDecimal.cpp Wed Jul 11 09:05:13 2007
@@ -101,7 +101,7 @@
 void XMLBigDecimal::setDecimalValue(const XMLCh* const strValue)
 {
     fScale = fTotalDigits = 0;
-    unsigned int valueLen = XMLString::stringLen(strValue);
+    XMLSize_t valueLen = XMLString::stringLen(strValue);
 
     if (valueLen > fRawDataLen)
     {
@@ -148,7 +148,7 @@
 
 
     //Extra space reserved in case strLen is zero
-    int    strLen = XMLString::stringLen(retBuf);
+    XMLSize_t strLen = XMLString::stringLen(retBuf);
     XMLCh* retBuffer = (XMLCh*) memMgr->allocate( (strLen + 4) * sizeof(XMLCh));
 
     if ( (sign == 0) || (totalDigits == 0))
@@ -495,7 +495,7 @@
         XMLCh* intvalStr;
         serEng.readString(intvalStr);
         ArrayJanitor<XMLCh> intvalName(intvalStr, serEng.getMemoryManager());
-        unsigned int intvalStrLen = XMLString::stringLen(intvalStr);
+        XMLSize_t intvalStrLen = XMLString::stringLen(intvalStr);
 
         if (fRawData)
             fMemoryManager->deallocate(fRawData);

Modified: xerces/c/trunk/src/xercesc/util/XMLBigDecimal.hpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/util/XMLBigDecimal.hpp?view=diff&rev=555320&r1=555319&r2=555320
==============================================================================
--- xerces/c/trunk/src/xercesc/util/XMLBigDecimal.hpp (original)
+++ xerces/c/trunk/src/xercesc/util/XMLBigDecimal.hpp Wed Jul 11 09:05:13 2007
@@ -154,7 +154,7 @@
     int            fSign;
     unsigned int   fTotalDigits;
     unsigned int   fScale;
-    unsigned int   fRawDataLen;
+    XMLSize_t      fRawDataLen;
     XMLCh*         fRawData;
     XMLCh*         fIntVal;
     MemoryManager* fMemoryManager;

Modified: xerces/c/trunk/src/xercesc/util/XMLBigInteger.cpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/util/XMLBigInteger.cpp?view=diff&rev=555320&r1=555319&r2=555320
==============================================================================
--- xerces/c/trunk/src/xercesc/util/XMLBigInteger.cpp (original)
+++ xerces/c/trunk/src/xercesc/util/XMLBigInteger.cpp Wed Jul 11 09:05:13 2007
@@ -258,8 +258,8 @@
     if (lSign == 0)    // optimization
         return 0;
 
-    int lStrLen = XMLString::stringLen(lValue->fMagnitude);
-    int rStrLen = XMLString::stringLen(rValue->fMagnitude);
+    XMLSize_t lStrLen = XMLString::stringLen(lValue->fMagnitude);
+    XMLSize_t rStrLen = XMLString::stringLen(rValue->fMagnitude);
 
     //
     // different length
@@ -310,8 +310,8 @@
     if (lSign == 0)    // optimization
         return 0;
 
-    int lStrLen = XMLString::stringLen(lString);
-    int rStrLen = XMLString::stringLen(rString);
+    XMLSize_t lStrLen = XMLString::stringLen(lString);
+    XMLSize_t rStrLen = XMLString::stringLen(rString);
 
     //
     // different length
@@ -350,7 +350,7 @@
     if (byteToShift <= 0)
         return;
 
-    int strLen = XMLString::stringLen(fMagnitude);
+    XMLSize_t strLen = XMLString::stringLen(fMagnitude);
     XMLCh* tmp = (XMLCh*) fMemoryManager->allocate
     (
         (strLen + byteToShift + 1) * sizeof(XMLCh)
@@ -376,7 +376,7 @@
     if (byteToShift <= 0)
         return;
 
-    int strLen = XMLString::stringLen(fMagnitude);
+    XMLSize_t strLen = XMLString::stringLen(fMagnitude);
     XMLCh* tmp = (XMLCh*) fMemoryManager->allocate
     (
         (strLen - byteToShift + 1) * sizeof(XMLCh)

Modified: xerces/c/trunk/src/xercesc/util/XMLChar.cpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/util/XMLChar.cpp?view=diff&rev=555320&r1=555319&r2=555320
==============================================================================
--- xerces/c/trunk/src/xercesc/util/XMLChar.cpp (original)
+++ xerces/c/trunk/src/xercesc/util/XMLChar.cpp Wed Jul 11 09:05:13 2007
@@ -41,7 +41,7 @@
 //  not. Breaks out on the first non-whitespace.
 //
 bool XMLChar1_0::isAllSpaces(const   XMLCh* const    toCheck
-                            , const unsigned int    count)
+                            , const XMLSize_t        count)
 {
     const XMLCh* curCh = toCheck;
     const XMLCh* endPtr = toCheck + count;
@@ -59,7 +59,7 @@
 //  not.
 //
 bool XMLChar1_0::containsWhiteSpace(const   XMLCh* const    toCheck
-                            , const unsigned int    count)
+                                   , const XMLSize_t        count)
 {
     const XMLCh* curCh = toCheck;
     const XMLCh* endPtr = toCheck + count;
@@ -72,7 +72,7 @@
 }
 
 bool XMLChar1_0::isValidNCName(const   XMLCh* const    toCheck
-                            , const unsigned int    count)
+                               , const XMLSize_t       count)
 {
     const XMLCh* curCh = toCheck;
     const XMLCh* endPtr = toCheck + count;
@@ -88,7 +88,7 @@
 }
 
 bool XMLChar1_0::isValidNmtoken(const   XMLCh*       const    toCheck
-                              , const   unsigned int          count)
+                              , const   XMLSize_t             count)
 {
     const XMLCh* curCh = toCheck;
     const XMLCh* endPtr = toCheck + count;
@@ -102,7 +102,7 @@
 }
 
 bool XMLChar1_0::isValidName(const   XMLCh* const    toCheck
-                            , const unsigned int    count)
+                            , const XMLSize_t        count)
 {
     const XMLCh* curCh = toCheck;
     const XMLCh* endPtr = toCheck + count;
@@ -126,12 +126,12 @@
   *
   */
 bool XMLChar1_0::isValidQName(const   XMLCh* const    toCheck
-                            , const unsigned int    count)
+                            , const XMLSize_t         count)
 {
-    int length = count;
+    XMLSize_t length = count;
     int colonPos = XMLString::indexOf(toCheck, chColon);
     if ((colonPos == 0) ||         // ":abcd"
-        (colonPos == length-1))    // "abcd:"
+        (colonPos == ((int)length)-1))    // "abcd:"
         return false;
 
     //
@@ -4317,7 +4317,7 @@
 //  not. Breaks out on the first non-whitespace.
 //
 bool XMLChar1_1::isAllSpaces(const   XMLCh* const    toCheck
-                            , const unsigned int    count)
+                            , const XMLSize_t        count)
 {
     const XMLCh* curCh = toCheck;
     const XMLCh* endPtr = toCheck + count;
@@ -4335,7 +4335,7 @@
 //  not.
 //
 bool XMLChar1_1::containsWhiteSpace(const   XMLCh* const    toCheck
-                            , const unsigned int    count)
+                                    , const XMLSize_t       count)
 {
     const XMLCh* curCh = toCheck;
     const XMLCh* endPtr = toCheck + count;
@@ -4349,7 +4349,7 @@
 
 
 bool XMLChar1_1::isValidNCName(const   XMLCh* const    toCheck
-                            , const unsigned int    count)
+                               , const XMLSize_t       count)
 {
     const XMLCh* curCh = toCheck;
     const XMLCh* endPtr = toCheck + count;
@@ -4412,7 +4412,7 @@
 }
 
 bool XMLChar1_1::isValidNmtoken(const   XMLCh*        const    toCheck
-                              , const   unsigned int           count)
+                              , const   XMLSize_t              count)
 {
     const XMLCh* curCh = toCheck;
     const XMLCh* endPtr = toCheck + count;
@@ -4467,7 +4467,7 @@
 }
 
 bool XMLChar1_1::isValidName(const   XMLCh* const    toCheck
-                            , const unsigned int    count)
+                            , const XMLSize_t        count)
 {
     const XMLCh* curCh = toCheck;
     const XMLCh* endPtr = toCheck + count;
@@ -4538,12 +4538,12 @@
   *
   */
 bool XMLChar1_1::isValidQName(const   XMLCh* const    toCheck
-                            , const unsigned int    count)
+                            , const XMLSize_t         count)
 {
-    int length = count;
+    XMLSize_t length = count;
     int colonPos = XMLString::indexOf(toCheck, chColon);
     if ((colonPos == 0) ||         // ":abcd"
-        (colonPos == length-1))    // "abcd:"
+        (colonPos == ((int)length)-1))    // "abcd:"
         return false;
 
     //

Modified: xerces/c/trunk/src/xercesc/util/XMLChar.hpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/util/XMLChar.hpp?view=diff&rev=555320&r1=555319&r2=555320
==============================================================================
--- xerces/c/trunk/src/xercesc/util/XMLChar.hpp (original)
+++ xerces/c/trunk/src/xercesc/util/XMLChar.hpp Wed Jul 11 09:05:13 2007
@@ -51,37 +51,37 @@
     static bool isAllSpaces
     (
         const   XMLCh* const    toCheck
-        , const unsigned int    count
+        , const XMLSize_t       count
     );
 
     static bool containsWhiteSpace
     (
         const   XMLCh* const    toCheck
-        , const unsigned int    count
+        , const XMLSize_t       count
     );
 
     static bool isValidNmtoken
     (
         const   XMLCh*        const    toCheck
-      , const   unsigned int           count
+      , const   XMLSize_t              count
     );
 
     static bool isValidName
     (
         const   XMLCh* const    toCheck
-        , const unsigned int    count
+        , const XMLSize_t       count
     );
 
     static bool isValidNCName
     (
         const   XMLCh* const    toCheck
-        , const unsigned int    count
+        , const XMLSize_t       count
     );
 
     static bool isValidQName
     (
         const   XMLCh* const    toCheck
-        , const unsigned int    count
+        , const XMLSize_t       count
     );
 
     // -----------------------------------------------------------------------
@@ -252,37 +252,37 @@
     static bool isAllSpaces
     (
         const   XMLCh* const    toCheck
-        , const unsigned int    count
+        , const XMLSize_t       count
     );
 
     static bool containsWhiteSpace
     (
         const   XMLCh* const    toCheck
-        , const unsigned int    count
+        , const XMLSize_t       count
     );
 
     static bool isValidNmtoken
     (
         const   XMLCh*        const    toCheck
-      , const   unsigned int           count
+      , const   XMLSize_t              count
     );
 
     static bool isValidName
     (
         const   XMLCh* const    toCheck
-        , const unsigned int    count
+        , const XMLSize_t       count
     );
 
     static bool isValidNCName
     (
         const   XMLCh* const    toCheck
-        , const unsigned int    count
+        , const XMLSize_t       count
     );
 
     static bool isValidQName
     (
         const   XMLCh* const    toCheck
-        , const unsigned int    count
+        , const XMLSize_t       count
     );
 
     // -----------------------------------------------------------------------

Modified: xerces/c/trunk/src/xercesc/util/XMLDateTime.cpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/util/XMLDateTime.cpp?view=diff&rev=555320&r1=555319&r2=555320
==============================================================================
--- xerces/c/trunk/src/xercesc/util/XMLDateTime.cpp (original)
+++ xerces/c/trunk/src/xercesc/util/XMLDateTime.cpp Wed Jul 11 09:05:13 2007
@@ -1728,13 +1728,13 @@
     return retBuf;
 }
 
-void XMLDateTime::fillString(XMLCh*& ptr, int value, int expLen) const
+void XMLDateTime::fillString(XMLCh*& ptr, int value, XMLSize_t expLen) const
 {
     XMLCh strBuffer[16];
     assert(expLen < 16);
     XMLString::binToText(value, strBuffer, expLen, 10, fMemoryManager);
-    int   actualLen = XMLString::stringLen(strBuffer);
-    int   i;
+    XMLSize_t actualLen = XMLString::stringLen(strBuffer);
+    XMLSize_t i;
     //append leading zeros
     for (i = 0; i < expLen - actualLen; i++)
     {
@@ -1753,27 +1753,25 @@
     XMLCh strBuffer[16];
     // let's hope we get no years of 15 digits...
     XMLString::binToText(value, strBuffer, 15, 10, fMemoryManager);
-    int   actualLen = XMLString::stringLen(strBuffer);
+    XMLSize_t actualLen = XMLString::stringLen(strBuffer);
     // don't forget that years can be negative...
-    int negativeYear = 0;
+    XMLSize_t negativeYear = 0;
     if(strBuffer[0] == chDash)
     {
         *ptr++ = strBuffer[0];
         negativeYear = 1;
     }
-    int   i;
+    XMLSize_t i;
     //append leading zeros
-    for (i = 0; i < 4 - actualLen+negativeYear; i++)
-    {
-        *ptr++ = chDigit_0;
-    }
+    if(actualLen+negativeYear < 4)
+        for (i = 0; i < 4 - actualLen+negativeYear; i++)
+            *ptr++ = chDigit_0;
 
     for (i = negativeYear; i < actualLen; i++)
-    {
         *ptr++ = strBuffer[i];
-    }
+
     if(actualLen > 4)
-        return actualLen-4;
+        return (int)actualLen-4;
     return 0;
 }
 

Modified: xerces/c/trunk/src/xercesc/util/XMLDateTime.hpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/util/XMLDateTime.hpp?view=diff&rev=555320&r1=555319&r2=555320
==============================================================================
--- xerces/c/trunk/src/xercesc/util/XMLDateTime.hpp (original)
+++ xerces/c/trunk/src/xercesc/util/XMLDateTime.hpp Wed Jul 11 09:05:13 2007
@@ -224,7 +224,7 @@
 
     void                  normalize();
 
-    void                  fillString(XMLCh*& ptr, int value, int expLen) const;
+    void                  fillString(XMLCh*& ptr, int value, XMLSize_t expLen) const;
 
     int                   fillYearString(XMLCh*& ptr, int value) const;
 

Modified: xerces/c/trunk/src/xercesc/util/XMLString.cpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/util/XMLString.cpp?view=diff&rev=555320&r1=555319&r2=555320
==============================================================================
--- xerces/c/trunk/src/xercesc/util/XMLString.cpp (original)
+++ xerces/c/trunk/src/xercesc/util/XMLString.cpp Wed Jul 11 09:05:13 2007
@@ -82,7 +82,7 @@
 // ---------------------------------------------------------------------------
 void XMLString::binToText(  const   unsigned long   toFormat
                             ,       char* const     toFill
-                            , const unsigned int    maxChars
+                            , const XMLSize_t       maxChars
                             , const unsigned int    radix
                             , MemoryManager* const  manager)
 {
@@ -172,7 +172,7 @@
 
 void XMLString::binToText(  const   unsigned int    toFormat
                             ,       char* const     toFill
-                            , const unsigned int    maxChars
+                            , const XMLSize_t       maxChars
                             , const unsigned int    radix
                             , MemoryManager* const  manager)
 {
@@ -182,7 +182,7 @@
 
 void XMLString::binToText(  const   long            toFormat
                             ,       char* const     toFill
-                            , const unsigned int    maxChars
+                            , const XMLSize_t       maxChars
                             , const unsigned int    radix
                             , MemoryManager* const  manager)
 {
@@ -209,7 +209,7 @@
 
 void XMLString::binToText(  const   int             toFormat
                             ,       char* const     toFill
-                            , const unsigned int    maxChars
+                            , const XMLSize_t       maxChars
                             , const unsigned int    radix
                             , MemoryManager* const  manager)
 {
@@ -249,7 +249,7 @@
 
 int XMLString::compareNString(  const   char* const     str1
                                 , const char* const     str2
-                                , const unsigned int    count)
+                                , const XMLSize_t       count)
 {
     // Watch for pathological secenario
     if (!count)
@@ -261,7 +261,7 @@
 
 int XMLString::compareNIString( const   char* const     str1
                                 , const char* const     str2
-                                , const unsigned int    count)
+                                , const XMLSize_t       count)
 {
     if (!count)
         return 0;
@@ -285,7 +285,7 @@
 
 
 void XMLString::cut(        XMLCh* const    toCutFrom
-                    , const unsigned int    count)
+                    , const XMLSize_t       count)
 {
     #if defined(XML_DEBUG)
     if (count > stringLen(toCutFrom))
@@ -332,11 +332,11 @@
 
 int XMLString::indexOf(const char* const toSearch, const char ch)
 {
-    const unsigned int len = strlen(toSearch);
-    for (unsigned int i = 0; i < len; i++)
+    const XMLSize_t len = strlen(toSearch);
+    for (XMLSize_t i = 0; i < len; i++)
     {
         if (toSearch[i] == ch)
-            return i;
+            return (int)i;
     }
     return -1;
 }
@@ -344,26 +344,26 @@
 
 int XMLString::indexOf( const   char* const     toSearch
                         , const char            ch
-                        , const unsigned int    fromIndex
+                        , const XMLSize_t       fromIndex
                         , MemoryManager* const  manager)
 {
-    const unsigned int len = strlen(toSearch);
+    const XMLSize_t len = strlen(toSearch);
 
     // Make sure the start index is within the XMLString bounds
 	if ((int)fromIndex > ((int)len)-1)
         ThrowXMLwithMemMgr(ArrayIndexOutOfBoundsException, XMLExcepts::Str_StartIndexPastEnd, manager);
 
-    for (unsigned int i = fromIndex; i < len; i++)
+    for (XMLSize_t i = fromIndex; i < len; i++)
     {
         if (toSearch[i] == ch)
-            return i;
+            return (int)i;
     }
     return -1;
 }
 
 int XMLString::lastIndexOf(const char* const toSearch, const char ch)
 {
-    const int len = strlen(toSearch);
+    const int len = (int)strlen(toSearch);
     for (int i = len-1; i >= 0; i--)
     {
         if (toSearch[i] == ch)
@@ -374,13 +374,13 @@
 
 int XMLString::lastIndexOf( const   char* const     toSearch
                             , const char            ch
-                            , const unsigned int    fromIndex
+                            , const XMLSize_t       fromIndex
                             , MemoryManager* const  manager)
 {
-    const int len = strlen(toSearch);
+    const XMLSize_t len = strlen(toSearch);
 
     // Make sure the start index is within the XMLString bounds
-	if ((int)fromIndex > len-1)
+	if ((int)fromIndex > ((int)len)-1)
         ThrowXMLwithMemMgr(ArrayIndexOutOfBoundsException, XMLExcepts::Str_StartIndexPastEnd, manager);
 
     for (int i = (int)fromIndex; i >= 0; i--)
@@ -392,8 +392,8 @@
 }
 
 
-unsigned int XMLString::replaceTokens(          XMLCh* const    errText
-                                        , const unsigned int    maxChars
+XMLSize_t XMLString::replaceTokens(          XMLCh* const    errText
+                                        , const XMLSize_t       maxChars
                                         , const XMLCh* const    text1
                                         , const XMLCh* const    text2
                                         , const XMLCh* const    text3
@@ -410,7 +410,7 @@
     ArrayJanitor<XMLCh> janText(orgText, manager);
 
     XMLCh* pszSrc = orgText;
-    unsigned int curOutInd = 0;
+    XMLSize_t curOutInd = 0;
 
     while (*pszSrc && (curOutInd < maxChars))
     {
@@ -489,7 +489,7 @@
     //  Get the len of the source and allocate a new buffer. Make sure to
     //  account for the nul terminator.
     //
-    const unsigned int srcLen = strlen(toRep);
+    const XMLSize_t srcLen = strlen(toRep);
     char* ret = (char*) manager->allocate((srcLen+1) * sizeof(char)); //new char[srcLen+1];
 
     // Copy over the text, adjusting for the size of a char
@@ -511,7 +511,7 @@
 }
 
 
-unsigned int XMLString::stringLen(const char* const src)
+XMLSize_t XMLString::stringLen(const char* const src)
 {
     return strlen(src);
 }
@@ -525,7 +525,7 @@
 
 bool XMLString::transcode(  const   XMLCh* const    toTranscode
                             ,       char* const     toFill
-                            , const unsigned int    maxChars
+                            , const XMLSize_t       maxChars
                             , MemoryManager* const  manager)
 {
     return gTranscoder->transcode(toTranscode, toFill, maxChars, manager);
@@ -539,7 +539,7 @@
 
 bool XMLString::transcode(  const   char* const     toTranscode
                             ,       XMLCh* const    toFill
-                            , const unsigned int    maxChars
+                            , const XMLSize_t       maxChars
                             , MemoryManager* const  manager)
 {
     return gTranscoder->transcode(toTranscode, toFill, maxChars, manager);
@@ -548,9 +548,9 @@
 
 void XMLString::trim(char* const toTrim)
 {
-    const unsigned int len = strlen(toTrim);
+    const XMLSize_t len = strlen(toTrim);
 
-    unsigned int skip, scrape;
+    XMLSize_t skip, scrape;
     for (skip = 0; skip < len; skip++)
     {
         if (! isspace(toTrim[skip]))
@@ -570,7 +570,7 @@
     if (skip)
     {
         // Copy the chars down
-        unsigned int index = 0;
+        XMLSize_t index = 0;
         while (toTrim[skip])
             toTrim[index++] = toTrim[skip++];
 
@@ -580,20 +580,21 @@
 
 
 void XMLString::subString(char* const targetStr, const char* const srcStr
-                          , const int startIndex, const int endIndex
+                          , const XMLSize_t startIndex, const XMLSize_t endIndex
                           , MemoryManager* const manager)
 {
     if (targetStr == 0)
         ThrowXMLwithMemMgr(IllegalArgumentException, XMLExcepts::Str_ZeroSizedTargetBuf, manager);
 
-    const int srcLen = strlen(srcStr);
-    const int copySize = endIndex - startIndex;
+    const XMLSize_t srcLen = strlen(srcStr);
 
     // Make sure the start index is within the XMLString bounds
     if ( startIndex < 0 || startIndex > endIndex || endIndex > srcLen)
         ThrowXMLwithMemMgr(ArrayIndexOutOfBoundsException, XMLExcepts::Str_StartIndexPastEnd, manager);
 
-    for (int i= startIndex; i < endIndex; i++) {
+    const XMLSize_t copySize = endIndex - startIndex;
+
+    for (XMLSize_t i= startIndex; i < endIndex; i++) {
         targetStr[i-startIndex] = srcStr[i];
     }
 
@@ -608,11 +609,11 @@
     //  where URI is optional
     //        ':' and localPart must be present
     //
-    int nameLen = XMLString::stringLen(name);
+    XMLSize_t nameLen = XMLString::stringLen(name);
     int colPos = XMLString::lastIndexOf(name, chColon);
 
     if ((colPos == -1)         ||      // no ':'
-        (colPos == nameLen - 1)  )     // <URI>':'
+        (colPos == ((int)nameLen) - 1)  )     // <URI>':'
         return false;
 
 
@@ -715,7 +716,7 @@
 // ---------------------------------------------------------------------------
 void XMLString::binToText(  const   unsigned long   toFormat
                             ,       XMLCh* const    toFill
-                            , const unsigned int    maxChars
+                            , const XMLSize_t       maxChars
                             , const unsigned int    radix
                             , MemoryManager* const  manager)
 {
@@ -806,7 +807,7 @@
 
 void XMLString::binToText(  const   unsigned int    toFormat
                             ,       XMLCh* const    toFill
-                            , const unsigned int    maxChars
+                            , const XMLSize_t       maxChars
                             , const unsigned int    radix
                             , MemoryManager* const  manager)
 {
@@ -816,7 +817,7 @@
 
 void XMLString::binToText(  const   long            toFormat
                             ,       XMLCh* const    toFill
-                            , const unsigned int    maxChars
+                            , const XMLSize_t       maxChars
                             , const unsigned int    radix
                             , MemoryManager* const  manager)
 {
@@ -843,7 +844,7 @@
 
 void XMLString::binToText(  const   int             toFormat
                             ,       XMLCh* const    toFill
-                            , const unsigned int    maxChars
+                            , const XMLSize_t       maxChars
                             , const unsigned int    radix
                             , MemoryManager* const  manager)
 {
@@ -872,7 +873,7 @@
 void XMLString::catString(XMLCh* const target, const XMLCh* const src)
 {
     // Get the starting point for the cat on the target XMLString
-    unsigned int index = stringLen(target);
+    XMLSize_t index = stringLen(target);
 
     // While the source is not zero, add them to target and bump
     const XMLCh* pszTmp = src;
@@ -900,10 +901,10 @@
     if (psz1 == 0 || psz2 == 0) {
 
         if (psz1 == 0) {
-            return 0 - XMLString::stringLen(psz2);
+            return 0 - (int)XMLString::stringLen(psz2);
         }
 		else if (psz2 == 0) {
-            return XMLString::stringLen(psz1);
+            return (int)XMLString::stringLen(psz1);
         }
     }
 
@@ -937,12 +938,12 @@
 
 int XMLString::compareNString(  const   XMLCh* const    str1
                                 , const XMLCh* const    str2
-                                , const unsigned int    maxChars)
+                                , const XMLSize_t       maxChars)
 {
     const XMLCh* psz1 = str1;
     const XMLCh* psz2 = str2;
 
-    unsigned int curCount = 0;
+    XMLSize_t curCount = 0;
     while (curCount < maxChars)
     {
         // If an inequality, then return difference
@@ -969,7 +970,7 @@
 
 int XMLString::compareNIString( const   XMLCh* const    str1
                                 , const XMLCh* const    str2
-                                , const unsigned int    maxChars)
+                                , const XMLSize_t       maxChars)
 {
     // Refer this oneto the transcoding service
     return XMLPlatformUtils::fgTransService->compareNIString(str1, str2, maxChars);
@@ -985,10 +986,10 @@
     if (psz1 == 0 || psz2 == 0) {
 
         if (psz1 == 0) {
-            return 0 - XMLString::stringLen(psz2);
+            return 0 - (int)XMLString::stringLen(psz2);
         }
 		else if (psz2 == 0) {
-            return XMLString::stringLen(psz1);
+            return (int)XMLString::stringLen(psz1);
         }
     }
 
@@ -1014,7 +1015,7 @@
 							  , const int			offset1
 							  , const XMLCh* const	str2
 							  , const int			offset2
-							  , const unsigned int	charCount)
+							  , const XMLSize_t     charCount)
 {
 	if (!validateRegion(str1, offset1,str2, offset2, charCount))
 		return false;
@@ -1029,7 +1030,7 @@
 						 	   , const int			offset1
 							   , const XMLCh* const	str2
 							   , const int			offset2
-							   , const unsigned int	charCount)
+							   , const XMLSize_t    charCount)
 {
 	if (!validateRegion(str1, offset1,str2, offset2, charCount))
 		return false;
@@ -1060,7 +1061,7 @@
 
 bool XMLString::copyNString(        XMLCh* const    target
                             , const XMLCh* const    src
-                            , const unsigned int    maxChars)
+                            , const XMLSize_t       maxChars)
 {
     XMLCh* outPtr = target;
     const XMLCh* srcPtr = src;
@@ -1120,13 +1121,13 @@
     if (!toSearch || !*toSearch )
         return -1;
 
-    const int patnLen = XMLString::stringLen(pattern);
+    const XMLSize_t patnLen = XMLString::stringLen(pattern);
 	if ( !patnLen )
 		return -1;
 
     const XMLCh* srcPtr    = toSearch;
     const XMLCh* patnStart = toSearch;
-    int  patnIndex = 0;
+    XMLSize_t patnIndex = 0;
 
     while (*srcPtr)
     {
@@ -1139,7 +1140,7 @@
         {
             if (++patnIndex == patnLen)
                 // full pattern match found
-                return (srcPtr - patnLen - toSearch);
+                return (int)(srcPtr - patnLen - toSearch);
 
         }
     }
@@ -1149,7 +1150,7 @@
 
 
 unsigned int XMLString::hashN(  const   XMLCh* const    tohash
-                                , const unsigned int    n
+                                , const XMLSize_t       n
                                 , const unsigned int    hashModulus
                                 , MemoryManager* const)
 {
@@ -1158,7 +1159,7 @@
     unsigned int hashVal = 0;
     if (tohash) {
         const XMLCh* curCh = tohash;
-        int i = n;
+        int i = (int)n;
         while (i--)
         {
             unsigned int top = hashVal >> 24;
@@ -1191,26 +1192,26 @@
 
 int XMLString::indexOf( const   XMLCh* const    toSearch
                         , const XMLCh           ch
-                        , const unsigned int    fromIndex
+                        , const XMLSize_t       fromIndex
                         , MemoryManager* const  manager)
 {
-    const int len = stringLen(toSearch);
+    const XMLSize_t len = stringLen(toSearch);
 
     // Make sure the start index is within the XMLString bounds
-	if ((int)fromIndex > len-1)
+	if ((int)fromIndex > ((int)len)-1)
         ThrowXMLwithMemMgr(ArrayIndexOutOfBoundsException, XMLExcepts::Str_StartIndexPastEnd, manager);
 
-    for (int i = (int)fromIndex; i < len; i++)
+    for (XMLSize_t i = fromIndex; i < len; i++)
     {
         if (toSearch[i] == ch)
-            return i;
+            return (int)i;
     }
     return -1;
 }
 
 int XMLString::lastIndexOf(const XMLCh ch,
                            const XMLCh* const toSearch,
-                           const unsigned int toSearchLen)
+                           const XMLSize_t    toSearchLen)
 {
     for (int i = (int)toSearchLen-1; i >= 0; i--)
     {
@@ -1222,10 +1223,10 @@
 
 int XMLString::lastIndexOf( const   XMLCh* const    toSearch
                             , const XMLCh           ch
-                            , const unsigned int    fromIndex
+                            , const XMLSize_t       fromIndex
                             , MemoryManager* const  manager)
 {
-    const int len = stringLen(toSearch);
+    const int len = (int)stringLen(toSearch);
 	if ((int)fromIndex > len-1)
         ThrowXMLwithMemMgr(ArrayIndexOutOfBoundsException, XMLExcepts::Str_StartIndexPastEnd, manager);
 
@@ -1246,7 +1247,7 @@
     //  form. Otherwise, just set it to the same thing as the base name.
     //
     XMLCh* pszRet = 0;
-    const unsigned int uriLen = stringLen(pszURI);
+    const XMLSize_t uriLen = stringLen(pszURI);
     if (uriLen)
     {
         pszRet = new XMLCh[uriLen + stringLen(pszName) + 3];
@@ -1281,7 +1282,7 @@
 	XMLCh* trimmedStr = XMLString::replicate(toConvert, manager);
 	ArrayJanitor<XMLCh> jan1(trimmedStr, manager);
 	XMLString::trim(trimmedStr);
-    unsigned int trimmedStrLen = XMLString::stringLen(trimmedStr);
+    XMLSize_t trimmedStrLen = XMLString::stringLen(trimmedStr);
 
 	if ( !trimmedStrLen )
 		return false;
@@ -1321,7 +1322,7 @@
 	XMLCh* trimmedStr = XMLString::replicate(toConvert, manager);
 	ArrayJanitor<XMLCh> jan1(trimmedStr, manager);
 	XMLString::trim(trimmedStr);
-    unsigned int trimmedStrLen = XMLString::stringLen(trimmedStr);
+    XMLSize_t trimmedStrLen = XMLString::stringLen(trimmedStr);
 
 	if ( !trimmedStrLen )
         ThrowXMLwithMemMgr(NumberFormatException, XMLExcepts::XMLNUM_null_ptr, manager);
@@ -1352,9 +1353,9 @@
 
 void XMLString::trim(XMLCh* const toTrim)
 {
-    const unsigned int len = stringLen(toTrim);
+    const XMLSize_t len = stringLen(toTrim);
 
-    unsigned int skip, scrape;
+    XMLSize_t skip, scrape;
     for (skip = 0; skip < len; skip++)
     {
         if (!XMLChar1_0::isWhitespace(toTrim[skip]))
@@ -1374,7 +1375,7 @@
     if (skip)
     {
         // Copy the chars down
-        unsigned int index = 0;
+        XMLSize_t index = 0;
         while (toTrim[skip])
             toTrim[index++] = toTrim[skip++];
 
@@ -1427,15 +1428,15 @@
 }
 
 void XMLString::subString(XMLCh* const targetStr, const XMLCh* const srcStr
-                          , const int startIndex, const int endIndex
+                          , const XMLSize_t startIndex, const XMLSize_t endIndex
                           , MemoryManager* const manager)
 {
     subString(targetStr, srcStr, startIndex, endIndex, stringLen(srcStr), manager);
 }
 
 void XMLString::subString(XMLCh* const targetStr, const XMLCh* const srcStr
-                          , const int startIndex, const int endIndex
-                          , const int srcStrLength
+                          , const XMLSize_t startIndex, const XMLSize_t endIndex
+                          , const XMLSize_t srcStrLength
                           , MemoryManager* const manager)
 {
     //if (startIndex < 0 || endIndex < 0)
@@ -1444,13 +1445,13 @@
     if (targetStr == 0)
         ThrowXMLwithMemMgr(IllegalArgumentException, XMLExcepts::Str_ZeroSizedTargetBuf, manager);
 
-    const int copySize = endIndex - startIndex;
-
     // Make sure the start index is within the XMLString bounds
     if ( startIndex < 0 || startIndex > endIndex || endIndex > srcStrLength)
         ThrowXMLwithMemMgr(ArrayIndexOutOfBoundsException, XMLExcepts::Str_StartIndexPastEnd, manager);
 
-    for (int i= startIndex; i < endIndex; i++) {
+    const XMLSize_t copySize = endIndex - startIndex;
+
+    for (XMLSize_t i= startIndex; i < endIndex; i++) {
         targetStr[i-startIndex] = srcStr[i];
     }
 
@@ -1466,9 +1467,9 @@
 
     RefArrayVectorOf<XMLCh>* tokenStack = new (manager) RefArrayVectorOf<XMLCh>(16, true, manager);
 
-    unsigned int len = stringLen(tokenizeStr);
-    unsigned int skip;
-    unsigned int index = 0;
+    XMLSize_t len = stringLen(tokenizeStr);
+    XMLSize_t skip;
+    XMLSize_t index = 0;
 
     while (index != len) {
         // find the first non-space character
@@ -1517,10 +1518,10 @@
     //  when we hit the end of the enum list or get a match.
     //
     const XMLCh* listPtr = enumList;
-    const unsigned int findLen = XMLString::stringLen(toFind);
+    const XMLSize_t findLen = XMLString::stringLen(toFind);
     while (*listPtr)
     {
-        unsigned int testInd;
+        XMLSize_t testInd;
         for (testInd = 0; testInd < findLen; testInd++)
         {
             //
@@ -1593,7 +1594,7 @@
 void XMLString::replaceWS(XMLCh* const toConvert
                           , MemoryManager* const  manager)
 {
-    int strLen = XMLString::stringLen(toConvert);
+    XMLSize_t strLen = XMLString::stringLen(toConvert);
     if (strLen == 0)
         return;
 

Modified: xerces/c/trunk/src/xercesc/util/XMLString.hpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/util/XMLString.hpp?view=diff&rev=555320&r1=555319&r2=555320
==============================================================================
--- xerces/c/trunk/src/xercesc/util/XMLString.hpp (original)
+++ xerces/c/trunk/src/xercesc/util/XMLString.hpp Wed Jul 11 09:05:13 2007
@@ -160,7 +160,7 @@
     (
         const   char* const     str1
         , const char* const     str2
-        , const unsigned int    count
+        , const XMLSize_t       count
     );
 
     /** Lexicographically compares, at most, the first count characters in
@@ -180,7 +180,7 @@
     (
         const   XMLCh* const    str1
         , const XMLCh* const    str2
-        , const unsigned int    count
+        , const XMLSize_t       count
     );
 
 
@@ -201,7 +201,7 @@
     (
         const   char* const     str1
         , const char* const     str2
-        , const unsigned int    count
+        , const XMLSize_t       count
     );
 
     /** Lexicographically compares, at most, the first count characters in
@@ -222,7 +222,7 @@
     (
         const   XMLCh* const    str1
         , const XMLCh* const    str2
-        , const unsigned int    count
+        , const XMLSize_t       count
     );
 
     /** Lexicographically compares <code>str1</code> and <code>str2</code> and
@@ -312,7 +312,7 @@
 		, const	int				offset1
         , const XMLCh* const    str2
 		, const int				offset2
-		, const unsigned int	charCount
+		, const XMLSize_t       charCount
     );
 
 	/** Lexicographically compares <code>str1</code> and <code>str2</code>
@@ -348,7 +348,7 @@
 		, const	int				offset1
         , const XMLCh* const    str2
 		, const int				offset2
-		, const unsigned int	charCount
+		, const XMLSize_t       charCount
     );
     //@}
 
@@ -402,7 +402,7 @@
     (
                 XMLCh* const    target
         , const XMLCh* const    src
-        , const unsigned int    maxChars
+        , const XMLSize_t       maxChars
     );
     //@}
 
@@ -448,7 +448,7 @@
     static unsigned int hashN
     (
         const   XMLCh* const    toHash
-        , const unsigned int    numChars
+        , const XMLSize_t       numChars
         , const unsigned int    hashModulus
         , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
     );
@@ -492,7 +492,7 @@
     (
         const   char* const     toSearch
         , const char            chToFind
-        , const unsigned int    fromIndex
+        , const XMLSize_t       fromIndex
         , MemoryManager* const  manager = XMLPlatformUtils::fgMemoryManager
     );
 
@@ -511,7 +511,7 @@
     (
         const   XMLCh* const    toSearch
         , const XMLCh           chToFind
-        , const unsigned int    fromIndex
+        , const XMLSize_t       fromIndex
         , MemoryManager* const  manager = XMLPlatformUtils::fgMemoryManager
     );
 
@@ -548,7 +548,7 @@
     (
         const XMLCh ch
         , const XMLCh* const toSearch
-        , const unsigned int toSearchLen
+        , const XMLSize_t    toSearchLen
     );
 
     /**
@@ -566,7 +566,7 @@
     (
         const   char* const     toSearch
         , const char            chToFind
-        , const unsigned int    fromIndex
+        , const XMLSize_t       fromIndex
         , MemoryManager* const  manager = XMLPlatformUtils::fgMemoryManager
     );
 
@@ -585,7 +585,7 @@
     (
         const   XMLCh* const    toSearch
         , const XMLCh           ch
-        , const unsigned int    fromIndex
+        , const XMLSize_t       fromIndex
         , MemoryManager* const  manager = XMLPlatformUtils::fgMemoryManager
     );
     //@}
@@ -601,7 +601,7 @@
     (
                 XMLCh* const    targetStr
         , const XMLCh* const    srcStr
-        , const unsigned int    count
+        , const XMLSize_t       count
     );
 
     //@}
@@ -621,8 +621,8 @@
     (
                 char* const    targetStr
         , const char* const    srcStr
-        , const int            startIndex
-        , const int            endIndex
+        , const XMLSize_t      startIndex
+        , const XMLSize_t      endIndex
         , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
     );
 
@@ -639,8 +639,8 @@
     (
                 XMLCh* const    targetStr
         , const XMLCh* const    srcStr
-        , const int             startIndex
-        , const int             endIndex
+        , const XMLSize_t       startIndex
+        , const XMLSize_t       endIndex
         , MemoryManager* const  manager = XMLPlatformUtils::fgMemoryManager
     );
 
@@ -658,9 +658,9 @@
     (
                 XMLCh* const    targetStr
         , const XMLCh* const    srcStr
-        , const int             startIndex
-        , const int             endIndex
-        , const int             srcStrLength
+        , const XMLSize_t       startIndex
+        , const XMLSize_t       endIndex
+        , const XMLSize_t       srcStrLength
         , MemoryManager* const  manager = XMLPlatformUtils::fgMemoryManager
     );
 
@@ -808,13 +808,13 @@
       * @param src The string whose length is to be determined
       * @return Returns the length of the string
       */
-    static unsigned int stringLen(const char* const src);
+    static XMLSize_t stringLen(const char* const src);
 
     /** Get the length of the string
       * @param src The string whose length is to be determined
       * @return Returns the length of the string
       */
-    static unsigned int stringLen(const XMLCh* const src);
+    static XMLSize_t stringLen(const XMLCh* const src);
 
     /**
       *
@@ -889,7 +889,7 @@
     (
         const   unsigned int    toFormat
         ,       char* const     toFill
-        , const unsigned int    maxChars
+        , const XMLSize_t       maxChars
         , const unsigned int    radix
         , MemoryManager* const  manager = XMLPlatformUtils::fgMemoryManager
     );
@@ -909,7 +909,7 @@
     (
         const   unsigned int    toFormat
         ,       XMLCh* const    toFill
-        , const unsigned int    maxChars
+        , const XMLSize_t       maxChars
         , const unsigned int    radix
         , MemoryManager* const  manager = XMLPlatformUtils::fgMemoryManager
     );
@@ -929,7 +929,7 @@
     (
         const   unsigned long   toFormat
         ,       char* const     toFill
-        , const unsigned int    maxChars
+        , const XMLSize_t       maxChars
         , const unsigned int    radix
         , MemoryManager* const  manager = XMLPlatformUtils::fgMemoryManager
     );
@@ -949,7 +949,7 @@
     (
         const   unsigned long   toFormat
         ,       XMLCh* const    toFill
-        , const unsigned int    maxChars
+        , const XMLSize_t       maxChars
         , const unsigned int    radix
         , MemoryManager* const  manager = XMLPlatformUtils::fgMemoryManager
     );
@@ -969,7 +969,7 @@
     (
         const   long            toFormat
         ,       char* const     toFill
-        , const unsigned int    maxChars
+        , const XMLSize_t       maxChars
         , const unsigned int    radix
         , MemoryManager* const  manager = XMLPlatformUtils::fgMemoryManager
     );
@@ -989,7 +989,7 @@
     (
         const   long            toFormat
         ,       XMLCh* const    toFill
-        , const unsigned int    maxChars
+        , const XMLSize_t       maxChars
         , const unsigned int    radix
         , MemoryManager* const  manager = XMLPlatformUtils::fgMemoryManager
     );
@@ -1009,7 +1009,7 @@
     (
         const   int             toFormat
         ,       char* const     toFill
-        , const unsigned int    maxChars
+        , const XMLSize_t       maxChars
         , const unsigned int    radix
         , MemoryManager* const  manager = XMLPlatformUtils::fgMemoryManager
     );
@@ -1029,7 +1029,7 @@
     (
         const   int             toFormat
         ,       XMLCh* const    toFill
-        , const unsigned int    maxChars
+        , const XMLSize_t       maxChars
         , const unsigned int    radix
         , MemoryManager* const  manager = XMLPlatformUtils::fgMemoryManager
     );
@@ -1079,7 +1079,7 @@
     static void cut
     (
                 XMLCh* const    toCutFrom
-        , const unsigned int    count
+        , const XMLSize_t       count
     );
 
     /** Transcodes a string to native code-page
@@ -1118,7 +1118,7 @@
     (
         const   XMLCh* const    toTranscode
         ,       char* const     toFill
-        , const unsigned int    maxChars
+        , const XMLSize_t       maxChars
         , MemoryManager* const  manager = XMLPlatformUtils::fgMemoryManager
     );
 
@@ -1153,7 +1153,7 @@
     (
         const   char* const     toTranscode
         ,       XMLCh* const    toFill
-        , const unsigned int    maxChars
+        , const XMLSize_t       maxChars
         , MemoryManager* const  manager = XMLPlatformUtils::fgMemoryManager
     );
 
@@ -1215,10 +1215,10 @@
       * @param manager The MemoryManager to use to allocate objects
       * @return Returns the count of characters that are outputted
       */
-    static unsigned int replaceTokens
+    static XMLSize_t replaceTokens
     (
                 XMLCh* const    errText
-        , const unsigned int    maxChars
+        , const XMLSize_t       maxChars
         , const XMLCh* const    text1
         , const XMLCh* const    text2
         , const XMLCh* const    text3
@@ -1361,7 +1361,7 @@
 	  */
 	static bool validateRegion(const XMLCh* const str1, const int offset1,
 						const XMLCh* const str2, const int offset2,
-						const unsigned int charCount);
+						const XMLSize_t charCount);
 
     static MemoryManager* fgMemoryManager;
 
@@ -1375,25 +1375,25 @@
 // ---------------------------------------------------------------------------
 inline void XMLString::moveChars(       XMLCh* const targetStr
                                 , const XMLCh* const srcStr
-                                , const unsigned int count)
+                                , const XMLSize_t    count)
 {
     memcpy(targetStr, srcStr, count * sizeof(XMLCh));
 }
 
-inline unsigned int XMLString::stringLen(const XMLCh* const src)
+inline XMLSize_t XMLString::stringLen(const XMLCh* const src)
 {
     if (src == 0 || *src == 0)
     {
         return 0;
-   }
+    }
     else
-   {
+    {
         const XMLCh* pszTmp = src + 1;
 
         while (*pszTmp)
             ++pszTmp;
 
-        return (unsigned int)(pszTmp - src);
+        return (pszTmp - src);
     }
 }
 
@@ -1404,7 +1404,7 @@
     XMLCh* ret = 0;
     if (toRep)
     {
-        const unsigned int len = stringLen(toRep);
+        const XMLSize_t len = stringLen(toRep);
         ret = (XMLCh*) manager->allocate((len+1) * sizeof(XMLCh)); //new XMLCh[len + 1];
         memcpy(ret, toRep, (len + 1) * sizeof(XMLCh));
     }
@@ -1427,9 +1427,9 @@
                                 const XMLCh* const suffix)
 {
 
-    unsigned int suffixLen = XMLString::stringLen(suffix);
+    XMLSize_t suffixLen = XMLString::stringLen(suffix);
 
-    return regionMatches(toTest, XMLString::stringLen(toTest) - suffixLen,
+    return regionMatches(toTest, (int)(XMLString::stringLen(toTest) - suffixLen),
                          suffix, 0, suffixLen);
 }
 
@@ -1437,7 +1437,7 @@
 									  const int offset1,
 									  const XMLCh* const str2,
 									  const int offset2,
-									  const unsigned int charCount)
+									  const XMLSize_t charCount)
 {
 
 	if (offset1 < 0 || offset2 < 0 ||

Modified: xerces/c/trunk/src/xercesc/util/XMLStringTokenizer.cpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/util/XMLStringTokenizer.cpp?view=diff&rev=555320&r1=555319&r2=555320
==============================================================================
--- xerces/c/trunk/src/xercesc/util/XMLStringTokenizer.cpp (original)
+++ xerces/c/trunk/src/xercesc/util/XMLStringTokenizer.cpp Wed Jul 11 09:05:13 2007
@@ -82,9 +82,6 @@
     CleanupType cleanup(this, &XMLStringTokenizer::cleanUp);
 
 	try {
-
-        
-
         if (fStringLen > 0) {
             fTokens = new (fMemoryManager) RefArrayVectorOf<XMLCh>(4, true, fMemoryManager);
         }
@@ -127,8 +124,8 @@
     }
 
     bool tokFound = false;
-    int  startIndex = fOffset;
-    int  endIndex = fOffset;
+    XMLSize_t startIndex = fOffset;
+    XMLSize_t endIndex = fOffset;
 
     for (; endIndex < fStringLen; endIndex++) {
 

Modified: xerces/c/trunk/src/xercesc/util/XMLStringTokenizer.hpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/util/XMLStringTokenizer.hpp?view=diff&rev=555320&r1=555319&r2=555320
==============================================================================
--- xerces/c/trunk/src/xercesc/util/XMLStringTokenizer.hpp (original)
+++ xerces/c/trunk/src/xercesc/util/XMLStringTokenizer.hpp Wed Jul 11 09:05:13 2007
@@ -111,7 +111,7 @@
       * Returns the number of tokens remaining in the string using the current
       * delimiter set.
       */
-    int countTokens();
+    unsigned int countTokens();
 
     /**
       * Returns the next token from this string tokenizer.
@@ -158,8 +158,8 @@
     //  fTokens
     //      A vector of the token strings
     // -----------------------------------------------------------------------
-    int                 fOffset;
-    int                 fStringLen;
+    XMLSize_t           fOffset;
+    XMLSize_t           fStringLen;
 	XMLCh*              fString;
     const XMLCh*        fDelimeters;
 	RefArrayVectorOf<XMLCh>* fTokens;
@@ -178,15 +178,15 @@
 // ---------------------------------------------------------------------------
 //  XMLStringTokenizer: Management methods
 // ---------------------------------------------------------------------------
-inline int XMLStringTokenizer::countTokens() {
+inline unsigned int XMLStringTokenizer::countTokens() {
 
     if (fStringLen == 0)
 		return 0;
 
-    int  tokCount = 0;
+    unsigned int tokCount = 0;
     bool inToken = false;
 
-    for (int i= fOffset; i< fStringLen; i++) {
+    for (XMLSize_t i= fOffset; i< fStringLen; i++) {
 
         if (isDelimeter(fString[i])) {
 

Modified: xerces/c/trunk/src/xercesc/util/XMLURL.cpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/util/XMLURL.cpp?view=diff&rev=555320&r1=555319&r2=555320
==============================================================================
--- xerces/c/trunk/src/xercesc/util/XMLURL.cpp (original)
+++ xerces/c/trunk/src/xercesc/util/XMLURL.cpp Wed Jul 11 09:05:13 2007
@@ -606,12 +606,12 @@
             // Need to manually replace any character reference %xx first
             // HTTP protocol will be done automatically by the netaccessor
             //
-            int end = XMLString::stringLen(realPath);
+            XMLSize_t end = XMLString::stringLen(realPath);
             int percentIndex = XMLString::indexOf(realPath, chPercent, 0, fMemoryManager);
 
             while (percentIndex != -1) {
 
-                if (percentIndex+2 >= end ||
+                if (percentIndex+2 >= (int)end ||
                     !isHexDigit(realPath[percentIndex+1]) ||
                     !isHexDigit(realPath[percentIndex+2]))
                 {
@@ -629,7 +629,7 @@
 
                 realPath[percentIndex] = XMLCh(value);
 
-                int i =0;
+                XMLSize_t i =0;
                 for (i = percentIndex + 1; i < end - 2 ; i++)
                     realPath[i] = realPath[i+2];
                 realPath[i] = chNull;
@@ -693,7 +693,7 @@
 void XMLURL::buildFullText()
 {
     // Calculate the worst case size of the buffer required
-    unsigned int bufSize = gMaxProtoLen + 1
+    XMLSize_t bufSize = gMaxProtoLen + 1
                            + XMLString::stringLen(fFragment) + 1
                            + XMLString::stringLen(fHost) + 2
                            + XMLString::stringLen(fPassword) + 1

Modified: xerces/c/trunk/src/xercesc/util/XMLUri.cpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/util/XMLUri.cpp?view=diff&rev=555320&r1=555319&r2=555320
==============================================================================
--- xerces/c/trunk/src/xercesc/util/XMLUri.cpp (original)
+++ xerces/c/trunk/src/xercesc/util/XMLUri.cpp Wed Jul 11 09:05:13 2007
@@ -407,7 +407,7 @@
     XMLCh* trimmedUriSpec = XMLString::replicate(uriSpec, fMemoryManager);
     XMLString::trim(trimmedUriSpec);
     ArrayJanitor<XMLCh> janName(trimmedUriSpec, fMemoryManager);
-    int trimmedUriSpecLen = XMLString::stringLen(trimmedUriSpec);
+    XMLSize_t trimmedUriSpecLen = XMLString::stringLen(trimmedUriSpec);
 
     if ( !baseURI &&
         (!trimmedUriSpec || trimmedUriSpecLen == 0))
@@ -590,7 +590,7 @@
         XMLCh* basePath = XMLString::replicate(baseURI->getPath(), fMemoryManager);
         ArrayJanitor<XMLCh> basePathName(basePath, fMemoryManager);
 
-        int bufLen = trimmedUriSpecLen+XMLString::stringLen(fPath)+XMLString::stringLen(basePath)+1;
+        XMLSize_t bufLen = trimmedUriSpecLen+XMLString::stringLen(fPath)+XMLString::stringLen(basePath)+1;
         XMLCh* path = (XMLCh*) fMemoryManager->allocate(bufLen * sizeof(XMLCh));//new XMLCh[bufLen];
         ArrayJanitor<XMLCh> pathName(path, fMemoryManager);
         path[0] = 0;
@@ -715,7 +715,7 @@
 
     int index = 0;
     int start = 0;
-    const int end = XMLString::stringLen(uriSpec);
+    const XMLSize_t end = XMLString::stringLen(uriSpec);
 
     //
     // server = [ [ userinfo "@" ] hostport ]
@@ -851,8 +851,8 @@
     }
 
     int index = 0;
-    int start = 0;
-    int end = XMLString::stringLen(uriSpec);
+    XMLSize_t start = 0;
+    XMLSize_t end = XMLString::stringLen(uriSpec);
     XMLCh testChar = 0;
 
     // path - everything up to query string or fragment
@@ -1638,7 +1638,7 @@
         return false;
         
     // Get address length.
-    int addrStrLen = XMLString::stringLen(addrString);
+    XMLSize_t addrStrLen = XMLString::stringLen(addrString);
     
     // Check if the host is a valid IPv6reference.
     if (*addrString == chOpenSquare)
@@ -1931,7 +1931,7 @@
 void XMLUri::buildFullText()
 {   
     // Calculate the worst case size of the buffer required
-    unsigned int bufSize = XMLString::stringLen(fScheme) + 1
+    XMLSize_t bufSize = XMLString::stringLen(fScheme) + 1
                            + XMLString::stringLen(fFragment) + 1
                            + XMLString::stringLen(fHost ? fHost : fRegAuth) + 2
                            + XMLString::stringLen(fPath)
@@ -2028,7 +2028,7 @@
     while (XMLChar1_0::isWhitespace(*trimmedUriSpec))
         trimmedUriSpec++;
 
-    int trimmedUriSpecLen = XMLString::stringLen(trimmedUriSpec);
+    XMLSize_t trimmedUriSpecLen = XMLString::stringLen(trimmedUriSpec);
 
     while (trimmedUriSpecLen) {
         if (XMLChar1_0::isWhitespace(trimmedUriSpec[trimmedUriSpecLen-1]))
@@ -2045,7 +2045,7 @@
             return true;
     }
 
-    int index = 0;
+    XMLSize_t index = 0;
     bool foundScheme = false;
 
     // Check for scheme, which must be before `/', '?' or '#'.     
@@ -2129,7 +2129,7 @@
     while (XMLChar1_0::isWhitespace(*trimmedUriSpec))
         trimmedUriSpec++;
 
-    int trimmedUriSpecLen = XMLString::stringLen(trimmedUriSpec);
+    XMLSize_t trimmedUriSpecLen = XMLString::stringLen(trimmedUriSpec);
 
     while (trimmedUriSpecLen) {
         if (XMLChar1_0::isWhitespace(trimmedUriSpec[trimmedUriSpecLen-1]))
@@ -2145,7 +2145,7 @@
         return true;
     }
 
-    int index = 0;
+    XMLSize_t index = 0;
     bool foundScheme = false;
 
     // Check for scheme, which must be before `/', '?' or '#'.     
@@ -2218,7 +2218,7 @@
 }
 
 bool XMLUri::isWellFormedAddress(const XMLCh* const addrString,
-                                 const int addrStrLen)
+                                 const XMLSize_t addrStrLen)
 {
     // Check that we have a non-zero length string.
     if (addrStrLen == 0)
@@ -2304,7 +2304,7 @@
     return true;
 }
 
-bool XMLUri::processScheme(const XMLCh* const schemeStr, int& index)
+bool XMLUri::processScheme(const XMLCh* const schemeStr, XMLSize_t& index)
 {
     const XMLCh* tmpPtr = XMLString::findAny(schemeStr, SCHEME_SEPARATORS);
 
@@ -2319,13 +2319,13 @@
 
 
 bool XMLUri::isConformantSchemeName( const XMLCh* const scheme
-                                   , const int schemeLen)
+                                   , const XMLSize_t schemeLen)
 {
     if (!XMLString::isAlpha(*scheme))     // first: alpha
         return false;
 
     // second onwards: ( alpha | digit | "+" | "-" | "." )
-    for (int i=1; i<schemeLen; i++)
+    for (XMLSize_t i=1; i<schemeLen; i++)
     {
         if ( !XMLString::isAlphaNum(scheme[i]) &&
              (XMLString::indexOf(SCHEME_CHARACTERS, scheme[i]) == -1))
@@ -2336,7 +2336,7 @@
 }
 
 bool XMLUri::processAuthority( const XMLCh* const authSpec
-                             , const int authLen)
+                             , const XMLSize_t authLen)
 {
     int index = XMLString::indexOf(authSpec, chAt);
     int start = 0;
@@ -2418,7 +2418,7 @@
 }
 
 bool XMLUri::processPath(const XMLCh* const pathStr,
-                         const int pathStrLen,
+                         const XMLSize_t pathStrLen,
                          const bool isSchemePresent,
                          const bool bAllowSpaces/*=false*/)
 {

Modified: xerces/c/trunk/src/xercesc/util/XMLUri.hpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/util/XMLUri.hpp?view=diff&rev=555320&r1=555319&r2=555320
==============================================================================
--- xerces/c/trunk/src/xercesc/util/XMLUri.hpp (original)
+++ xerces/c/trunk/src/xercesc/util/XMLUri.hpp Wed Jul 11 09:05:13 2007
@@ -550,11 +550,11 @@
      void cleanUp();
 
     static bool isConformantSchemeName(const XMLCh* const scheme,
-                                       const int schemeLen);
-    static bool processScheme(const XMLCh* const uriStr, int& index);
-    static bool processAuthority(const XMLCh* const uriStr, const int authLen);
-    static bool isWellFormedAddress(const XMLCh* const addr, const int addrLen);
-    static bool processPath(const XMLCh* const pathStr, const int pathStrLen,
+                                       const XMLSize_t schemeLen);
+    static bool processScheme(const XMLCh* const uriStr, XMLSize_t& index);
+    static bool processAuthority(const XMLCh* const uriStr, const XMLSize_t authLen);
+    static bool isWellFormedAddress(const XMLCh* const addr, const XMLSize_t addrLen);
+    static bool processPath(const XMLCh* const pathStr, const XMLSize_t pathStrLen,
                             const bool isSchemePresent, const bool bAllowSpaces=false);
 
     // -----------------------------------------------------------------------

Modified: xerces/c/trunk/src/xercesc/util/regx/BMPattern.cpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/util/regx/BMPattern.cpp?view=diff&rev=555320&r1=555319&r2=555320
==============================================================================
--- xerces/c/trunk/src/xercesc/util/regx/BMPattern.cpp (original)
+++ xerces/c/trunk/src/xercesc/util/regx/BMPattern.cpp Wed Jul 11 09:05:13 2007
@@ -99,14 +99,14 @@
 // ---------------------------------------------------------------------------
 //  BMPattern: matches methods
 // ---------------------------------------------------------------------------
-int BMPattern::matches(const XMLCh* const content, int start, int limit) {
+int BMPattern::matches(const XMLCh* const content, XMLSize_t start, XMLSize_t limit) {
 
-	const unsigned int	patternLen = XMLString::stringLen(fPattern);
+	const XMLSize_t patternLen = XMLString::stringLen(fPattern);
 	// Uppercase Content
 	XMLCh* ucContent = 0;
 
 	if (patternLen == 0)
-		return start;
+		return (int)start;
 
 	if (fIgnoreCase) {
 		
@@ -116,12 +116,12 @@
 
 	ArrayJanitor<XMLCh> janUCContent(ucContent, fMemoryManager);
 
-	int index = start + patternLen;
+	XMLSize_t index = start + patternLen;
 
 	while (index <= limit) {
 
-		int patternIndex = patternLen;
-		int nIndex = index + 1;
+		XMLSize_t patternIndex = patternLen;
+		XMLSize_t nIndex = index + 1;
 		XMLCh ch = 0;
 
 		while (patternIndex > 0) {
@@ -139,7 +139,7 @@
 			}
 
 			if (patternIndex == 0)
-				return index;
+				return (int)index;
 		}
 
 		index += fShiftTable[ch % fShiftTableLen] + 1;
@@ -156,10 +156,10 @@
 // ---------------------------------------------------------------------------
 void BMPattern::initialize() {
 
-	const unsigned int	patternLen = XMLString::stringLen(fPattern);
+	const XMLSize_t patternLen = XMLString::stringLen(fPattern);
 	XMLCh* lowercasePattern = 0;
 
-	fShiftTable = (int*) fMemoryManager->allocate(fShiftTableLen*sizeof(int)); //new int[fShiftTableLen];
+	fShiftTable = (XMLSize_t*) fMemoryManager->allocate(fShiftTableLen*sizeof(XMLSize_t)); //new XMLSize_t[fShiftTableLen];
 
 	if (fIgnoreCase) {
 
@@ -176,9 +176,9 @@
 
 	for (unsigned int k=0; k< patternLen; k++) {
 
-		XMLCh	ch = fPattern[k];
-		int		diff = patternLen - k - 1;
-		int		index = ch % fShiftTableLen;
+		XMLCh	  ch = fPattern[k];
+		XMLSize_t diff = patternLen - k - 1;
+		int		  index = ch % fShiftTableLen;
 
 		if (diff < fShiftTable[index])
 			fShiftTable[index] = diff;

Modified: xerces/c/trunk/src/xercesc/util/regx/BMPattern.hpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/util/regx/BMPattern.hpp?view=diff&rev=555320&r1=555319&r2=555320
==============================================================================
--- xerces/c/trunk/src/xercesc/util/regx/BMPattern.hpp (original)
+++ xerces/c/trunk/src/xercesc/util/regx/BMPattern.hpp Wed Jul 11 09:05:13 2007
@@ -100,7 +100,7 @@
 	  *	This method will perform a match of the given content against a
 	  *	predefined pattern.
 	  */
-	int matches(const XMLCh* const content, int start, int limit);
+	int matches(const XMLCh* const content, XMLSize_t start, XMLSize_t limit);
 
 	//@}
 
@@ -141,7 +141,7 @@
     // -----------------------------------------------------------------------
 	bool           fIgnoreCase;
 	unsigned int   fShiftTableLen;
-	int*           fShiftTable;
+	XMLSize_t*     fShiftTable;
 	XMLCh*         fPattern;
 	XMLCh*         fUppercasePattern;
     MemoryManager* fMemoryManager; 

Modified: xerces/c/trunk/src/xercesc/util/regx/Match.hpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/util/regx/Match.hpp?view=diff&rev=555320&r1=555319&r2=555320
==============================================================================
--- xerces/c/trunk/src/xercesc/util/regx/Match.hpp (original)
+++ xerces/c/trunk/src/xercesc/util/regx/Match.hpp Wed Jul 11 09:05:13 2007
@@ -38,16 +38,16 @@
 {
 public:
 
-	// -----------------------------------------------------------------------
-  //  Public Constructors and Destructor
-  // -----------------------------------------------------------------------
+    // -----------------------------------------------------------------------
+    //  Public Constructors and Destructor
+    // -----------------------------------------------------------------------
 	Match(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
 	
-  /**
-  * Copy constructor
-  */
-  Match(const Match& toCopy);
-  Match& operator=(const Match& toAssign);
+    /**
+    * Copy constructor
+    */
+    Match(const Match& toCopy);
+    Match& operator=(const Match& toAssign);
 
 	virtual ~Match();
 
@@ -69,7 +69,7 @@
 	// -----------------------------------------------------------------------
 	// Initialize/Clean up methods
 	// -----------------------------------------------------------------------
-  void initialize(const Match& toCopy);
+    void initialize(const Match& toCopy);
 	void cleanUp();
 
 	// -----------------------------------------------------------------------

Modified: xerces/c/trunk/src/xercesc/util/regx/ParserForXMLSchema.cpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/util/regx/ParserForXMLSchema.cpp?view=diff&rev=555320&r1=555319&r2=555320
==============================================================================
--- xerces/c/trunk/src/xercesc/util/regx/ParserForXMLSchema.cpp (original)
+++ xerces/c/trunk/src/xercesc/util/regx/ParserForXMLSchema.cpp Wed Jul 11 09:05:13 2007
@@ -442,7 +442,7 @@
 // ---------------------------------------------------------------------------
 //  ParserForXMLSchema: Helper methods
 // ---------------------------------------------------------------------------
-bool ParserForXMLSchema::checkQuestion(const int) {
+bool ParserForXMLSchema::checkQuestion(const XMLSize_t ) {
 
     return false;
 }

Modified: xerces/c/trunk/src/xercesc/util/regx/ParserForXMLSchema.hpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/util/regx/ParserForXMLSchema.hpp?view=diff&rev=555320&r1=555319&r2=555320
==============================================================================
--- xerces/c/trunk/src/xercesc/util/regx/ParserForXMLSchema.hpp (original)
+++ xerces/c/trunk/src/xercesc/util/regx/ParserForXMLSchema.hpp Wed Jul 11 09:05:13 2007
@@ -89,7 +89,7 @@
     // -----------------------------------------------------------------------
     //  Helper methods
     // -----------------------------------------------------------------------
-    bool checkQuestion(const int off);
+    bool checkQuestion(const XMLSize_t off);
 	XMLInt32 decodeEscaped();
 
 private:

Modified: xerces/c/trunk/src/xercesc/util/regx/RegularExpression.cpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/util/regx/RegularExpression.cpp?view=diff&rev=555320&r1=555319&r2=555320
==============================================================================
--- xerces/c/trunk/src/xercesc/util/regx/RegularExpression.cpp (original)
+++ xerces/c/trunk/src/xercesc/util/regx/RegularExpression.cpp Wed Jul 11 09:05:13 2007
@@ -205,9 +205,9 @@
 //  RegularExpression::Context: Public methods
 // ---------------------------------------------------------------------------
 void RegularExpression::Context::reset(const XMLCh* const string
-                                       , const int stringLen
-                                       , const int start
-                                       , const int limit
+                                       , const XMLSize_t stringLen
+                                       , const XMLSize_t start
+                                       , const XMLSize_t limit
                                        , const int noClosures)
 {
     fString = string;
@@ -232,7 +232,7 @@
 		fOffsets[i] = -1;
 }
 
-bool RegularExpression::Context::nextCh(XMLInt32& ch, int& offset,
+bool RegularExpression::Context::nextCh(XMLInt32& ch, XMLSize_t& offset,
 										const short direction)
 {
 
@@ -466,7 +466,7 @@
 }
 
 bool RegularExpression::matches(const char* const expression,
-								const int start, const int end
+								const XMLSize_t start, const XMLSize_t end
                                 , MemoryManager* const manager) {
 
 	XMLCh* tmpBuf = XMLString::transcode(expression, manager);
@@ -483,8 +483,8 @@
 	return matches(tmpBuf, 0, XMLString::stringLen(tmpBuf), match, manager);
 }
 
-bool RegularExpression::matches(const char* const expression, const int start,
-                                const int end, Match* const pMatch
+bool RegularExpression::matches(const char* const expression, const XMLSize_t start,
+                                const XMLSize_t end, Match* const pMatch
                                 , MemoryManager* const manager)				{
 
 	XMLCh* tmpBuf = XMLString::transcode(expression, manager);
@@ -502,7 +502,7 @@
 }
 
 bool RegularExpression::matches(const XMLCh* const expression,
-								const int start, const int end
+								const XMLSize_t start, const XMLSize_t end
                                 , MemoryManager* const manager) {
 
 	return matches(expression, start, end, 0, manager);
@@ -515,12 +515,12 @@
 	return matches(expression, 0, XMLString::stringLen(expression), match, manager);
 }
 
-bool RegularExpression::matches(const XMLCh* const expression, const int start,
-                                const int end, Match* const pMatch
+bool RegularExpression::matches(const XMLCh* const expression, const XMLSize_t start,
+                                const XMLSize_t end, Match* const pMatch
                                 , MemoryManager* const manager)	{
 		
 	Context context(manager);
-	int		 strLength = XMLString::stringLen(expression);
+	XMLSize_t strLength = XMLString::stringLen(expression);
 
     context.reset(expression, strLength, start, end, fNoClosures);
 
@@ -592,8 +592,8 @@
 		}
 	}
 
-	int limit = context.fLimit - fMinLength;
-	int matchStart;
+	XMLSize_t limit = context.fLimit - fMinLength;
+	XMLSize_t matchStart;
 	int matchEnd = -1;
 
 	/*
@@ -691,7 +691,7 @@
 }
 
 RefArrayVectorOf<XMLCh>* RegularExpression::tokenize(const char* const expression,
-								const int start, const int end) {
+								const XMLSize_t start, const XMLSize_t end) {
 
   XMLCh* tmpBuf = XMLString::transcode(expression, fMemoryManager);
   ArrayJanitor<XMLCh> janBuf(tmpBuf, fMemoryManager);
@@ -708,20 +708,20 @@
 }
 
 RefArrayVectorOf<XMLCh>* RegularExpression::tokenize(const XMLCh* const expression,
-								                                     const int start, const int end)
+								                     const XMLSize_t start, const XMLSize_t end)
 {
   return tokenize(expression, start, end, 0);
 }
 
 RefArrayVectorOf<XMLCh>* RegularExpression::tokenize(const XMLCh* const expression, 
-                                                     const int start, const int end,
+                                                     const XMLSize_t start, const XMLSize_t end,
                                                      RefVectorOf<Match> *subEx){
   
   RefArrayVectorOf<XMLCh>* tokenStack = new (fMemoryManager) RefArrayVectorOf<XMLCh>(16, true, fMemoryManager);
 
   Context context(fMemoryManager);
 
-  int		 strLength = XMLString::stringLen(expression);
+  XMLSize_t strLength = XMLString::stringLen(expression);
  
   context.reset(expression, strLength, start, end, fNoClosures);
  
@@ -741,8 +741,8 @@
   context.fMatch = lMatch;
   context.fAdoptMatch = adoptMatch;
 
-  int tokStart = start;
-  int matchStart = start;
+  XMLSize_t tokStart = start;
+  XMLSize_t matchStart = start;
 
   for (; matchStart <= end; matchStart++) { 
   
@@ -841,14 +841,14 @@
 
 XMLCh* RegularExpression::replace(const char* const matchString, 
                                   const char* const replaceString,
-                                  const int start, const int end){
+                                  const XMLSize_t start, const XMLSize_t end){
 
  	XMLCh* tmpBuf = XMLString::transcode(matchString, fMemoryManager);
     ArrayJanitor<XMLCh> janBuf(tmpBuf, fMemoryManager);
  	XMLCh* tmpBuf2 = XMLString::transcode(replaceString, fMemoryManager);
     ArrayJanitor<XMLCh> janBuf2(tmpBuf2, fMemoryManager);
   
-  return replace(tmpBuf, tmpBuf2, start, end);
+    return replace(tmpBuf, tmpBuf2, start, end);
 }
 
 
@@ -858,57 +858,57 @@
 XMLCh* RegularExpression::replace(const XMLCh* const matchString, 
                                   const XMLCh* const replaceString){
 
-  return replace(matchString, replaceString, 0, 
+    return replace(matchString, replaceString, 0, 
                  XMLString::stringLen(matchString));
 }
 
 XMLCh* RegularExpression::replace(const XMLCh* const matchString,  
                                   const XMLCh* const replaceString,
-                                  const int start, const int end)
+                                  const XMLSize_t start, const XMLSize_t end)
 {
 
-  //check if matches zero length string - throw error if so
-  if (matches(XMLUni::fgZeroLenString, fMemoryManager)){
-		ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::Regex_RepPatMatchesZeroString, fMemoryManager);
-  }
+    //check if matches zero length string - throw error if so
+    if (matches(XMLUni::fgZeroLenString, fMemoryManager)){
+        ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::Regex_RepPatMatchesZeroString, fMemoryManager);
+    }
       
-  RefVectorOf<Match> *subEx = new (fMemoryManager) RefVectorOf<Match>(10, true, fMemoryManager);
-	  Janitor<RefVectorOf<Match> > janSubEx(subEx);
+    RefVectorOf<Match> *subEx = new (fMemoryManager) RefVectorOf<Match>(10, true, fMemoryManager);
+    Janitor<RefVectorOf<Match> > janSubEx(subEx);
 
-  //Call to tokenize with Match vector so that we keep track of the locations
-  //of the subExpression within each of the matches
-  RefArrayVectorOf<XMLCh>* tokenStack = tokenize(matchString, start, end, subEx);
-	  Janitor<RefArrayVectorOf<XMLCh> > janTokStack(tokenStack);
+    //Call to tokenize with Match vector so that we keep track of the locations
+    //of the subExpression within each of the matches
+    RefArrayVectorOf<XMLCh>* tokenStack = tokenize(matchString, start, end, subEx);
+    Janitor<RefArrayVectorOf<XMLCh> > janTokStack(tokenStack);
     
-  XMLBuffer result(1023, fMemoryManager);
-  
-  int numSubEx = 0;
-  
-  if (subEx && subEx->size() > 0)
-    numSubEx = subEx->elementAt(0)->getNoGroups() - 1;
-  
-  int tokStackSize = tokenStack->size();
-  const XMLCh* curRepString = XMLString::replicate(replaceString, fMemoryManager);
-    
-  for (int i = 0; i < tokStackSize; i++){
-      
-    result.append(tokenStack->elementAt(i));
+    XMLBuffer result(1023, fMemoryManager);
   
-    if (i != tokStackSize - 1) {
-       
-      //if there are subExpressions, then determine the string we want to 
-      //substitute in.
-        if (numSubEx != 0) {
-            fMemoryManager->deallocate((XMLCh*)curRepString);
-            curRepString = subInExp(replaceString, matchString, subEx->elementAt(i));     
+    int numSubEx = 0;
+
+    if (subEx && subEx->size() > 0)
+        numSubEx = subEx->elementAt(0)->getNoGroups() - 1;
+
+    int tokStackSize = tokenStack->size();
+    const XMLCh* curRepString = XMLString::replicate(replaceString, fMemoryManager);
+
+    for (int i = 0; i < tokStackSize; i++){
+
+        result.append(tokenStack->elementAt(i));
+
+        if (i != tokStackSize - 1) {
+
+            //if there are subExpressions, then determine the string we want to 
+            //substitute in.
+            if (numSubEx != 0) {
+                fMemoryManager->deallocate((XMLCh*)curRepString);
+                curRepString = subInExp(replaceString, matchString, subEx->elementAt(i));     
+            }
+            result.append(curRepString);
         }
-      result.append(curRepString);
-    }
-  }  
-    
-  fMemoryManager->deallocate((XMLCh*)curRepString);
-  return XMLString::replicate(result.getRawBuffer(), fMemoryManager); 
-    
+    }  
+
+    fMemoryManager->deallocate((XMLCh*)curRepString);
+    return XMLString::replicate(result.getRawBuffer(), fMemoryManager); 
+
 }
 
 
@@ -984,7 +984,7 @@
 
 
 int RegularExpression::match(Context* const context, const Op* const operations
-							 , int offset, const short direction)
+							 , XMLSize_t offset, const short direction)
 {
 	const Op* tmpOp = operations;
 	bool ignoreCase = isSet(fOptions, IGNORE_CASE);
@@ -1131,12 +1131,15 @@
 	return offset;
 }
 bool RegularExpression::matchChar(Context* const context,
-								  const XMLInt32 ch, int& offset,
+								  const XMLInt32 ch, XMLSize_t& offset,
 								  const short direction, const bool ignoreCase)
 {
-	int tmpOffset = direction > 0 ? offset : offset - 1;
+    if(direction < 0 && offset==0)
+        return false;
 
-	if (tmpOffset >= context->fLimit || tmpOffset < 0)
+	XMLSize_t tmpOffset = direction > 0 ? offset : offset - 1;
+
+	if (tmpOffset >= context->fLimit)
 		return false;
 
 	XMLInt32 strCh = 0;
@@ -1154,12 +1157,15 @@
 	return true;
 }
 
-bool RegularExpression::matchDot(Context* const context, int& offset,
+bool RegularExpression::matchDot(Context* const context, XMLSize_t& offset,
 								 const short direction)
 {
-	int tmpOffset = direction > 0 ? offset : offset - 1;
+    if(direction < 0 && offset==0)
+        return false;
+
+	XMLSize_t tmpOffset = direction > 0 ? offset : offset - 1;
 
-	if (tmpOffset >= context->fLimit || tmpOffset < 0)
+	if (tmpOffset >= context->fLimit)
 		return false;
 
 	XMLInt32 strCh = 0;
@@ -1181,12 +1187,15 @@
 }
 
 bool RegularExpression::matchRange(Context* const context, const Op* const op,
-								   int& offset, const short direction,
+								   XMLSize_t& offset, const short direction,
 								   const bool ignoreCase)
 {
-	int tmpOffset = direction > 0 ? offset : offset - 1;
+    if(direction < 0 && offset==0)
+        return false;
+
+	XMLSize_t tmpOffset = direction > 0 ? offset : offset - 1;
 
-	if (tmpOffset >= context->fLimit || tmpOffset < 0)
+	if (tmpOffset >= context->fLimit)
 		return false;
 
 	XMLInt32 strCh = 0;
@@ -1212,7 +1221,7 @@
 }
 
 bool RegularExpression::matchAnchor(Context* const context, const XMLInt32 ch,
-									const int offset)
+									const XMLSize_t offset)
 {
 	switch ((XMLCh) ch) {
 	case chLatin_A:
@@ -1307,7 +1316,7 @@
 }
 
 bool RegularExpression::matchBackReference(Context* const context,
-										   const XMLInt32 refNo, int& offset,
+										   const XMLInt32 refNo, XMLSize_t& offset,
 										   const short direction,
 										   const bool ignoreCase)
 {
@@ -1320,7 +1329,11 @@
 
 	int start = context->fMatch->getStartPos(refNo);
 	int length = context->fMatch->getEndPos(refNo) - start;
-	int tmpOffset = (direction > 0) ? offset : offset - length;
+
+    if(direction < 0 && offset<length)
+        return false;
+
+    XMLSize_t tmpOffset = (direction > 0) ? offset : offset - length;
 
 	if (context->fLimit - tmpOffset < length)
 		return false;
@@ -1339,11 +1352,14 @@
 }
 
 bool RegularExpression::matchString(Context* const context,
-									const XMLCh* const literal, int& offset,
+									const XMLCh* const literal, XMLSize_t& offset,
 									const short direction, const bool ignoreCase)
 {
-	int length = XMLString::stringLen(literal);
-	int tmpOffset = (direction > 0) ? offset : offset - length;
+	XMLSize_t length = XMLString::stringLen(literal);
+    if(direction < 0 && offset<length)
+        return false;
+
+	XMLSize_t tmpOffset = (direction > 0) ? offset : offset - length;
 
 	if (context->fLimit - tmpOffset < length)
 		return false;
@@ -1362,7 +1378,7 @@
 }
 
 int RegularExpression::matchCapture(Context* const context, const Op* const op,
-                                    int offset, const short direction)
+                                    XMLSize_t offset, const short direction)
 {
 	// No check is made for nullness of fMatch as the function is only called if
 	// fMatch is not null.
@@ -1387,7 +1403,7 @@
 }
 
 int RegularExpression::matchUnion(Context* const context,
-                                   const Op* const op, int offset,
+                                   const Op* const op, XMLSize_t offset,
                                    const short direction)
 {
   unsigned int opSize = op->getSize();
@@ -1410,7 +1426,7 @@
 
 
 bool RegularExpression::matchCondition(Context* const context,
-                                              const Op* const op, int offset,
+                                              const Op* const op, XMLSize_t offset,
                                               const short direction)
 {
 
@@ -1429,9 +1445,9 @@
 		return 0;
 
 	int opts = 0;
-	int length = XMLString::stringLen(options);
+	XMLSize_t length = XMLString::stringLen(options);
 
-	for (int i=0; i < length; i++) {
+	for (XMLSize_t i=0; i < length; i++) {
 	
 		int v = getOptionValue(options[i]);
 

Modified: xerces/c/trunk/src/xercesc/util/regx/RegularExpression.hpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/util/regx/RegularExpression.hpp?view=diff&rev=555320&r1=555319&r2=555320
==============================================================================
--- xerces/c/trunk/src/xercesc/util/regx/RegularExpression.hpp (original)
+++ xerces/c/trunk/src/xercesc/util/regx/RegularExpression.hpp Wed Jul 11 09:05:13 2007
@@ -102,18 +102,18 @@
     //  Matching methods
     // -----------------------------------------------------------------------
     bool matches(const char* const matchString, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
-    bool matches(const char* const matchString, const int start,
-                 const int end, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
+    bool matches(const char* const matchString, const XMLSize_t start,
+                 const XMLSize_t end, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
     bool matches(const char* const matchString, Match* const pMatch, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
-    bool matches(const char* const matchString, const int start,
-                 const int end, Match* const pMatch, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
+    bool matches(const char* const matchString, const XMLSize_t start,
+                 const XMLSize_t end, Match* const pMatch, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
 
     bool matches(const XMLCh* const matchString, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
-    bool matches(const XMLCh* const matchString, const int start,
-                 const int end, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
+    bool matches(const XMLCh* const matchString, const XMLSize_t start,
+                 const XMLSize_t end, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
     bool matches(const XMLCh* const matchString, Match* const pMatch, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
-    bool matches(const XMLCh* const matchString, const int start,
-                 const int end, Match* const pMatch, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
+    bool matches(const XMLCh* const matchString, const XMLSize_t start,
+                 const XMLSize_t end, Match* const pMatch, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
 
     // -----------------------------------------------------------------------
     //  Tokenize methods
@@ -121,12 +121,12 @@
     // Note: The caller owns the string vector that is returned, and is responsible
     //       for deleting it.
     RefArrayVectorOf<XMLCh> *tokenize(const char* const matchString);
-    RefArrayVectorOf<XMLCh> *tokenize(const char* const matchString, const int start,
-                                      const int end);
+    RefArrayVectorOf<XMLCh> *tokenize(const char* const matchString, const XMLSize_t start,
+                                      const XMLSize_t end);
 
     RefArrayVectorOf<XMLCh> *tokenize(const XMLCh* const matchString);
     RefArrayVectorOf<XMLCh> *tokenize(const XMLCh* const matchString,
-                                      const int start, const int end);
+                                      const XMLSize_t start, const XMLSize_t end);
 
     // -----------------------------------------------------------------------
     //  Replace methods
@@ -135,11 +135,11 @@
     //       deleting it.
     XMLCh *replace(const char* const matchString, const char* const replaceString);
     XMLCh *replace(const char* const matchString, const char* const replaceString,
-                   const int start, const int end);
+                   const XMLSize_t start, const XMLSize_t end);
 
     XMLCh *replace(const XMLCh* const matchString, const XMLCh* const replaceString);
     XMLCh *replace(const XMLCh* const matchString, const XMLCh* const replaceString,
-                   const int start, const int end);
+                   const XMLSize_t start, const XMLSize_t end);
 
     // -----------------------------------------------------------------------
     //  Static initialize and cleanup methods
@@ -178,16 +178,16 @@
 
             Context& operator= (const Context& other);
             inline const XMLCh* getString() const { return fString; }
-            void reset(const XMLCh* const string, const int stringLen,
-                       const int start, const int limit, const int noClosures);
-            bool nextCh(XMLInt32& ch, int& offset, const short direction);
+            void reset(const XMLCh* const string, const XMLSize_t stringLen,
+                       const XMLSize_t start, const XMLSize_t limit, const int noClosures);
+            bool nextCh(XMLInt32& ch, XMLSize_t& offset, const short direction);
             
             bool           fAdoptMatch;
-            int            fStart;
-            int            fLimit;
-            int            fLength;    // fLimit - fStart
+            XMLSize_t      fStart;
+            XMLSize_t      fLimit;
+            XMLSize_t      fLength;    // fLimit - fStart
             int            fSize;
-            int            fStringMaxLen;
+            XMLSize_t      fStringMaxLen;
             int*           fOffsets;
             Match*         fMatch;
             const XMLCh*   fString;
@@ -205,42 +205,42 @@
     // -----------------------------------------------------------------------
     void prepare();
     int parseOptions(const XMLCh* const options);
-    unsigned short getWordType(const XMLCh* const target, const int begin,
-                               const int end, const int offset);
+    unsigned short getWordType(const XMLCh* const target, const XMLSize_t begin,
+                               const XMLSize_t end, const XMLSize_t offset);
     unsigned short getCharType(const XMLCh ch);
     unsigned short getPreviousWordType(const XMLCh* const target,
-                                       const int start, const int end,
-                                       int offset);
+                                       const XMLSize_t start, const XMLSize_t end,
+                                       XMLSize_t offset);
 
     /**
       *    Matching helpers
       */
-    int match(Context* const context, const Op* const operations, int offset,
+    int match(Context* const context, const Op* const operations, XMLSize_t offset,
               const short direction);
     bool matchIgnoreCase(const XMLInt32 ch1, const XMLInt32 ch2);
 
     /**
       *    Helper methods used by match(Context* ...)
       */
-    bool matchChar(Context* const context, const XMLInt32 ch, int& offset,
+    bool matchChar(Context* const context, const XMLInt32 ch, XMLSize_t& offset,
                    const short direction, const bool ignoreCase);
-    bool matchDot(Context* const context, int& offset, const short direction);
+    bool matchDot(Context* const context, XMLSize_t& offset, const short direction);
     bool matchRange(Context* const context, const Op* const op,
-                    int& offset, const short direction, const bool ignoreCase);
+                    XMLSize_t& offset, const short direction, const bool ignoreCase);
     bool matchAnchor(Context* const context, const XMLInt32 ch,
-                     const int offset);
+                     const XMLSize_t offset);
     bool matchBackReference(Context* const context, const XMLInt32 ch,
-                            int& offset, const short direction,
+                            XMLSize_t& offset, const short direction,
                             const bool ignoreCase);
     bool matchString(Context* const context, const XMLCh* const literal,
-                     int& offset, const short direction, const bool ignoreCase);
-    int  matchUnion(Context* const context, const Op* const op, int offset,
+                     XMLSize_t& offset, const short direction, const bool ignoreCase);
+    int  matchUnion(Context* const context, const Op* const op, XMLSize_t offset,
                     const short direction);
-    int matchCapture(Context* const context, const Op* const op, int offset,
+    int matchCapture(Context* const context, const Op* const op, XMLSize_t offset,
                      const short direction);
-    bool matchCondition(Context* const context, const Op* const op, int offset,
+    bool matchCondition(Context* const context, const Op* const op, XMLSize_t offset,
                         const short direction);
-    int matchModifier(Context* const context, const Op* const op, int offset,
+    int matchModifier(Context* const context, const Op* const op, XMLSize_t offset,
                       const short direction);
 
     /**
@@ -254,7 +254,7 @@
      *    RefArrayVectorOf<XMLCh*>
      */
     RefArrayVectorOf<XMLCh> *tokenize(const XMLCh* const matchString,
-                                      const int start, const int end,
+                                      const XMLSize_t start, const XMLSize_t end,
                                       RefVectorOf<Match> *subEx);
     /**
      *    Replace helpers
@@ -556,7 +556,7 @@
   }
 
   inline int RegularExpression::matchModifier(Context* const context,
-                                              const Op* const op, int offset,
+                                              const Op* const op, XMLSize_t offset,
                                               const short direction)
   {
       int saveOptions = fOptions;
@@ -571,9 +571,9 @@
   }
 
   inline unsigned short RegularExpression::getWordType(const XMLCh* const target
-                                                       , const int begin
-                                                       , const int end
-                                                       , const int offset)
+                                                       , const XMLSize_t begin
+                                                       , const XMLSize_t end
+                                                       , const XMLSize_t offset)
   {
       if (offset < begin || offset >= end)
           return WT_OTHER;
@@ -583,9 +583,9 @@
 
   inline
   unsigned short RegularExpression::getPreviousWordType(const XMLCh* const target
-                                                        , const int start
-                                                        , const int end
-                                                        , int offset)
+                                                        , const XMLSize_t start
+                                                        , const XMLSize_t end
+                                                        , XMLSize_t offset)
   {
       unsigned short ret = getWordType(target, start, end, --offset);
 



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xerces.apache.org
For additional commands, e-mail: commits-help@xerces.apache.org