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/18 15:28:58 UTC

svn commit: r557254 - in /xerces/c/trunk/src/xercesc: dom/impl/ framework/ internal/ util/ util/regx/ validators/datatype/ validators/schema/ xinclude/

Author: amassari
Date: Wed Jul 18 06:28:54 2007
New Revision: 557254

URL: http://svn.apache.org/viewvc?view=rev&rev=557254
Log:
Fixed signed/unsigned conversions (XERCESC-1531)

Modified:
    xerces/c/trunk/src/xercesc/dom/impl/DOMLSSerializerImpl.cpp
    xerces/c/trunk/src/xercesc/framework/XMLAttr.hpp
    xerces/c/trunk/src/xercesc/framework/XMLEntityDecl.cpp
    xerces/c/trunk/src/xercesc/internal/XProtoType.cpp
    xerces/c/trunk/src/xercesc/internal/XSerializeEngine.cpp
    xerces/c/trunk/src/xercesc/util/HexBin.cpp
    xerces/c/trunk/src/xercesc/util/XMLBigDecimal.cpp
    xerces/c/trunk/src/xercesc/util/XMLBigInteger.hpp
    xerces/c/trunk/src/xercesc/util/XMLDateTime.cpp
    xerces/c/trunk/src/xercesc/util/XMLUri.cpp
    xerces/c/trunk/src/xercesc/util/XMLUri.hpp
    xerces/c/trunk/src/xercesc/util/regx/RegularExpression.cpp
    xerces/c/trunk/src/xercesc/util/regx/RegxParser.cpp
    xerces/c/trunk/src/xercesc/validators/datatype/AbstractStringValidator.cpp
    xerces/c/trunk/src/xercesc/validators/schema/SchemaValidator.cpp
    xerces/c/trunk/src/xercesc/validators/schema/TraverseSchema.hpp
    xerces/c/trunk/src/xercesc/xinclude/XIncludeLocation.cpp
    xerces/c/trunk/src/xercesc/xinclude/XIncludeUtils.cpp

Modified: xerces/c/trunk/src/xercesc/dom/impl/DOMLSSerializerImpl.cpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/dom/impl/DOMLSSerializerImpl.cpp?view=diff&rev=557254&r1=557253&r2=557254
==============================================================================
--- xerces/c/trunk/src/xercesc/dom/impl/DOMLSSerializerImpl.cpp (original)
+++ xerces/c/trunk/src/xercesc/dom/impl/DOMLSSerializerImpl.cpp Wed Jul 18 06:28:54 2007
@@ -1457,7 +1457,7 @@
         {
             nextPtr = curPtr + endTagPos + offset;  // skip the ']]>'
             *(curPtr + endTagPos) = chNull;         //nullify the first ']'
-            if (endTagPos != len)
+            if (XMLSize_t(endTagPos) != len)
                 reportError(nodeToWrite, DOMError::DOM_SEVERITY_WARNING, XMLDOMMsg::Writer_NestedCDATA);
             len = len - endTagPos - offset;
         }

Modified: xerces/c/trunk/src/xercesc/framework/XMLAttr.hpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/framework/XMLAttr.hpp?view=diff&rev=557254&r1=557253&r2=557254
==============================================================================
--- xerces/c/trunk/src/xercesc/framework/XMLAttr.hpp (original)
+++ xerces/c/trunk/src/xercesc/framework/XMLAttr.hpp Wed Jul 18 06:28:54 2007
@@ -460,8 +460,8 @@
                         , const XMLCh* const        attrPrefix
                         , const XMLCh* const        attrValue
                         , const XMLAttDef::AttTypes type
-                        , DatatypeValidator * datatypeValidator 
-                        , const bool isSchema )
+                        , DatatypeValidator * /*datatypeValidator */
+                        , const bool /*isSchema*/ )
 {
     // Set the name info and the value via their respective calls
     fAttName->setName(attrPrefix, attrName, uriId);
@@ -475,8 +475,8 @@
                         , const XMLCh* const        attrRawName
                         , const XMLCh* const        attrValue
                         , const XMLAttDef::AttTypes type
-                        , DatatypeValidator * datatypeValidator 
-                        , const bool isSchema )
+                        , DatatypeValidator * /*datatypeValidator */
+                        , const bool /*isSchema*/ )
 {
     // Set the name info and the value via their respective calls
     fAttName->setName(attrRawName, uriId);

Modified: xerces/c/trunk/src/xercesc/framework/XMLEntityDecl.cpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/framework/XMLEntityDecl.cpp?view=diff&rev=557254&r1=557253&r2=557254
==============================================================================
--- xerces/c/trunk/src/xercesc/framework/XMLEntityDecl.cpp (original)
+++ xerces/c/trunk/src/xercesc/framework/XMLEntityDecl.cpp Wed Jul 18 06:28:54 2007
@@ -170,7 +170,7 @@
     if (serEng.isStoring())
     {
         serEng<<fId;
-        serEng<<fValueLen;
+        serEng<<(unsigned long)fValueLen;
         serEng.writeString(fValue);
         serEng.writeString(fName);
         serEng.writeString(fNotationName);
@@ -181,7 +181,7 @@
     else
     {
         serEng>>fId;
-        serEng>>fValueLen;
+        serEng>>(unsigned long&)fValueLen;
         serEng.readString(fValue);
         serEng.readString(fName);
         serEng.readString(fNotationName);

Modified: xerces/c/trunk/src/xercesc/internal/XProtoType.cpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/internal/XProtoType.cpp?view=diff&rev=557254&r1=557253&r2=557254
==============================================================================
--- xerces/c/trunk/src/xercesc/internal/XProtoType.cpp (original)
+++ xerces/c/trunk/src/xercesc/internal/XProtoType.cpp Wed Jul 18 06:28:54 2007
@@ -37,7 +37,7 @@
 void XProtoType::store(XSerializeEngine& serEng) const
 {
     XMLSize_t strLen = XMLString::stringLen((char*)fClassName);
-	serEng << strLen;
+	serEng << (unsigned long)strLen;
 	serEng.write(fClassName, strLen * sizeof(XMLByte));
 }
 
@@ -60,14 +60,14 @@
     // read and check class name length
     XMLSize_t inNameLen = XMLString::stringLen((char*)inName); 
     XMLSize_t classNameLen = 0;
-    serEng >> classNameLen;
+    serEng >> (unsigned long&)classNameLen;
 
 	if (classNameLen != inNameLen)
     {
         XMLCh value1[17];
         XMLCh value2[17];
-        XMLString::binToText(inNameLen,    value1, 16, 10, manager);
-        XMLString::binToText(classNameLen, value2, 16, 10, manager);
+        XMLString::binToText((unsigned long)inNameLen,    value1, 16, 10, manager);
+        XMLString::binToText((unsigned long)classNameLen, value2, 16, 10, manager);
 
         ThrowXMLwithMemMgr2(XSerializationException
                 , XMLExcepts::XSer_ProtoType_NameLen_Dif

Modified: xerces/c/trunk/src/xercesc/internal/XSerializeEngine.cpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/internal/XSerializeEngine.cpp?view=diff&rev=557254&r1=557253&r2=557254
==============================================================================
--- xerces/c/trunk/src/xercesc/internal/XSerializeEngine.cpp (original)
+++ xerces/c/trunk/src/xercesc/internal/XSerializeEngine.cpp Wed Jul 18 06:28:54 2007
@@ -288,10 +288,10 @@
     if (toWrite) 
     {
         if (toWriteBufLen)
-            *this<<bufferLen;
+            *this<<(unsigned long)bufferLen;
 
         XMLSize_t strLen = XMLString::stringLen(toWrite);
-        *this<<strLen;
+        *this<<(unsigned long)strLen;
 
         write(toWrite, strLen);
     }
@@ -310,10 +310,10 @@
     if (toWrite) 
     {
         if (toWriteBufLen)
-            *this<<bufferLen;
+            *this<<(unsigned long)bufferLen;
 
         XMLSize_t strLen = XMLString::stringLen((char*)toWrite);
-        *this<<strLen;
+        *this<<(unsigned long)strLen;
         write(toWrite, strLen);
     }
     else
@@ -488,7 +488,7 @@
     /***
      * Check if any data written
      ***/
-    *this>>bufferLen;
+    *this>>(unsigned long&)bufferLen;
 
     if (bufferLen == noDataFollowed)
     {
@@ -500,7 +500,7 @@
 
     if (toReadBufLen)
     {
-        *this>>dataLen;
+        *this>>(unsigned long&)dataLen;
     }
     else
     {
@@ -520,7 +520,7 @@
     /***
      * Check if any data written
      ***/
-    *this>>bufferLen;
+    *this>>(unsigned long&)bufferLen;
     if (bufferLen == noDataFollowed)
     {
         toRead = 0;
@@ -531,7 +531,7 @@
 
     if (toReadBufLen)
     {
-        *this>>dataLen;
+        *this>>(unsigned long&)dataLen;
     }
     else
     {
@@ -849,14 +849,14 @@
      * to do: combine the checking and create a new exception code later
      ***/
     TEST_THROW_ARG2( (bytesRead < fBufSize)
-               , bytesRead
-               , fBufSize
+               , (unsigned long)bytesRead
+               , (unsigned long)fBufSize
                , XMLExcepts::XSer_InStream_Read_LT_Req
                )
 
     TEST_THROW_ARG2( (bytesRead > fBufSize)
-               , bytesRead
-               , fBufSize
+               , (unsigned long)bytesRead
+               , (unsigned long)fBufSize
                , XMLExcepts::XSer_InStream_Read_OverFlow
                )
 
@@ -891,7 +891,7 @@
 inline void XSerializeEngine::checkAndFlushBuffer(XMLSize_t bytesNeedToWrite)
 {
     TEST_THROW_ARG1( (bytesNeedToWrite <= 0)
-                   , bytesNeedToWrite
+                   , (unsigned long)bytesNeedToWrite
                    , XMLExcepts::XSer_Inv_checkFlushBuffer_Size
                    )
 
@@ -904,7 +904,7 @@
 {
 
     TEST_THROW_ARG1( (bytesNeedToRead <= 0)
-                   , bytesNeedToRead
+                   , (unsigned long)bytesNeedToRead
                    , XMLExcepts::XSer_Inv_checkFillBuffer_Size
                    )
 
@@ -920,8 +920,8 @@
 {
 
     TEST_THROW_ARG2 ( !((fBufStart <= fBufCur) && (fBufCur <= fBufEnd))
-                    , (fBufCur - fBufStart)
-                    , (fBufEnd - fBufCur)
+                    , (unsigned long)(fBufCur - fBufStart)
+                    , (unsigned long)(fBufEnd - fBufCur)
                     , XMLExcepts::XSer_StoreBuffer_Violation
                     )
 
@@ -931,8 +931,8 @@
 {
 
     TEST_THROW_ARG2 ( !((fBufStart <= fBufCur) && (fBufCur <= fBufLoadMax))
-                    , (fBufCur - fBufStart)
-                    , (fBufLoadMax - fBufCur)
+                    , (unsigned long)(fBufCur - fBufStart)
+                    , (unsigned long)(fBufLoadMax - fBufCur)
                     , XMLExcepts::XSer_LoadBuffer_Violation
                     )
 

Modified: xerces/c/trunk/src/xercesc/util/HexBin.cpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/util/HexBin.cpp?view=diff&rev=557254&r1=557253&r2=557254
==============================================================================
--- xerces/c/trunk/src/xercesc/util/HexBin.cpp (original)
+++ xerces/c/trunk/src/xercesc/util/HexBin.cpp Wed Jul 18 06:28:54 2007
@@ -102,7 +102,7 @@
         return 0;
 
     //prepare the return string
-    int decodeLength = strLen/2;
+    int decodeLength = (int)strLen/2;
     XMLByte *retVal = (XMLByte*) manager->allocate( (decodeLength + 1) * sizeof(XMLByte));
     ArrayJanitor<XMLByte> janFill(retVal, manager);
     

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=557254&r1=557253&r2=557254
==============================================================================
--- xerces/c/trunk/src/xercesc/util/XMLBigDecimal.cpp (original)
+++ xerces/c/trunk/src/xercesc/util/XMLBigDecimal.cpp Wed Jul 18 06:28:54 2007
@@ -269,7 +269,7 @@
             if (!dotSignFound)
             {
                 dotSignFound = true;
-                fractDigits = endPtr - startPtr - 1;
+                fractDigits = (int)(endPtr - startPtr - 1);
                 startPtr++;
                 continue;
             }

Modified: xerces/c/trunk/src/xercesc/util/XMLBigInteger.hpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/util/XMLBigInteger.hpp?view=diff&rev=557254&r1=557253&r2=557254
==============================================================================
--- xerces/c/trunk/src/xercesc/util/XMLBigInteger.hpp (original)
+++ xerces/c/trunk/src/xercesc/util/XMLBigInteger.hpp Wed Jul 18 06:28:54 2007
@@ -80,7 +80,7 @@
 
     void        divide(const unsigned int byteToShift);
 
-    int         getTotalDigit() const;
+    unsigned int       getTotalDigit() const;
    
     /**
      *  Return a copy of the fMagnitue.
@@ -150,9 +150,9 @@
     return fSign;
 }
 
-inline int XMLBigInteger::getTotalDigit() const
+inline unsigned int XMLBigInteger::getTotalDigit() const
 {
-    return ((getSign() ==0) ? 0 : XMLString::stringLen(fMagnitude));
+    return ((getSign() ==0) ? 0 : (unsigned int)XMLString::stringLen(fMagnitude));
 }
 
 inline bool XMLBigInteger::operator==(const XMLBigInteger& toCompare) const

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=557254&r1=557253&r2=557254
==============================================================================
--- xerces/c/trunk/src/xercesc/util/XMLDateTime.cpp (original)
+++ xerces/c/trunk/src/xercesc/util/XMLDateTime.cpp Wed Jul 18 06:28:54 2007
@@ -1831,8 +1831,8 @@
             serEng<<fTimeZone[i];
         }
 
-        serEng<<fStart;
-        serEng<<fEnd;
+        serEng<<(unsigned long)fStart;
+        serEng<<(unsigned long)fEnd;
 
         serEng.writeString(fBuffer, fBufferMaxLen, XSerializeEngine::toWriteBufferLen);
     }
@@ -1848,8 +1848,8 @@
             serEng>>fTimeZone[i];
         }
 
-        serEng>>fStart;
-        serEng>>fEnd;
+        serEng>>(unsigned long&)fStart;
+        serEng>>(unsigned long&)fEnd;
 
         XMLSize_t dataLen = 0;
         serEng.readString(fBuffer, fBufferMaxLen, dataLen ,XSerializeEngine::toReadBufferLen);

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=557254&r1=557253&r2=557254
==============================================================================
--- xerces/c/trunk/src/xercesc/util/XMLUri.cpp (original)
+++ xerces/c/trunk/src/xercesc/util/XMLUri.cpp Wed Jul 18 06:28:54 2007
@@ -425,7 +425,7 @@
         return;
 	}
 
-	int index = 0;
+	XMLSize_t index = 0;
 	bool foundScheme = false;
 
 	// Check for scheme, which must be before `/', '?' or '#'. 	
@@ -473,7 +473,7 @@
         XMLString::startsWith(authUriSpec, DOUBLE_SLASH))
     {
         index += 2;
-        int startPos = index;
+        XMLSize_t startPos = index;
 
         // get authority - everything up to path, query or fragment
         XMLCh testChar;
@@ -614,11 +614,11 @@
         XMLString::catString(path, fPath);
 
         // 6c - remove all "./" where "." is a complete path segment
-        index = -1;
-        while ((index = XMLString::patternMatch(path, SLASH_DOT_SLASH)) != -1)
+        int iIndex = -1;
+        while ((iIndex = XMLString::patternMatch(path, SLASH_DOT_SLASH)) != -1)
         {
-            XMLString::subString(tmp1, path, 0, index, fMemoryManager);
-            XMLString::subString(tmp2, path, index+2, XMLString::stringLen(path), fMemoryManager);
+            XMLString::subString(tmp1, path, 0, iIndex, fMemoryManager);
+            XMLString::subString(tmp2, path, iIndex+2, XMLString::stringLen(path), fMemoryManager);
 
             path[0] = 0;
             XMLString::catString(path, tmp1);
@@ -633,28 +633,28 @@
 
         // 6e - remove all "<segment>/../" where "<segment>" is a complete
         // path segment not equal to ".."
-        index = -1;
+        iIndex = -1;
         int segIndex = -1;
         int offset = 1;
 
-        while ((index = XMLString::patternMatch(&(path[offset]), SLASH_DOTDOT_SLASH)) != -1)
+        while ((iIndex = XMLString::patternMatch(&(path[offset]), SLASH_DOTDOT_SLASH)) != -1)
         {
 			// Undo offset
-			index += offset;
+			iIndex += offset;
 
 			// Find start of <segment> within substring ending at found point.
-			XMLString::subString(tmp1, path, 0, index-1, fMemoryManager);
+			XMLString::subString(tmp1, path, 0, iIndex-1, fMemoryManager);
 			segIndex = XMLString::lastIndexOf(tmp1, chForwardSlash);
 
 			// Ensure <segment> exists and != ".."
             if (segIndex != -1                &&
                 (path[segIndex+1] != chPeriod ||
                  path[segIndex+2] != chPeriod ||
-				 segIndex + 3 != index))
+				 segIndex + 3 != iIndex))
             {
 
                 XMLString::subString(tmp1, path, 0, segIndex, fMemoryManager);
-                XMLString::subString(tmp2, path, index+3, XMLString::stringLen(path), fMemoryManager);
+                XMLString::subString(tmp2, path, iIndex+3, XMLString::stringLen(path), fMemoryManager);
 
                 path[0] = 0;
                 XMLString::catString(path, tmp1);
@@ -680,7 +680,7 @@
             if (segIndex != -1                &&
                 (path[segIndex+1] != chPeriod ||
                  path[segIndex+2] != chPeriod ||
-				 segIndex + 3 != index))
+				 segIndex + 3 != (int)index))
             {
                 path[segIndex+1] = chNull;
             }
@@ -714,7 +714,7 @@
 {
 
     int index = 0;
-    int start = 0;
+    XMLSize_t start = 0;
     const XMLSize_t end = XMLString::stringLen(uriSpec);
 
     //
@@ -850,7 +850,7 @@
                 , fMemoryManager);
     }
 
-    int index = 0;
+    XMLSize_t index = 0;
     XMLSize_t start = 0;
     XMLSize_t end = XMLString::stringLen(uriSpec);
     XMLCh testChar = 0;
@@ -1444,10 +1444,10 @@
 }
 
 bool XMLUri::isValidServerBasedAuthority(const XMLCh* const host,
-                                         const int hostLen,
+                                         const XMLSize_t hostLen,
                                          const int port,
                                          const XMLCh* const userinfo,
-                                         const int userLen)
+                                         const XMLSize_t userLen)
 {
     // The order is important, do not change
     if (!isWellFormedAddress(host, hostLen))
@@ -1458,7 +1458,7 @@
         return false;
 
     // check userinfo
-    int index = 0;
+    XMLSize_t index = 0;
     while (index < userLen)
     {
         if (isUnreservedCharacter(userinfo[index]) ||
@@ -1524,10 +1524,10 @@
 }
 
 bool XMLUri::isValidRegistryBasedAuthority(const XMLCh* const authority,
-                                           const int authLen)
+                                           const XMLSize_t authLen)
 {
     // check authority
-    int index = 0;
+    XMLSize_t index = 0;
     while (index < authLen)
     {
         if (isUnreservedCharacter(authority[index]) ||
@@ -1662,7 +1662,7 @@
 
     // if the string ends with "."
     // get the second last "."
-    if (lastPeriodPos + 1 == addrStrLen)
+    if (XMLSize_t(lastPeriodPos + 1) == addrStrLen)
     {
         XMLCh* tmp2 = (XMLCh*) manager->allocate
         (
@@ -1698,7 +1698,7 @@
         
         // domain labels can contain alphanumerics and '-"
         // but must start and end with an alphanumeric
-        for (int i = 0; i < addrStrLen; i++)
+        for (XMLSize_t i = 0; i < addrStrLen; i++)
         {
             if (addrString[i] == chPeriod)
             {
@@ -1732,7 +1732,7 @@
 //
 //  IPv4address   = 1*3DIGIT "." 1*3DIGIT "." 1*3DIGIT "." 1*3DIGIT
 //
-bool XMLUri::isWellFormedIPv4Address(const XMLCh* const addr, const int length)
+bool XMLUri::isWellFormedIPv4Address(const XMLCh* const addr, const XMLSize_t length)
 {
     int numDots = 0;
     int numDigits = 0;
@@ -1745,7 +1745,7 @@
     // 3) that we find 3 dots
     // 4) that each segment contains 1 to 3 digits.
     // 5) that each segment is not greater than 255.    
-    for (int i = 0; i < length; ++i)
+    for (XMLSize_t i = 0; i < length; ++i)
     {
         if (addr[i] == chPeriod)
         {
@@ -1790,10 +1790,9 @@
 //
 //  IPv6reference = "[" IPv6address "]"
 //
-bool XMLUri::isWellFormedIPv6Reference(const XMLCh* const addr, const int length)
+bool XMLUri::isWellFormedIPv6Reference(const XMLCh* const addr, const XMLSize_t length)
 {
-    int index = 1;
-    int end = length-1;
+    XMLSize_t end = length-1;
     
     // Check if string is a potential match for IPv6reference.
     if (!(length > 2 && addr[0] == chOpenSquare && addr[end] == chCloseSquare))
@@ -1805,13 +1804,13 @@
     int counter = 0;
       
     // Scan hex sequence before possible '::' or IPv4 address.
-    index = scanHexSequence(addr, index, end, counter);
-    if (index == -1) 
-    {
+    int iIndex = scanHexSequence(addr, 1, end, counter);
+    if (iIndex == -1) 
         return false;
-    }
+
+    XMLSize_t index=(XMLSize_t)iIndex;
     // Address must contain 128-bits of information.
-    else if (index == end) 
+    if (index == end) 
     {
        return (counter == 8);
     }
@@ -1850,32 +1849,32 @@
       
     // 3. Scan hex sequence after '::'.
     int prevCount = counter;
-    index = scanHexSequence(addr, index, end, counter);
-    if (index == -1) 
-    {
+    iIndex = scanHexSequence(addr, index, end, counter);
+    if (iIndex == -1) 
         return false;
-    }
+
+    index=(XMLSize_t)iIndex;
     // If this is the end of the address then
     // we've got 128-bits of information.
-    else if (index == end) 
+    if (index == end) 
     {
         return true;
     }
 
     // The address ends in an IPv4 address, or it is invalid. 
     // scanHexSequence has already made sure that we have the right number of bits. 
-    int shiftCount = (counter > prevCount) ? index+1 : index;
+    XMLSize_t shiftCount = (counter > prevCount) ? index+1 : index;
     return isWellFormedIPv4Address(addr + shiftCount, end - shiftCount);
 }
 
 //
 //  For use with isWellFormedIPv6Reference only.
 //
-int XMLUri::scanHexSequence (const XMLCh* const addr, int index, int end, int& counter)
+int XMLUri::scanHexSequence (const XMLCh* const addr, XMLSize_t index, XMLSize_t end, int& counter)
 {
     XMLCh testChar = chNull;
     int numDigits = 0;
-    int start = index;
+    XMLSize_t start = index;
       
     // Trying to match the following productions:
     // hexseq = hex4 *( ":" hex4)
@@ -1893,7 +1892,7 @@
       	    // This could be '::'.
       	    if (numDigits == 0 || ((index+1 < end) && addr[index+1] == chColon))
       	    {
-      	        return index;
+      	        return (int)index;
       	    }
       	    numDigits = 0;
         }
@@ -1903,8 +1902,8 @@
         {
             if (testChar == chPeriod && numDigits < 4 && numDigits > 0 && counter <= 6)
             {
-                int back = index - numDigits - 1;
-                return (back >= start) ? back : start;
+                int back = (int)index - numDigits - 1;
+                return (back >= (int)start) ? back : (int)start;
             }
             return -1;
         }
@@ -1914,7 +1913,7 @@
             return -1;
         }
     }
-    return (numDigits > 0 && ++counter <= 8) ? end : -1;
+    return (numDigits > 0 && ++counter <= 8) ? (int)end : -1;
 }
 
 bool XMLUri::isGenericURI()
@@ -2081,7 +2080,7 @@
         XMLString::startsWith(authUriSpec, DOUBLE_SLASH))
     {
         index += 2;
-        int startPos = index;
+        XMLSize_t startPos = index;
 
         // get authority - everything up to path, query or fragment
         XMLCh testChar;
@@ -2181,7 +2180,7 @@
         XMLString::startsWith(authUriSpec, DOUBLE_SLASH))
     {
         index += 2;
-        int startPos = index;
+        XMLSize_t startPos = index;
 
         // get authority - everything up to path, query or fragment
         XMLCh testChar;
@@ -2246,7 +2245,7 @@
 
     // if the string ends with "."
     // get the second last "."
-    if (lastPeriodPos + 1 == addrStrLen)
+    if (XMLSize_t(lastPeriodPos + 1) == addrStrLen)
     {
         lastPeriodPos = XMLString::lastIndexOf(chPeriod, addrString, lastPeriodPos);
 
@@ -2276,7 +2275,7 @@
         
         // domain labels can contain alphanumerics and '-"
         // but must start and end with an alphanumeric
-        for (int i = 0; i < addrStrLen; i++)
+        for (XMLSize_t i = 0; i < addrStrLen; i++)
         {
             if (addrString[i] == chPeriod)
             {
@@ -2339,13 +2338,13 @@
                              , const XMLSize_t authLen)
 {
     int index = XMLString::indexOf(authSpec, chAt);
-    int start = 0;
+    XMLSize_t start = 0;
 
     // server = [ [ userinfo "@" ] hostport ]
     // userinfo is everything up @,
     const XMLCh* userinfo;
     int userInfoLen = 0;
-    if ((index != -1) && (index < authLen))
+    if ((index != -1) && (XMLSize_t(index) < authLen))
     {
         userinfo = authSpec;
         userInfoLen = index;
@@ -2362,11 +2361,11 @@
     //
     // Search for port boundary.
     const XMLCh* host;
-    int hostLen = 0;
+    XMLSize_t hostLen = 0;
     if ((start < authLen) && (authSpec[start] == chOpenSquare))
     {
     	index = XMLString::indexOf(&(authSpec[start]), chCloseSquare);
-    	if ((index != -1) && (index < authLen))
+    	if ((index != -1) && (XMLSize_t(index) < authLen))
     	{
             // skip the ']'
             index = ((start + index + 1) < authLen
@@ -2376,7 +2375,7 @@
     else
     {
         index = XMLString::indexOf(&(authSpec[start]), chColon);
-        if (index >= authLen)
+        if (index!=-1 && XMLSize_t(index) >= authLen)
             index = -1;
     }
 
@@ -2402,7 +2401,7 @@
         if (*portStr)
         {
             port = 0;
-            for (int i=0; i<(authLen - start); i++)
+            for (XMLSize_t i=0; i<(authLen - start); i++)
             {
                 if (portStr[i] < chDigit_0 || portStr[i] > chDigit_9)
                     return false;
@@ -2424,7 +2423,7 @@
 {
     if (pathStrLen != 0)
     {
-        int index = 0;
+        XMLSize_t index = 0;
         XMLCh testChar = chNull;
         bool isOpaque = (!isSchemePresent || *pathStr == chForwardSlash);
 

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=557254&r1=557253&r2=557254
==============================================================================
--- xerces/c/trunk/src/xercesc/util/XMLUri.hpp (original)
+++ xerces/c/trunk/src/xercesc/util/XMLUri.hpp Wed Jul 18 06:28:54 2007
@@ -382,10 +382,10 @@
      * a valid server authority
      */
     static bool isValidServerBasedAuthority(const XMLCh* const host
-                                           , const int hostLen
+                                           , const XMLSize_t hostLen
                                            , const int port
                                            , const XMLCh* const userinfo
-                                           , const int userLen);
+                                           , const XMLSize_t userLen);
                                            
     /**
      * Determines whether the components host, port, and user info
@@ -407,7 +407,7 @@
     * @return true if the given string is a registry based authority
     */
     static bool isValidRegistryBasedAuthority(const XMLCh* const authority
-                                             , const int authLen);
+                                             , const XMLSize_t authLen);
 
    /**
     * Determines whether the given string is a registry based authority.
@@ -447,7 +447,7 @@
      *
      * @return true if the string is a syntactically valid IPv4 address
      */
-     static bool isWellFormedIPv4Address(const XMLCh* const addr, const int length);
+     static bool isWellFormedIPv4Address(const XMLCh* const addr, const XMLSize_t length);
      
     /**
      * Determines whether a string is an IPv6 reference as defined
@@ -462,7 +462,7 @@
      *
      * @return true if the string is a syntactically valid IPv6 reference
      */
-     static bool isWellFormedIPv6Reference(const XMLCh* const addr, const int length);
+     static bool isWellFormedIPv6Reference(const XMLCh* const addr, const XMLSize_t length);
      
     /**
      * Helper function for isWellFormedIPv6Reference which scans the 
@@ -479,7 +479,7 @@
      * @return the index of the next character to scan, or -1 if the
      * string cannot match a valid IPv6 address
      */
-     static int scanHexSequence (const XMLCh* const addr, int index, int end, int& counter);
+     static int scanHexSequence (const XMLCh* const addr, XMLSize_t index, XMLSize_t end, int& counter);
 
     /**
      * Get the indicator as to whether this URI uses the "generic URI"

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=557254&r1=557253&r2=557254
==============================================================================
--- xerces/c/trunk/src/xercesc/util/regx/RegularExpression.cpp (original)
+++ xerces/c/trunk/src/xercesc/util/regx/RegularExpression.cpp Wed Jul 18 06:28:54 2007
@@ -550,7 +550,7 @@
 
 			if (context.fMatch != 0) {
 
-				context.fMatch->setStartPos(0, context.fStart);
+				context.fMatch->setStartPos(0, (int)context.fStart);
 				context.fMatch->setEndPos(0, matchEnd);
 			}		
 			return true;
@@ -570,7 +570,7 @@
 
 			if (context.fMatch != 0) {
 				context.fMatch->setStartPos(0, ret);
-				context.fMatch->setEndPos(0, ret + strLength);
+				context.fMatch->setEndPos(0, (int)(ret + strLength));
 			}		
 			return true;
 		}		
@@ -672,7 +672,7 @@
 
 		if (context.fMatch != 0) {
 
-			context.fMatch->setStartPos(0, matchStart);
+			context.fMatch->setStartPos(0, (int)matchStart);
 			context.fMatch->setEndPos(0, matchEnd);
 		}		
 		return true;
@@ -746,13 +746,14 @@
 
   for (; matchStart <= end; matchStart++) { 
   
- 	  int matchEnd = match(&context, fOperations, matchStart, 1);
+ 	  int iMatchEnd = match(&context, fOperations, matchStart, 1);
   
- 	  if (matchEnd != -1) {
+ 	  if (iMatchEnd != -1) {
+          XMLSize_t matchEnd=iMatchEnd;
 
  	    if (context.fMatch != 0) {
- 	      context.fMatch->setStartPos(0, context.fStart);
- 	      context.fMatch->setEndPos(0, matchEnd);
+ 	      context.fMatch->setStartPos(0, (int)context.fStart);
+ 	      context.fMatch->setEndPos(0, (int)matchEnd);
  	    }
 
       if (subEx){
@@ -1035,7 +1036,7 @@
 				if (id >= 0) {
 					int prevOffset = context->fOffsets[id];
 					if (prevOffset < 0 || prevOffset != offset) {
-						context->fOffsets[id] = offset;
+						context->fOffsets[id] = (int)offset;
 					}
 					else {
 
@@ -1128,8 +1129,9 @@
 		}
 	}
 	
-	return offset;
+	return (int)offset;
 }
+
 bool RegularExpression::matchChar(Context* const context,
 								  const XMLInt32 ch, XMLSize_t& offset,
 								  const short direction, const bool ignoreCase)
@@ -1330,18 +1332,18 @@
 	int start = context->fMatch->getStartPos(refNo);
 	int length = context->fMatch->getEndPos(refNo) - start;
 
-    if(direction < 0 && offset<length)
+    if(direction < 0 && (int)offset<length)
         return false;
 
     XMLSize_t tmpOffset = (direction > 0) ? offset : offset - length;
 
-	if (context->fLimit - tmpOffset < length)
+	if (int(context->fLimit - tmpOffset) < length)
 		return false;
 
 	bool match = ignoreCase
-					? XMLString::regionIMatches(context->fString,tmpOffset,
+					? XMLString::regionIMatches(context->fString,(int)tmpOffset,
 												context->fString,start,length)
-					: XMLString::regionMatches(context->fString, tmpOffset,
+					: XMLString::regionMatches(context->fString, (int)tmpOffset,
 											   context->fString, start,length);
 
 	if (!match)
@@ -1365,9 +1367,9 @@
 		return false;
 
 	bool match = ignoreCase
-					? XMLString::regionIMatches(context->fString, tmpOffset,
+					? XMLString::regionIMatches(context->fString, (int)tmpOffset,
 												literal, 0, length)
-					: XMLString::regionMatches(context->fString, tmpOffset,
+					: XMLString::regionMatches(context->fString, (int)tmpOffset,
 											   literal, 0, length);
 
 	if (match) {
@@ -1388,14 +1390,14 @@
 
 	if (index > 0) {
 
-		context->fMatch->setStartPos(index, offset);
+		context->fMatch->setStartPos(index, (int)offset);
 		int ret = match(context, op->getNextOp(), offset, direction);
 		if (ret < 0)
 			context->fMatch->setStartPos(index, save);
 		return ret;
 	}
 	
-	context->fMatch->setEndPos(-index, offset);
+	context->fMatch->setEndPos(-index, (int)offset);
 	int ret = match(context, op->getNextOp(), offset, direction);
 	if (ret < 0)
 		context->fMatch->setEndPos(-index, save);
@@ -1413,7 +1415,7 @@
   for(unsigned int i=0; i < opSize; i++) {
       Context tmpContext(context);
       int ret = match(&tmpContext, op->elementAt(i), offset, direction);
-      if (ret >= 0 && ret <= context->fLimit && ret>bestResult)
+      if (ret >= 0 && (XMLSize_t)ret <= context->fLimit && ret>bestResult)
       {
           bestResult=ret;
           bestResultContext=tmpContext;

Modified: xerces/c/trunk/src/xercesc/util/regx/RegxParser.cpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/util/regx/RegxParser.cpp?view=diff&rev=557254&r1=557253&r2=557254
==============================================================================
--- xerces/c/trunk/src/xercesc/util/regx/RegxParser.cpp (original)
+++ xerces/c/trunk/src/xercesc/util/regx/RegxParser.cpp Wed Jul 18 06:28:54 2007
@@ -109,7 +109,7 @@
 
 	if (fOffset != fStringLen) {
         XMLCh value1[65];
-        XMLString::binToText(fOffset, value1, 64, 10, fMemoryManager);
+        XMLString::binToText((unsigned long)fOffset, value1, 64, 10, fMemoryManager);
         ThrowXMLwithMemMgr2(ParseException,XMLExcepts::Parser_Parse1, value1, fString, fMemoryManager);
     }
 

Modified: xerces/c/trunk/src/xercesc/validators/datatype/AbstractStringValidator.cpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/validators/datatype/AbstractStringValidator.cpp?view=diff&rev=557254&r1=557253&r2=557254
==============================================================================
--- xerces/c/trunk/src/xercesc/validators/datatype/AbstractStringValidator.cpp (original)
+++ xerces/c/trunk/src/xercesc/validators/datatype/AbstractStringValidator.cpp Wed Jul 18 06:28:54 2007
@@ -716,7 +716,7 @@
 int AbstractStringValidator::getLength(const XMLCh* const content
                                    , MemoryManager* const) const
 {
-    return XMLString::stringLen(content);
+    return (int)XMLString::stringLen(content);
 }
 
 /***

Modified: xerces/c/trunk/src/xercesc/validators/schema/SchemaValidator.cpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/validators/schema/SchemaValidator.cpp?view=diff&rev=557254&r1=557253&r2=557254
==============================================================================
--- xerces/c/trunk/src/xercesc/validators/schema/SchemaValidator.cpp (original)
+++ xerces/c/trunk/src/xercesc/validators/schema/SchemaValidator.cpp Wed Jul 18 06:28:54 2007
@@ -1702,8 +1702,8 @@
     // Now, see if there are some elements in the base we didn't match up
     // in case of Sequence or All
     if (!toLax && codeToThrow == XMLExcepts::NoError &&
-        (true || (baseType & 0x0f) == ContentSpecNode::All || 
-         derivedSpecNodeIn->getElement()->getURI() != XMLElementDecl::fgPCDataElemId)) {
+        (baseType & 0x0f) == ContentSpecNode::All || derivedSpecNodeIn->getElement()->getURI() != XMLElementDecl::fgPCDataElemId) 
+    {
         for (unsigned int j = current; j < count2; j++) {
             if (baseNodes->elementAt(j)->getMinTotalRange() * baseSpecNode->getMinOccurs()) { //!emptiable
                 codeToThrow =  XMLExcepts::PD_Recurse2;                

Modified: xerces/c/trunk/src/xercesc/validators/schema/TraverseSchema.hpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/validators/schema/TraverseSchema.hpp?view=diff&rev=557254&r1=557253&r2=557254
==============================================================================
--- xerces/c/trunk/src/xercesc/validators/schema/TraverseSchema.hpp (original)
+++ xerces/c/trunk/src/xercesc/validators/schema/TraverseSchema.hpp Wed Jul 18 06:28:54 2007
@@ -792,7 +792,7 @@
     int    colonIndex = XMLString::indexOf(rawName, chColon);
     XMLSize_t rawNameLen = XMLString::stringLen(rawName);
 
-    if (colonIndex + 1 == rawNameLen) {
+    if (XMLSize_t(colonIndex + 1) == rawNameLen) {
         return XMLUni::fgZeroLenString;
     }
 

Modified: xerces/c/trunk/src/xercesc/xinclude/XIncludeLocation.cpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/xinclude/XIncludeLocation.cpp?view=diff&rev=557254&r1=557253&r2=557254
==============================================================================
--- xerces/c/trunk/src/xercesc/xinclude/XIncludeLocation.cpp (original)
+++ xerces/c/trunk/src/xercesc/xinclude/XIncludeLocation.cpp Wed Jul 18 06:28:54 2007
@@ -48,7 +48,6 @@
 //  Destructor and Constructor
 // ---------------------------------------------------------------------------
 XIncludeLocation::XIncludeLocation(const XMLCh *href){
-	size_t length = XMLString::stringLen(href);
 	fHref = allocate(href);
 }
 

Modified: xerces/c/trunk/src/xercesc/xinclude/XIncludeUtils.cpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/xinclude/XIncludeUtils.cpp?view=diff&rev=557254&r1=557253&r2=557254
==============================================================================
--- xerces/c/trunk/src/xercesc/xinclude/XIncludeUtils.cpp (original)
+++ xerces/c/trunk/src/xercesc/xinclude/XIncludeUtils.cpp Wed Jul 18 06:28:54 2007
@@ -605,19 +605,19 @@
 
 /* 4.1.1 */
 const XMLCh *
-XIncludeUtils::getEscapedHRefAttrValue(const XMLCh *hrefAttrValue, bool &needsDeallocating){
+XIncludeUtils::getEscapedHRefAttrValue(const XMLCh * /*hrefAttrValue*/, bool & /*needsDeallocating*/){
 	XMLCh *escapedAttr = NULL;
 	return escapedAttr;
 }
 
 /* 4.1.2 */
 bool 
-XIncludeUtils::setContentNegotiation(const XMLCh *acceptAttrValue, const XMLCh *acceptLangAttrValue){
+XIncludeUtils::setContentNegotiation(const XMLCh * /*acceptAttrValue*/, const XMLCh * /*acceptLangAttrValue*/){
 	return false;
 }
 
 bool
-XIncludeUtils::checkTextIsValidForInclude(XMLCh *includeChars){
+XIncludeUtils::checkTextIsValidForInclude(XMLCh * /*includeChars*/){
 	return false;
 }
 
@@ -669,7 +669,7 @@
 }
 
 XIncludeHistoryNode *
-XIncludeUtils::popFromCurrentInclusionHistoryStack(const XMLCh *toPop){
+XIncludeUtils::popFromCurrentInclusionHistoryStack(const XMLCh * /*toPop*/){
 	XIncludeHistoryNode *historyCursor = fIncludeHistoryHead;
 	XIncludeHistoryNode *penultimateCursor = historyCursor;
 
@@ -708,7 +708,7 @@
 }
 
 bool 
-XIncludeUtils::reportError(const DOMNode* const    errorNode
+XIncludeUtils::reportError(const DOMNode* const    /*errorNode*/
                               , XMLErrs::Codes errorType
                               , const XMLCh*   const    errorMsg
 							  , const XMLCh * const href)



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