Author: dbertoni
Date: Tue Jul  1 17:58:08 2008
New Revision: 673248

URL: http://svn.apache.org/viewvc?rev=673248&view=rev
Log:
Cleaned up some compiler warnings.

Modified:
    xerces/c/trunk/samples/src/Redirect/RedirectHandlers.cpp
    xerces/c/trunk/samples/src/Redirect/RedirectHandlers.hpp
    xerces/c/trunk/src/xercesc/framework/psvi/XSValue.cpp
    xerces/c/trunk/src/xercesc/validators/datatype/ListDatatypeValidator.hpp

Modified: xerces/c/trunk/samples/src/Redirect/RedirectHandlers.cpp
URL: 
http://svn.apache.org/viewvc/xerces/c/trunk/samples/src/Redirect/RedirectHandlers.cpp?rev=673248&r1=673247&r2=673248&view=diff
==============================================================================
--- xerces/c/trunk/samples/src/Redirect/RedirectHandlers.cpp (original)
+++ xerces/c/trunk/samples/src/Redirect/RedirectHandlers.cpp Tue Jul  1 
17:58:08 2008
@@ -134,8 +134,7 @@
 }
 
 
-#if 0
-// This is the old resolveEntity interface...
+// This is the SAX2 resolveEntity interface...
 // -----------------------------------------------------------------------
 //  Handlers for the SAX EntityResolver interface
 // -----------------------------------------------------------------------
@@ -143,65 +142,26 @@
                                              , const XMLCh* const    systemId)
 {
     //
-    //  If its our file, then create a new URL input source for the file that
-    //  we want to really be used. Otherwise, just return zero to let the
+    //  If it's our file, then create a new URL input source for the file that
+    //  we want to really be used. Otherwise, just return NULL to let the
     //  default action occur.
-    //
-    //  We cannot assume that the XMLCh type is ok to pass to wcscmp(), so
-    //  just do a comparison ourselves.
-    //
-    const XMLCh* s1 = gFileToTrap;
-    const XMLCh* s2 = systemId;
-    while (true)
+    if (XMLString::compareString(gFileToTrap, systemId) != 0)
     {
-        // Break out on any difference
-        if (*s1 != *s2)
-            return 0;
-
-        // If one is null, then both were null, so they are equal
-        if (!*s1)
-            break;
-
-        // Else get the next char
-        s1++;
-        s2++;
+        return NULL;
+    }
+    else
+    {
+        // They were equal, so redirect to our other file
+        return new LocalFileInputSource(gRedirectToFile);
     }
-
-    // They were equal, so redirect to our other file
-    return new LocalFileInputSource(gRedirectToFile);
 }
-#endif
+
 // -----------------------------------------------------------------------
 //  Handlers for the XMLEntityResolver interface
 // -----------------------------------------------------------------------
 
 InputSource* RedirectHandlers::resolveEntity(XMLResourceIdentifier* 
resourceIdentifier)
 {
-    //
-    //  If its our file, then create a new URL input source for the file that
-    //  we want to really be used. Otherwise, just return zero to let the
-    //  default action occur.
-    //
-    //  We cannot assume that the XMLCh type is ok to pass to wcscmp(), so
-    //  just do a comparison ourselves.
-    //
-    const XMLCh* s1 = gFileToTrap;
-    const XMLCh* s2 = resourceIdentifier->getSystemId();
-    while (true)
-    {
-        // Break out on any difference
-        if (*s1 != *s2)
-            return 0;
-
-        // If one is null, then both were null, so they are equal
-        if (!*s1)
-            break;
-
-        // Else get the next char
-        s1++;
-        s2++;
-    }
-
-    // They were equal, so redirect to our other file
-    return new LocalFileInputSource(gRedirectToFile);
+    // Call the SAX2 version.
+    return resolveEntity(NULL, resourceIdentifier->getSystemId());
 }

Modified: xerces/c/trunk/samples/src/Redirect/RedirectHandlers.hpp
URL: 
http://svn.apache.org/viewvc/xerces/c/trunk/samples/src/Redirect/RedirectHandlers.hpp?rev=673248&r1=673247&r2=673248&view=diff
==============================================================================
--- xerces/c/trunk/samples/src/Redirect/RedirectHandlers.hpp (original)
+++ xerces/c/trunk/samples/src/Redirect/RedirectHandlers.hpp Tue Jul  1 
17:58:08 2008
@@ -84,8 +84,8 @@
     void fatalError(const SAXParseException& exc);
 
 
-#if 0
-    // This is the old resolveEntity interface
+    // This is the SAX2 resolveEntity interface.  This is inherited from
+    // EntityResolver.
     // -----------------------------------------------------------------------
     //  Handlers for the SAX EntityResolver interface
     // -----------------------------------------------------------------------
@@ -94,7 +94,7 @@
         const   XMLCh* const    publicId
         , const XMLCh* const    systemId
     );
-#endif
+
     // -----------------------------------------------------------------------
     //  Handlers for the XMLEntityResolver interface
     // -----------------------------------------------------------------------

Modified: xerces/c/trunk/src/xercesc/framework/psvi/XSValue.cpp
URL: 
http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/framework/psvi/XSValue.cpp?rev=673248&r1=673247&r2=673248&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/framework/psvi/XSValue.cpp (original)
+++ xerces/c/trunk/src/xercesc/framework/psvi/XSValue.cpp Tue Jul  1 17:58:08 
2008
@@ -1019,7 +1019,6 @@
     catch (const NumberFormatException&)
     {
         status = st_FOCA0002;
-        return 0;
     }
 
     return 0;

Modified: 
xerces/c/trunk/src/xercesc/validators/datatype/ListDatatypeValidator.hpp
URL: 
http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/validators/datatype/ListDatatypeValidator.hpp?rev=673248&r1=673247&r2=673248&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/validators/datatype/ListDatatypeValidator.hpp 
(original)
+++ xerces/c/trunk/src/xercesc/validators/datatype/ListDatatypeValidator.hpp 
Tue Jul  1 17:58:08 2008
@@ -171,7 +171,7 @@
 // Getter methods
 // -----------------------------------------------------------------------
 
-    inline const XMLCh* const   getContent() const;
+    inline const XMLCh*         getContent() const;
 
 // -----------------------------------------------------------------------
 // Setter methods
@@ -199,7 +199,7 @@
 // -----------------------------------------------------------------------
 // Getter methods
 // -----------------------------------------------------------------------
-inline const XMLCh* const ListDatatypeValidator::getContent() const
+inline const XMLCh* ListDatatypeValidator::getContent() const
 {
     return fContent;
 }



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

Reply via email to