You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by tn...@apache.org on 2002/09/24 21:51:25 UTC

cvs commit: xml-xerces/c/src/xercesc/util HashXMLCh.cpp NameIdPool.c QName.cpp XMLAbstractDoubleFloat.cpp XMLDouble.cpp XMLFloat.cpp XMLURL.cpp

tng         2002/09/24 12:51:25

  Modified:    c/src/xercesc/util HashXMLCh.cpp NameIdPool.c QName.cpp
                        XMLAbstractDoubleFloat.cpp XMLDouble.cpp
                        XMLFloat.cpp XMLURL.cpp
  Log:
  Performance: use XMLString::equals instead of XMLString::compareString
  
  Revision  Changes    Path
  1.2       +13 -13    xml-xerces/c/src/xercesc/util/HashXMLCh.cpp
  
  Index: HashXMLCh.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/util/HashXMLCh.cpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- HashXMLCh.cpp	1 Feb 2002 22:22:10 -0000	1.1
  +++ HashXMLCh.cpp	24 Sep 2002 19:51:24 -0000	1.2
  @@ -1,37 +1,37 @@
   /*
    * The Apache Software License, Version 1.1
  - * 
  + *
    * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights
    * reserved.
  - * 
  + *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
    * are met:
  - * 
  + *
    * 1. Redistributions of source code must retain the above copyright
  - *    notice, this list of conditions and the following disclaimer. 
  - * 
  + *    notice, this list of conditions and the following disclaimer.
  + *
    * 2. Redistributions in binary form must reproduce the above copyright
    *    notice, this list of conditions and the following disclaimer in
    *    the documentation and/or other materials provided with the
    *    distribution.
  - * 
  + *
    * 3. The end-user documentation included with the redistribution,
  - *    if any, must include the following acknowledgment:  
  + *    if any, must include the following acknowledgment:
    *       "This product includes software developed by the
    *        Apache Software Foundation (http://www.apache.org/)."
    *    Alternately, this acknowledgment may appear in the software itself,
    *    if and wherever such third-party acknowledgments normally appear.
  - * 
  + *
    * 4. The names "Xerces" and "Apache Software Foundation" must
    *    not be used to endorse or promote products derived from this
  - *    software without prior written permission. For written 
  + *    software without prior written permission. For written
    *    permission, please contact apache\@apache.org.
  - * 
  + *
    * 5. Products derived from this software may not be called "Apache",
    *    nor may "Apache" appear in their name, without prior written
    *    permission of the Apache Software Foundation.
  - * 
  + *
    * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  @@ -45,7 +45,7 @@
    * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    * SUCH DAMAGE.
    * ====================================================================
  - * 
  + *
    * This software consists of voluntary contributions made by many
    * individuals on behalf of the Apache Software Foundation, and was
    * originally based on software copyright (c) 1999, International
  @@ -72,5 +72,5 @@
   
   bool HashXMLCh::equals(const void *const key1, const void *const key2)
   {
  -	return (XMLString::compareString((XMLCh*)key1, (XMLCh*)key2) == 0) ? true : false;
  +	return (XMLString::equals((XMLCh*)key1, (XMLCh*)key2)) ? true : false;
   }
  
  
  
  1.3       +17 -14    xml-xerces/c/src/xercesc/util/NameIdPool.c
  
  Index: NameIdPool.c
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/util/NameIdPool.c,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- NameIdPool.c	8 May 2002 19:05:29 -0000	1.2
  +++ NameIdPool.c	24 Sep 2002 19:51:24 -0000	1.3
  @@ -1,37 +1,37 @@
   /*
    * The Apache Software License, Version 1.1
  - * 
  + *
    * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights
    * reserved.
  - * 
  + *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
    * are met:
  - * 
  + *
    * 1. Redistributions of source code must retain the above copyright
  - *    notice, this list of conditions and the following disclaimer. 
  - * 
  + *    notice, this list of conditions and the following disclaimer.
  + *
    * 2. Redistributions in binary form must reproduce the above copyright
    *    notice, this list of conditions and the following disclaimer in
    *    the documentation and/or other materials provided with the
    *    distribution.
  - * 
  + *
    * 3. The end-user documentation included with the redistribution,
  - *    if any, must include the following acknowledgment:  
  + *    if any, must include the following acknowledgment:
    *       "This product includes software developed by the
    *        Apache Software Foundation (http://www.apache.org/)."
    *    Alternately, this acknowledgment may appear in the software itself,
    *    if and wherever such third-party acknowledgments normally appear.
  - * 
  + *
    * 4. The names "Xerces" and "Apache Software Foundation" must
    *    not be used to endorse or promote products derived from this
  - *    software without prior written permission. For written 
  + *    software without prior written permission. For written
    *    permission, please contact apache\@apache.org.
  - * 
  + *
    * 5. Products derived from this software may not be called "Apache",
    *    nor may "Apache" appear in their name, without prior written
    *    permission of the Apache Software Foundation.
  - * 
  + *
    * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  @@ -45,7 +45,7 @@
    * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    * SUCH DAMAGE.
    * ====================================================================
  - * 
  + *
    * This software consists of voluntary contributions made by many
    * individuals on behalf of the Apache Software Foundation, and was
    * originally based on software copyright (c) 1999, International
  @@ -56,6 +56,9 @@
   
   /**
    * $Log$
  + * Revision 1.3  2002/09/24 19:51:24  tng
  + * Performance: use XMLString::equals instead of XMLString::compareString
  + *
    * Revision 1.2  2002/05/08 19:05:29  knoaman
    * [Bug 7701] NameIdPoolEnumerator copy constructor should call base class - fix by Martin Kalen
    *
  @@ -310,7 +313,7 @@
       NameIdPoolBucketElem<TElem>* curElem = fBucketList[hashVal];
       while (curElem)
       {
  -        if (!XMLString::compareString(key, curElem->fData->getKey()))
  +        if (XMLString::equals(key, curElem->fData->getKey()))
               return curElem;
           curElem = curElem->fNext;
       }
  @@ -331,7 +334,7 @@
       const NameIdPoolBucketElem<TElem>* curElem = fBucketList[hashVal];
       while (curElem)
       {
  -        if (!XMLString::compareString(key, curElem->fData->getKey()))
  +        if (XMLString::equals(key, curElem->fData->getKey()))
               return curElem;
   
           curElem = curElem->fNext;
  
  
  
  1.4       +5 -2      xml-xerces/c/src/xercesc/util/QName.cpp
  
  Index: QName.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/util/QName.cpp,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- QName.cpp	5 Sep 2002 16:06:41 -0000	1.3
  +++ QName.cpp	24 Sep 2002 19:51:24 -0000	1.4
  @@ -56,6 +56,9 @@
   
   /*
    * $Log$
  + * Revision 1.4  2002/09/24 19:51:24  tng
  + * Performance: use XMLString::equals instead of XMLString::compareString
  + *
    * Revision 1.3  2002/09/05 16:06:41  tng
    * [Bug 12232] Make operator to be constant.
    *
  @@ -421,10 +424,10 @@
   bool QName::operator==(const QName& qname) const
   {
       if (fURIId == 0) // null URI
  -        return (XMLString::compareString(getRawName(),qname.getRawName())==0);
  +        return (XMLString::equals(getRawName(),qname.getRawName()));
   
       return ((fURIId == qname.getURI()) &&
  -           (XMLString::compareString(fLocalPart, qname.getLocalPart())==0));
  +           (XMLString::equals(fLocalPart, qname.getLocalPart())));
   }
   
   // ---------------------------------------------------------------------------
  
  
  
  1.5       +16 -12    xml-xerces/c/src/xercesc/util/XMLAbstractDoubleFloat.cpp
  
  Index: XMLAbstractDoubleFloat.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/util/XMLAbstractDoubleFloat.cpp,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- XMLAbstractDoubleFloat.cpp	3 May 2002 16:05:45 -0000	1.4
  +++ XMLAbstractDoubleFloat.cpp	24 Sep 2002 19:51:24 -0000	1.5
  @@ -57,6 +57,9 @@
   /*
    * $Id$
    * $Log$
  + * Revision 1.5  2002/09/24 19:51:24  tng
  + * Performance: use XMLString::equals instead of XMLString::compareString
  + *
    * Revision 1.4  2002/05/03 16:05:45  peiyongz
    * Bug 7341: Missing newline at end of util and DOM source files,
    * patch from Martin Kalen.
  @@ -123,27 +126,27 @@
   
       normalizeZero(tmpStrValue);
   
  -    if (XMLString::compareString(tmpStrValue, XMLUni::fgNegINFString) == 0)
  +    if (XMLString::equals(tmpStrValue, XMLUni::fgNegINFString) )
       {
           fType = NegINF;
           return;
       }
  -    else if (XMLString::compareString(tmpStrValue, XMLUni::fgNegZeroString) == 0)
  +    else if (XMLString::equals(tmpStrValue, XMLUni::fgNegZeroString) )
       {
           fType = NegZero;
           return;
       }
  -    else if (XMLString::compareString(tmpStrValue, XMLUni::fgPosZeroString) == 0)
  +    else if (XMLString::equals(tmpStrValue, XMLUni::fgPosZeroString) )
       {
           fType = PosZero;
           return;
       }
  -    else if (XMLString::compareString(tmpStrValue, XMLUni::fgPosINFString) == 0)
  +    else if (XMLString::equals(tmpStrValue, XMLUni::fgPosINFString) )
       {
           fType = PosINF;
           return;
       }
  -    else if (XMLString::compareString(tmpStrValue, XMLUni::fgNaNString) == 0)
  +    else if (XMLString::equals(tmpStrValue, XMLUni::fgNaNString) )
       {
           fType = NaN;
           return;
  @@ -351,9 +354,9 @@
   //
   //  Return:
   //
  -//  for input comforming to [+]? [0]* '.'? [0]*, 
  -//            normalize the input to positive zero string 
  -//  for input comforming to '-' [0]* '.'? [0]*, 
  +//  for input comforming to [+]? [0]* '.'? [0]*,
  +//            normalize the input to positive zero string
  +//  for input comforming to '-' [0]* '.'? [0]*,
   //            normalize the input to negative zero string
   //  otherwise, do nothing
   //
  @@ -361,10 +364,10 @@
   {
   
   	// do a quick check
  -	if (!inData  || 
  +	if (!inData  ||
   		!*inData ||
  -        (XMLString::compareString(inData, XMLUni::fgNegZeroString) == 0) ||
  -        (XMLString::compareString(inData, XMLUni::fgPosZeroString) == 0)  )
  +        (XMLString::equals(inData, XMLUni::fgNegZeroString) ) ||
  +        (XMLString::equals(inData, XMLUni::fgPosZeroString) )  )
           return;
   
       XMLCh*   srcStr = inData;
  
  
  
  1.3       +13 -9     xml-xerces/c/src/xercesc/util/XMLDouble.cpp
  
  Index: XMLDouble.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/util/XMLDouble.cpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- XMLDouble.cpp	3 May 2002 16:05:45 -0000	1.2
  +++ XMLDouble.cpp	24 Sep 2002 19:51:24 -0000	1.3
  @@ -57,6 +57,9 @@
   /*
    * $Id$
    * $Log$
  + * Revision 1.3  2002/09/24 19:51:24  tng
  + * Performance: use XMLString::equals instead of XMLString::compareString
  + *
    * Revision 1.2  2002/05/03 16:05:45  peiyongz
    * Bug 7341: Missing newline at end of util and DOM source files,
    * patch from Martin Kalen.
  @@ -157,7 +160,7 @@
       chDigit_1, chDigit_1, chDigit_5, chDigit_7, chDigit_9, chDigit_5,
       chDigit_3, chDigit_8, chDigit_6, chDigit_4, chDigit_6, chDigit_5,
       chDigit_2, chDigit_5, chDigit_9, chDigit_5, chDigit_3, chDigit_9,
  -    chDigit_4, chDigit_5, chDigit_1, 
  +    chDigit_4, chDigit_5, chDigit_1,
       chLatin_E, chPlus,    chDigit_3, chDigit_0, chDigit_7, chNull
   };
   
  @@ -175,7 +178,7 @@
       chDigit_0, chDigit_6, chDigit_2, chDigit_3, chDigit_2, chDigit_7,
       chDigit_2, chDigit_0, chDigit_8, chDigit_8, chDigit_2, chDigit_8,
       chDigit_4, chDigit_3, chDigit_9, chDigit_6, chDigit_4, chDigit_3,
  -    chDigit_4, chDigit_1, chDigit_1, 
  +    chDigit_4, chDigit_1, chDigit_1,
       chLatin_E, chDash,    chDigit_3, chDigit_2, chDigit_4, chNull
   };
   
  @@ -187,7 +190,7 @@
       chDigit_1, chDigit_1, chDigit_5, chDigit_7, chDigit_9, chDigit_5,
       chDigit_3, chDigit_8, chDigit_6, chDigit_4, chDigit_6, chDigit_5,
       chDigit_2, chDigit_5, chDigit_9, chDigit_5, chDigit_3, chDigit_9,
  -    chDigit_4, chDigit_5, chDigit_1, 
  +    chDigit_4, chDigit_5, chDigit_1,
       chLatin_E, chPlus,    chDigit_3, chDigit_0, chDigit_7, chNull
   };
   
  @@ -199,7 +202,7 @@
       chDigit_0, chDigit_6, chDigit_2, chDigit_3, chDigit_2, chDigit_7,
       chDigit_2, chDigit_0, chDigit_8, chDigit_8, chDigit_2, chDigit_8,
       chDigit_4, chDigit_3, chDigit_9, chDigit_6, chDigit_4, chDigit_3,
  -    chDigit_4, chDigit_1, chDigit_1, 
  +    chDigit_4, chDigit_1, chDigit_1,
       chLatin_E, chDash,    chDigit_3, chDigit_2, chDigit_4, chNull
   };
   
  @@ -260,10 +263,10 @@
       //
       // by-pass boundary check for boundary value itself
       //
  -    if (( XMLString::compareString(strValue, DBL_MAX_NEGATIVE) == 0 ) ||
  -        ( XMLString::compareString(strValue, DBL_MIN_NEGATIVE) == 0 ) ||
  -        ( XMLString::compareString(strValue, DBL_MIN_POSITIVE) == 0 ) ||
  -        ( XMLString::compareString(strValue, DBL_MAX_POSITIVE) == 0 )  )
  +    if (( XMLString::equals(strValue, DBL_MAX_NEGATIVE) ) ||
  +        ( XMLString::equals(strValue, DBL_MIN_NEGATIVE) ) ||
  +        ( XMLString::equals(strValue, DBL_MIN_POSITIVE) ) ||
  +        ( XMLString::equals(strValue, DBL_MAX_POSITIVE) )  )
           return;
   
       //  error: this < maxNegativeValue
  
  
  
  1.3       +13 -9     xml-xerces/c/src/xercesc/util/XMLFloat.cpp
  
  Index: XMLFloat.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/util/XMLFloat.cpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- XMLFloat.cpp	3 May 2002 16:05:45 -0000	1.2
  +++ XMLFloat.cpp	24 Sep 2002 19:51:24 -0000	1.3
  @@ -57,6 +57,9 @@
   /*
    * $Id$
    * $Log$
  + * Revision 1.3  2002/09/24 19:51:24  tng
  + * Performance: use XMLString::equals instead of XMLString::compareString
  + *
    * Revision 1.2  2002/05/03 16:05:45  peiyongz
    * Bug 7341: Missing newline at end of util and DOM source files,
    * patch from Martin Kalen.
  @@ -131,7 +134,7 @@
       chDigit_0, chDigit_9, chDigit_3, chDigit_8, chDigit_4, chDigit_6,
       chDigit_3, chDigit_4, chDigit_6, chDigit_3, chDigit_3, chDigit_7,
       chDigit_4, chDigit_6, chDigit_0, chDigit_7, chDigit_4, chDigit_3,
  -    chDigit_1, chDigit_7, chDigit_7, 
  +    chDigit_1, chDigit_7, chDigit_7,
       chLatin_E, chPlus,    chDigit_3, chDigit_8, chNull
   };
   
  @@ -149,7 +152,7 @@
       chDigit_2, chDigit_4, chDigit_8, chDigit_1, chDigit_7, chDigit_0,
       chDigit_7, chDigit_0, chDigit_9, chDigit_2, chDigit_3, chDigit_7,
       chDigit_2, chDigit_9, chDigit_5, chDigit_8, chDigit_3, chDigit_2,
  -    chDigit_8, chDigit_9, chDigit_9, 
  +    chDigit_8, chDigit_9, chDigit_9,
       chLatin_E, chDash,    chDigit_4, chDigit_5, chNull
   };
   
  @@ -161,7 +164,7 @@
       chDigit_0, chDigit_9, chDigit_3, chDigit_8, chDigit_4, chDigit_6,
       chDigit_3, chDigit_4, chDigit_6, chDigit_3, chDigit_3, chDigit_7,
       chDigit_4, chDigit_6, chDigit_0, chDigit_7, chDigit_4, chDigit_3,
  -    chDigit_1, chDigit_7, chDigit_7, 
  +    chDigit_1, chDigit_7, chDigit_7,
       chLatin_E, chPlus,    chDigit_3, chDigit_8, chNull
   };
   
  @@ -173,7 +176,7 @@
       chDigit_2, chDigit_4, chDigit_8, chDigit_1, chDigit_7, chDigit_0,
       chDigit_7, chDigit_0, chDigit_9, chDigit_2, chDigit_3, chDigit_7,
       chDigit_2, chDigit_9, chDigit_5, chDigit_8, chDigit_3, chDigit_2,
  -    chDigit_8, chDigit_9, chDigit_9, 
  +    chDigit_8, chDigit_9, chDigit_9,
       chLatin_E, chDash,    chDigit_4, chDigit_5, chNull
   };
   
  @@ -234,10 +237,10 @@
       //
       // by-pass boundary check for boundary value itself
       //
  -    if (( XMLString::compareString(strValue, FLT_MAX_NEGATIVE) == 0 ) ||
  -        ( XMLString::compareString(strValue, FLT_MIN_NEGATIVE) == 0 ) ||
  -        ( XMLString::compareString(strValue, FLT_MIN_POSITIVE) == 0 ) ||
  -        ( XMLString::compareString(strValue, FLT_MAX_POSITIVE) == 0 )  )
  +    if ((XMLString::equals(strValue, FLT_MAX_NEGATIVE)) ||
  +        (XMLString::equals(strValue, FLT_MIN_NEGATIVE)) ||
  +        (XMLString::equals(strValue, FLT_MIN_POSITIVE)) ||
  +        (XMLString::equals(strValue, FLT_MAX_POSITIVE))  )
           return;
   
       //  error: this < maxNegativeValue
  
  
  
  1.2       +4 -4      xml-xerces/c/src/xercesc/util/XMLURL.cpp
  
  Index: XMLURL.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/util/XMLURL.cpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- XMLURL.cpp	1 Feb 2002 22:22:17 -0000	1.1
  +++ XMLURL.cpp	24 Sep 2002 19:51:24 -0000	1.2
  @@ -392,7 +392,7 @@
       //  way so they should now be the same even if they came in via different
       //  relative parts.
       //
  -    if (XMLString::compareString(getURLText(), toCompare.getURLText()))
  +    if (!XMLString::equals(getURLText(), toCompare.getURLText()))
           return false;
   
       return true;
  @@ -945,8 +945,8 @@
                   srcPtr += XMLString::stringLen(fHost);
               }
           }
  -    } 
  -    else 
  +    }
  +    else
       {
   	    //
   	    // http protocol requires two forward slashes
  
  
  

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