You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by db...@apache.org on 2009/03/28 18:41:45 UTC

svn commit: r759520 - in /xalan/c/trunk/src/xalanc/XPath: XPathExpression.cpp XPathExpression.hpp

Author: dbertoni
Date: Sat Mar 28 17:41:45 2009
New Revision: 759520

URL: http://svn.apache.org/viewvc?rev=759520&view=rev
Log:
Cleaned up some some argument names and unnecessary code.

Modified:
    xalan/c/trunk/src/xalanc/XPath/XPathExpression.cpp
    xalan/c/trunk/src/xalanc/XPath/XPathExpression.hpp

Modified: xalan/c/trunk/src/xalanc/XPath/XPathExpression.cpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/XPath/XPathExpression.cpp?rev=759520&r1=759519&r2=759520&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/XPath/XPathExpression.cpp (original)
+++ xalan/c/trunk/src/xalanc/XPath/XPathExpression.cpp Sat Mar 28 17:41:45 2009
@@ -189,8 +189,9 @@
 
 
 
-XPathExpression::XPathExpressionException::XPathExpressionException(const XalanDOMString&   theMessage,
-                                                                    MemoryManager&      theManager) :
+XPathExpression::XPathExpressionException::XPathExpressionException(
+            const XalanDOMString&   theMessage,
+            MemoryManager&          theManager) :
     XalanXPathException(theMessage, theManager)
 {
 }
@@ -203,9 +204,14 @@
 
 
 
-XPathExpression::InvalidOpCodeException::InvalidOpCodeException(OpCodeMapValueType  theOpCode,
-                                                                XalanDOMString&     theResult) :
-XPathExpressionException(FormatErrorMessage(theOpCode, theResult), theResult.getMemoryManager())
+XPathExpression::InvalidOpCodeException::InvalidOpCodeException(
+            OpCodeMapValueType  theOpCode,
+            XalanDOMString&     theBuffer) :
+    XPathExpressionException(
+        FormatErrorMessage(
+            theOpCode,
+            theBuffer),
+        theBuffer.getMemoryManager())
 {
 }
 
@@ -220,14 +226,14 @@
 XalanDOMString&
 XPathExpression::InvalidOpCodeException::FormatErrorMessage(
             OpCodeMapValueType  theOpCode,
-            XalanDOMString&     theResult)
+            XalanDOMString&     theBuffer)
 {
-    XalanDOMString  theOpcode(theResult.getMemoryManager()); 
+    XalanDOMString  theOpcode(theBuffer.getMemoryManager()); 
 
     NumberToDOMString(theOpCode, theOpcode);
 
     return XalanMessageLoader::getMessage(
-                theResult,
+                theBuffer,
                 XalanMessages::InvalidOpcodeWasDetected_1Param,
                 theOpcode);
 }
@@ -238,14 +244,14 @@
             OpCodeMapValueType  theOpCode,
             OpCodeMapValueType  theExpectedCount,
             OpCodeMapValueType  theSuppliedCount,
-            XalanDOMString&     theResult) :
+            XalanDOMString&     theBuffer) :
     XPathExpressionException(
         FormatErrorMessage(
             theOpCode,
             theExpectedCount,
             theSuppliedCount,
-            theResult),
-        theResult.getMemoryManager())
+            theBuffer),
+        theBuffer.getMemoryManager())
 {
 }
 
@@ -276,7 +282,7 @@
 
 
     return XalanMessageLoader::getMessage(
-                theBuffer ,
+                theBuffer,
                 XalanMessages::InvalidNumberOfArgsWasDetected_3Param,
                 theResult1,
                 theResult2);
@@ -287,13 +293,13 @@
 XPathExpression::InvalidArgumentException::InvalidArgumentException(
             OpCodeMapValueType  theOpCode,
             OpCodeMapValueType  theValue,
-            XalanDOMString&     theResult) :
+            XalanDOMString&     theBuffer) :
     XPathExpressionException(
         FormatErrorMessage(
             theOpCode,
             theValue,
-            theResult),
-        theResult.getMemoryManager())
+            theBuffer),
+        theBuffer.getMemoryManager())
 {
 }
 
@@ -354,9 +360,6 @@
 void
 XPathExpression::reset()
 {
-    XALAN_USING_STD(fill);
-    XALAN_USING_STD(for_each);
-
     m_opMap.clear();
     m_tokenQueue.clear();
 }
@@ -380,8 +383,8 @@
 
 XPathExpression::OpCodeMapValueType
 XPathExpression::getOpCodeLengthFromOpMap(
-            OpCodeMapPositionType     opPos,
-            MemoryManager&        theManager) const
+            OpCodeMapPositionType   opPos,
+            MemoryManager&          theManager) const
 {
     assert(opPos - getInitialOpCodePosition() >= 0 &&
            opPos - getInitialOpCodePosition() < opCodeMapSize());
@@ -393,9 +396,9 @@
 
     if (theOpCodeLength == 0)
     {
-        XalanDOMString   theResult(theManager);
+        XalanDOMString   theBuffer(theManager);
 
-        throw InvalidOpCodeException(-1, theResult);
+        throw InvalidOpCodeException(-1, theBuffer);
     }
     else
     {
@@ -415,19 +418,19 @@
 XPathExpression::OpCodeMapValueType
 XPathExpression::getOpCodeLengthFromOpMap(
 #if defined(XALAN_XPATH_EXPRESSION_USE_ITERATORS)
-            OpCodeMapSizeType     theIndex,
+            OpCodeMapSizeType       theIndex,
 #else
-            OpCodeMapPositionType theIndex,
+            OpCodeMapPositionType   theIndex,
 #endif
-            MemoryManager&    theManager) const
+            MemoryManager&          theManager) const
 {
     OpCodeMapValueType  theResult = 0;
 
     if (theIndex >= opCodeMapSize())
     {
-        XalanDOMString   theResult(theManager);
+        XalanDOMString   theBuffer(theManager);
 
-        throw InvalidOpCodeException(-1, theResult);
+        throw InvalidOpCodeException(-1, theBuffer);
     }
     else
     {
@@ -436,9 +439,9 @@
 
         if (theOpCodeLength == 0)
         {
-            XalanDOMString   theResult(theManager);
+            XalanDOMString   theBuffer(theManager);
 
-            throw InvalidOpCodeException(-1, theResult);
+            throw InvalidOpCodeException(-1, theBuffer);
         }
         else
         {
@@ -473,9 +476,11 @@
     if (theOpCodeLength == 0 ||
         m_opMap[theIndex] != theOpCode)
     {
-        XalanDOMString   theResult( getMemoryManager() );
+        XalanDOMString   theBuffer(getMemoryManager());
 
-        throw InvalidOpCodeException(theOpCode, theResult);
+        throw InvalidOpCodeException(
+                theOpCode,
+                theBuffer);
     }
     else
     {
@@ -484,12 +489,13 @@
 
         if (OpCodeMapValueVectorType::size_type(theArgCount) != theArgs.size())
         {
-            XalanDOMString   theResult( getMemoryManager() );
+            XalanDOMString   theBuffer(getMemoryManager());
 
-            throw InvalidArgumentCountException(theOpCode,
-                                                theOpCodeLength,
-                                                theArgCount,
-                                                theResult);
+            throw InvalidArgumentCountException(
+                    theOpCode,
+                    theOpCodeLength,
+                    theArgCount,
+                    theBuffer);
         }
         else
         {
@@ -499,10 +505,12 @@
             {
                 if (theArgs[i] < 0)
                 {
-                    XalanDOMString   theResult( getMemoryManager() );
-                    throw InvalidArgumentException(theOpCode,
-                                                   theArgs[i],
-                                                   theResult);
+                    XalanDOMString   theBuffer(getMemoryManager());
+
+                    throw InvalidArgumentException(
+                            theOpCode,
+                            theArgs[i],
+                            theBuffer);
                 }
                 else
                 {
@@ -523,9 +531,11 @@
 
     if (theOpCodeLength == 0)
     {
-        XalanDOMString   theResult( getMemoryManager() );
+        XalanDOMString   theBuffer(getMemoryManager());
 
-        throw InvalidOpCodeException(theOpCode, theResult);
+        throw InvalidOpCodeException(
+                theOpCode,
+                theBuffer);
     }
     else
     {
@@ -571,9 +581,11 @@
         m_opMap[theIndex] != theOldOpCode ||
         getOpCodeLength(theOldOpCode) != getOpCodeLength(theNewOpCode))
     {
-        XalanDOMString   theResult( getMemoryManager() );
+        XalanDOMString   theBuffer(getMemoryManager());
 
-        throw InvalidOpCodeException(theNewOpCode, theResult);
+        throw InvalidOpCodeException(
+                theNewOpCode,
+                theBuffer);
     }
     else
     {
@@ -592,9 +604,11 @@
 
     if (theOpCodeLength == 0)
     {
-        XalanDOMString   theResult( getMemoryManager() );
+        XalanDOMString   theBuffer(getMemoryManager());
 
-        throw InvalidOpCodeException(theOpCode, theResult);
+        throw InvalidOpCodeException(
+                theOpCode,
+                theBuffer);
     }
     else
     {
@@ -643,9 +657,11 @@
     if (theOpCodeLength == 0 ||
         m_opMap[theNewIndex] != theOpCode)
     {
-        XalanDOMString   theResult( getMemoryManager() );
+        XalanDOMString   theBuffer(getMemoryManager());
 
-        throw InvalidOpCodeException(theOpCode, theResult);
+        throw InvalidOpCodeException(
+                theOpCode,
+                theBuffer);
     }
     else
     {
@@ -657,9 +673,11 @@
         // Too long, then throw an exception.
         if (theLengthIndex >= opCodeMapSize())
         {
-            XalanDOMString   theResult( getMemoryManager() );
+            XalanDOMString   theBuffer(getMemoryManager());
 
-            throw InvalidOpCodeException(theOpCode, theResult);
+            throw InvalidOpCodeException(
+                    theOpCode,
+                    theBuffer);
         }
         else
         {
@@ -695,9 +713,11 @@
     if (theOpCodeLength == 0 ||
         m_opMap[theIndex] != theOpCode)
     {
-        XalanDOMString   theResult( getMemoryManager() );
+        XalanDOMString   theBuffer(getMemoryManager());
 
-        throw InvalidOpCodeException(theOpCode, theResult);
+        throw InvalidOpCodeException(
+                theOpCode,
+                theBuffer);
     }
     else
     {
@@ -746,9 +766,11 @@
     if (theOpCodeLength == 0 ||
         isNodeTestOpCode(theOpCode) == false)
     {
-        XalanDOMString   theResult( getMemoryManager() );
+        XalanDOMString   theBuffer(getMemoryManager());
 
-        throw InvalidOpCodeException(theOpCode, theResult);
+        throw InvalidOpCodeException(
+                theOpCode,
+                theBuffer);
     }
     else
     {

Modified: xalan/c/trunk/src/xalanc/XPath/XPathExpression.hpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/XPath/XPathExpression.hpp?rev=759520&r1=759519&r2=759520&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/XPath/XPathExpression.hpp (original)
+++ xalan/c/trunk/src/xalanc/XPath/XPathExpression.hpp Sat Mar 28 17:41:45 2009
@@ -627,8 +627,9 @@
          * 
          * @param theOpCode operation code that caused the exception
          */
-        InvalidOpCodeException(OpCodeMapValueType   theOpCode,
-                                XalanDOMString&     theResult);
+        InvalidOpCodeException(
+                    OpCodeMapValueType  theOpCode,
+                    XalanDOMString&     theBuffer);
 
         virtual~
         InvalidOpCodeException();
@@ -636,8 +637,9 @@
     private:
 
         static XalanDOMString&
-        FormatErrorMessage(OpCodeMapValueType   theOpCode,
-                            XalanDOMString&     theResult);
+        FormatErrorMessage(
+                OpCodeMapValueType  theOpCode,
+                XalanDOMString&     theBuffer);
     };
 
     /**
@@ -659,7 +661,7 @@
             OpCodeMapValueType  theOpCode,
             OpCodeMapValueType  theExpectedCount,
             OpCodeMapValueType  theSuppliedCount,
-            XalanDOMString&     theResult);
+            XalanDOMString&     theBuffer);
 
         virtual~
         InvalidArgumentCountException();
@@ -671,7 +673,7 @@
             OpCodeMapValueType  theOpCode,
             OpCodeMapValueType  theExpectedCount,
             OpCodeMapValueType  theSuppliedCount,
-            XalanDOMString&     theResult);
+            XalanDOMString&     theBuffer);
     };
 
     /**
@@ -690,7 +692,7 @@
         InvalidArgumentException(
             OpCodeMapValueType  theOpCode,
             OpCodeMapValueType  theValue,
-            XalanDOMString&     theResult);
+            XalanDOMString&     theBuffer);
 
         virtual~
         InvalidArgumentException();
@@ -701,7 +703,7 @@
         FormatErrorMessage(
                 OpCodeMapValueType  theOpCode,
                 OpCodeMapValueType  theValue,
-                XalanDOMString&     theResult);
+                XalanDOMString&     theBuffer);
     };
 
 



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