diff --git a/src/xercesc/internal/IGXMLScanner.cpp b/src/xercesc/internal/IGXMLScanner.cpp
index 261d152a445888c67cb06411268d798bca030620..73bd4ca7e9d2ce14c45ca3c4b4c7628a11bd519f 100644
--- a/src/xercesc/internal/IGXMLScanner.cpp
+++ b/src/xercesc/internal/IGXMLScanner.cpp
@@ -2379,7 +2379,7 @@ bool IGXMLScanner::scanStartTagNS(bool& gotData)
                     // look in the list of undeclared elements, as would have been
                     // done before we made grammars stateless:
                     elemDecl = fSchemaElemNonDeclPool->getByKey(
-                        nameRawBuf, uriId, Grammar::TOP_LEVEL_SCOPE
+                        nameRawBuf, uriId, (int)Grammar::TOP_LEVEL_SCOPE
                     );
                 }
             }
@@ -2402,7 +2402,7 @@ bool IGXMLScanner::scanStartTagNS(bool& gotData)
             );
             elemDecl->setId(
                 fSchemaElemNonDeclPool->put((void*)elemDecl->getBaseName()
-                , uriId, Grammar::TOP_LEVEL_SCOPE, (SchemaElementDecl*)elemDecl)
+                , uriId, (int)Grammar::TOP_LEVEL_SCOPE, (SchemaElementDecl*)elemDecl)
             );
         }
         wasAdded = true;
diff --git a/src/xercesc/internal/SGXMLScanner.cpp b/src/xercesc/internal/SGXMLScanner.cpp
index e03b56c52d3d0e2c810b8a1e82c8e4fc352cf872..f9cedfde7d79e600e98fc66f88de351de2a07a6e 100644
--- a/src/xercesc/internal/SGXMLScanner.cpp
+++ b/src/xercesc/internal/SGXMLScanner.cpp
@@ -1259,7 +1259,7 @@ bool SGXMLScanner::scanStartTag(bool& gotData)
             {
                 // look in the list of undeclared elements, as would have been done
                 // before we made grammars stateless:
-                elemDecl = fElemNonDeclPool->getByKey(nameRawBuf, uriId, Grammar::TOP_LEVEL_SCOPE);
+                elemDecl = fElemNonDeclPool->getByKey(nameRawBuf, uriId, (int)Grammar::TOP_LEVEL_SCOPE);
             }
             if(!elemDecl) {
                 // still not found in specified uri
@@ -1362,7 +1362,7 @@ bool SGXMLScanner::scanStartTag(bool& gotData)
             {
                 // look in the list of undeclared elements, as would have been done
                 // before we made grammars stateless:
-                elemDecl = fElemNonDeclPool->getByKey(nameRawBuf, uriId, Grammar::TOP_LEVEL_SCOPE);
+                elemDecl = fElemNonDeclPool->getByKey(nameRawBuf, uriId, (int)Grammar::TOP_LEVEL_SCOPE);
             }
             if (!elemDecl && orgGrammarUri != fEmptyNamespaceId) {
                 // still Not found in specified uri
diff --git a/src/xercesc/internal/XSAXMLScanner.cpp b/src/xercesc/internal/XSAXMLScanner.cpp
index 3fddf2c914ab247a9e699bc457caa09c975efc94..9a0f5b0938828ac023d31eed8af53d4119bb6504 100644
--- a/src/xercesc/internal/XSAXMLScanner.cpp
+++ b/src/xercesc/internal/XSAXMLScanner.cpp
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -78,7 +78,7 @@ void XSAXMLScanner::scanEndTag(bool& gotData)
 
     // Make sure that its the end of the element that we expect
     const XMLCh *elemName = fElemStack.getCurrentSchemaElemName();
-    const ElemStack::StackElem* topElem = fElemStack.popTop(); 
+    const ElemStack::StackElem* topElem = fElemStack.popTop();
     if (!fReaderMgr.skippedString(elemName))
     {
         emitError
@@ -152,27 +152,27 @@ void XSAXMLScanner::scanEndTag(bool& gotData)
                     , topElem->fChildren[failure]->getRawName()
                     , topElem->fThisElement->getFormattedContentModel()
                 );
-            }            
+            }
         }
     }
 
-    // now we can reset the datatype buffer, since the 
+    // now we can reset the datatype buffer, since the
     // application has had a chance to copy the characters somewhere else
     ((SchemaValidator *)fValidator)->clearDatatypeBuffer();
 
     // If we have a doc handler, tell it about the end tag
     if (fDocHandler)
-    {        
+    {
         if (topElem->fPrefixColonPos != -1)
             fPrefixBuf.set(elemName, topElem->fPrefixColonPos);
         else
-            fPrefixBuf.reset();        
+            fPrefixBuf.reset();
         fDocHandler->endElement
         (
             *topElem->fThisElement
             , uriId
             , isRoot
-            , fPrefixBuf.getRawBuffer()            
+            , fPrefixBuf.getRawBuffer()
         );
     }
 
@@ -204,7 +204,7 @@ bool XSAXMLScanner::scanStartTag(bool& gotData)
     //  in the element name.
     int prefixColonPos;
     if (!fReaderMgr.getQName(fQNameBuf, &prefixColonPos))
-    {       
+    {
         if (fQNameBuf.isEmpty())
             emitError(XMLErrs::ExpectedElementName);
         else
@@ -278,7 +278,7 @@ bool XSAXMLScanner::scanStartTag(bool& gotData)
 
     //  Resolve the qualified name to a URI and name so that we can look up
     //  the element decl for this element. We have now update the prefix to
-    //  namespace map so we should get the correct element now.    
+    //  namespace map so we should get the correct element now.
     unsigned int uriId = resolveQNameWithColon
     (
         qnameRawBuf, fPrefixBuf, ElemStack::Mode_Element, prefixColonPos
@@ -319,7 +319,7 @@ bool XSAXMLScanner::scanStartTag(bool& gotData)
         {
             // if still not found, look in list of undeclared elements
             elemDecl = fElemNonDeclPool->getByKey(
-                nameRawBuf, uriId, Grammar::TOP_LEVEL_SCOPE);
+                nameRawBuf, uriId, (int)Grammar::TOP_LEVEL_SCOPE);
 
             if (!elemDecl)
             {
@@ -329,14 +329,13 @@ bool XSAXMLScanner::scanStartTag(bool& gotData)
                     , SchemaElementDecl::Any, Grammar::TOP_LEVEL_SCOPE
                     , fMemoryManager
                 );
-                elemDecl->setId
-                (
-                    fElemNonDeclPool->put
-                    (
-                        (void*)elemDecl->getBaseName(), uriId
-                        , Grammar::TOP_LEVEL_SCOPE, (SchemaElementDecl*)elemDecl
-                    )
-                );
+
+                elemDecl->setId (fElemNonDeclPool->put(
+                      (void*)elemDecl->getBaseName(),
+                      uriId,
+                      (int)Grammar::TOP_LEVEL_SCOPE,
+                      (SchemaElementDecl*)elemDecl));
+
                 wasAdded = true;
             }
 		}
@@ -587,13 +586,13 @@ void XSAXMLScanner::scanReset(const InputSource& src)
     fReaderMgr.pushReader(newReader, 0);
 
     // and reset security-related things if necessary:
-    if(fSecurityManager != 0) 
+    if(fSecurityManager != 0)
     {
         fEntityExpansionLimit = fSecurityManager->getEntityExpansionLimit();
         fEntityExpansionCount = 0;
     }
     fElemCount = 0;
-    if (fUIntPoolRowTotal >= 32) 
+    if (fUIntPoolRowTotal >= 32)
     { // 8 KB tied up with validating attributes...
         fAttDefRegistry->removeAll();
         recreateUIntPool();
diff --git a/src/xercesc/util/Transcoders/Iconv/IconvTransService.cpp b/src/xercesc/util/Transcoders/Iconv/IconvTransService.cpp
index 64bfa9f985e40ccbafe74d9ddc222b5d8e3d0830..5e243502354bb2c3cc4849dc3931886e8180712b 100644
--- a/src/xercesc/util/Transcoders/Iconv/IconvTransService.cpp
+++ b/src/xercesc/util/Transcoders/Iconv/IconvTransService.cpp
@@ -329,7 +329,7 @@ bool IconvLCPTranscoder::transcode( const   XMLCh* const    toTranscode
 
     // Ok, go ahead and try the transcoding. If it fails, then ...
     size_t mblen = ::wcstombs(toFill, wideCharBuf, maxBytes);
-    if (mblen == -1)
+    if (mblen == (size_t)-1)
     {
         if (allocatedArray)
           manager->deallocate(allocatedArray);
@@ -381,7 +381,7 @@ bool IconvLCPTranscoder::transcode( const   char* const     toTranscode
     else
         wideCharBuf = tmpWideCharArr;
 
-    if (::mbstowcs(wideCharBuf, toTranscode, maxChars) == -1)
+    if (::mbstowcs(wideCharBuf, toTranscode, maxChars) == (size_t)-1)
     {
         if (allocatedArray)
           manager->deallocate(allocatedArray);
diff --git a/src/xercesc/xinclude/XIncludeLocation.cpp b/src/xercesc/xinclude/XIncludeLocation.cpp
index d5dc383549979627ae21568713d0329ce1012065..ccde5c6ab46cabf45ec490693065ebc89d691785 100644
--- a/src/xercesc/xinclude/XIncludeLocation.cpp
+++ b/src/xercesc/xinclude/XIncludeLocation.cpp
@@ -30,11 +30,11 @@
 XERCES_CPP_NAMESPACE_BEGIN
 
 const XMLCh *allocate(const XMLCh *href){
-    const XMLCh *allocated;
+    XMLCh *allocated;
     XMLSize_t length = XMLString::stringLen(href);
-    allocated = (const XMLCh *)XMLPlatformUtils::fgMemoryManager->allocate((length+1) * sizeof(XMLCh));
-    XMLString::copyString((XMLCh *)allocated, href);
-    XMLPlatformUtils::removeDotDotSlash((XMLCh *const)allocated);
+    allocated = (XMLCh*)XMLPlatformUtils::fgMemoryManager->allocate((length+1) * sizeof(XMLCh));
+    XMLString::copyString(allocated, href);
+    XMLPlatformUtils::removeDotDotSlash(allocated);
 
     return allocated;
 }
@@ -67,7 +67,7 @@ XIncludeLocation::prependPath(const XMLCh *baseToAdd){
         return fHref;
     }
 
-    XMLPlatformUtils::removeDotDotSlash((XMLCh *const)baseToAdd);
+    XMLPlatformUtils::removeDotDotSlash((XMLCh*)baseToAdd);
     XMLSize_t baseLength = XMLString::stringLen(baseToAdd);
 
     int lastSlash = XMLString::lastIndexOf(baseToAdd, chForwardSlash);