summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorthilo.boehm <thilo.boehm>2013-01-08 13:36:16 +0000
committerthilo.boehm <thilo.boehm>2013-01-08 13:36:16 +0000
commit6a5a35bfd6c371a69626a8408ab965982766085d (patch)
tree023920d70977d411ba235c8136980e07bdfb1c5c
parent4479400fda892503ad2da16bad0769c4d51144ce (diff)
downloadtog-pegasus-RELEASE_2_9-branch.zip
tog-pegasus-RELEASE_2_9-branch.tar.gz
tog-pegasus-RELEASE_2_9-branch.tar.xz
TITLE: V2.9.3 Compiler error in HTTPConnection.cpp DESCRIPTION: Apply patch of BZ8705
-rw-r--r--src/Pegasus/Common/Buffer.h12
-rw-r--r--src/Pegasus/Common/OrderedSet.h12
2 files changed, 18 insertions, 6 deletions
diff --git a/src/Pegasus/Common/Buffer.h b/src/Pegasus/Common/Buffer.h
index e6c1a72..1ffe614 100644
--- a/src/Pegasus/Common/Buffer.h
+++ b/src/Pegasus/Common/Buffer.h
@@ -72,6 +72,13 @@ public:
*/
const char* getData() const;
+ /**
+ Returns a pointer to the character buffer with the Buffer contents.
+ This function does NOT append a null character.
+ Resulting data should NOT be used with C string processing functions.
+ */
+ char* getContentPtr();
+
char get(Uint32 i) const;
void set(Uint32 i, char x);
@@ -149,6 +156,11 @@ inline const char* Buffer::getData() const
return _rep->data;
}
+inline char* Buffer::getContentPtr()
+{
+ return _rep->data;
+}
+
inline char Buffer::get(Uint32 i) const
{
return _rep->data[i];
diff --git a/src/Pegasus/Common/OrderedSet.h b/src/Pegasus/Common/OrderedSet.h
index 7511177..acfe33a 100644
--- a/src/Pegasus/Common/OrderedSet.h
+++ b/src/Pegasus/Common/OrderedSet.h
@@ -168,7 +168,7 @@ inline OrderedSet<T, R, N>::~OrderedSet()
// avoids creation of an empty buffer getting build
if (_size > 0)
{
- Node* data = (Node*) _array.getData();
+ Node* data = (Node*) _array.getContentPtr();
for (Uint32 i = 0; i < _size; i++)
{
@@ -188,7 +188,7 @@ inline void OrderedSet<T, R, N>::clear()
memset((*_table), 0, sizeof(Node*) * N);
if (_size > 0)
{
- Node* data = (Node*) _array.getData();
+ Node* data = (Node*) _array.getContentPtr();
for (Uint32 i = 0; i < _size; i++)
{
@@ -270,7 +270,7 @@ inline void OrderedSet<T, R, N>::append(const T& x)
// Now add to hash table
{
- Node* data = (Node*) _array.getData();
+ Node* data = (Node*) _array.getContentPtr();
(*_table)[code] = &data[_size];
}
@@ -292,7 +292,7 @@ inline void OrderedSet<T, R, N>::remove(Uint32 index)
// Remove node from array (dynamic, ordered list)
{
- Node* node = (Node*) _array.getData() + index;
+ Node* node = (Node*) _array.getContentPtr() + index;
node->rep->decreaseOwnerCount();
node->rep->Dec();
_array.remove(index * Uint32(sizeof(Node)), Uint32(sizeof(Node)));
@@ -351,7 +351,7 @@ inline T& OrderedSet<T, R, N>::operator[](Uint32 index)
if (index >= _size)
throw IndexOutOfBoundsException();
- const Node* node = (const Node*) _array.getData() + index;
+ const Node* node = (const Node*) _array.getContentPtr() + index;
return *const_cast<T*>(reinterpret_cast<const T*>(node));
}
@@ -368,7 +368,7 @@ void OrderedSet<T, R, N>::_reorganize()
current state of the dynamic, ordered list
*/
memset((*_table), 0, sizeof(Node*) * N);
- Node* data = (Node*) _array.getData();
+ Node* data = (Node*) _array.getContentPtr();
for (Uint32 i = 0; i < _size; i++)
{