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 2004/02/06 09:57:09 UTC
cvs commit: xml-xalan/c/src/xalanc/XalanDOM XalanDOMString.cpp XalanDOMString.hpp
dbertoni 2004/02/06 00:57:09
Modified: c/src/xalanc/Include PlatformDefinitions.hpp
c/src/xalanc/PlatformSupport DOMStringHelper.cpp
DOMStringPrintWriter.cpp
NamedNodeMapAttributeList.hpp
XalanDecimalFormat.cpp XalanOutputStream.cpp
XalanOutputStream.hpp
XalanOutputStreamPrintWriter.cpp
XalanTranscodingServices.cpp
XalanTranscodingServices.hpp XalanUnicode.hpp
XalanXMLChar.hpp
c/src/xalanc/XMLSupport FormatterToXML.cpp
FormatterToXML.hpp FormatterToXMLBase.cpp
FormatterToXML_UTF8.cpp
c/src/xalanc/XPath MutableNodeRefList.cpp NodeRefList.cpp
NodeRefListBase.hpp XNodeSetBase.hpp
XPathExpression.cpp XPathExpression.hpp
XPathFunctionTable.cpp
c/src/xalanc/XPathCAPI XPathCAPI.cpp
c/src/xalanc/XSLT CountersTable.cpp ElemNumber.cpp
ExtensionNSHandler.cpp VariablesStack.cpp
VariablesStack.hpp
c/src/xalanc/XalanDOM XalanDOMString.cpp XalanDOMString.hpp
Log:
Various typedef changes for better 32/64 compatibility and consistency with Xerces.
Revision Changes Path
1.5 +17 -0 xml-xalan/c/src/xalanc/Include/PlatformDefinitions.hpp
Index: PlatformDefinitions.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/Include/PlatformDefinitions.hpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- PlatformDefinitions.hpp 6 Jan 2004 02:41:28 -0000 1.4
+++ PlatformDefinitions.hpp 6 Feb 2004 08:57:08 -0000 1.5
@@ -79,6 +79,8 @@
#error Unknown compiler!
#endif
+
+
#include "XalanVersion.hpp"
#if defined(__cplusplus)
@@ -147,6 +149,21 @@
#define XALAN_DECLARE_XERCES_CLASS(NAME) class NAME;
#define XALAN_DECLARE_XERCES_STRUCT(NAME) struct NAME;
#endif
+
+
+
+#include <cstddef>
+
+
+
+XALAN_CPP_NAMESPACE_BEGIN
+#if defined(XALAN_USE_NATIVE_WCHAR_T)
+typedef wchar_t XalanDOMChar;
+#else
+// UTF-16 character...
+typedef unsigned short XalanDOMChar;
+#endif
+XALAN_CPP_NAMESPACE_END
1.4 +8 -2 xml-xalan/c/src/xalanc/PlatformSupport/DOMStringHelper.cpp
Index: DOMStringHelper.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/PlatformSupport/DOMStringHelper.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- DOMStringHelper.cpp 6 Jan 2004 02:41:28 -0000 1.3
+++ DOMStringHelper.cpp 6 Feb 2004 08:57:08 -0000 1.4
@@ -1686,7 +1686,10 @@
XalanDOMChar* const theBegin = ScalarToDecimalString(theValue, theEnd);
- append(theResult, theBegin, theEnd - theBegin);
+ append(
+ theResult,
+ theBegin,
+ XalanDOMString::size_type(theEnd - theBegin));
}
@@ -1748,7 +1751,10 @@
XalanDOMChar* const theBegin = UnsignedScalarToHexadecimalString(theValue, theEnd);
- append(theResult, theBegin, theEnd - theBegin);
+ append(
+ theResult,
+ theBegin,
+ XalanDOMString::size_type(theEnd - theBegin));
}
}
1.4 +7 -1 xml-xalan/c/src/xalanc/PlatformSupport/DOMStringPrintWriter.cpp
Index: DOMStringPrintWriter.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/PlatformSupport/DOMStringPrintWriter.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- DOMStringPrintWriter.cpp 6 Jan 2004 02:41:28 -0000 1.3
+++ DOMStringPrintWriter.cpp 6 Feb 2004 08:57:08 -0000 1.4
@@ -112,7 +112,13 @@
size_t theOffset,
size_t theLength)
{
- write(TranscodeFromLocalCodePage(s), theOffset, theLength);
+ assert(XalanDOMString::size_type(theOffset) == theOffset);
+ assert(XalanDOMString::size_type(theLength) == theLength);
+
+ write(
+ TranscodeFromLocalCodePage(s),
+ XalanDOMString::size_type(theOffset),
+ XalanDOMString::size_type(theLength));
}
1.4 +0 -4 xml-xalan/c/src/xalanc/PlatformSupport/NamedNodeMapAttributeList.hpp
Index: NamedNodeMapAttributeList.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/PlatformSupport/NamedNodeMapAttributeList.hpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- NamedNodeMapAttributeList.hpp 6 Jan 2004 02:41:28 -0000 1.3
+++ NamedNodeMapAttributeList.hpp 6 Feb 2004 08:57:08 -0000 1.4
@@ -72,10 +72,6 @@
-#include <xalanc/XalanDOM/XalanDOMString.hpp>
-
-
-
XALAN_CPP_NAMESPACE_BEGIN
1.4 +2 -5 xml-xalan/c/src/xalanc/PlatformSupport/XalanDecimalFormat.cpp
Index: XalanDecimalFormat.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/PlatformSupport/XalanDecimalFormat.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- XalanDecimalFormat.cpp 6 Jan 2004 02:41:28 -0000 1.3
+++ XalanDecimalFormat.cpp 6 Feb 2004 08:57:08 -0000 1.4
@@ -178,24 +178,21 @@
unsigned long theValue,
XalanDOMString& theResult)
{
- // $$$ ToDo: Fix this!
XalanNumberFormat::format(theValue, theResult);
}
void
-XalanDecimalFormat::applyPattern(const XalanDOMString& thePattern)
+XalanDecimalFormat::applyPattern(const XalanDOMString& /* thePattern */)
{
- // $$$ ToDo: Fix this!!!
}
void
-XalanDecimalFormat::applyLocalizedPattern(const XalanDOMString& thePattern)
+XalanDecimalFormat::applyLocalizedPattern(const XalanDOMString& /* thePattern */)
{
- // $$$ ToDo: Fix this!!!
}
1.5 +21 -20 xml-xalan/c/src/xalanc/PlatformSupport/XalanOutputStream.cpp
Index: XalanOutputStream.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/PlatformSupport/XalanOutputStream.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- XalanOutputStream.cpp 6 Jan 2004 02:41:28 -0000 1.4
+++ XalanOutputStream.cpp 6 Feb 2004 08:57:08 -0000 1.5
@@ -104,8 +104,8 @@
XalanOutputStream::XalanOutputStream(
- BufferType::size_type theBufferSize,
- TranscodeVectorType::size_type theTranscoderBlockSize,
+ size_type theBufferSize,
+ size_type theTranscoderBlockSize,
bool fThrowTranscodeException) :
m_transcoderBlockSize(theTranscoderBlockSize),
m_transcoder(0),
@@ -136,7 +136,7 @@
void
XalanOutputStream::write(
const XalanDOMChar* theBuffer,
- size_t theBufferLength)
+ size_type theBufferLength)
{
assert(theBuffer != 0);
@@ -164,7 +164,7 @@
void
XalanOutputStream::transcode(
const XalanDOMChar* theBuffer,
- size_t theBufferLength,
+ size_type theBufferLength,
TranscodeVectorType& theDestination)
{
if (m_transcoder == 0)
@@ -190,14 +190,14 @@
// Keep track of the total bytes we've added to the
// destination vector, and the total bytes we've
// eaten from theBuffer.
- size_t theTotalBytesFilled = 0;
- size_t theTotalBytesEaten = 0;
+ size_type theTotalBytesFilled = 0;
+ size_type theTotalBytesEaten = 0;
// Keep track of the current position in the input buffer,
// and amount remaining in the buffer, since we may not be
// able to transcode it all at once.
const XalanDOMChar* theBufferPosition = theBuffer;
- size_t theRemainingBufferLength = theBufferLength;
+ size_type theRemainingBufferLength = theBufferLength;
// Keep track of the destination size, and the target size, which is
// the size of the destination that has not yet been filled with
@@ -205,16 +205,16 @@
// transcoding to a 16-bit encoding.
// $$$ ToDo: We need to know the size of an encoding, so we can
// do the right thing with the destination size.
- size_t theDestinationSize = theBufferLength * 2;
- size_t theTargetSize = theDestinationSize;
+ size_type theDestinationSize = theBufferLength * 2;
+ size_type theTargetSize = theDestinationSize;
do
{
// Resize the buffer...
theDestination.resize(theDestinationSize + 1);
- size_t theSourceBytesEaten = 0;
- size_t theTargetBytesEaten = 0;
+ size_type theSourceBytesEaten = 0;
+ size_type theTargetBytesEaten = 0;
XalanTranscodingServices::eCode theResult =
m_transcoder->transcode(
@@ -235,9 +235,6 @@
{
throw TranscodingException();
}
- else
- {
- }
}
theTotalBytesFilled += theTargetBytesEaten;
@@ -322,7 +319,7 @@
XalanTranscodingServices::getStreamProlog(theEncoding);
assert(theProlog != 0);
- const size_t theLength = XalanTranscodingServices::length(theProlog);
+ const size_type theLength = XalanTranscodingServices::length(theProlog);
if (theLength > 0)
{
@@ -363,7 +360,9 @@
{
CollectionClearGuard<BufferType> theGuard(m_buffer);
- doWrite(&*m_buffer.begin(), m_buffer.size());
+ assert(size_type(m_buffer.size()) == m_buffer.size());
+
+ doWrite(&*m_buffer.begin(), size_type(m_buffer.size()));
}
assert(m_buffer.empty() == true);
@@ -374,7 +373,7 @@
void
XalanOutputStream::doWrite(
const XalanDOMChar* theBuffer,
- size_t theBufferLength)
+ size_type theBufferLength)
{
assert(theBuffer != 0);
@@ -396,16 +395,18 @@
assert(&m_transcodingBuffer[0] != 0);
- writeData(
+ assert(size_type(m_transcodingBuffer.size()) == m_transcodingBuffer.size());
+
+ writeData(
&m_transcodingBuffer[0],
- m_transcodingBuffer.size());
+ size_type(m_transcodingBuffer.size()));
}
}
void
-XalanOutputStream::setBufferSize(BufferType::size_type theBufferSize)
+XalanOutputStream::setBufferSize(size_type theBufferSize)
{
flushBuffer();
1.6 +18 -16 xml-xalan/c/src/xalanc/PlatformSupport/XalanOutputStream.hpp
Index: XalanOutputStream.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/PlatformSupport/XalanOutputStream.hpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- XalanOutputStream.hpp 6 Jan 2004 02:41:28 -0000 1.5
+++ XalanOutputStream.hpp 6 Feb 2004 08:57:08 -0000 1.6
@@ -72,6 +72,7 @@
+#include <xalanc/PlatformSupport/XalanTranscodingServices.hpp>
#include <xalanc/PlatformSupport/XSLException.hpp>
@@ -101,7 +102,8 @@
typedef std::vector<char> TranscodeVectorType;
#endif
- typedef BufferType::size_type size_type;
+ typedef XalanTranscodingServices::size_type size_type;
+ typedef XalanTranscodingServices::UnicodeCharType UnicodeCharType;
/**
* Constructor.
@@ -112,9 +114,9 @@
*/
explicit
XalanOutputStream(
- BufferType::size_type theBufferSize = eDefaultBufferSize,
- TranscodeVectorType::size_type theTranscoderBlockSize = eDefaultTranscoderBlockSize,
- bool fThrowTranscodeException = true);
+ size_type theBufferSize = eDefaultBufferSize,
+ size_type theTranscoderBlockSize = eDefaultTranscoderBlockSize,
+ bool fThrowTranscodeException = true);
virtual
~XalanOutputStream();
@@ -277,7 +279,7 @@
* @return true if the value can be represented, and false if not.
*/
bool
- canTranscodeTo(unsigned int theChar) const;
+ canTranscodeTo(UnicodeCharType theChar) const;
const XalanOutputTranscoder*
getTranscoder() const
@@ -310,7 +312,7 @@
* @param the new value of the flag.
*/
void
- setThrowTranscodeException(bool flag)
+ setThrowTranscodeException(bool flag)
{
m_throwTranscodeException = flag;
}
@@ -321,7 +323,7 @@
* @param theBufferSize The buffer size.
*/
void
- setBufferSize(BufferType::size_type theBufferSize);
+ setBufferSize(size_type theBufferSize);
class XALAN_PLATFORMSUPPORT_EXPORT XalanOutputStreamException : public XSLException
@@ -450,24 +452,24 @@
void
doWrite(
const XalanDOMChar* theBuffer,
- size_t theBufferLength);
+ size_type theBufferLength);
- const TranscodeVectorType::size_type m_transcoderBlockSize;
+ const size_type m_transcoderBlockSize;
- XalanOutputTranscoder* m_transcoder;
+ XalanOutputTranscoder* m_transcoder;
- BufferType::size_type m_bufferSize;
+ size_type m_bufferSize;
- BufferType m_buffer;
+ BufferType m_buffer;
- XalanDOMString m_encoding;
+ XalanDOMString m_encoding;
- bool m_writeAsUTF16;
+ bool m_writeAsUTF16;
- bool m_throwTranscodeException;
+ bool m_throwTranscodeException;
- TranscodeVectorType m_transcodingBuffer;
+ TranscodeVectorType m_transcodingBuffer;
};
1.6 +8 -5 xml-xalan/c/src/xalanc/PlatformSupport/XalanOutputStreamPrintWriter.cpp
Index: XalanOutputStreamPrintWriter.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/PlatformSupport/XalanOutputStreamPrintWriter.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- XalanOutputStreamPrintWriter.cpp 6 Jan 2004 02:41:28 -0000 1.5
+++ XalanOutputStreamPrintWriter.cpp 6 Feb 2004 08:57:08 -0000 1.6
@@ -154,10 +154,17 @@
size_t theLength)
{
assert(s != 0);
+ assert(XalanDOMString::size_type(theLength) == theLength);
flushWideChars();
- if (theLength == npos)
+ if (theLength != npos)
+ {
+ m_outputStream.write(
+ s + theOffset,
+ XalanDOMString::size_type(theLength));
+ }
+ else
{
if (theOffset == 0)
{
@@ -167,10 +174,6 @@
{
m_outputStream.write(s + theOffset);
}
- }
- else
- {
- m_outputStream.write(s + theOffset, theLength);
}
}
1.5 +2 -2 xml-xalan/c/src/xalanc/PlatformSupport/XalanTranscodingServices.cpp
Index: XalanTranscodingServices.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/PlatformSupport/XalanTranscodingServices.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- XalanTranscodingServices.cpp 6 Jan 2004 02:41:28 -0000 1.4
+++ XalanTranscodingServices.cpp 6 Feb 2004 08:57:08 -0000 1.5
@@ -283,7 +283,7 @@
XalanTranscodingServices::makeNewTranscoder(
const XalanDOMString& theEncodingName,
eCode& theResult,
- size_t theBlockSize)
+ size_type theBlockSize)
{
XALAN_USING_XERCES(XMLPlatformUtils)
@@ -465,7 +465,7 @@
XalanTranscodingServices::UnrepresentableCharacterException::UnrepresentableCharacterException(
- unsigned int theCharacter,
+ UnicodeCharType theCharacter,
const XalanDOMString& theEncoding) :
XSLException(
XalanMessageLoader::getMessage(
1.5 +25 -21 xml-xalan/c/src/xalanc/PlatformSupport/XalanTranscodingServices.hpp
Index: XalanTranscodingServices.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/PlatformSupport/XalanTranscodingServices.hpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- XalanTranscodingServices.hpp 6 Jan 2004 02:41:28 -0000 1.4
+++ XalanTranscodingServices.hpp 6 Feb 2004 08:57:08 -0000 1.5
@@ -98,20 +98,22 @@
terminate();
typedef unsigned char XalanXMLByte;
+ typedef unsigned int size_type;
+ typedef unsigned int UnicodeCharType;
- static size_t
+ static size_type
length(const XalanXMLByte* theBytes)
{
assert(theBytes != 0);
- const XalanXMLByte* theCurrentByte = theBytes;
+ size_type i = 0;
- while(*theCurrentByte != 0)
+ while(theBytes[i] != 0)
{
- ++theCurrentByte;
+ ++i;
}
- return theCurrentByte - theBytes;
+ return i;
}
enum eCode
@@ -136,7 +138,7 @@
makeNewTranscoder(
const XalanDOMString& theEncodingName,
eCode& theResult,
- size_t theBlockSize);
+ size_type theBlockSize);
/**
* Destroy a transcoder instance.
@@ -244,7 +246,7 @@
getBytesEqualChars(const XalanDOMString& theEncoding);
static bool
- canTranscodeToLocalCodePage(unsigned int theChar)
+ canTranscodeToLocalCodePage(UnicodeCharType theChar)
{
// Yuck!! See getMaximumCharacterValue() for more details.
return theChar <= 0x7fu ? true : false;
@@ -276,13 +278,13 @@
public:
UnrepresentableCharacterException(
- unsigned int theCharacter,
+ UnicodeCharType theCharacter,
const XalanDOMString& theEncoding);
virtual
~UnrepresentableCharacterException();
- unsigned int
+ UnicodeCharType
getCharacter() const
{
return m_badCharacter;
@@ -296,7 +298,7 @@
private:
- const unsigned int m_badCharacter;
+ const UnicodeCharType m_badCharacter;
const XalanDOMString m_encoding;
};
@@ -314,8 +316,10 @@
{
public:
- typedef XalanTranscodingServices::XalanXMLByte XalanXMLByte;
- typedef XalanTranscodingServices::eCode eCode;
+ typedef XalanTranscodingServices::XalanXMLByte XalanXMLByte;
+ typedef XalanTranscodingServices::eCode eCode;
+ typedef XalanTranscodingServices::size_type size_type;
+ typedef XalanTranscodingServices::UnicodeCharType UnicodeCharType;
explicit
XalanOutputTranscoder();
@@ -339,11 +343,11 @@
virtual eCode
transcode(
const XalanDOMChar* theSourceData,
- size_t theSourceCount,
+ size_type theSourceCount,
XalanXMLByte* theTarget,
- size_t theTargetSize,
- size_t& theSourceCharsTranscoded,
- size_t& theTargetBytesUsed) = 0;
+ size_type theTargetSize,
+ size_type& theSourceCharsTranscoded,
+ size_type& theTargetBytesUsed) = 0;
/**
* Transcode data from the transcoder's encoding to UTF-16. If successfull,
@@ -362,15 +366,15 @@
virtual eCode
transcode(
const XalanXMLByte* theSourceData,
- size_t theSourceCount,
+ size_type theSourceCount,
XalanDOMChar* theTarget,
- size_t theTargetSize,
- size_t& theSourceCharsTranscoded,
- size_t& theTargetBytesUsed,
+ size_type theTargetSize,
+ size_type& theSourceCharsTranscoded,
+ size_type& theTargetBytesUsed,
unsigned char* theCharSizes) = 0;
virtual bool
- canTranscodeTo(unsigned int theChar) const = 0;
+ canTranscodeTo(UnicodeCharType theChar) const = 0;
private:
1.5 +0 -4 xml-xalan/c/src/xalanc/PlatformSupport/XalanUnicode.hpp
Index: XalanUnicode.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/PlatformSupport/XalanUnicode.hpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- XalanUnicode.hpp 6 Jan 2004 02:41:28 -0000 1.4
+++ XalanUnicode.hpp 6 Feb 2004 08:57:08 -0000 1.5
@@ -64,10 +64,6 @@
-#include <xalanc/XalanDOM/XalanDOMString.hpp>
-
-
-
XALAN_CPP_NAMESPACE_BEGIN
1.4 +0 -4 xml-xalan/c/src/xalanc/PlatformSupport/XalanXMLChar.hpp
Index: XalanXMLChar.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/PlatformSupport/XalanXMLChar.hpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- XalanXMLChar.hpp 6 Jan 2004 02:41:28 -0000 1.3
+++ XalanXMLChar.hpp 6 Feb 2004 08:57:08 -0000 1.4
@@ -64,10 +64,6 @@
-#include <xalanc/XalanDOM/XalanDOMString.hpp>
-
-
-
XALAN_CPP_NAMESPACE_BEGIN
1.9 +5 -4 xml-xalan/c/src/xalanc/XMLSupport/FormatterToXML.cpp
Index: FormatterToXML.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XMLSupport/FormatterToXML.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- FormatterToXML.cpp 22 Jan 2004 02:44:45 -0000 1.8
+++ FormatterToXML.cpp 6 Feb 2004 08:57:08 -0000 1.9
@@ -195,10 +195,11 @@
m_maxCharacter = XalanTranscodingServices::getMaximumCharacterValue(m_encoding);
// We cannot omit the XML declaration if the encoding is not UTF-8 or
- // UTF-16
+ // UTF-16, or if there is a standalone declaration
const bool canOmitXMLDeclaration =
- XalanTranscodingServices::encodingIsUTF8(m_encoding) ||
- XalanTranscodingServices::encodingIsUTF16(m_encoding);
+ (XalanTranscodingServices::encodingIsUTF8(m_encoding) ||
+ XalanTranscodingServices::encodingIsUTF16(m_encoding)) &&
+ m_standalone.length() == 0;
if (canOmitXMLDeclaration == false && m_shouldWriteXMLHeader == false)
{
@@ -1979,7 +1980,7 @@
FXML_SIZE(s_xhtmlDocTypeString);
-const FormatterToXML::DOMCharBufferType::size_type FormatterToXML::s_maxBufferSize = 512;
+const XalanDOMString::size_type FormatterToXML::s_maxBufferSize = 512;
1.4 +2 -2 xml-xalan/c/src/xalanc/XMLSupport/FormatterToXML.hpp
Index: FormatterToXML.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XMLSupport/FormatterToXML.hpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- FormatterToXML.hpp 6 Jan 2004 02:41:31 -0000 1.3
+++ FormatterToXML.hpp 6 Feb 2004 08:57:08 -0000 1.4
@@ -1111,11 +1111,11 @@
DOMCharBufferType m_charBuf;
- DOMCharBufferType::size_type m_pos;
+ XalanDOMString::size_type m_pos;
ByteBufferType m_byteBuf;
- static const DOMCharBufferType::size_type s_maxBufferSize;
+ static const XalanDOMString::size_type s_maxBufferSize;
/**
* A stack of Boolean objects that tell if the given element
1.7 +2 -1 xml-xalan/c/src/xalanc/XMLSupport/FormatterToXMLBase.cpp
Index: FormatterToXMLBase.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XMLSupport/FormatterToXMLBase.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- FormatterToXMLBase.cpp 6 Jan 2004 02:41:31 -0000 1.6
+++ FormatterToXMLBase.cpp 6 Feb 2004 08:57:08 -0000 1.7
@@ -165,7 +165,8 @@
m_newlineString(0),
m_newlineStringLength(0),
m_needToOutputDoctypeDecl(false),
- m_shouldWriteXMLHeader(xmlDecl),
+ // We must write the XML declaration if standalone is specified
+ m_shouldWriteXMLHeader(xmlDecl == true ? true : standalone.length() == 0),
m_elemStack()
{
if(isEmpty(m_doctypePublic) == false)
1.9 +6 -2 xml-xalan/c/src/xalanc/XMLSupport/FormatterToXML_UTF8.cpp
Index: FormatterToXML_UTF8.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XMLSupport/FormatterToXML_UTF8.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- FormatterToXML_UTF8.cpp 5 Feb 2004 21:37:06 -0000 1.8
+++ FormatterToXML_UTF8.cpp 6 Feb 2004 08:57:08 -0000 1.9
@@ -352,7 +352,9 @@
}
else
{
- write(firstChar, currentChar - firstChar);
+ write(
+ firstChar,
+ XalanDOMString::size_type(currentChar - firstChar));
const XalanDOMChar high = *currentChar;
const XalanDOMChar low = *(++currentChar);
@@ -365,7 +367,9 @@
}
}
- write(firstChar, currentChar - firstChar);
+ write(
+ firstChar,
+ XalanDOMString::size_type(currentChar - firstChar));
}
1.5 +5 -4 xml-xalan/c/src/xalanc/XPath/MutableNodeRefList.cpp
Index: MutableNodeRefList.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XPath/MutableNodeRefList.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- MutableNodeRefList.cpp 6 Feb 2004 01:44:46 -0000 1.4
+++ MutableNodeRefList.cpp 6 Feb 2004 08:57:08 -0000 1.5
@@ -600,9 +600,7 @@
{
if (node != 0)
{
- const size_type size = m_nodeList.size();
-
- if (size == 0)
+ if (m_nodeList.size() == 0)
{
addNode(node);
}
@@ -746,7 +744,10 @@
nodelist.m_nodeList.assign(m_nodeList.rbegin(), m_nodeList.rend());
#else
nodelist.clear();
- nodelist.reserve(m_nodeList.size());
+
+ assert(size_type(m_nodeList.size()) == m_nodeList.size());
+
+ nodelist.reserve(size_type(m_nodeList.size()));
typedef NodeListVectorType::const_reverse_iterator const_reverse_iterator;
1.4 +3 -1 xml-xalan/c/src/xalanc/XPath/NodeRefList.cpp
Index: NodeRefList.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XPath/NodeRefList.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- NodeRefList.cpp 6 Jan 2004 02:41:32 -0000 1.3
+++ NodeRefList.cpp 6 Feb 2004 08:57:08 -0000 1.4
@@ -162,7 +162,9 @@
NodeRefList::size_type
NodeRefList::getLength() const
{
- return m_nodeList.size();
+ assert(size_type(m_nodeList.size()) == m_nodeList.size());
+
+ return size_type(m_nodeList.size());
}
1.4 +6 -5 xml-xalan/c/src/xalanc/XPath/NodeRefListBase.hpp
Index: NodeRefListBase.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XPath/NodeRefListBase.hpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- NodeRefListBase.hpp 6 Jan 2004 02:41:32 -0000 1.3
+++ NodeRefListBase.hpp 6 Feb 2004 08:57:08 -0000 1.4
@@ -89,11 +89,12 @@
virtual
~NodeRefListBase();
-#if defined(XALAN_STRICT_ANSI_HEADERS)
- typedef std::size_t size_type;
-#else
- typedef size_t size_type;
-#endif
+//#if defined(XALAN_STRICT_ANSI_HEADERS)
+// typedef std::size_t size_type;
+//#else
+// typedef size_t size_type;
+//#endif
+ typedef unsigned int size_type;
/**
* Returns the <code>index</code>th item in the collection. If
1.5 +2 -1 xml-xalan/c/src/xalanc/XPath/XNodeSetBase.hpp
Index: XNodeSetBase.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XPath/XNodeSetBase.hpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- XNodeSetBase.hpp 6 Jan 2004 02:41:32 -0000 1.4
+++ XNodeSetBase.hpp 6 Feb 2004 08:57:08 -0000 1.5
@@ -69,6 +69,7 @@
+#include <xalanc/XPath/NodeRefListBase.hpp>
#include <xalanc/XPath/XNodeSetResultTreeFragProxy.hpp>
@@ -84,7 +85,7 @@
{
public:
- typedef size_t size_type;
+ typedef NodeRefListBase::size_type size_type;
virtual
~XNodeSetBase();
1.6 +14 -10 xml-xalan/c/src/xalanc/XPath/XPathExpression.cpp
Index: XPathExpression.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XPath/XPathExpression.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- XPathExpression.cpp 9 Jan 2004 07:07:46 -0000 1.5
+++ XPathExpression.cpp 6 Feb 2004 08:57:08 -0000 1.6
@@ -459,10 +459,10 @@
}
else
{
- const OpCodeMapSizeType theArgCount =
+ const OpCodeMapValueType theArgCount =
theOpCodeLength - 1 - s_opCodeMapLengthIndex;
- if (theArgCount != theArgs.size())
+ if (OpCodeMapValueVectorType::size_type(theArgCount) != theArgs.size())
{
throw InvalidArgumentCountException(theOpCode,
theOpCodeLength,
@@ -472,7 +472,7 @@
{
assert(opCodeMapSize() > theIndex + theArgCount);
- for (OpCodeMapSizeType i = 0; i < theArgCount; ++i)
+ for (OpCodeMapValueType i = 0; i < theArgCount; ++i)
{
if (theArgs[i] < 0)
{
@@ -540,7 +540,7 @@
eOpCodes theOldOpCode,
eOpCodes theNewOpCode)
{
- if (theIndex >= m_opMap.size() ||
+ if (theIndex >= opCodeMapSize() ||
m_opMap[theIndex] != theOldOpCode ||
getOpCodeLength(theOldOpCode) != getOpCodeLength(theNewOpCode))
{
@@ -592,8 +592,12 @@
void
XPathExpression::updateShiftedOpCodeLength(
OpCodeMapValueType theOpCode,
- OpCodeMapSizeType theOriginalIndex,
- OpCodeMapSizeType theNewIndex)
+#if defined(NDEBUG)
+ OpCodeMapValueType /* theOriginalIndex */,
+#else
+ OpCodeMapValueType theOriginalIndex,
+#endif
+ OpCodeMapValueType theNewIndex)
{
// There must be some other expressions in
// the buffer...
@@ -601,7 +605,7 @@
assert(theNewIndex > theOriginalIndex);
- const int theOpCodeLength = getOpCodeLength(theOpCode);
+ const OpCodeMapValueType theOpCodeLength = getOpCodeLength(theOpCode);
// Make sure it's a valid op code and that it
// matches the op code at supplied index.
@@ -643,7 +647,7 @@
void
XPathExpression::updateOpCodeLength(
OpCodeMapValueType theOpCode,
- OpCodeMapSizeType theIndex)
+ OpCodeMapValueType theIndex)
{
// There must be some other expressions in
// the buffer...
@@ -689,7 +693,7 @@
void
-XPathExpression::updateOpCodeLengthAfterNodeTest(OpCodeMapSizeType theIndex)
+XPathExpression::updateOpCodeLengthAfterNodeTest(OpCodeMapValueType theIndex)
{
// There must be some other expressions in
// the buffer...
@@ -821,7 +825,7 @@
{
assert(m_currentPosition != 0);
- const TokenQueueSizeType thePosition = m_currentPosition - 1;
+ const int thePosition = m_currentPosition - 1;
assert(thePosition < tokenQueueSize());
1.4 +12 -13 xml-xalan/c/src/xalanc/XPath/XPathExpression.hpp
Index: XPathExpression.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XPath/XPathExpression.hpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- XPathExpression.hpp 6 Jan 2004 02:41:32 -0000 1.3
+++ XPathExpression.hpp 6 Feb 2004 08:57:08 -0000 1.4
@@ -737,23 +737,21 @@
#if defined(XALAN_NO_STD_NAMESPACE)
-
typedef vector<int> OpCodeMapType;
typedef vector<XToken> TokenQueueType;
typedef OpCodeMapType::value_type OpCodeMapValueType;
- typedef OpCodeMapType::size_type OpCodeMapSizeType;
+ typedef OpCodeMapValueType OpCodeMapSizeType;
typedef vector<OpCodeMapValueType> OpCodeMapValueVectorType;
typedef vector<double> NumberLiteralValueVectorType;
#else
-
typedef std::vector<int> OpCodeMapType;
typedef std::vector<XToken> TokenQueueType;
typedef OpCodeMapType::value_type OpCodeMapValueType;
- typedef OpCodeMapType::size_type OpCodeMapSizeType;
+ typedef OpCodeMapValueType OpCodeMapSizeType;
typedef std::vector<OpCodeMapValueType> OpCodeMapValueVectorType;
@@ -761,7 +759,7 @@
#endif
typedef TokenQueueType::value_type TokenQueueValueType;
- typedef TokenQueueType::size_type TokenQueueSizeType;
+ typedef int TokenQueueSizeType;
/**
* The length is always the opcode position + 1. Length is always expressed
@@ -803,7 +801,7 @@
OpCodeMapSizeType
opCodeMapSize() const
{
- return m_opMap.size();
+ return OpCodeMapSizeType(m_opMap.size());
}
/**
@@ -844,7 +842,7 @@
TokenQueueSizeType
tokenQueueSize() const
{
- return m_tokenQueue.size();
+ return TokenQueueSizeType(m_tokenQueue.size());
}
/**
@@ -970,7 +968,7 @@
* @param theIndex index in list
*/
void
- updateOpCodeLength(OpCodeMapSizeType theIndex)
+ updateOpCodeLength(OpCodeMapValueType theIndex)
{
assert(theIndex < opCodeMapSize());
@@ -988,8 +986,8 @@
void
updateShiftedOpCodeLength(
OpCodeMapValueType theOpCode,
- OpCodeMapSizeType theOriginalIndex,
- OpCodeMapSizeType theNewIndex);
+ OpCodeMapValueType theOriginalIndex,
+ OpCodeMapValueType theNewIndex);
/**
* Update the length of an operation code at a specified index in the list.
@@ -1004,7 +1002,7 @@
void
updateOpCodeLength(
OpCodeMapValueType theOpCode,
- OpCodeMapSizeType theIndex);
+ OpCodeMapValueType theIndex);
/**
* Whether the operation code is one of the node test types, for example,
@@ -1022,7 +1020,7 @@
* @param theIndex index in list
*/
void
- updateOpCodeLengthAfterNodeTest(OpCodeMapSizeType theIndex);
+ updateOpCodeLengthAfterNodeTest(OpCodeMapValueType theIndex);
/**
* Whether there are any more tokens in the token queue.
@@ -1068,6 +1066,7 @@
m_currentPosition = thePosition > theSize ? theSize : thePosition;
}
+#if 0
/**
* Set the current position in the token queue to a specified value.
*
@@ -1078,7 +1077,7 @@
{
setTokenPosition(thePosition > 0 ? TokenQueueSizeType(thePosition) : 0);
}
-
+#endif
/**
* Retrieve a token at the specified position in the token queue.
*
1.4 +3 -1 xml-xalan/c/src/xalanc/XPath/XPathFunctionTable.cpp
Index: XPathFunctionTable.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XPath/XPathFunctionTable.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- XPathFunctionTable.cpp 6 Jan 2004 02:41:32 -0000 1.3
+++ XPathFunctionTable.cpp 6 Feb 2004 08:57:08 -0000 1.4
@@ -534,7 +534,9 @@
}
else
{
- return theCurrent - s_functionNames;
+ assert(int(theCurrent - s_functionNames) == theCurrent - s_functionNames);
+
+ return int(theCurrent - s_functionNames);
}
}
1.4 +7 -4 xml-xalan/c/src/xalanc/XPathCAPI/XPathCAPI.cpp
Index: XPathCAPI.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XPathCAPI/XPathCAPI.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- XPathCAPI.cpp 6 Jan 2004 02:41:36 -0000 1.3
+++ XPathCAPI.cpp 6 Feb 2004 08:57:09 -0000 1.4
@@ -307,6 +307,7 @@
}
+typedef XalanTranscodingServices::size_type size_type;
inline int
transcodeString(
@@ -314,7 +315,7 @@
const char* theString,
XalanDOMChar* theChars,
unsigned char* theCharsCount,
- size_t theLength,
+ size_type theLength,
XalanDOMString& theResultString)
{
assert(theTranscoder != 0);
@@ -322,8 +323,8 @@
assert(theChars != 0);
assert(theCharsCount != 0);
- size_t theSourceCharsTranscoded = 0;
- size_t theTargetBytesUsed = 0;
+ size_type theSourceCharsTranscoded = 0;
+ size_type theTargetBytesUsed = 0;
const XalanTranscodingServices::eCode theCode = theTranscoder->transcode(
#if defined(XALAN_OLD_STYLE_CASTS)
@@ -344,7 +345,9 @@
}
else
{
- theResultString.assign(theChars, theTargetBytesUsed);
+ assert(XalanDOMString::size_type(theTargetBytesUsed) == theTargetBytesUsed);
+
+ theResultString.assign(theChars, XalanDOMString::size_type(theTargetBytesUsed));
return XALAN_XPATH_API_SUCCESS;
}
1.4 +4 -2 xml-xalan/c/src/xalanc/XSLT/CountersTable.cpp
Index: CountersTable.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XSLT/CountersTable.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- CountersTable.cpp 6 Jan 2004 02:41:36 -0000 1.3
+++ CountersTable.cpp 6 Feb 2004 08:57:09 -0000 1.4
@@ -140,10 +140,11 @@
Counter& counter = counters[i];
const Counter::NodeVectorType::size_type cacheLen = counter.m_countNodes.size();
+ assert(cacheLen == CountType(cacheLen));
if(cacheLen > 0 && counter.m_countNodes[cacheLen - 1] == target)
{
- count += cacheLen + counter.m_countNodesStartCount;
+ count += CountType(cacheLen) + counter.m_countNodesStartCount;
if(cacheLen > 0)
{
@@ -186,6 +187,7 @@
const XalanNode* node) const
{
const NodeVectorType::size_type n = m_countNodes.size();
+ assert(CountType(n) == n);
CountType result = 0;
@@ -197,7 +199,7 @@
{
// Since the list is in backwards order, the count is
// how many are in the rest of the list.
- result = i + m_countNodesStartCount;
+ result = CountType(i) + m_countNodesStartCount;
break;
}
1.6 +2 -2 xml-xalan/c/src/xalanc/XSLT/ElemNumber.cpp
Index: ElemNumber.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XSLT/ElemNumber.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- ElemNumber.cpp 6 Jan 2004 02:41:36 -0000 1.5
+++ ElemNumber.cpp 6 Feb 2004 08:57:09 -0000 1.6
@@ -1050,7 +1050,7 @@
//String orientation = thisBundle.getString(Constants.LANG_ORIENTATION);
// next character to set in the buffer
- size_t charPos = 0;
+ XalanDOMString::size_type charPos = 0;
// array of number groups: ie.1000, 100, 10, 1
const NumberTypeVectorType& groups = theResourceBundle.getNumberGroups();
@@ -1441,7 +1441,7 @@
#endif
// next character to set in the buffer
- size_t charPos = buflen - 1 ; // work backward through buf[]
+ XalanDOMString::size_type charPos = buflen - 1 ; // work backward through buf[]
// index in table of the last character that we stored
size_t lookupIndex = 1; // start off with anything other than zero to make correction work
1.4 +1 -1 xml-xalan/c/src/xalanc/XSLT/ExtensionNSHandler.cpp
Index: ExtensionNSHandler.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XSLT/ExtensionNSHandler.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ExtensionNSHandler.cpp 6 Jan 2004 02:41:36 -0000 1.3
+++ ExtensionNSHandler.cpp 6 Feb 2004 08:57:09 -0000 1.4
@@ -223,7 +223,7 @@
XalanDOMString
-ExtensionNSHandler::getScriptString(const XalanElement& elem)
+ExtensionNSHandler::getScriptString(const XalanElement& /* elem */)
{
return XalanDOMString();
}
1.8 +16 -24 xml-xalan/c/src/xalanc/XSLT/VariablesStack.cpp
Index: VariablesStack.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XSLT/VariablesStack.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- VariablesStack.cpp 6 Jan 2004 02:41:36 -0000 1.7
+++ VariablesStack.cpp 6 Feb 2004 08:57:09 -0000 1.8
@@ -81,7 +81,7 @@
VariablesStack::VariablesStack() :
m_stack(),
- m_globalStackFrameIndex(-1),
+ m_globalStackFrameIndex(~0u),
m_globalStackFrameMarked(false),
m_currentStackFrameIndex(0),
m_guardStack(),
@@ -111,7 +111,7 @@
m_elementFrameStack.clear();
m_globalStackFrameMarked = false;
- m_globalStackFrameIndex = -1;
+ m_globalStackFrameIndex = ~0u;
}
@@ -174,7 +174,7 @@
}
}
- m_currentStackFrameIndex = m_stack.size();
+ m_currentStackFrameIndex = size_type(m_stack.size());
}
@@ -318,12 +318,13 @@
void
VariablesStack::resetParams()
{
- const unsigned int nElems = getCurrentStackFrameIndex();
+ const size_type nElems = getCurrentStackFrameIndex();
+ assert(nElems > 0);
// There is guaranteed to be a context marker at
// the bottom of the stack, so i should stop at
// 1.
- for(unsigned int i = nElems - 1; i > 0; --i)
+ for(size_type i = nElems - 1; i > 0; --i)
{
StackEntry& theEntry = m_stack[i];
@@ -343,7 +344,7 @@
void
VariablesStack::markGlobalStackFrame()
{
- m_globalStackFrameIndex = m_stack.size();
+ m_globalStackFrameIndex = size_type(m_stack.size());
m_globalStackFrameMarked = true;
@@ -357,7 +358,7 @@
{
popContextMarker();
- m_globalStackFrameIndex = -1;
+ m_globalStackFrameIndex = ~0u;
m_globalStackFrameMarked = false;
}
@@ -449,22 +450,20 @@
-VariablesStack::VariableStackStackType::size_type
+VariablesStack::size_type
VariablesStack::findEntry(
const XalanQName& qname,
bool fIsParam,
bool fSearchGlobalSpace)
{
- typedef VariableStackStackType::size_type size_type;
-
- size_type theEntryIndex = m_stack.size();
+ size_type theEntryIndex = size_type(m_stack.size());
- const unsigned int nElems = getCurrentStackFrameIndex();
+ const size_type nElems = getCurrentStackFrameIndex();
// There is guaranteed to be a context marker at
// the bottom of the stack, so i should stop at
// 1.
- for(unsigned int i = nElems - 1; i > 0; --i)
+ for(size_type i = nElems - 1; i > 0; --i)
{
StackEntry& theEntry = m_stack[i];
@@ -477,7 +476,7 @@
if(theEntry.getName()->equals(qname))
{
- theEntryIndex = size_type(i);
+ theEntryIndex = i;
break;
}
@@ -490,7 +489,7 @@
{
theEntry.activate();
- theEntryIndex = size_type(i);
+ theEntryIndex = i;
break;
}
@@ -505,7 +504,7 @@
if(theEntryIndex == m_stack.size() && fIsParam == false && true == fSearchGlobalSpace && m_globalStackFrameIndex > 1)
{
// Look in the global space
- for(unsigned int i = m_globalStackFrameIndex - 1; i > 0; i--)
+ for(size_type i = m_globalStackFrameIndex - 1; i > 0; i--)
{
StackEntry& theEntry = m_stack[i];
@@ -517,7 +516,7 @@
if(theEntry.getName()->equals(qname))
{
- theEntryIndex = size_type(i);
+ theEntryIndex = i;
break;
}
@@ -679,13 +678,6 @@
VariablesStack::StackEntry::~StackEntry()
{
-#if !defined(NDEBUG)
- m_qname = (const XalanQName*) 0xDEADBEEF;
-
- m_variable = (const ElemVariable*) 0xDEADBEEF;
-
- m_element = (const ElemTemplateElement*) 0xDEADBEEF;
-#endif
}
1.7 +17 -12 xml-xalan/c/src/xalanc/XSLT/VariablesStack.hpp
Index: VariablesStack.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XSLT/VariablesStack.hpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- VariablesStack.hpp 6 Jan 2004 02:41:36 -0000 1.6
+++ VariablesStack.hpp 6 Feb 2004 08:57:09 -0000 1.7
@@ -97,6 +97,8 @@
{
public:
+ typedef unsigned long size_type;
+
/**
* Constructor for a variable stack.
*/
@@ -105,7 +107,6 @@
~VariablesStack();
-
/**
* Reset the stack.
*/
@@ -298,12 +299,18 @@
* @param currentStackFrameIndex new value of index
*/
void
- setCurrentStackFrameIndex(int currentStackFrameIndex = -1)
+ setCurrentStackFrameIndex(size_type currentStackFrameIndex = ~0u)
{
- if (currentStackFrameIndex == -1)
- m_currentStackFrameIndex = m_stack.size();
+ if (currentStackFrameIndex == ~0u)
+ {
+ assert(size_type(m_stack.size()) == m_stack.size());
+
+ m_currentStackFrameIndex = size_type(m_stack.size());
+ }
else
+ {
m_currentStackFrameIndex = currentStackFrameIndex;
+ }
}
/**
@@ -312,7 +319,7 @@
*
* @return current value of index
*/
- int
+ size_type
getCurrentStackFrameIndex() const
{
return m_currentStackFrameIndex;
@@ -323,7 +330,7 @@
*
* @return current value of index
*/
- int
+ size_type
getGlobalStackFrameIndex() const
{
return m_globalStackFrameIndex;
@@ -510,12 +517,10 @@
typedef std::vector<StackEntry> VariableStackStackType;
#endif
- typedef VariableStackStackType::size_type size_type;
-
size_type
getStackSize() const
{
- return m_stack.size();
+ return size_type(m_stack.size());
}
enum { eDefaultStackSize = 100 };
@@ -595,7 +600,7 @@
bool fSearchGlobalSpace,
bool& fNameFound);
- VariableStackStackType::size_type
+ size_type
findEntry(
const XalanQName& name,
bool fIsParam,
@@ -604,7 +609,7 @@
VariableStackStackType m_stack;
- int m_globalStackFrameIndex;
+ size_type m_globalStackFrameIndex;
bool m_globalStackFrameMarked;
@@ -613,7 +618,7 @@
* for a variable or param should take place. It may not
* be the real stack top.
*/
- unsigned int m_currentStackFrameIndex;
+ size_type m_currentStackFrameIndex;
/**
* This will be a stack for any variable definitions
1.7 +8 -4 xml-xalan/c/src/xalanc/XalanDOM/XalanDOMString.cpp
Index: XalanDOMString.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XalanDOM/XalanDOMString.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- XalanDOMString.cpp 6 Jan 2004 02:41:41 -0000 1.6
+++ XalanDOMString.cpp 6 Feb 2004 08:57:09 -0000 1.7
@@ -219,7 +219,8 @@
m_data.erase(i, i + (theActualCount));
- const size_type theNewSize = m_data.size();
+ const size_type theNewSize = size_type(m_data.size());
+ assert(size_type(m_data.size()) == theNewSize);
if (theNewSize < 2)
{
@@ -316,7 +317,9 @@
m_data.push_back(XalanDOMChar(0));
- m_size = m_data.size() - 1;
+ m_size = size_type(m_data.size()) - 1;
+ assert(m_data.size() - 1 == m_size);
+
#endif
invariants();
@@ -415,7 +418,8 @@
append(&*theTempVector.begin(), size_type(theTempVector.size()));
}
- m_size = m_data.size() - 1;
+ m_size = size_type(m_data.size()) - 1;
+ assert(m_data.size() - 1 == m_size);
}
invariants();
@@ -588,7 +592,7 @@
{
m_data.insert(theInsertPosition, theFirstPosition, theLastPosition);
- m_size = m_data.size() - 1;
+ m_size = size_type(m_data.size()) - 1;
assert(m_size == m_data.size() - 1);
}
1.5 +2 -11 xml-xalan/c/src/xalanc/XalanDOM/XalanDOMString.hpp
Index: XalanDOMString.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XalanDOM/XalanDOMString.hpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- XalanDOMString.hpp 6 Jan 2004 02:41:41 -0000 1.4
+++ XalanDOMString.hpp 6 Feb 2004 08:57:09 -0000 1.5
@@ -76,15 +76,6 @@
-#if defined(XALAN_USE_NATIVE_WCHAR_T)
-typedef wchar_t XalanDOMChar;
-#else
-// UTF-16 character...
-typedef unsigned short XalanDOMChar;
-#endif
-
-
-
class XALAN_DOM_EXPORT XalanDOMString
{
public:
@@ -103,7 +94,7 @@
typedef XalanDOMChar& reference;
typedef const XalanDOMChar& const_reference;
- typedef XalanDOMCharVectorType::size_type size_type;
+ typedef unsigned int size_type;
typedef XalanDOMCharVectorType::iterator iterator;
typedef XalanDOMCharVectorType::const_iterator const_iterator;
@@ -286,7 +277,7 @@
{
invariants();
- return m_data.capacity() - 1;
+ return size_type(m_data.capacity()) - 1;
}
void
---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org