[cpp-xmltooling] branch master updated: Remove static warning guard variable

Scott Cantor cantor.2 at osu.edu
Mon Jun 13 10:20:01 EDT 2016


This is an automated email from the git hooks/post-receive script.

scantor pushed a commit to branch master
in repository cpp-xmltooling.

View the commit online:
http://git.shibboleth.net/view/?p=cpp-xmltooling.git;a=commit;h=36fbea51f878ad3d7b1a844e405e18ae38d7d8e1

The following commit(s) were added to refs/heads/master by this push:
       new  36fbea5   Remove static warning guard variable
36fbea5 is described below

commit 36fbea51f878ad3d7b1a844e405e18ae38d7d8e1
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Mon Jun 13 10:19:56 2016 -0400

    Remove static warning guard variable
---
 xmltooling/util/XMLHelper.cpp | 17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)

diff --git a/xmltooling/util/XMLHelper.cpp b/xmltooling/util/XMLHelper.cpp
index 79c3fb9..de32838 100644
--- a/xmltooling/util/XMLHelper.cpp
+++ b/xmltooling/util/XMLHelper.cpp
@@ -365,22 +365,19 @@ bool XMLHelper::getAttrBool(const DOMElement* e, bool defValue, const XMLCh* loc
 
 bool XMLHelper::getCaseSensitive(const xercesc::DOMElement* e, bool defValue, const XMLCh* ns)
 {
-    static const XMLCh ignoreCase[] =   UNICODE_LITERAL_10(i,g,n,o,r,e,C,a,s,e);
-    static const XMLCh caseSensitive[] =   UNICODE_LITERAL_13(c,a,s,e,S,e,n,s,i,t,i,v,e);
-    static bool ignoreCaseWarned = false;
-    bool result=defValue;
+    static const XMLCh ignoreCase[] = UNICODE_LITERAL_10(i,g,n,o,r,e,C,a,s,e);
+    static const XMLCh caseSensitive[] = UNICODE_LITERAL_13(c,a,s,e,S,e,n,s,i,t,i,v,e);
+    bool result = defValue;
 
     if (e) {
         const XMLCh* ic = e->getAttributeNS(ns, ignoreCase);
         if (ic && * ic) {
-            if (!ignoreCaseWarned) {
-                logging::Category::getInstance(XMLTOOLING_LOGCAT ".XMLHelper").warn("Deprecated attribute \"ignoreCase\" encountered in configuration.  Use \"caseSensitive\".");
-                ignoreCaseWarned = true;
-            }
+            logging::Category::getInstance(XMLTOOLING_LOGCAT ".XMLHelper").warn("Deprecated attribute \"ignoreCase\" encountered in configuration. Use \"caseSensitive\".");
+
             // caseInsensitive = !"ignoreCase"
             if (*ic == chLatin_t || *ic == chDigit_1)
                 result = false;
-            if (*ic == chLatin_f || *ic == chDigit_0)
+            else if (*ic == chLatin_f || *ic == chDigit_0)
                 result = true;
         }
         const XMLCh* ci = e->getAttributeNS(ns, caseSensitive);
@@ -391,7 +388,7 @@ bool XMLHelper::getCaseSensitive(const xercesc::DOMElement* e, bool defValue, co
             if (*ci == chLatin_t || *ci == chDigit_1) {
                 result =  true;
             }
-            if (*ci == chLatin_f || *ci == chDigit_0) {
+            else if (*ci == chLatin_f || *ci == chDigit_0) {
                 result =  false;
             }
         }

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list