From dd9d375be4fd703ab13af53fb63ddddf71e73fa8 Mon Sep 17 00:00:00 2001 From: David N Bertoni <dbertoni@apache.org> Date: Tue, 1 Jul 2008 17:55:39 +0000 Subject: [PATCH] Cleaned up some compiler warnings. git-svn-id: https://svn.apache.org/repos/asf/xerces/c/trunk@673155 13f79535-47bb-0310-9956-ffa450edef68 --- src/xercesc/internal/IGXMLScanner2.cpp | 264 +++++++++--------- src/xercesc/util/HashCMStateSet.hpp | 6 +- src/xercesc/util/XMLAbstractDoubleFloat.cpp | 2 - src/xercesc/util/XMLDouble.hpp | 4 +- src/xercesc/util/XMLFloat.hpp | 4 +- src/xercesc/util/XMLString.cpp | 4 +- src/xercesc/util/regx/RegularExpression.cpp | 58 ++-- .../AbstractNumericFacetValidator.hpp | 16 +- .../schema/GeneralAttributeCheck.cpp | 4 +- src/xercesc/validators/schema/SchemaInfo.hpp | 8 +- .../validators/schema/TraverseSchema.cpp | 30 +- .../validators/schema/TraverseSchema.hpp | 2 +- 12 files changed, 202 insertions(+), 200 deletions(-) diff --git a/src/xercesc/internal/IGXMLScanner2.cpp b/src/xercesc/internal/IGXMLScanner2.cpp index 5660dec15..fb78f82ca 100644 --- a/src/xercesc/internal/IGXMLScanner2.cpp +++ b/src/xercesc/internal/IGXMLScanner2.cpp @@ -2320,174 +2320,174 @@ bool IGXMLScanner::scanAttValue( const XMLAttDef* const attDef bool escaped; while (true) { - try - { - while(true) + try { - nextCh = fReaderMgr.getNextChar(); - - if (!nextCh) - ThrowXMLwithMemMgr(UnexpectedEOFException, XMLExcepts::Gen_UnexpectedEOF, fMemoryManager); - - // Check for our ending quote in the same entity - if (nextCh == quoteCh) + while(true) { - if (curReader == fReaderMgr.getCurrentReaderNum()) - return true; + nextCh = fReaderMgr.getNextChar(); - // Watch for spillover into a previous entity - if (curReader > fReaderMgr.getCurrentReaderNum()) + if (!nextCh) + ThrowXMLwithMemMgr(UnexpectedEOFException, XMLExcepts::Gen_UnexpectedEOF, fMemoryManager); + + // Check for our ending quote in the same entity + if (nextCh == quoteCh) { - emitError(XMLErrs::PartialMarkupInEntity); - return false; + if (curReader == fReaderMgr.getCurrentReaderNum()) + return true; + + // Watch for spillover into a previous entity + if (curReader > fReaderMgr.getCurrentReaderNum()) + { + emitError(XMLErrs::PartialMarkupInEntity); + return false; + } } - } - // Check for an entity ref now, before we let it affect our - // whitespace normalization logic below. We ignore the empty flag - // in this one. - escaped = false; - if (nextCh == chAmpersand) - { - if (scanEntityRef(true, nextCh, secondCh, escaped) != EntityExp_Returned) + // Check for an entity ref now, before we let it affect our + // whitespace normalization logic below. We ignore the empty flag + // in this one. + escaped = false; + if (nextCh == chAmpersand) { - gotLeadingSurrogate = false; - continue; + if (scanEntityRef(true, nextCh, secondCh, escaped) != EntityExp_Returned) + { + gotLeadingSurrogate = false; + continue; + } } - } - else if ((nextCh >= 0xD800) && (nextCh <= 0xDBFF)) - { - // Deal with surrogate pairs - // Its a leading surrogate. If we already got one, then - // issue an error, else set leading flag to make sure that - // we look for a trailing next time. - if (gotLeadingSurrogate) - emitError(XMLErrs::Expected2ndSurrogateChar); - else - gotLeadingSurrogate = true; - } - else - { - // If its a trailing surrogate, make sure that we are - // prepared for that. Else, its just a regular char so make - // sure that we were not expected a trailing surrogate. - if ((nextCh >= 0xDC00) && (nextCh <= 0xDFFF)) + else if ((nextCh >= 0xD800) && (nextCh <= 0xDBFF)) { - // Its trailing, so make sure we were expecting it - if (!gotLeadingSurrogate) - emitError(XMLErrs::Unexpected2ndSurrogateChar); + // Deal with surrogate pairs + // Its a leading surrogate. If we already got one, then + // issue an error, else set leading flag to make sure that + // we look for a trailing next time. + if (gotLeadingSurrogate) + emitError(XMLErrs::Expected2ndSurrogateChar); + else + gotLeadingSurrogate = true; } else { - // Its just a char, so make sure we were not expecting a - // trailing surrogate. - if (gotLeadingSurrogate) - emitError(XMLErrs::Expected2ndSurrogateChar); - - // Its got to at least be a valid XML character - if (!fReaderMgr.getCurrentReader()->isXMLChar(nextCh)) + // If its a trailing surrogate, make sure that we are + // prepared for that. Else, its just a regular char so make + // sure that we were not expected a trailing surrogate. + if ((nextCh >= 0xDC00) && (nextCh <= 0xDFFF)) { - XMLCh tmpBuf[9]; - XMLString::binToText - ( - nextCh - , tmpBuf - , 8 - , 16 - , fMemoryManager - ); - emitError(XMLErrs::InvalidCharacterInAttrValue, attrName, tmpBuf); + // Its trailing, so make sure we were expecting it + if (!gotLeadingSurrogate) + emitError(XMLErrs::Unexpected2ndSurrogateChar); + } + else + { + // Its just a char, so make sure we were not expecting a + // trailing surrogate. + if (gotLeadingSurrogate) + emitError(XMLErrs::Expected2ndSurrogateChar); + + // Its got to at least be a valid XML character + if (!fReaderMgr.getCurrentReader()->isXMLChar(nextCh)) + { + XMLCh tmpBuf[9]; + XMLString::binToText + ( + nextCh + , tmpBuf + , 8 + , 16 + , fMemoryManager + ); + emitError(XMLErrs::InvalidCharacterInAttrValue, attrName, tmpBuf); + } } + gotLeadingSurrogate = false; } - gotLeadingSurrogate = false; - } - // If its not escaped, then make sure its not a < character, which - // is not allowed in attribute values. - if (!escaped && (nextCh == chOpenAngle)) - emitError(XMLErrs::BracketInAttrValue, attrName); - - // If the attribute is a CDATA type we do simple replacement of - // tabs and new lines with spaces, if the character is not escaped - // by way of a char ref. - // - // Otherwise, we do the standard non-CDATA normalization of - // compressing whitespace to single spaces and getting rid of leading - // and trailing whitespace. - if (type == XMLAttDef::CData) - { - if (!escaped) + // If its not escaped, then make sure its not a < character, which + // is not allowed in attribute values. + if (!escaped && (nextCh == chOpenAngle)) + emitError(XMLErrs::BracketInAttrValue, attrName); + + // If the attribute is a CDATA type we do simple replacement of + // tabs and new lines with spaces, if the character is not escaped + // by way of a char ref. + // + // Otherwise, we do the standard non-CDATA normalization of + // compressing whitespace to single spaces and getting rid of leading + // and trailing whitespace. + if (type == XMLAttDef::CData) { - if ((nextCh == 0x09) || (nextCh == 0x0A) || (nextCh == 0x0D)) + if (!escaped) { - // Check Validity Constraint for Standalone document declaration - // XML 1.0, Section 2.9 - if (fStandalone && fValidate && isAttExternal) + if ((nextCh == 0x09) || (nextCh == 0x0A) || (nextCh == 0x0D)) { - // Can't have a standalone document declaration of "yes" if attribute - // values are subject to normalisation - fValidator->emitError(XMLValid::NoAttNormForStandalone, attrName); + // Check Validity Constraint for Standalone document declaration + // XML 1.0, Section 2.9 + if (fStandalone && fValidate && isAttExternal) + { + // Can't have a standalone document declaration of "yes" if attribute + // values are subject to normalisation + fValidator->emitError(XMLValid::NoAttNormForStandalone, attrName); + } + nextCh = chSpace; } - nextCh = chSpace; } } - } - else - { - if (curState == InWhitespace) + else { - if ((escaped && nextCh != chSpace) || !fReaderMgr.getCurrentReader()->isWhitespace(nextCh)) + if (curState == InWhitespace) { - if (firstNonWS) - toFill.append(chSpace); - curState = InContent; - firstNonWS = true; - } - else - { - continue; + if ((escaped && nextCh != chSpace) || !fReaderMgr.getCurrentReader()->isWhitespace(nextCh)) + { + if (firstNonWS) + toFill.append(chSpace); + curState = InContent; + firstNonWS = true; + } + else + { + continue; + } } - } - else if (curState == InContent) - { - if ((nextCh == chSpace) || - (fReaderMgr.getCurrentReader()->isWhitespace(nextCh) && !escaped)) + else if (curState == InContent) { - curState = InWhitespace; - - // Check Validity Constraint for Standalone document declaration - // XML 1.0, Section 2.9 - if (fStandalone && fValidate && isAttExternal) + if ((nextCh == chSpace) || + (fReaderMgr.getCurrentReader()->isWhitespace(nextCh) && !escaped)) { - if (!firstNonWS || (nextCh != chSpace) || (fReaderMgr.lookingAtSpace())) + curState = InWhitespace; + + // Check Validity Constraint for Standalone document declaration + // XML 1.0, Section 2.9 + if (fStandalone && fValidate && isAttExternal) { - // Can't have a standalone document declaration of "yes" if attribute - // values are subject to normalisation - fValidator->emitError(XMLValid::NoAttNormForStandalone, attrName); + if (!firstNonWS || (nextCh != chSpace) || (fReaderMgr.lookingAtSpace())) + { + // Can't have a standalone document declaration of "yes" if attribute + // values are subject to normalisation + fValidator->emitError(XMLValid::NoAttNormForStandalone, attrName); + } } + continue; } - continue; + firstNonWS = true; } - firstNonWS = true; } - } - // Else add it to the buffer - toFill.append(nextCh); + // Else add it to the buffer + toFill.append(nextCh); - if (secondCh) - { - toFill.append(secondCh); - secondCh=0; + if (secondCh) + { + toFill.append(secondCh); + secondCh=0; + } } } - } - catch(const EndOfEntityException&) - { - // Just eat it and continue. - gotLeadingSurrogate = false; - escaped = false; - } + catch(const EndOfEntityException&) + { + // Just eat it and continue. + gotLeadingSurrogate = false; + escaped = false; + } } return true; } diff --git a/src/xercesc/util/HashCMStateSet.hpp b/src/xercesc/util/HashCMStateSet.hpp index 4f2d7053f..06fe087c5 100644 --- a/src/xercesc/util/HashCMStateSet.hpp +++ b/src/xercesc/util/HashCMStateSet.hpp @@ -62,14 +62,14 @@ inline HashCMStateSet::~HashCMStateSet() inline unsigned int HashCMStateSet::getHashVal(const void *const key, unsigned int mod , MemoryManager* const) { - const CMStateSet* const pkey = (const CMStateSet* const) key; + const CMStateSet* const pkey = (const CMStateSet*) key; return ((pkey->hashCode()) % mod); } inline bool HashCMStateSet::equals(const void *const key1, const void *const key2) { - const CMStateSet* const pkey1 = (const CMStateSet* const) key1; - const CMStateSet* const pkey2 = (const CMStateSet* const) key2; + const CMStateSet* const pkey1 = (const CMStateSet*) key1; + const CMStateSet* const pkey2 = (const CMStateSet*) key2; return (*pkey1==*pkey2); } diff --git a/src/xercesc/util/XMLAbstractDoubleFloat.cpp b/src/xercesc/util/XMLAbstractDoubleFloat.cpp index cb88d2302..dd6bbf4db 100644 --- a/src/xercesc/util/XMLAbstractDoubleFloat.cpp +++ b/src/xercesc/util/XMLAbstractDoubleFloat.cpp @@ -307,8 +307,6 @@ int XMLAbstractDoubleFloat::compareValues(const XMLAbstractDoubleFloat* const lV { return (-1) * compareSpecial(rValue, manager); } - - return 0; } int XMLAbstractDoubleFloat::compareSpecial(const XMLAbstractDoubleFloat* const specialValue diff --git a/src/xercesc/util/XMLDouble.hpp b/src/xercesc/util/XMLDouble.hpp index 342514c05..e1daadc1a 100644 --- a/src/xercesc/util/XMLDouble.hpp +++ b/src/xercesc/util/XMLDouble.hpp @@ -88,8 +88,8 @@ private: inline int XMLDouble::compareValues(const XMLDouble* const lValue , const XMLDouble* const rValue) { - return XMLAbstractDoubleFloat::compareValues((const XMLAbstractDoubleFloat* const) lValue, - (const XMLAbstractDoubleFloat* const) rValue + return XMLAbstractDoubleFloat::compareValues((const XMLAbstractDoubleFloat*) lValue, + (const XMLAbstractDoubleFloat*) rValue , ((XMLAbstractDoubleFloat*)lValue)->getMemoryManager()); } diff --git a/src/xercesc/util/XMLFloat.hpp b/src/xercesc/util/XMLFloat.hpp index 8254a1263..caf12fe3c 100644 --- a/src/xercesc/util/XMLFloat.hpp +++ b/src/xercesc/util/XMLFloat.hpp @@ -87,8 +87,8 @@ private: inline int XMLFloat::compareValues(const XMLFloat* const lValue , const XMLFloat* const rValue) { - return XMLAbstractDoubleFloat::compareValues((const XMLAbstractDoubleFloat* const) lValue, - (const XMLAbstractDoubleFloat* const) rValue + return XMLAbstractDoubleFloat::compareValues((const XMLAbstractDoubleFloat*) lValue, + (const XMLAbstractDoubleFloat*) rValue , ((XMLAbstractDoubleFloat*)lValue)->getMemoryManager()); } diff --git a/src/xercesc/util/XMLString.cpp b/src/xercesc/util/XMLString.cpp index a650d3a80..139348ca0 100644 --- a/src/xercesc/util/XMLString.cpp +++ b/src/xercesc/util/XMLString.cpp @@ -716,7 +716,7 @@ void XMLString::subString(char* const targetStr, const char* const srcStr const XMLSize_t srcLen = strlen(srcStr); // Make sure the start index is within the XMLString bounds - if ( startIndex < 0 || startIndex > endIndex || endIndex > srcLen) + if (startIndex > endIndex || endIndex > srcLen) ThrowXMLwithMemMgr(ArrayIndexOutOfBoundsException, XMLExcepts::Str_StartIndexPastEnd, manager); const XMLSize_t copySize = endIndex - startIndex; @@ -1701,7 +1701,7 @@ void XMLString::subString(XMLCh* const targetStr, const XMLCh* const srcStr ThrowXMLwithMemMgr(IllegalArgumentException, XMLExcepts::Str_ZeroSizedTargetBuf, manager); // Make sure the start index is within the XMLString bounds - if ( startIndex < 0 || startIndex > endIndex || endIndex > srcStrLength) + if (startIndex > endIndex || endIndex > srcStrLength) ThrowXMLwithMemMgr(ArrayIndexOutOfBoundsException, XMLExcepts::Str_StartIndexPastEnd, manager); const XMLSize_t copySize = endIndex - startIndex; diff --git a/src/xercesc/util/regx/RegularExpression.cpp b/src/xercesc/util/regx/RegularExpression.cpp index b964f34ab..db1a6c6b2 100644 --- a/src/xercesc/util/regx/RegularExpression.cpp +++ b/src/xercesc/util/regx/RegularExpression.cpp @@ -149,35 +149,39 @@ RegularExpression::Context::Context(Context* src) : } } -RegularExpression::Context& RegularExpression::Context::operator= (const RegularExpression::Context& other) +RegularExpression::Context& RegularExpression::Context::operator=(const RegularExpression::Context& other) { - fStart=other.fStart; - fLimit=other.fLimit; - fLength=other.fLength; - fSize=other.fSize; - fStringMaxLen=other.fStringMaxLen; - fString=other.fString; - fOptions=other.fOptions; - if (fOffsets) - fMemoryManager->deallocate(fOffsets);//delete [] fOffsets; - fOffsets=0; - if (fAdoptMatch) - delete fMatch; - fMatch=0; - fAdoptMatch=false; - - fMemoryManager=other.fMemoryManager; - if(other.fOffsets) - { - fOffsets = (int*) fMemoryManager->allocate(fSize* sizeof(int)); - for (int i = 0; i< fSize; i++) - fOffsets[i] = other.fOffsets[i]; - } - if(other.fMatch) + if (this != &other) { - fMatch=new Match(*other.fMatch); - fAdoptMatch=true; + fStart=other.fStart; + fLimit=other.fLimit; + fLength=other.fLength; + fSize=other.fSize; + fStringMaxLen=other.fStringMaxLen; + fString=other.fString; + fOptions=other.fOptions; + if (fOffsets) + fMemoryManager->deallocate(fOffsets);//delete [] fOffsets; + fOffsets=0; + if (fAdoptMatch) + delete fMatch; + fMatch=0; + fAdoptMatch=false; + + fMemoryManager=other.fMemoryManager; + if(other.fOffsets) + { + fOffsets = (int*) fMemoryManager->allocate(fSize* sizeof(int)); + for (int i = 0; i< fSize; i++) + fOffsets[i] = other.fOffsets[i]; + } + if(other.fMatch) + { + fMatch=new Match(*other.fMatch); + fAdoptMatch=true; + } } + return *this; } @@ -753,7 +757,7 @@ void RegularExpression::allMatches(const XMLCh* const matchString, const XMLSize XMLSize_t matchStart = start; while(matchStart <= end) { XMLSize_t matchEnd = match(&context, fOperations, matchStart, 1); - if(matchEnd != -1) { + if(matchEnd != (XMLSize_t)-1) { context.fMatch->setStartPos(0, matchStart); context.fMatch->setEndPos(0, matchEnd); diff --git a/src/xercesc/validators/datatype/AbstractNumericFacetValidator.hpp b/src/xercesc/validators/datatype/AbstractNumericFacetValidator.hpp index c30ae5c15..8f1b32eb3 100644 --- a/src/xercesc/validators/datatype/AbstractNumericFacetValidator.hpp +++ b/src/xercesc/validators/datatype/AbstractNumericFacetValidator.hpp @@ -105,13 +105,13 @@ public: // Getter methods // ----------------------------------------------------------------------- - inline XMLNumber* const getMaxInclusive() const; + inline XMLNumber* getMaxInclusive() const; - inline XMLNumber* const getMaxExclusive() const; + inline XMLNumber* getMaxExclusive() const; - inline XMLNumber* const getMinInclusive() const; + inline XMLNumber* getMinInclusive() const; - inline XMLNumber* const getMinExclusive() const; + inline XMLNumber* getMinExclusive() const; inline RefVectorOf<XMLNumber>* getEnumeration() const; @@ -167,22 +167,22 @@ private: // Getter methods // ----------------------------------------------------------------------- -inline XMLNumber* const AbstractNumericFacetValidator::getMaxInclusive() const +inline XMLNumber* AbstractNumericFacetValidator::getMaxInclusive() const { return fMaxInclusive; } -inline XMLNumber* const AbstractNumericFacetValidator::getMaxExclusive() const +inline XMLNumber* AbstractNumericFacetValidator::getMaxExclusive() const { return fMaxExclusive; } -inline XMLNumber* const AbstractNumericFacetValidator::getMinInclusive() const +inline XMLNumber* AbstractNumericFacetValidator::getMinInclusive() const { return fMinInclusive; } -inline XMLNumber* const AbstractNumericFacetValidator::getMinExclusive() const +inline XMLNumber* AbstractNumericFacetValidator::getMinExclusive() const { return fMinExclusive; } diff --git a/src/xercesc/validators/schema/GeneralAttributeCheck.cpp b/src/xercesc/validators/schema/GeneralAttributeCheck.cpp index 427cfc178..444de5a60 100644 --- a/src/xercesc/validators/schema/GeneralAttributeCheck.cpp +++ b/src/xercesc/validators/schema/GeneralAttributeCheck.cpp @@ -189,12 +189,12 @@ GeneralAttributeCheck::checkAttributes(const DOMElement* const elem, } DOMNamedNodeMap* eltAttrs = elem->getAttributes(); - unsigned int attrCount = eltAttrs->getLength(); + const XMLSize_t attrCount = eltAttrs->getLength(); XMLByte attList[A_Count]; memset(attList, 0, sizeof(attList)); - for (unsigned int i = 0; i < attrCount; i++) { + for (XMLSize_t i = 0; i < attrCount; i++) { DOMNode* attribute = eltAttrs->item(i); const XMLCh* attName = attribute->getNodeName(); diff --git a/src/xercesc/validators/schema/SchemaInfo.hpp b/src/xercesc/validators/schema/SchemaInfo.hpp index 49e07f76b..f6d0ddee2 100644 --- a/src/xercesc/validators/schema/SchemaInfo.hpp +++ b/src/xercesc/validators/schema/SchemaInfo.hpp @@ -92,8 +92,8 @@ public: // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- - XMLCh* const getCurrentSchemaURL() const; - const XMLCh* const getTargetNSURIString() const; + XMLCh* getCurrentSchemaURL() const; + const XMLCh* getTargetNSURIString() const; const DOMElement* getRoot() const; bool getProcessed() const; int getBlockDefault() const; @@ -205,12 +205,12 @@ inline NamespaceScope* SchemaInfo::getNamespaceScope() const { return fNamespaceScope; } -inline XMLCh* const SchemaInfo::getCurrentSchemaURL() const { +inline XMLCh* SchemaInfo::getCurrentSchemaURL() const { return fCurrentSchemaURL; } -inline const XMLCh* const SchemaInfo::getTargetNSURIString() const { +inline const XMLCh* SchemaInfo::getTargetNSURIString() const { return fTargetNSURIString; } diff --git a/src/xercesc/validators/schema/TraverseSchema.cpp b/src/xercesc/validators/schema/TraverseSchema.cpp index 890b1ac92..1d4a256e0 100644 --- a/src/xercesc/validators/schema/TraverseSchema.cpp +++ b/src/xercesc/validators/schema/TraverseSchema.cpp @@ -1402,7 +1402,7 @@ int TraverseSchema::traverseComplexTypeDecl(const DOMElement* const elem, // Create a new instance // ----------------------------------------------------------------------- unsigned int previousCircularCheckIndex = fCircularCheckIndex; - int previousScope = fCurrentScope; + unsigned int previousScope = fCurrentScope; if (preProcessFlag) { @@ -1629,7 +1629,7 @@ TraverseSchema::traverseGroupDecl(const DOMElement* const elem, // ------------------------------------------------------------------ // Process contents of global groups // ------------------------------------------------------------------ - int saveScope = fCurrentScope; + unsigned int saveScope = fCurrentScope; Janitor<ContentSpecNode> specNode(0); XercesGroupInfo* saveGroupInfo = fCurrentGroupInfo; @@ -4704,9 +4704,9 @@ bool TraverseSchema::retrieveNamespaceMapping(const DOMElement* const elem) { DOMNamedNodeMap* eltAttrs = elem->getAttributes(); bool seenNS=false; - unsigned int attrCount = eltAttrs->getLength(); + const XMLSize_t attrCount = eltAttrs->getLength(); - for (unsigned int i = 0; i < attrCount; i++) { + for (XMLSize_t i = 0; i < attrCount; i++) { DOMNode* attribute = eltAttrs->item(i); @@ -5089,7 +5089,7 @@ TraverseSchema::findDTValidator(const DOMElement* const elem, SchemaInfo::ListType infoType = SchemaInfo::INCLUDE; SchemaInfo* saveInfo = fSchemaInfo; - int saveScope = fCurrentScope; + unsigned int saveScope = fCurrentScope; if (!XMLString::equals(uri, fTargetNSURIString) && (uri && *uri)) { @@ -5381,7 +5381,7 @@ TraverseSchema::getElementTypeValidator(const DOMElement* const elem, DatatypeValidator* dv = 0; SchemaInfo::ListType infoType = SchemaInfo::INCLUDE; SchemaInfo* saveInfo = fSchemaInfo; - int saveScope = fCurrentScope; + unsigned int saveScope = fCurrentScope; if (otherSchemaURI && *otherSchemaURI) { @@ -5458,7 +5458,7 @@ TraverseSchema::getAttrDatatypeValidatorNS(const DOMElement* const elem, DatatypeValidator* dv = getDatatypeValidator(typeURI, localPart); SchemaInfo::ListType infoType = SchemaInfo::INCLUDE; SchemaInfo* saveInfo = fSchemaInfo; - int saveScope = fCurrentScope; + unsigned int saveScope = fCurrentScope; if (!XMLString::equals(typeURI, fTargetNSURIString) && (typeURI && *typeURI)) { @@ -5521,7 +5521,7 @@ TraverseSchema::getElementComplexTypeInfo(const DOMElement* const elem, ComplexTypeInfo* typeInfo = 0; SchemaInfo* saveInfo = fSchemaInfo; SchemaInfo::ListType infoType = SchemaInfo::INCLUDE; - int saveScope = fCurrentScope; + unsigned int saveScope = fCurrentScope; fBuffer.set(typeURI); fBuffer.append(chComma); @@ -5596,7 +5596,7 @@ TraverseSchema::getGlobalElemDecl(const DOMElement* const elem, SchemaElementDecl* elemDecl = 0; SchemaInfo* saveInfo = fSchemaInfo; SchemaInfo::ListType infoType = SchemaInfo::INCLUDE; - int saveScope = fCurrentScope; + unsigned int saveScope = fCurrentScope; unsigned int uriId = fURIStringPool->addOrFind(nameURI); if (fSchemaInfo->getTargetNSURI() != (int) uriId) @@ -5858,7 +5858,7 @@ void TraverseSchema::processAttributeDeclRef(const DOMElement* const elem, SchemaInfo* saveInfo = fSchemaInfo; SchemaInfo::ListType infoType = SchemaInfo::INCLUDE; SchemaAttDef* refAttDef = 0; - int saveScope = fCurrentScope; + unsigned int saveScope = fCurrentScope; if (!XMLString::equals(uriStr, fTargetNSURIString)) { @@ -6496,7 +6496,7 @@ void TraverseSchema::processBaseTypeInfo(const DOMElement* const elem, ComplexTypeInfo* baseComplexTypeInfo = 0; DatatypeValidator* baseDTValidator = 0; SchemaInfo::ListType infoType = SchemaInfo::INCLUDE; - int saveScope = fCurrentScope; + unsigned int saveScope = fCurrentScope; // check if the base type is from another schema if (!XMLString::equals(uriStr, fTargetNSURIString)) { @@ -6941,7 +6941,7 @@ InputSource* TraverseSchema::resolveSchemaLocation(const XMLCh* const loc, void TraverseSchema::restoreSchemaInfo(SchemaInfo* const toRestore, SchemaInfo::ListType const aListType, - const int saveScope) { + const unsigned int saveScope) { if (aListType == SchemaInfo::IMPORT) { // restore grammar info @@ -7188,7 +7188,7 @@ XercesGroupInfo* TraverseSchema::processGroupRef(const DOMElement* const elem, XercesGroupInfo* groupInfo = 0; SchemaInfo* saveInfo = fSchemaInfo; SchemaInfo::ListType infoType = SchemaInfo::INCLUDE; - int saveScope = fCurrentScope; + unsigned int saveScope = fCurrentScope; //if from another target namespace if (!XMLString::equals(uriStr, fTargetNSURIString)) { @@ -7288,7 +7288,7 @@ TraverseSchema::processAttributeGroupRef(const DOMElement* const elem, XercesAttGroupInfo* attGroupInfo = 0; SchemaInfo* saveInfo = fSchemaInfo; SchemaInfo::ListType infoType = SchemaInfo::INCLUDE; - int saveScope = fCurrentScope; + unsigned int saveScope = fCurrentScope; if (!XMLString::equals(uriStr, fTargetNSURIString)) { @@ -9096,7 +9096,7 @@ XSAnnotation* TraverseSchema::generateSyntheticAnnotation(const DOMElement* cons // next is the namespaces on the elem DOMElement* currentElem = (DOMElement*) elem; DOMNamedNodeMap* eltAttrs; - unsigned int attrCount; + XMLSize_t attrCount; do { eltAttrs = currentElem->getAttributes(); attrCount = eltAttrs->getLength(); diff --git a/src/xercesc/validators/schema/TraverseSchema.hpp b/src/xercesc/validators/schema/TraverseSchema.hpp index 11d93c6e3..f0ab03d2e 100644 --- a/src/xercesc/validators/schema/TraverseSchema.hpp +++ b/src/xercesc/validators/schema/TraverseSchema.hpp @@ -510,7 +510,7 @@ private: void restoreSchemaInfo(SchemaInfo* const toRestore, SchemaInfo::ListType const aListType = SchemaInfo::INCLUDE, - const int saveScope = Grammar::TOP_LEVEL_SCOPE); + const unsigned int saveScope = Grammar::TOP_LEVEL_SCOPE); void popCurrentTypeNameStack(); /** -- GitLab