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 2001/09/25 23:13:56 UTC
cvs commit: xml-xalan/c/src/XalanDOM XalanDOMString.cpp XalanDOMString.hpp
dbertoni 01/09/25 14:13:56
Modified: c/src/XalanDOM XalanDOMString.cpp XalanDOMString.hpp
Log:
32/64-bit fixes.
Revision Changes Path
1.16 +16 -21 xml-xalan/c/src/XalanDOM/XalanDOMString.cpp
Index: XalanDOMString.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XalanDOM/XalanDOMString.cpp,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- XalanDOMString.cpp 2001/08/15 15:09:31 1.15
+++ XalanDOMString.cpp 2001/09/25 21:13:55 1.16
@@ -168,16 +168,16 @@
{
// If the string is of 0 length, resize but add an
// extra byte for the terminating byte.
- m_data.resize(real_size_type(theCount + 1), theChar);
+ m_data.resize(theCount + 1, theChar);
}
else
{
// If the string is not of 0 length, resize but
// put a copy of theChar where the terminating
// byte used to be.
- m_data.resize(real_size_type(theCount), theChar);
+ m_data.resize(theCount, theChar);
- m_data[real_size_type(theOldSize)] = theChar;
+ m_data[theOldSize] = theChar;
}
m_size = theCount;
@@ -213,8 +213,7 @@
m_data.erase(i, i + (theActualCount));
- const size_type theNewSize = size_type(m_data.size());
- assert(real_size_type(theNewSize) == m_data.size());
+ const size_type theNewSize = m_data.size();
if (theNewSize < 2)
{
@@ -263,7 +262,7 @@
{
if (m_data.size() == 0)
{
- m_data.reserve(real_size_type(theLength) + 1);
+ m_data.reserve(theLength + 1);
m_data.insert(m_data.end(), theString, theString + theLength);
@@ -339,9 +338,7 @@
append(&*theTempVector.begin(), size_type(theTempVector.size()));
}
- m_size = size_type(m_data.size()) - 1;
-
- assert(real_size_type(m_size) == m_data.size() - 1);
+ m_size = m_data.size() - 1;
}
invariants();
@@ -359,7 +356,7 @@
if (m_data.size() == 0)
{
- m_data.insert(m_data.end(), real_size_type(theCount) + 1, theChar);
+ m_data.insert(m_data.end(), theCount + 1, theChar);
m_data.back() = 0;
@@ -369,7 +366,7 @@
}
else
{
- m_data.insert(getBackInsertIterator(), real_size_type(theCount), theChar);
+ m_data.insert(getBackInsertIterator(), theCount, theChar);
m_size += theCount;
}
@@ -408,7 +405,7 @@
{
invariants();
- m_data.insert(getIteratorForPosition(thePosition), real_size_type(theCount), theChar);
+ m_data.insert(getIteratorForPosition(thePosition), theCount, theChar);
m_size += theCount;
@@ -445,7 +442,7 @@
{
invariants();
- m_data.insert(thePosition, real_size_type(theCount), theChar);
+ m_data.insert(thePosition, theCount, theChar);
m_size += theCount;
@@ -464,9 +461,9 @@
m_data.insert(theInsertPosition, theFirstPosition, theLastPosition);
- m_size = size_type(m_data.size()) - 1;
+ m_size = m_data.size() - 1;
- assert(real_size_type(m_size) == m_data.size() - 1);
+ assert(m_size == m_data.size() - 1);
invariants();
}
@@ -663,7 +660,7 @@
{
assert(theString != 0);
- assert(strlen(theString) < real_size_type(npos));
+ assert(strlen(theString) < size_type(npos));
return size_type(strlen(theString));
}
@@ -778,8 +775,6 @@
CharVectorType& theTargetVector,
bool terminate)
{
- typedef XalanDOMString::real_size_type real_size_type;
-
// Short circuit if it's a null pointer, or of length 0.
if (!theSourceString || (!theSourceString[0]))
{
@@ -829,14 +824,14 @@
theSourceStringLength = length(theSourceString);
}
- theTempSourceJanitor.reset(new wchar_t[real_size_type(theSourceStringLength) + 1]);
+ theTempSourceJanitor.reset(new wchar_t[theSourceStringLength + 1]);
- for (size_t index = 0; index < size_t(theSourceStringLength); ++index)
+ for (size_t index = 0; index < theSourceStringLength; ++index)
{
theTempSourceJanitor[index] = wchar_t(theSourceString[index]);
}
- theTempSourceJanitor[size_t(theSourceStringLength)] = 0;
+ theTempSourceJanitor[theSourceStringLength] = 0;
theTempSource = theTempSourceJanitor.get();
}
1.20 +7 -15 xml-xalan/c/src/XalanDOM/XalanDOMString.hpp
Index: XalanDOMString.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XalanDOM/XalanDOMString.hpp,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- XalanDOMString.hpp 2001/08/06 01:35:44 1.19
+++ XalanDOMString.hpp 2001/09/25 21:13:55 1.20
@@ -98,11 +98,7 @@
typedef XalanDOMChar& reference;
typedef const XalanDOMChar& const_reference;
- // We're stuck with 32-bit lengths because of the DOMs IDL
- // bindings. Ideally, we'ed like to re-visit this in the
- // future. See typedef below of real_size_type.
- typedef unsigned int size_type;
- typedef XalanDOMCharVectorType::size_type real_size_type;
+ typedef XalanDOMCharVectorType::size_type size_type;
typedef XalanDOMCharVectorType::iterator iterator;
typedef XalanDOMCharVectorType::const_iterator const_iterator;
@@ -239,9 +235,7 @@
{
invariants();
- assert(real_size_type(size_type(m_data.capacity())) == m_data.capacity());
-
- return size_type(m_data.capacity()) - 1;
+ return m_data.capacity() - 1;
}
void
@@ -249,7 +243,7 @@
{
invariants();
- m_data.reserve(real_size_type(theCount) + 1);
+ m_data.reserve(theCount + 1);
}
void
@@ -282,7 +276,7 @@
{
invariants();
- return m_data[real_size_type(theIndex)];
+ return m_data[theIndex];
}
reference
@@ -290,7 +284,7 @@
{
invariants();
- return m_data[real_size_type(theIndex)];
+ return m_data[theIndex];
}
#if 0
@@ -301,7 +295,7 @@
{
invariants();
- return m_data.at(real_size_type(theIndex));
+ return m_data.at(theIndex);
}
reference
@@ -309,7 +303,7 @@
{
invariants();
- return m_data.at(real_size_type(theIndex));
+ return m_data.at(theIndex);
}
#endif
@@ -1107,10 +1101,8 @@
TranscodeFromLocalCodePage(const CharVectorType& theSourceString)
{
typedef XalanDOMString::size_type size_type;
- typedef XalanDOMString::real_size_type real_size_type;
const CharVectorType::size_type theSize = theSourceString.size();
- assert(real_size_type(size_type(theSize)) == theSize);
if (theSourceString[theSize - 1] == CharVectorType::value_type(0))
{
---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org