[crisscross commit] r880 - in trunk: . source source/crisscross targets/vs2005 targets/xcode/CrissCross.xcodeproj

1 view
Skip to first unread message

codesite...@google.com

unread,
Nov 4, 2008, 12:07:49 PM11/4/08
to crisscr...@googlegroups.com
Author: steven.noonan
Date: Tue Nov 4 09:06:18 2008
New Revision: 880

Added:
trunk/targets/vs2005/
trunk/targets/vs2005/.gitignore
trunk/targets/vs2005/CrissCross.sln (contents, props changed)
trunk/targets/vs2005/CrissCross.vcproj (contents, props changed)
Modified:
trunk/COPYING
trunk/Doxyfile
trunk/INSTALL
trunk/TODO
trunk/source/crisscross/darray.cpp
trunk/source/crisscross/darray.h
trunk/source/crisscross/error.h
trunk/source/crisscross/node.h
trunk/source/crisscross/rbtree.cpp
trunk/source/crisscross/rbtree.h
trunk/source/crisscross/universal_include.h
trunk/source/error.cpp
trunk/targets/xcode/CrissCross.xcodeproj/project.pbxproj

Log:
Updating from git repo


Modified: trunk/COPYING
==============================================================================
--- trunk/COPYING (original)
+++ trunk/COPYING Tue Nov 4 09:06:18 2008
@@ -1,10 +1,32 @@
Copyright (c) 2006-2008 Steven Noonan <ste...@uplinklabs.net>.
All rights reserved.

-Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
+Redistribution and use in source and binary forms, with or
+without modification, are permitted provided that the following
+conditions are met:

- * Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- * 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.
- * Neither the name of Uplink Laboratories nor the names of its
contributors may be used to endorse or promote products derived from this
software without specific prior written permission.
+ * Redistributions of source code must retain the above
+ copyright notice, this list of conditions and the
+ following disclaimer.
+ * 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.
+ * Neither the name of Uplink Laboratories nor the names of
+ its contributors may be used to endorse or promote
+ products derived from this software without specific
+ prior written permission.

-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\ No newline at end of file
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Modified: trunk/Doxyfile
==============================================================================
--- trunk/Doxyfile (original)
+++ trunk/Doxyfile Tue Nov 4 09:06:18 2008
@@ -5,7 +5,7 @@

#---------------------------------------------------------------------------
DOXYFILE_ENCODING = UTF-8
PROJECT_NAME = CrissCross
-PROJECT_NUMBER = 0.7.2-rc3
+PROJECT_NUMBER = 0.7.2
OUTPUT_DIRECTORY =
CREATE_SUBDIRS = NO
OUTPUT_LANGUAGE = English

Modified: trunk/INSTALL
==============================================================================
--- trunk/INSTALL (original)
+++ trunk/INSTALL Tue Nov 4 09:06:18 2008
@@ -8,3 +8,39 @@
make install

and ignore the rest of this document.
+
+It's best to build CrissCross outside of the source tree,
+however. The best way to accomplish this is to do something
+like this (note that the commands assume you start inside the
+CrissCross source tree, and that the CrissCross source tree
+is in a folder called 'crisscross'):
+
+ mkdir ../cc-build
+ cd ../cc-build
+ cmake ../crisscross
+ make check
+ make install
+
+Thanks to CMake, building on Windows systems is not much
+harder than building on any other platform. First, install
+CMake from www.cmake.org. You can use Cygwin if you prefer,
+but CMake in Cygwin does not generate Visual Studio project
+files. Once the Windows version of CMake is installed, bring
+up a command prompt and 'cd' to the directory the CrissCross
+sources are in. Once there, type
+
+ cmake -G "Visual Studio 9 2008" .
+
+and you've got Visual Studio 2008 projects set up. If you
+have an older version of Visual Studio, no worries. You can
+replace the text in quotes with "Visual Studio 8 2005" or
+one of the other options CMake allows. You can find out what
+other options cmake permits by bringing up a command prompt
+and simply running 'cmake'.
+
+Major warning about Visual Studio compiles: we do NOT support
+compiling with Visual Studio 6. While we personally prefer the
+UI Visual Studio 6 provides, the compiler it has is essentially
+broken and refuses to compile some perfectly valid C++ code.
+It's possible to set up Visual Studio 6.0 to use a newer
+compiler, but that is beyond the scope of this document.

Modified: trunk/TODO
==============================================================================
--- trunk/TODO (original)
+++ trunk/TODO Tue Nov 4 09:06:18 2008
@@ -1,2 +0,0 @@
-* Rewrite CPUID class. It's massive, and it's messy. Refer to Linux kernel
to see how it can be done better.
-* Finish INSTALL documentation.

Modified: trunk/source/crisscross/darray.cpp
==============================================================================
--- trunk/source/crisscross/darray.cpp (original)
+++ trunk/source/crisscross/darray.cpp Tue Nov 4 09:06:18 2008
@@ -31,6 +31,64 @@
m_array = NULL;
m_emptyNodes = new DStack<size_t>;
m_emptyNodes->push((size_t)-1);
+ m_encapsulated = true;
+ }
+
+ template <class T>
+ DArray <T>::DArray(T *_array, size_t _indices, bool _encapsulate)
+ {
+ m_encapsulated = _encapsulate;
+ if ( _encapsulate )
+ {
+ m_array = new T[_indices];
+ memcpy(m_array, _array, _indices * sizeof(T));
+ } else {
+ m_array = _array;
+ }
+ m_shadow = new char[_indices];
+ memset(m_shadow, 0, _indices * sizeof(char));
+ m_numUsed = 0;
+ for (size_t i = 0; i < _indices; i++)
+ {
+ m_shadow[i] = m_array[i] != NULL ? 1 : 0;
+ if ( m_shadow[i] )
+ {
+ m_numUsed++;
+ }
+ }
+ m_numUsed = m_numUsed;
+ m_arraySize = _indices;
+ m_stepSize = -1;
+ m_emptyNodes = new DStack<size_t>;
+ rebuildStack();
+ }
+
+ template <class T>
+ DArray <T>::DArray(DArray const &_array, bool _encapsulate)
+ {
+ m_encapsulated = _encapsulate;
+ if ( _encapsulate )
+ {
+ m_array = new T[_array.m_arraySize];
+ memcpy(m_array, _array.m_array, _array.m_arraySize * sizeof(T));
+ } else {
+ m_array = _array.m_array;
+ }
+ m_shadow = new char[_array.m_arraySize];
+ memset(m_shadow, 0, _array.m_arraySize * sizeof(char));
+ m_numUsed = 0;
+ for (size_t i = 0; i < _array.m_arraySize; i++)
+ {
+ m_shadow[i] = m_array[i] != NULL ? 1 : 0;
+ if ( m_shadow[i] )
+ {
+ m_numUsed++;
+ }
+ }
+ m_arraySize = _array.m_arraySize;
+ m_stepSize = _array.m_stepSize;
+ m_emptyNodes = new DStack<size_t>;
+ rebuildStack();
}

template <class T>
@@ -46,6 +104,7 @@
m_array = NULL;
m_emptyNodes = new DStack<size_t> (_newStepSize + 1);
m_emptyNodes->push((size_t)-1);
+ m_encapsulated = true;
}

template <class T>
@@ -53,11 +112,27 @@
{
empty();
delete m_emptyNodes;
+ m_emptyNodes = NULL;
+ }
+
+ template <class T>
+ size_t DArray <T>::pop()
+ {
+ CoreAssert ( m_encapsulated );
+
+ size_t freeslot = getNextFree();
+
+ if (m_shadow[freeslot] == 0) m_numUsed++;
+
+ m_shadow[freeslot] = 1;
+ return freeslot;
}

template <class T>
void DArray <T>::rebuildStack()
{
+ if ( !m_encapsulated ) return;
+
/* Reset free list */

m_emptyNodes->empty();
@@ -73,6 +148,8 @@
template <class T>
void DArray <T>::recount()
{
+ if ( !m_encapsulated ) return;
+
m_numUsed = 0;
for (size_t i = 0; i < m_arraySize; i++)
if (m_shadow[i] == 1)
@@ -82,6 +159,8 @@
template <class T>
void DArray <T>::setSize(size_t newsize)
{
+ if ( !m_encapsulated ) return;
+
if (newsize > m_arraySize) {
size_t oldarraysize = m_arraySize;

@@ -133,6 +212,8 @@
template <class T>
void DArray <T>::grow()
{
+ CoreAssert ( m_encapsulated );
+
if (m_stepSize == -1) {
/* Double array size */
if (m_arraySize == 0) {
@@ -152,7 +233,6 @@
m_stepSize = _stepSize;
}

-
template <class T>
void DArray <T>::setStepDouble()
{
@@ -162,6 +242,8 @@
template <class T>
size_t DArray <T>::insert(T const & newdata)
{
+ CoreAssert ( m_encapsulated );
+
size_t freeslot = getNextFree();

m_array[freeslot] = newdata;
@@ -174,6 +256,8 @@
template <class T>
void DArray <T>::insert(T const & newdata, size_t index)
{
+ CoreAssert ( m_encapsulated );
+
while (index >= m_arraySize) grow();

m_array[index] = newdata;
@@ -185,10 +269,12 @@
template <class T>
void DArray <T>::empty()
{
- delete [] m_array;
- delete [] m_shadow;
-
+ if ( m_encapsulated ) {
+ delete [] m_array;
+ m_array = NULL;
+ }
m_array = NULL;
+ delete [] m_shadow;
m_shadow = NULL;

m_emptyNodes->empty();
@@ -196,11 +282,14 @@

m_arraySize = 0;
m_numUsed = 0;
+ m_encapsulated = true;
}

template <class T>
size_t DArray <T>::getNextFree()
{
+ if ( !m_encapsulated ) return -1;
+
/* WARNING: This function assumes the node returned */
/* will be used by the calling function. */

@@ -240,6 +329,9 @@
template <class T>
T & DArray <T>::operator [](size_t index)
{
+ /* Ugh. Messy. Don't run into this. >.< */
+ CoreAssert ( m_encapsulated );
+
CoreAssert(m_shadow[index]);
CoreAssert(index < m_arraySize);

@@ -249,6 +341,9 @@
template <class T>
const T &DArray <T>::operator [](size_t index) const
{
+ /* Ugh. Messy. Don't run into this. >.< */
+ CoreAssert ( m_encapsulated );
+
CoreAssert(m_shadow[index]);
CoreAssert(index < m_arraySize);

@@ -267,6 +362,7 @@
template <class T>
void DArray <T>::remove(size_t index)
{
+ if ( !m_encapsulated ) return;
CoreAssert(m_shadow[index] != 0);
CoreAssert(index < m_arraySize);

@@ -292,6 +388,8 @@
template <class T>
int DArray <T>::sort(Sorter<T> *_sortMethod)
{
+ if ( !m_encapsulated ) return -1;
+
int ret;

T *temp_array = new T[m_numUsed];
@@ -326,6 +424,8 @@
template <class T>
int DArray <T>::sort(Sorter<T> &_sortMethod)
{
+ if ( !m_encapsulated ) return -1;
+
return sort(&_sortMethod);
}
#endif
@@ -333,9 +433,12 @@
template <class T>
void DArray<T>::flush()
{
- for (size_t i = 0; i < m_arraySize; ++i) {
- if (valid(i)) {
- delete m_array[i];
+ if ( m_encapsulated )
+ {
+ for (size_t i = 0; i < m_arraySize; ++i) {
+ if (valid(i)) {
+ delete m_array[i];
+ }
}
}
empty();
@@ -344,9 +447,12 @@
template <class T>
void DArray<T>::flushArray()
{
- for (size_t i = 0; i < m_arraySize; ++i) {
- if (valid(i)) {
- delete [] m_array[i];
+ if ( m_encapsulated )
+ {
+ for (size_t i = 0; i < m_arraySize; ++i) {
+ if (valid(i)) {
+ delete [] m_array[i];
+ }
}
}
empty();
@@ -359,9 +465,12 @@
template <class T>
void DArray<T>::EmptyAndDelete()
{
- for (size_t i = 0; i < m_arraySize; ++i) {
- if (valid(i)) {
- delete m_array[i];
+ if ( m_encapsulated )
+ {
+ for (size_t i = 0; i < m_arraySize; ++i) {
+ if (valid(i)) {
+ delete m_array[i];
+ }
}
}

@@ -371,18 +480,21 @@
template <class T>
void DArray<T>::EmptyAndDeleteArray()
{
- for (size_t i = 0; i < m_arraySize; ++i) {
- if (valid(i)) {
- delete [] m_array[i];
+ if ( m_encapsulated )
+ {
+ for (size_t i = 0; i < m_arraySize; ++i) {
+ if (valid(i)) {
+ delete [] m_array[i];
+ }
}
}
-
empty();
}

template <class T>
void DArray<T>::ChangeData(T const & _rec, size_t index)
{
+ if ( !m_encapsulated ) return;
CoreAssert(m_shadow[index] == 1);
m_array[index] = _rec;
}

Modified: trunk/source/crisscross/darray.h
==============================================================================
--- trunk/source/crisscross/darray.h (original)
+++ trunk/source/crisscross/darray.h Tue Nov 4 09:06:18 2008
@@ -21,6 +21,8 @@
{
namespace Data
{
+ template <class Key, class Data> class RedBlackTree;
+
/*! \brief A dynamic array implementation. */
template <class T> class DArray
{
@@ -32,6 +34,8 @@
DStack<size_t> *m_emptyNodes;

protected:
+ bool m_encapsulated;
+
/*! \brief The size by which to increase the size of the array when
there are no more empty nodes. */
/*!
* If set to -1, it will double the size of the array each time the
array grows.
@@ -78,6 +82,12 @@
/*! \brief The default constructor. */
DArray();

+ /*! \brief Initialize the DArray with an existing array. */
+ DArray(T *_array, size_t _indices, bool _encapsulate = true);
+
+ /*! \brief Initialize the DArray with an existing array. */
+ DArray(DArray const &_array, bool _encapsulate = true);
+
/*! \brief The secondary constructor. */
/*!
* Parameter _newStepSize should be larger than 1. A step size of 1
forces
@@ -138,6 +148,13 @@
*/
size_t insert(T const & _newdata);

+ /*! \brief Marks and index used and passes the index back. */
+ /*!
+ * \param _newdata The data to put into the array.
+ * \return The index of the node where the data was stored.
+ */
+ size_t pop();
+
/*! \brief Inserts data into the array at the given index. */
/*!
* \param _newdata The data to put into the array.
@@ -298,5 +315,6 @@
}

#include <crisscross/darray.cpp>
+#include <crisscross/rbtree.h>

#endif

Modified: trunk/source/crisscross/error.h
==============================================================================
--- trunk/source/crisscross/error.h (original)
+++ trunk/source/crisscross/error.h Tue Nov 4 09:06:18 2008
@@ -22,6 +22,7 @@
*/
enum Errors
{
+ CC_ERR_TIMED_OUT = -12, /*!< \brief The connection
attempt timed out. */
CC_ERR_NO_SOCK = -11, /*!< \brief No connection was
accepted. */
CC_ERR_WOULD_BLOCK = -10, /*!< \brief Non-blocking I/O
is enabled and the requested operation would block. */
CC_ERR_NOT_SOCKET = -9, /*!< \brief An operation was
attempted on an invalid socket. */

Modified: trunk/source/crisscross/node.h
==============================================================================
--- trunk/source/crisscross/node.h (original)
+++ trunk/source/crisscross/node.h Tue Nov 4 09:06:18 2008
@@ -162,10 +162,10 @@
RedBlackNode *parent;

/*! \brief The key for this node. */
- Key id;
+ size_t id_ind;

/*! \brief The data held at this node. */
- Data data;
+ size_t data_ind;

/*! \brief The color of the node (either red or black). */
unsigned char color : 1;
@@ -178,25 +178,6 @@
/*! \brief The destructor. */
~RedBlackNode()
{
- Dealloc(id);
- delete left; left = NULL;
- delete right; right = NULL;
- }
-
-
- /*! \brief Returns the overhead caused by the node. */
- /*!
- * \param _parentTree The tree which contains this node instance.
- * \return Memory usage in bytes.
- */
- size_t mem_usage(CrissCross::Data::RedBlackTree<Key, Data> const
*_parentTree) const
- {
- size_t ret = sizeof(*this);
- if (left && left != _parentTree->nullNode) ret +=
left->mem_usage(_parentTree);
-
- if (right && right != _parentTree->nullNode) ret +=
right->mem_usage(_parentTree);
-
- return ret;
}
};
}

Modified: trunk/source/crisscross/rbtree.cpp
==============================================================================
--- trunk/source/crisscross/rbtree.cpp (original)
+++ trunk/source/crisscross/rbtree.cpp Tue Nov 4 09:06:18 2008
@@ -29,7 +29,8 @@
nullNode = new RedBlackNode<Key, Data>();
nullNode->left = nullNode->right = nullNode->parent = nullNode;
nullNode->color = BLACK;
- nullNode->id = NullKey<Key>();
+ nullNode->data_ind = nullNode->id_ind = keyPool.insert(NullKey<Key>());
+ dataPool.insert(NullKey<Data>(), nullNode->id_ind);
rootNode = nullNode;
m_cachedSize = 0;
}
@@ -49,14 +50,14 @@

/* establish x->right link */
x->right = y->left;
- if (y->left != nullNode)
+ if (valid(y->left))
y->left->parent = x;

/* establish y->parent link */
- if (y != nullNode)
+ if (valid(y))
y->parent = x->parent;

- if (x->parent) {
+ if (valid(x->parent)) {
if (x == x->parent->left)
x->parent->left = y;
else
@@ -67,7 +68,7 @@

/* link x and y */
y->left = x;
- if (x != nullNode)
+ if (valid(x))
x->parent = y;
}

@@ -78,14 +79,14 @@

/* establish x->left link */
x->left = y->right;
- if (y->right != nullNode)
+ if (valid(y->right))
y->right->parent = x;

/* establish y->parent link */
- if (y != nullNode)
+ if (valid(y))
y->parent = x->parent;

- if (x->parent) {
+ if (valid(x->parent)) {
if (x == x->parent->right)
x->parent->right = y;
else
@@ -96,7 +97,7 @@

/* link x and y */
y->right = x;
- if (x != nullNode)
+ if (valid(x))
x->parent = y;
}

@@ -109,7 +110,7 @@
if (x->parent == x->parent->parent->left) {
RedBlackNode<Key, Data> *y = x->parent->parent->right;

- if (y && y->color == RED) {
+ if (valid(y) && y->color == RED) {
/* uncle is RED */
x->parent->color = BLACK;
y->color = BLACK;
@@ -132,7 +133,7 @@
/* mirror image of above code */
RedBlackNode<Key, Data> *y = x->parent->parent->left;

- if (y && y->color == RED) {
+ if (valid(y) && y->color == RED) {
/* uncle is RED */
x->parent->color = BLACK;
y->color = BLACK;
@@ -160,21 +161,20 @@
RedBlackNode<Key, Data> *current;
current = findNode(key);
if (!valid(current)) return false;
-
- current->data = rec;
+ dataPool.insert(rec, current->data_ind);
return true;
}

template <class Key, class Data>
bool RedBlackTree<Key, Data>::insert(Key const &key, Data const & rec)
{
- RedBlackNode<Key, Data> *current = nullNode, *parent = NULL, *x =
nullNode;
+ RedBlackNode<Key, Data> *current, *parent = nullNode, *x = nullNode;

/* find future parent */
current = rootNode;
- while (current != nullNode) {
+ while (valid(current)) {
parent = current;
- current = (Compare(key, current->id) <= 0) ?
+ current = (Compare(key, keyPool[current->id_ind]) <= 0) ?
current->left : current->right;
}

@@ -187,12 +187,12 @@
x->left = nullNode;
x->right = nullNode;
x->color = RED;
- x->id = Duplicate(key);
- x->data = rec;
+ x->data_ind = x->id_ind = keyPool.insert(Duplicate(key));
+ dataPool.insert(rec, x->id_ind);

/* insert node in tree */
- if (parent != NULL) {
- if (Compare(key, parent->id) <= 0)
+ if (valid(parent)) {
+ if (Compare(key, keyPool[parent->id_ind]) <= 0)
parent->left = x;
else
parent->right = x;
@@ -210,7 +210,7 @@
template <class Key, class Data>
void RedBlackTree<Key, Data>::deleteFixup(RedBlackNode<Key, Data> * x)
{
- if (!x) return;
+ if (!valid(x)) return;

while (x != rootNode && x->color == BLACK) {
if (x == x->parent->left) {
@@ -275,20 +275,18 @@
template <class Key, class Data>
bool RedBlackTree<Key, Data>::erase(Key const &key)
{
- RedBlackNode<Key, Data> *z, *parent;
+ RedBlackNode<Key, Data> *z;

/* delete node z from tree */

/* find node in tree */
z = rootNode;
- parent = 0;

- while (z != nullNode) {
- if (Compare(key, z->id) == 0)
+ while (valid(z)) {
+ if (Compare(key, keyPool[z->id_ind]) == 0)
break;
else{
- parent = z;
- z = (Compare(key, z->id) <= 0) ? z->left : z->right;
+ z = (Compare(key, keyPool[z->id_ind]) <= 0) ? z->left : z->right;
}
}

@@ -313,8 +311,8 @@

bool killed = false;

- if (Compare(curnode->id, key) == 0) {
- if (Compare(curnode->data, rec) == 0) {
+ if (Compare(keyPool[curnode->id_ind], key) == 0) {
+ if (Compare(dataPool[curnode->data_ind], rec) == 0) {
killNode(curnode);
killed = true;
}
@@ -334,27 +332,27 @@
{
RedBlackNode<Key, Data> *x, *y;

- if (z->left == nullNode || z->right == nullNode) {
+ if (!valid(z->left) || !valid(z->right)) {
/* y has a null node as a child */
y = z;
} else {
/* find tree successor with a null node as a child */
y = z->right;

- while (y->left != nullNode)
+ while (valid(y->left))
y = y->left;
}

/* x is y's only child */
- if (y->left != nullNode)
+ if (valid(y->left))
x = y->left;
else
x = y->right;

/* remove y from the parent chain */
- if (x) x->parent = y->parent;
+ if (valid(x)) x->parent = y->parent;

- if (y->parent) {
+ if (valid(y->parent)) {
if (y == y->parent->left)
y->parent->left = x;
else
@@ -363,11 +361,11 @@
rootNode = x;

if (y != z) {
- Dealloc(z->id);
- z->id = Duplicate(y->id);
- z->data = y->data;
+ Dealloc(keyPool[z->id_ind]);
+ keyPool[z->id_ind] = Duplicate(keyPool[y->id_ind]);
+ dataPool[z->data_ind] = dataPool[y->data_ind];
} else {
- Dealloc(y->id);
+ Dealloc(keyPool[y->id_ind]);
}

if (y->color == BLACK)
@@ -375,6 +373,8 @@

m_cachedSize--;

+ keyPool.remove(y->id_ind);
+ dataPool.remove(y->data_ind);
y->left = NULL;
y->right = NULL;
delete y;
@@ -387,11 +387,11 @@
{
RedBlackNode<Key, Data> *current = rootNode;

- while (current != nullNode) {
- if (Compare(key, current->id) == 0) {
- return current->data;
+ while (valid(current)) {
+ if (Compare(key, keyPool[current->id_ind]) == 0) {
+ return dataPool[current->data_ind];
} else {
- current = (Compare(key, current->id) <= 0) ?
+ current = (Compare(key, keyPool[current->id_ind]) <= 0) ?
current->left : current->right;
}
}
@@ -404,12 +404,12 @@
{
RedBlackNode<Key, Data> *current = rootNode;

- while (current != nullNode) {
- if (Compare(key, current->id) == 0) {
- _data = current->data;
+ while (valid(current)) {
+ if (Compare(key, keyPool[current->id_ind]) == 0) {
+ _data = dataPool[current->data_ind];
return true;
} else {
- current = (Compare(key, current->id) <= 0) ?
+ current = (Compare(key, keyPool[current->id_ind]) <= 0) ?
current->left : current->right;
}
}
@@ -422,11 +422,12 @@
{
RedBlackNode<Key, Data> * current = rootNode;

- while (current != nullNode) {
- if (Compare(key, current->id) == 0) {
+ while (valid(current)) {
+ if (Compare(key, keyPool[current->id_ind]) == 0) {
return current;
} else {
- current = (Compare(key, current->id) <= 0) ? current->left :
current->right;
+ current = (Compare(key, keyPool[current->id_ind]) <= 0) ?
+ current->left : current->right;
}
}

@@ -437,32 +438,34 @@
bool RedBlackTree<Key, Data>::exists(Key const &_key) const
{
RedBlackNode<Key, Data> *p_current = findNode(_key);
- if (!p_current) return false;
+ if (!valid(p_current)) return false;
else return true;
}

template <class Key, class Data>
void RedBlackTree<Key, Data>::killAll(RedBlackNode<Key, Data> *rec)
{
- if (rec == nullNode) {
+ if (!valid(rec)) {
return;
}

/* First kill our subnodes: */
- if (rec->left != nullNode)
+ if (valid(rec->left))
killAll(rec->left);

- if (rec->right != nullNode)
+ if (valid(rec->right))
killAll(rec->right);

- if (rec->parent != NULL) { /* We're not root. */
+ if (valid(rec->parent)) { /* We're not root. */
if (rec->parent->left == rec)
rec->parent->left = nullNode;
else
rec->parent->right = nullNode;
}

- Dealloc(rec->id);
+ Dealloc(keyPool[rec->id_ind]);
+ keyPool.remove(rec->id_ind);
+ dataPool.remove(rec->data_ind);
rec->left = NULL;
rec->right = NULL;
delete rec;
@@ -489,11 +492,11 @@
void RedBlackTree<Key, Data>::findRecursive(DArray<Data> *_array, Key
const &_key, RedBlackNode<Key, Data> *_node) const
{
CoreAssert(_array);
- if (!_node || _node == nullNode) return;
+ if (!valid(_node)) return;

findRecursive(_array, _key, _node->left);
- if (Compare(_node->id, _key) == 0) {
- _array->insert(_node->data);
+ if (Compare(keyPool[_node->id_ind], _key) == 0) {
+ _array->insert(dataPool[_node->data_ind]);
}

findRecursive(_array, _key, _node->right);
@@ -503,46 +506,24 @@
size_t RedBlackTree<Key, Data>::mem_usage() const
{
size_t ret = sizeof(*this);
- if (!rootNode || rootNode == nullNode) return ret;
+ if (!valid(rootNode)) return ret;

ret += rootNode->mem_usage(this);
return ret;
}

template <class Key, class Data>
- DArray<Data> *RedBlackTree<Key, Data>::ConvertToDArray() const
+ DArray<Data> *RedBlackTree<Key, Data>::ConvertToDArray(bool
_encapsulate) const
{
- DArray<Data> *darray = new DArray<Data> ((int)size());
- RecursiveConvertToDArray(darray, rootNode);
+ DArray<Data> *darray = new DArray<Data>(dataPool, _encapsulate);
return darray;
}

template <class Key, class Data>
- DArray<Key> *RedBlackTree<Key, Data>::ConvertIndexToDArray() const
+ DArray<Key> *RedBlackTree<Key, Data>::ConvertIndexToDArray(bool
_encapsulate) const
{
- DArray<Key> *darray = new DArray<Key> ((int)size());
- RecursiveConvertIndexToDArray(darray, rootNode);
+ DArray<Key> *darray = new DArray<Key>(keyPool, _encapsulate);
return darray;
- }
-
- template <class Key, class Data>
- void RedBlackTree<Key, Data>::RecursiveConvertToDArray(DArray<Data>
*darray, RedBlackNode<Key, Data> *btree) const
- {
- if (!btree || btree == nullNode) return;
-
- RecursiveConvertToDArray(darray, btree->left);
- darray->insert(btree->data);
- RecursiveConvertToDArray(darray, btree->right);
- }
-
- template <class Key, class Data>
- void RedBlackTree<Key, Data>::RecursiveConvertIndexToDArray(DArray<Key>
*darray, RedBlackNode<Key, Data> *btree) const
- {
- if (!btree || btree == nullNode) return;
-
- RecursiveConvertIndexToDArray(darray, btree->left);
- darray->insert(btree->id);
- RecursiveConvertIndexToDArray(darray, btree->right);
}
}
}

Modified: trunk/source/crisscross/rbtree.h
==============================================================================
--- trunk/source/crisscross/rbtree.h (original)
+++ trunk/source/crisscross/rbtree.h Tue Nov 4 09:06:18 2008
@@ -48,6 +48,8 @@
RedBlackTree<Key, Data> &operator =(const RedBlackTree<Key, Data> &);

protected:
+ DArray<Key> keyPool;
+ DArray<Data> dataPool;

/*! \brief The root node at the top of the tree. */
RedBlackNode<Key, Data> *rootNode;
@@ -58,9 +60,6 @@
/*! \brief The cached size() return value. Changes on each tree
modification (insertions and deletions). */
size_t m_cachedSize;

- void RecursiveConvertIndexToDArray(DArray <Key> *_darray,
RedBlackNode<Key, Data> *_btree) const;
- void RecursiveConvertToDArray(DArray <Data> *_darray,
RedBlackNode<Key, Data> *_btree) const;
-
void rotateLeft(RedBlackNode<Key, Data> * _x);
void rotateRight(RedBlackNode<Key, Data> * _x);
void insertFixup(RedBlackNode<Key, Data> * _x);
@@ -84,7 +83,7 @@
*/
inline bool valid(const RedBlackNode<Key, Data> *_node) const
{
- return (_node != NULL);
+ return (_node != NULL && _node != nullNode);
};

public:
@@ -190,14 +189,14 @@
* \return A DArray containing the data of the tree.
* \warning Delete the returned DArray when done with it.
*/
- DArray <Data> *ConvertToDArray() const;
+ DArray <Data> *ConvertToDArray(bool _copy = false) const;

/*! \brief Converts the tree keys into a linearized DArray. */
/*!
* \return A DArray containing the keys in the tree.
* \warning Delete the returned DArray when done with it.
*/
- DArray <Key> *ConvertIndexToDArray() const;
+ DArray <Key> *ConvertIndexToDArray(bool _copy = false) const;

/*! \brief Returns the overhead caused by the data structure. */
/*!

Modified: trunk/source/crisscross/universal_include.h
==============================================================================
--- trunk/source/crisscross/universal_include.h (original)
+++ trunk/source/crisscross/universal_include.h Tue Nov 4 09:06:18 2008
@@ -39,11 +39,11 @@
/* # define CC_LIB_CODENAME "Thor" // v0.9.0 codename
*/
/* # define CC_LIB_CODENAME "Valhalla" // v1.0.0 codename
*/

-#define CC_LIB_VERSION "0.7.2-rc3"
+#define CC_LIB_VERSION "0.7.2"
#define CC_LIB_BRANCH_AT_VERSION "0.8.0"
#define CC_LIB_VERSION_MAJOR 0
#define CC_LIB_VERSION_MINOR 7
-#define CC_LIB_VERSION_REVISION 1
+#define CC_LIB_VERSION_REVISION 2
const int CC_LIB_VERSION_BUILD = BUILD_NUMBER;
#undef BUILD_NUMBER
#undef __included_build_number_h

Modified: trunk/source/error.cpp
==============================================================================
--- trunk/source/error.cpp (original)
+++ trunk/source/error.cpp Tue Nov 4 09:06:18 2008
@@ -37,6 +37,7 @@
{WSAEINPROGRESS, "WSAEINPROGRESS", CC_ERR_WOULD_BLOCK},
/* {WSAEALREADY, "WSAEALREADY", CC_ERR_EALREADY}, */
{WSAENOTSOCK, "WSAENOTSOCK", CC_ERR_NOT_SOCKET},
+ {WSAETIMEDOUT, "WSAETIMEDOUT", CC_ERR_TIMED_OUT},
/*{WSAEDESTADDRREQ, "WSAEDESTADDRREQ", CC_ERR_EDESTADDRREQ},
* {WSAEMSGSIZE, "WSAEMSGSIZE", CC_ERR_EMSGSIZE},
* {WSAEPROTOTYPE, "WSAEPROTOTYPE", CC_ERR_EPROTOTYPE},
@@ -58,7 +59,6 @@
* {WSAENOTCONN, "WSAENOTCONN", CC_ERR_ENOTCONN},
* {WSAESHUTDOWN, "WSAESHUTDOWN", CC_ERR_ESHUTDOWN},
* {WSAETOOMANYREFS, "WSAETOOMANYREFS", CC_ERR_ETOOMANYREFS},
- * {WSAETIMEDOUT, "WSAETIMEDOUT", CC_ERR_ETIMEDOUT},
* {WSAECONNREFUSED, "WSAECONNREFUSED", CC_ERR_ECONNREFUSED},
* {WSAELOOP, "WSAELOOP", CC_ERR_ELOOP},
* {WSAENAMETOOLONG, "WSAENAMETOOLONG", CC_ERR_ENAMETOOLONG},
@@ -87,6 +87,7 @@
#endif
{EWOULDBLOCK, "EWOULDBLOCK", CC_ERR_WOULD_BLOCK},
{EINPROGRESS, "EINPROGRESS", CC_ERR_WOULD_BLOCK},
+ {ETIMEDOUT, "ETIMEDOUT", CC_ERR_TIMED_OUT},
/*
* {EADDRINUSE, "EADDRINUSE", CC_ERR_ADDR_IN_USE},
* {EADDRNOTAVAIL, "EADDRNOTAVAIL", CC_ERR_EADDRNOTAVAIL},
@@ -100,7 +101,6 @@
* {ENOTCONN, "ENOTCONN", CC_ERR_ENOTCONN},
* {ESHUTDOWN, "ESHUTDOWN", CC_ERR_ESHUTDOWN},
* {ETOOMANYREFS, "ETOOMANYREFS", CC_ERR_ETOOMANYREFS},
- * {ETIMEDOUT, "ETIMEDOUT", CC_ERR_ETIMEDOUT},
* {ECONNREFUSED, "ECONNREFUSED", CC_ERR_ECONNREFUSED},
* {ELOOP, "ELOOP", CC_ERR_ELOOP},
* {ENAMETOOLONG, "ENAMETOOLONG", CC_ERR_ENAMETOOLONG},

Added: trunk/targets/vs2005/.gitignore
==============================================================================
--- (empty file)
+++ trunk/targets/vs2005/.gitignore Tue Nov 4 09:06:18 2008
@@ -0,0 +1,5 @@
+*.ncb
+*.suo
+*.vcproj.*.user
+Debug
+Release

Added: trunk/targets/vs2005/CrissCross.sln
==============================================================================
--- (empty file)
+++ trunk/targets/vs2005/CrissCross.sln Tue Nov 4 09:06:18 2008
@@ -0,0 +1,20 @@
+
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual Studio 2005
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}")
= "CrissCross", "CrissCross.vcproj", "{D41B6899-77A7-4CB8-B739-BE29475EF864}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Win32 = Debug|Win32
+ Release|Win32 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {D41B6899-77A7-4CB8-B739-BE29475EF864}.Debug|Win32.ActiveCfg = Debug|
Win32
+ {D41B6899-77A7-4CB8-B739-BE29475EF864}.Debug|Win32.Build.0 = Debug|Win32
+ {D41B6899-77A7-4CB8-B739-BE29475EF864}.Release|Win32.ActiveCfg = Release|
Win32
+ {D41B6899-77A7-4CB8-B739-BE29475EF864}.Release|Win32.Build.0 = Release|
Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal

Added: trunk/targets/vs2005/CrissCross.vcproj
==============================================================================
--- (empty file)
+++ trunk/targets/vs2005/CrissCross.vcproj Tue Nov 4 09:06:18 2008
@@ -0,0 +1,626 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="CrissCross"
+ ProjectGUID="{D41B6899-77A7-4CB8-B739-BE29475EF864}"
+ RootNamespace="CrissCross"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="4"
+ CharacterSet="1"
+ WholeProgramOptimization="0"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ Description="Generating build_number.h..."
+
CommandLine="&quot;$(ProjectDir)\..\..\tools\GenerateBuildNumber.exe&quot;
&quot;$(ProjectDir)\..\..\source\crisscross&quot;
&quot;$(ProjectDir)\..\..\source\crisscross&quot;"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="&quot;$(ProjectDir)\..\..\source&quot;"
+ PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="1"
+ UsePrecompiledHeader="2"
+ PrecompiledHeaderThrough="crisscross/universal_include.h"
+ WarningLevel="3"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="4"
+ CharacterSet="1"
+ WholeProgramOptimization="0"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ Description="Generating build_number.h..."
+
CommandLine="&quot;$(ProjectDir)\..\..\tools\GenerateBuildNumber.exe&quot;
&quot;$(ProjectDir)\..\..\source\crisscross&quot;
&quot;$(ProjectDir)\..\..\source\crisscross&quot;"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ EnableIntrinsicFunctions="true"
+ AdditionalIncludeDirectories="&quot;$(ProjectDir)\..\..\source&quot;"
+ PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
+ RuntimeLibrary="0"
+ EnableFunctionLevelLinking="true"
+ UsePrecompiledHeader="2"
+ PrecompiledHeaderThrough="crisscross/universal_include.h"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source"
+ >
+ <File
+ RelativePath="..\..\source\console.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\source\core_io_reader.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\source\core_io_writer.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\source\core_network.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\source\core_socket.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\source\cpuid.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\source\debug.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\source\error.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\source\filereader.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\source\filewriter.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\source\md2.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\source\md4.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\source\md5.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\source\mutex.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\source\sha1.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\source\sha256.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\source\sha512.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\source\stopwatch.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\source\system.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\source\tcpsocket.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\source\tiger.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\source\udpsocket.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\source\universal_include.cpp"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\source\version.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\source\windows_version.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Headers"
+ >
+ <File
+ RelativePath="..\..\source\crisscross\avltree.cpp"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\source\crisscross\avltree.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\source\crisscross\bubblesort.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\source\crisscross\build_number.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\source\crisscross\combsort.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\source\crisscross\compare.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\source\crisscross\console.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\source\crisscross\core_io.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\source\crisscross\core_io_reader.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\source\crisscross\core_io_writer.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\source\crisscross\core_network.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\source\crisscross\core_socket.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\source\crisscross\cpuid.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\source\crisscross\crisscross.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\source\crisscross\darray.cpp"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\source\crisscross\darray.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\source\crisscross\datatypes.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\source\crisscross\debug.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\source\crisscross\deprecate.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\source\crisscross\dstack.cpp"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\source\crisscross\dstack.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\source\crisscross\error.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\source\crisscross\exception_handler.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\source\crisscross\filereader.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\source\crisscross\filewriter.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\source\crisscross\hash.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\source\crisscross\hashtable.cpp"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\source\crisscross\hashtable.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\source\crisscross\heapsort.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\source\crisscross\insertionsort.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\source\crisscross\internal_mem.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\source\crisscross\llist.cpp"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\source\crisscross\llist.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\source\crisscross\md2.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\source\crisscross\md4.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\source\crisscross\md5.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\source\crisscross\mini_version.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\source\crisscross\mutex.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\source\crisscross\node.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\source\crisscross\platform_detect.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\source\crisscross\quicksort.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\source\crisscross\rbtree.cpp"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\source\crisscross\rbtree.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\source\crisscross\sha1.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\source\crisscross\sha256.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\source\crisscross\sha512.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\source\crisscross\shellsort.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\source\crisscross\sort.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\source\crisscross\splaytree.cpp"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\source\crisscross\splaytree.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\source\crisscross\stopwatch.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\source\crisscross\system.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\source\crisscross\tcpsocket.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\source\crisscross\tiger.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\source\crisscross\udpsocket.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\source\crisscross\universal_include.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\source\crisscross\version.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\source\crisscross\windows_version.h"
+ >
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Modified: trunk/targets/xcode/CrissCross.xcodeproj/project.pbxproj
==============================================================================
--- trunk/targets/xcode/CrissCross.xcodeproj/project.pbxproj (original)
+++ trunk/targets/xcode/CrissCross.xcodeproj/project.pbxproj Tue Nov 4
09:06:18 2008
@@ -431,7 +431,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "#!/bin/bash\n\necho \"Generating
build_number.h...\";\n\necho \"Changing directory
to '$PROJECT_DIR/../../source/crisscross/'...\";\ncd
\"$PROJECT_DIR/../../source/crisscross/\"\n\nBUILD=`svn info | grep
\"Revision\" | sed 's/Revision: //g'`\n\nif [ \"${BUILD}x\" == \"x\" ];
then\n\techo \"Build number couldn't be detected, defaulting to
0!\"\n\tBUILD=0\nelse\n\techo \"Build number ${BUILD} detected, creating
header...\"\nfi\n\necho \"#ifndef __included_build_number_h\" >
build_number.h.tmp\necho \"#define __included_build_number_h\" >>
build_number.h.tmp\necho \"\" >> build_number.h.tmp\necho \"#define
BUILD_NUMBER ${BUILD}\" >> build_number.h.tmp\necho \"\" >>
build_number.h.tmp\necho \"#endif\" >> build_number.h.tmp\necho \"\" >>
build_number.h.tmp\n\ntouch build_number.h\n\nTEMPHEADERMD5=`md5 -q
build_number.h.tmp`\nHEADERMD5=`md5 -q build_number.h`\n\nif [
\"${TEMPHEADERMD5}\" != \"${HEADERMD5}\" ]; then\n\techo \"Header
updated.\"\n\tmv build_number.h.tmp build_number.h\nelse\n\techo \"Header
is already up to date. Skipping update...\"\n\trm
build_number.h.tmp\nfi\n\nexit 0";
+ shellScript = "#!/bin/bash\n\necho \"Generating
build_number.h...\";\n\necho \"Changing directory
to '$PROJECT_DIR/../../source/crisscross/'...\";\ncd
\"$PROJECT_DIR/../../source/crisscross/\"\n\nif [ -d .svn ];
then\n\tBUILD=`svn --xml info | tr -d '\\r' | tr -d '\\n' | sed
-e 's/.*<entry.*revision=\"\\([0-9]*\\)\".*<url>.*/\\1/'`\nelse\n\tBUILD=`/opt/local/bin/git
rev-list --all | wc -l | tr -d ' '`\nfi\n\nif [[ \"${#BUILD}\" -lt \"1\"
]]; then\n\techo \"Build number couldn't be detected, defaulting to
1!\"\n\tBUILD=1\nelse\n\techo \"Build number ${BUILD} detected, creating
header...\"\nfi\n\necho \"#ifndef __included_build_number_h\" >
build_number.h.tmp\necho \"#define __included_build_number_h\" >>
build_number.h.tmp\necho \"\" >> build_number.h.tmp\necho \"#define
BUILD_NUMBER ${BUILD}\" >> build_number.h.tmp\necho \"\" >>
build_number.h.tmp\necho \"#endif\" >> build_number.h.tmp\necho \"\" >>
build_number.h.tmp\n\ntouch build_number.h\n\nTEMPHEADERMD5=`md5 -q
build_number.h.tmp`\nHEADERMD5=`md5 -q build_number.h`\n\nif [
\"${TEMPHEADERMD5}\" != \"${HEADERMD5}\" ]; then\n\techo \"Header
updated.\"\n\tmv build_number.h.tmp build_number.h\nelse\n\techo \"Header
is already up to date. Skipping update...\"\n\trm
build_number.h.tmp\nfi\n\nexit 0";
};
/* End PBXShellScriptBuildPhase section */

@@ -492,6 +492,8 @@
4FADC24708B4156D00ABE55E /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
+ ARCHS = "$(ARCHS_STANDARD_32_BIT_PRE_XCODE_3_1)";
+ ARCHS_STANDARD_32_BIT_PRE_XCODE_3_1 = "ppc i386";
GCC_ENABLE_CPP_RTTI = NO;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "$(PROJECT_DIR)/CrissCross_Prefix.pch";
@@ -514,12 +516,8 @@
4FADC24808B4156D00ABE55E /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = (
- i386,
- x86_64,
- ppc,
- ppc64,
- );
+ ARCHS = "$(ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1)";
+ ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1 = "ppc i386 ppc64 x86_64";
GCC_ENABLE_CPP_RTTI = NO;
GCC_OPTIMIZATION_LEVEL = 3;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
Reply all
Reply to author
Forward
0 new messages