[crisscross commit] r878 - in trunk: . TestSuite TestSuite/TestSuite.xcodeproj doc examples examples/CPSAT examples/C...

4 views
Skip to first unread message

codesite...@google.com

unread,
Oct 17, 2008, 11:21:36 PM10/17/08
to crisscr...@googlegroups.com
Author: steven.noonan
Date: Fri Oct 17 20:19:35 2008
New Revision: 878

Added:
trunk/.gitignore
trunk/TestSuite/.gitignore
trunk/TestSuite/TestSuite.xcodeproj/.gitignore
trunk/doc/.gitignore
trunk/examples/.gitignore
trunk/examples/CPSAT/.gitignore
trunk/examples/CPUID/.gitignore
trunk/examples/CheckMark/.gitignore
trunk/examples/EmptyProject/.gitignore
trunk/examples/GenPrime/.gitignore
trunk/examples/SimpleTCPClient/.gitignore
trunk/examples/SortBenchmark/.gitignore
trunk/source/.gitignore
trunk/source/crisscross/.gitignore
trunk/targets/.gitignore
trunk/targets/vs2008/.gitignore
trunk/targets/xcode/.gitignore
trunk/targets/xcode/CrissCross.xcodeproj/.gitignore
trunk/targets/xcode/English.lproj/.gitignore
trunk/tools/.gitignore
trunk/tools/Build/.gitignore
Modified:
trunk/ (props changed)
trunk/TestSuite/ (props changed)
trunk/TestSuite/TestSuite.xcodeproj/ (props changed)
trunk/TestSuite/avltree.cpp
trunk/TestSuite/darray.cpp
trunk/TestSuite/dstack.cpp
trunk/TestSuite/llist.cpp
trunk/TestSuite/md2.cpp
trunk/TestSuite/rbtree.cpp
trunk/TestSuite/sha1.cpp
trunk/TestSuite/splaytree.cpp
trunk/TestSuite/stopwatch.cpp
trunk/TestSuite/testutils.h
trunk/doc/ (props changed)
trunk/examples/ (props changed)
trunk/examples/CPSAT/ (props changed)
trunk/examples/CPUID/ (props changed)
trunk/examples/CPUID/main.cpp
trunk/examples/CheckMark/ (props changed)
trunk/examples/EmptyProject/ (props changed)
trunk/examples/GenPrime/ (props changed)
trunk/examples/GenPrime/main.cpp
trunk/examples/SimpleTCPClient/ (props changed)
trunk/examples/SimpleTCPClient/main.cpp
trunk/examples/SortBenchmark/ (props changed)
trunk/source/ (props changed)
trunk/source/core_socket.cpp
trunk/source/crisscross/ (props changed)
trunk/source/crisscross/avltree.h
trunk/source/crisscross/darray.cpp
trunk/source/crisscross/darray.h
trunk/source/crisscross/node.h
trunk/source/crisscross/rbtree.h
trunk/source/crisscross/splaytree.h
trunk/source/crisscross/universal_include.h
trunk/source/debug.cpp
trunk/source/error.cpp
trunk/source/md2.cpp
trunk/source/md4.cpp
trunk/source/tcpsocket.cpp
trunk/targets/ (props changed)
trunk/targets/vs2008/ (props changed)
trunk/targets/xcode/ (props changed)
trunk/targets/xcode/CrissCross.xcodeproj/ (props changed)
trunk/targets/xcode/English.lproj/ (props changed)
trunk/tools/ (props changed)
trunk/tools/Build/ (props changed)
trunk/tools/Build/GenerateBuildNumber.cpp
trunk/tools/Build/crc.cpp
trunk/tools/Build/crc.h

Log:
Uncrustifying before Git conversion.


Added: trunk/.gitignore
==============================================================================
--- (empty file)
+++ trunk/.gitignore Fri Oct 17 20:19:35 2008
@@ -0,0 +1,4 @@
+CMakeCache.txt
+CMakeFiles
+cmake_install.cmake
+Makefile

Added: trunk/TestSuite/.gitignore
==============================================================================
--- (empty file)
+++ trunk/TestSuite/.gitignore Fri Oct 17 20:19:35 2008
@@ -0,0 +1,7 @@
+CMakeCache.txt
+CMakeFiles
+cmake_install.cmake
+Makefile
+*.a
+*.h.gch
+TestSuite

Added: trunk/TestSuite/TestSuite.xcodeproj/.gitignore
==============================================================================
--- (empty file)
+++ trunk/TestSuite/TestSuite.xcodeproj/.gitignore Fri Oct 17 20:19:35 2008
@@ -0,0 +1,3 @@
+*.mode1
+*.pbxuser
+

Modified: trunk/TestSuite/avltree.cpp
==============================================================================
--- trunk/TestSuite/avltree.cpp (original)
+++ trunk/TestSuite/avltree.cpp Fri Oct 17 20:19:35 2008
@@ -39,25 +39,25 @@

const char *tmp1 = "one", *tmp2 = NULL;
TEST_ASSERT(avltree->find("first", tmp2));
- TEST_ASSERT(Compare(tmp2,tmp1) == 0);
+ TEST_ASSERT(Compare(tmp2, tmp1) == 0);
TEST_ASSERT(!avltree->exists("fifth"));
TEST_ASSERT(avltree->find("second", tmp2));

tmp1 = "two";
- TEST_ASSERT(Compare(tmp2,tmp1) == 0);
+ TEST_ASSERT(Compare(tmp2, tmp1) == 0);
TEST_ASSERT(!avltree->erase("fifth"));
TEST_ASSERT(avltree->size() == 4);

TEST_ASSERT(avltree->exists("first"));
TEST_ASSERT(avltree->erase("first"));
TEST_ASSERT(avltree->size() == 3);
-
+
TEST_ASSERT(avltree->exists("second"));
TEST_ASSERT(avltree->erase("second"));
-
+
TEST_ASSERT(avltree->exists("third"));
TEST_ASSERT(avltree->erase("third"));
-
+
TEST_ASSERT(avltree->exists("fourth"));
TEST_ASSERT(avltree->erase("fourth"));

@@ -80,11 +80,11 @@

TEST_ASSERT(avltree->size() == 4);

- std::string tmp;
+ std::string tmp;
TEST_ASSERT(avltree->find("first", tmp));
TEST_ASSERT(tmp == "one");
TEST_ASSERT(!avltree->exists("fifth"));
-
+
TEST_ASSERT(avltree->find("second", tmp));
TEST_ASSERT(tmp == "two");
TEST_ASSERT(!avltree->exists("fifth"));
@@ -119,7 +119,7 @@

int tmp;
TEST_ASSERT(avltree->size() == 4);
-
+
TEST_ASSERT(avltree->find(1, tmp));
TEST_ASSERT(tmp == 1);


Modified: trunk/TestSuite/darray.cpp
==============================================================================
--- trunk/TestSuite/darray.cpp (original)
+++ trunk/TestSuite/darray.cpp Fri Oct 17 20:19:35 2008
@@ -24,7 +24,7 @@
darray->insert(3);
darray->insert(5);
darray->insert(7);
-
+
TEST_ASSERT(darray->used() == 4);
TEST_ASSERT(darray->get(0) == 1);
TEST_ASSERT(darray->get(3) == 7);

Modified: trunk/TestSuite/dstack.cpp
==============================================================================
--- trunk/TestSuite/dstack.cpp (original)
+++ trunk/TestSuite/dstack.cpp Fri Oct 17 20:19:35 2008
@@ -23,16 +23,16 @@
for (int i = 0; i < 16; i++) {
dstack->push(i);
}
-
+
TEST_ASSERT(dstack->count() == 16);
TEST_ASSERT(dstack->peek() == 15);

for (int i = 15; i > 0; i--) {
TEST_ASSERT(dstack->pop() == i);
}
-
+
TEST_ASSERT(dstack->count() == 1);
-
+
dstack->empty();
TEST_ASSERT(dstack->count() == 0);


Modified: trunk/TestSuite/llist.cpp
==============================================================================
--- trunk/TestSuite/llist.cpp (original)
+++ trunk/TestSuite/llist.cpp Fri Oct 17 20:19:35 2008
@@ -51,7 +51,7 @@
TEST_ASSERT(!llist->valid(-1));
TEST_ASSERT(!llist->valid(1));
TEST_ASSERT(!llist->valid(0));
-
+
delete llist;

return 0;

Modified: trunk/TestSuite/md2.cpp
==============================================================================
--- trunk/TestSuite/md2.cpp (original)
+++ trunk/TestSuite/md2.cpp Fri Oct 17 20:19:35 2008
@@ -33,7 +33,7 @@
teststring = "a"; length = strlen(teststring);
md2.Process(teststring, length);
TEST_ASSERT(strcmp(md2.ToString(), "32ec01ec4a6dac72c0ab96fb34c0b5d1") ==
0);
-
+
teststring = "abc"; length = strlen(teststring);
md2.Process(teststring, length);
TEST_ASSERT(strcmp(md2.ToString(), "da853b0d3f88d99b30283a69e6ded6bb") ==
0);

Modified: trunk/TestSuite/rbtree.cpp
==============================================================================
--- trunk/TestSuite/rbtree.cpp (original)
+++ trunk/TestSuite/rbtree.cpp Fri Oct 17 20:19:35 2008
@@ -91,7 +91,7 @@

TEST_ASSERT(rbtree->find("first", res));
TEST_ASSERT(res == "one");
-
+
TEST_ASSERT(!rbtree->exists("fifth"));

TEST_ASSERT(rbtree->exists("second"));

Modified: trunk/TestSuite/sha1.cpp
==============================================================================
--- trunk/TestSuite/sha1.cpp (original)
+++ trunk/TestSuite/sha1.cpp Fri Oct 17 20:19:35 2008
@@ -46,7 +46,7 @@
SHA1Hash otherhash;
otherhash.Process("cheese", 6);
TEST_ASSERT(otherhash != sha1 && sha1 != otherhash);
-
+
otherhash.Process(teststring, length);
TEST_ASSERT(otherhash == sha1 && sha1 == otherhash);


Modified: trunk/TestSuite/splaytree.cpp
==============================================================================
--- trunk/TestSuite/splaytree.cpp (original)
+++ trunk/TestSuite/splaytree.cpp Fri Oct 17 20:19:35 2008
@@ -20,7 +20,7 @@
int TestSplayTree_CString()
{
SplayTree<const char *, const char *> *splaytree = new SplayTree<const
char *, const char *>();
- char *tmp;
+ char *tmp;

TEST_ASSERT(splaytree->size() == 0);

@@ -85,13 +85,13 @@
splaytree->insert("third", "three");
splaytree->insert("fourth", "four");

- std::string res;
+ std::string res;

TEST_ASSERT(splaytree->size() == 4);

TEST_ASSERT(splaytree->find("first", res));
TEST_ASSERT(res == "one");
-
+
TEST_ASSERT(!splaytree->exists("fifth"));

TEST_ASSERT(splaytree->exists("second"));
@@ -133,7 +133,7 @@
splaytree->insert(3, 3);
splaytree->insert(4, 4);

- int res;
+ int res;
TEST_ASSERT(splaytree->size() == 4);

TEST_ASSERT(splaytree->find(1, res));

Modified: trunk/TestSuite/stopwatch.cpp
==============================================================================
--- trunk/TestSuite/stopwatch.cpp (original)
+++ trunk/TestSuite/stopwatch.cpp Fri Oct 17 20:19:35 2008
@@ -31,7 +31,7 @@
System::ThreadSleep(10);
sw2->Stop();
TEST_ASSERT(sw2->Elapsed() < 1.0 && sw2->Elapsed() > 0.0);
-
+
delete sw2;

return 0;

Modified: trunk/TestSuite/testutils.h
==============================================================================
--- trunk/TestSuite/testutils.h (original)
+++ trunk/TestSuite/testutils.h Fri Oct 17 20:19:35 2008
@@ -18,10 +18,10 @@
extern CrissCross::IO::Console *g_console;

#define TEST_ASSERT(condition) \
- if (!(condition)) { \
- g_console->SetColour(g_console->FG_YELLOW|g_console->FG_INTENSITY); \
- g_console->WriteLine("\nWARNING: Condition '%s' failed assertion!",
#condition ); \
- g_console->SetColour(g_console->FG_RED|g_console->FG_INTENSITY); \
+ if (!(condition)) { \
+ g_console->SetColour(g_console->FG_YELLOW | g_console->FG_INTENSITY); \
+ g_console->WriteLine("\nWARNING: Condition '%s' failed assertion!", #
condition); \
+ g_console->SetColour(g_console->FG_RED | g_console->FG_INTENSITY); \
CrissCross::Debug::PrintStackTrace(g_console); \
g_console->SetColour(); \
return 1; \

Added: trunk/doc/.gitignore
==============================================================================
--- (empty file)
+++ trunk/doc/.gitignore Fri Oct 17 20:19:35 2008
@@ -0,0 +1 @@
+html

Added: trunk/examples/.gitignore
==============================================================================
--- (empty file)
+++ trunk/examples/.gitignore Fri Oct 17 20:19:35 2008
@@ -0,0 +1,6 @@
+CMakeCache.txt
+CMakeFiles
+cmake_install.cmake
+Makefile
+*.a
+*.h.gch

Added: trunk/examples/CPSAT/.gitignore
==============================================================================
--- (empty file)
+++ trunk/examples/CPSAT/.gitignore Fri Oct 17 20:19:35 2008
@@ -0,0 +1,7 @@
+CMakeCache.txt
+CMakeFiles
+cmake_install.cmake
+Makefile
+*.a
+*.h.gch
+CPSAT

Added: trunk/examples/CPUID/.gitignore
==============================================================================
--- (empty file)
+++ trunk/examples/CPUID/.gitignore Fri Oct 17 20:19:35 2008
@@ -0,0 +1,7 @@
+CMakeCache.txt
+CMakeFiles
+cmake_install.cmake
+Makefile
+*.a
+*.h.gch
+CPUID

Modified: trunk/examples/CPUID/main.cpp
==============================================================================
--- trunk/examples/CPUID/main.cpp (original)
+++ trunk/examples/CPUID/main.cpp Fri Oct 17 20:19:35 2008
@@ -72,7 +72,7 @@
console->WriteLine();
console->SetColour(console->FG_YELLOW | console->FG_INTENSITY);
console->WriteLine("WARNING: Expected at least 1 physical package, but
detected %0.1lf. Are you\n"
- "running this under a hypervisor?", ratio);
+ "running this under a hypervisor?", ratio);
console->SetColour();
}

@@ -120,7 +120,6 @@
if (featureIDs->valid(i))
if (features->get(i)->Enabled)
console->Write("%s ", featureIDs->get(i));
-
}

delete featureIDs;

Added: trunk/examples/CheckMark/.gitignore
==============================================================================
--- (empty file)
+++ trunk/examples/CheckMark/.gitignore Fri Oct 17 20:19:35 2008
@@ -0,0 +1,7 @@
+CMakeCache.txt
+CMakeFiles
+cmake_install.cmake
+Makefile
+*.a
+*.h.gch
+CheckMark

Added: trunk/examples/EmptyProject/.gitignore
==============================================================================
--- (empty file)
+++ trunk/examples/EmptyProject/.gitignore Fri Oct 17 20:19:35 2008
@@ -0,0 +1,7 @@
+CMakeCache.txt
+CMakeFiles
+cmake_install.cmake
+Makefile
+*.a
+*.h.gch
+EmptyProject

Added: trunk/examples/GenPrime/.gitignore
==============================================================================
--- (empty file)
+++ trunk/examples/GenPrime/.gitignore Fri Oct 17 20:19:35 2008
@@ -0,0 +1,7 @@
+CMakeCache.txt
+CMakeFiles
+cmake_install.cmake
+Makefile
+*.a
+*.h.gch
+GenPrime

Modified: trunk/examples/GenPrime/main.cpp
==============================================================================
--- trunk/examples/GenPrime/main.cpp (original)
+++ trunk/examples/GenPrime/main.cpp Fri Oct 17 20:19:35 2008
@@ -156,7 +156,6 @@
for (n = 3; primeCachePtr - primeCache <= PREGEN - 2; n += 2)
if (isPrime(n))
AddPrimeToCache((prime_t)n);
-
}
#endif


Added: trunk/examples/SimpleTCPClient/.gitignore
==============================================================================
--- (empty file)
+++ trunk/examples/SimpleTCPClient/.gitignore Fri Oct 17 20:19:35 2008
@@ -0,0 +1,7 @@
+CMakeCache.txt
+CMakeFiles
+cmake_install.cmake
+Makefile
+*.a
+*.h.gch
+SimpleTCPClient

Modified: trunk/examples/SimpleTCPClient/main.cpp
==============================================================================
--- trunk/examples/SimpleTCPClient/main.cpp (original)
+++ trunk/examples/SimpleTCPClient/main.cpp Fri Oct 17 20:19:35 2008
@@ -23,14 +23,14 @@
console = new Console();

/* Begin your application here. */
- int cc_err;
+ int cc_err;

TCPSocket * sock = new TCPSocket();
console->WriteLine("Connecting...");
cc_err = sock->Connect("www.example.com", 80);
if (cc_err == CC_ERR_WOULD_BLOCK)
console->WriteLine("Non-blocking sockets are enabled. Waiting for
connection...");
- while(sock->State() == SOCKET_STATE_CONNECTING);
+ while (sock->State() == SOCKET_STATE_CONNECTING) ;
if (sock->State() != SOCKET_STATE_CONNECTED) {
console->WriteLine("Connection failed.");
return 1;
@@ -42,12 +42,11 @@
console->WriteLine("Failed.");
else
console->WriteLine("OK");
-
- while(sock->State() == SOCKET_STATE_CONNECTED) {
+
+ while (sock->State() == SOCKET_STATE_CONNECTED) {
string in;
cc_err = sock->Read(in);
- if (cc_err == 0)
- {
+ if (cc_err == 0) {
console->WriteLine(in);
break;
} else {
@@ -56,9 +55,9 @@
System::ThreadSleep(10);
}
}
-
+
sock->Close();
-
+
delete sock;

return 0;

Added: trunk/examples/SortBenchmark/.gitignore
==============================================================================
--- (empty file)
+++ trunk/examples/SortBenchmark/.gitignore Fri Oct 17 20:19:35 2008
@@ -0,0 +1,7 @@
+CMakeCache.txt
+CMakeFiles
+cmake_install.cmake
+Makefile
+*.a
+*.h.gch
+SortBenchmark

Added: trunk/source/.gitignore
==============================================================================
--- (empty file)
+++ trunk/source/.gitignore Fri Oct 17 20:19:35 2008
@@ -0,0 +1,6 @@
+CMakeCache.txt
+CMakeFiles
+cmake_install.cmake
+Makefile
+*.a
+*.h.gch

Modified: trunk/source/core_socket.cpp
==============================================================================
--- trunk/source/core_socket.cpp (original)
+++ trunk/source/core_socket.cpp Fri Oct 17 20:19:35 2008
@@ -153,10 +153,10 @@
{
if (m_sock == INVALID_SOCKET) return CC_ERR_NOT_SOCKET;
if (!IsReadable()) return CC_ERR_WOULD_BLOCK;
-
+
_output = "";
-
- int errbefore = GetError();
+
+ int errbefore = GetError();

char *buf = new char[m_bufferSize];
int recvlen = 0;
@@ -172,9 +172,9 @@
} while (recvlen > 0);

delete [] buf;
-
+
int err = GetError();
-
+
/* The error wasn't triggered by what we did here */
if (err == errbefore)
err = CC_ERR_NONE;
@@ -258,9 +258,9 @@

bool CoreSocket::IsReadable() const
{
- int ret;
- fd_set read;
- struct timeval timeout;
+ int ret;
+ fd_set read;
+ struct timeval timeout;

/* We only take 0.001 seconds to check */
timeout.tv_sec = 0;
@@ -269,7 +269,7 @@
FD_ZERO(&read);
FD_SET(m_sock, &read);

- int errbefore = GetError(), errafter;
+ int errbefore = GetError(), errafter;

/* Select to check if it's readable. */
ret = select(m_sock + 1, &read, NULL, NULL, &timeout);
@@ -293,9 +293,9 @@

bool CoreSocket::IsWritable() const
{
- int ret;
- fd_set write;
- struct timeval timeout;
+ int ret;
+ fd_set write;
+ struct timeval timeout;

/* We only take 0.001 seconds to check */
timeout.tv_sec = 0;
@@ -304,7 +304,7 @@
FD_ZERO(&write);
FD_SET(m_sock, &write);

- int errbefore = GetError(), errafter;
+ int errbefore = GetError(), errafter;

/* Select to check if it's readable. */
ret = select(m_sock + 1, NULL, &write, NULL, &timeout);

Added: trunk/source/crisscross/.gitignore
==============================================================================
--- (empty file)
+++ trunk/source/crisscross/.gitignore Fri Oct 17 20:19:35 2008
@@ -0,0 +1,3 @@
+build_number.h
+universal_include.h.gch
+

Modified: trunk/source/crisscross/avltree.h
==============================================================================
--- trunk/source/crisscross/avltree.h (original)
+++ trunk/source/crisscross/avltree.h Fri Oct 17 20:19:35 2008
@@ -315,7 +315,7 @@
* \return Memory usage in bytes.
*/
size_t mem_usage() const;
-
+
#if !defined(DISABLE_DEPRECATED_CODE)
/*
* Deprecated Compatibility Functions

Modified: trunk/source/crisscross/darray.cpp
==============================================================================
--- trunk/source/crisscross/darray.cpp (original)
+++ trunk/source/crisscross/darray.cpp Fri Oct 17 20:19:35 2008
@@ -68,7 +68,6 @@
for (size_t i = m_arraySize - 1; (int)i >= 0; i--)
if (m_shadow[i] == 0)
m_emptyNodes->push(i);
-
}

template <class T>
@@ -78,7 +77,6 @@
for (size_t i = 0; i < m_arraySize; i++)
if (m_shadow[i] == 1)
m_numUsed++;
-
}

template <class T>
@@ -331,7 +329,7 @@
return sort(&_sortMethod);
}
#endif
-
+
template <class T>
void DArray<T>::flush()
{
@@ -342,7 +340,7 @@
}
empty();
}
-
+
template <class T>
void DArray<T>::flushArray()
{
@@ -353,10 +351,10 @@
}
empty();
}
-
+

/* BELOW ARE DEPRECATED FUNCTIONS */
-
+
#if !defined(DISABLE_DEPRECATED_CODE)
template <class T>
void DArray<T>::EmptyAndDelete()

Modified: trunk/source/crisscross/darray.h
==============================================================================
--- trunk/source/crisscross/darray.h (original)
+++ trunk/source/crisscross/darray.h Fri Oct 17 20:19:35 2008
@@ -217,10 +217,10 @@
* \return Memory usage in bytes.
*/
size_t mem_usage() const;
-
+
/*! \brief Empties the array and deletes the data contained in it with
the 'delete' operator. */
inline void flush();
-
+
/*! \brief Empties the array and deletes the data contained in it with
the 'delete []' operator. */
inline void flushArray();


Modified: trunk/source/crisscross/node.h
==============================================================================
--- trunk/source/crisscross/node.h (original)
+++ trunk/source/crisscross/node.h Fri Oct 17 20:19:35 2008
@@ -127,7 +127,7 @@
delete left; left = NULL;
delete right; right = NULL;
}
-
+
/*! \brief Returns the overhead caused by the node. */
/*!
* \return Memory usage in bytes.
@@ -183,7 +183,7 @@
delete right; right = NULL;
}

-
+
/*! \brief Returns the overhead caused by the node. */
/*!
* \param _parentTree The tree which contains this node instance.

Modified: trunk/source/crisscross/rbtree.h
==============================================================================
--- trunk/source/crisscross/rbtree.h (original)
+++ trunk/source/crisscross/rbtree.h Fri Oct 17 20:19:35 2008
@@ -204,7 +204,7 @@
* \return Memory usage in bytes.
*/
size_t mem_usage() const;
-
+
#if !defined(DISABLE_DEPRECATED_CODE)
/*
* Deprecated Compatibility Functions

Modified: trunk/source/crisscross/splaytree.h
==============================================================================
--- trunk/source/crisscross/splaytree.h (original)
+++ trunk/source/crisscross/splaytree.h Fri Oct 17 20:19:35 2008
@@ -170,7 +170,7 @@
* \return Memory usage in bytes.
*/
size_t mem_usage() const;
-
+
#if !defined(DISABLE_DEPRECATED_CODE)
/*
* Deprecated Compatibility Functions

Modified: trunk/source/crisscross/universal_include.h
==============================================================================
--- trunk/source/crisscross/universal_include.h (original)
+++ trunk/source/crisscross/universal_include.h Fri Oct 17 20:19:35 2008
@@ -56,7 +56,7 @@
#define ENABLE_CPUID
#define ENABLE_HASHES
#define ENABLE_SORTS
-//#define ENABLE_CRASHREPORTS /* Enables XCrashReports on Windows. */
+/* #define ENABLE_CRASHREPORTS / * Enables XCrashReports on Windows. * / */
/* #define DISABLE_DEPRECATED_CODE */ /* This will be enabled by default
in a future release */

/* NOTE: By disabling this line, you will not be in compliance with the
New BSD License. */

Modified: trunk/source/debug.cpp
==============================================================================
--- trunk/source/debug.cpp (original)
+++ trunk/source/debug.cpp Fri Oct 17 20:19:35 2008
@@ -105,8 +105,8 @@
IMAGEHLP_LINE
lineInfo = { sizeof(IMAGEHLP_LINE) };
if (SymGetLineFromAddr
-
(GetCurrentProcess(),
( DWORD )address, &dwDisplacement,
-
&lineInfo))
{
+
(GetCurrentProcess(),
( DWORD )address, &dwDisplacement,
+
&lineInfo))
{
const char *pDelim = strrchr(lineInfo.FileName, '\\');
char temp[1024];
sprintf(temp, " at %s(%u)", (pDelim ? pDelim + 1 : lineInfo.FileName),
lineInfo.LineNumber);
@@ -159,18 +159,18 @@

#elif defined (ENABLE_BACKTRACE)
#if defined(TARGET_OS_MACOSX)
- int (*backtrace)(void **, int);
- char **(*backtrace_symbols)(void * const *, int);
- backtrace = (int (*) (void **, int))dlsym(RTLD_DEFAULT, "backtrace");
- backtrace_symbols = (char **(*) (void * const *,
int))dlsym(RTLD_DEFAULT, "backtrace_symbols");
+ int (*backtrace)(void * *, int);
+ char * *(*backtrace_symbols)(void * const *, int);
+ backtrace = (int(*) (void * *, int))dlsym(RTLD_DEFAULT, "backtrace");
+ backtrace_symbols = (char * *(*)(void * const *,
int))dlsym(RTLD_DEFAULT, "backtrace_symbols");
#endif

void *array[256];
int size;
- char **strings;
+ char * *strings;
int i;

- memset(array,0,sizeof(void*) * 256);
+ memset(array, 0, sizeof(void *) * 256);

/* use -rdynamic flag when compiling */
size = backtrace(array, 256);
@@ -197,11 +197,11 @@
free(realname);
}
#elif defined(TARGET_OS_MACOSX)
- char *addr = ::strstr(strings[i], "0x");
- char *mangled = ::strchr(addr, ' ') + 1;
- char *postmangle = ::strchr(mangled, ' ');
+ char *addr = ::strstr(strings[i], "0x");
+ char *mangled = ::strchr(addr, ' ') + 1;
+ char *postmangle = ::strchr(mangled, ' ');
bt += addr;
- int status;
+ int status;
if (addr && mangled) {
if (postmangle)
*postmangle = '\0';
@@ -210,7 +210,7 @@
bt += ": ";
bt += realname;
}
- free ( realname );
+ free(realname);
}
#endif
bt += "\n";

Modified: trunk/source/error.cpp
==============================================================================
--- trunk/source/error.cpp (original)
+++ trunk/source/error.cpp Fri Oct 17 20:19:35 2008
@@ -29,48 +29,48 @@
const struct tl errmap [] =
{
/*{WSANO_DATA, "WSANO_DATA", CC_ERR_NO_DATA},
- {WSAHOST_NOT_FOUND, "WSAHOST_NOT_FOUND", CC_ERR_HOST_NOT_FOUND},
- {WSANO_RECOVERY, "WSANO_RECOVERY", CC_ERR_NO_RECOVERY},
- {WSATRY_AGAIN, "WSATRY_AGAIN", CC_ERR_TRY_AGAIN},
- {WSAEINTR, "WSAEINTR", CC_ERR_EINTR},*/
+ * {WSAHOST_NOT_FOUND, "WSAHOST_NOT_FOUND", CC_ERR_HOST_NOT_FOUND},
+ * {WSANO_RECOVERY, "WSANO_RECOVERY", CC_ERR_NO_RECOVERY},
+ * {WSATRY_AGAIN, "WSATRY_AGAIN", CC_ERR_TRY_AGAIN},
+ * {WSAEINTR, "WSAEINTR", CC_ERR_EINTR},*/
{WSAEWOULDBLOCK, "WSAEWOULDBLOCK", CC_ERR_WOULD_BLOCK},
{WSAEINPROGRESS, "WSAEINPROGRESS", CC_ERR_WOULD_BLOCK},
- //{WSAEALREADY, "WSAEALREADY", CC_ERR_EALREADY},
+ /* {WSAEALREADY, "WSAEALREADY", CC_ERR_EALREADY}, */
{WSAENOTSOCK, "WSAENOTSOCK", CC_ERR_NOT_SOCKET},
/*{WSAEDESTADDRREQ, "WSAEDESTADDRREQ", CC_ERR_EDESTADDRREQ},
- {WSAEMSGSIZE, "WSAEMSGSIZE", CC_ERR_EMSGSIZE},
- {WSAEPROTOTYPE, "WSAEPROTOTYPE", CC_ERR_EPROTOTYPE},
- {WSAENOPROTOOPT, "WSAENOPROTOOPT", CC_ERR_ENOPROTOOPT},
- {WSAEPROTONOSUPPORT, "WSAEPROTONOSUPPORT", CC_ERR_EPROTONOSUPPORT},
- {WSAESOCKTNOSUPPORT, "WSAESOCKTNOSUPPORT", CC_ERR_ESOCKTNOSUPPORT},
- {WSAEOPNOTSUPP, "WSAEOPNOTSUPP", CC_ERR_EOPNOTSUPP},
- {WSAEPFNOSUPPORT, "WSAEPFNOSUPPORT", CC_ERR_EPFNOSUPPORT},
- {WSAEAFNOSUPPORT, "WSAEAFNOSUPPORT", CC_ERR_EAFNOSUPPORT},
- {WSAEADDRINUSE, "WSAEADDRINUSE", CC_ERR_EADDRINUSE},
- {WSAEADDRNOTAVAIL, "WSAEADDRNOTAVAIL", CC_ERR_EADDRNOTAVAIL},
- {WSAENETDOWN, "WSAENETDOWN", CC_ERR_ENETDOWN},
- {WSAENETUNREACH, "WSAENETUNREACH", CC_ERR_ENETUNREACH},
- {WSAENETRESET, "WSAENETRESET", CC_ERR_ENETRESET},
- {WSAECONNABORTED, "WSAECONNABORTED", CC_ERR_ECONNABORTED},
- {WSAECONNRESET, "WSAECONNRESET", CC_ERR_ECONNRESET},
- {WSAENOBUFS, "WSAENOBUFS", CC_ERR_ENOBUFS},
- {WSAEISCONN, "WSAEISCONN", CC_ERR_EISCONN},
- {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},
- {WSAEHOSTDOWN, "WSAEHOSTDOWN", CC_ERR_EHOSTDOWN},
- {WSAEHOSTUNREACH, "WSAEHOSTUNREACH", CC_ERR_EHOSTUNREACH},
- {WSAENOTEMPTY, "WSAENOTEMPTY", CC_ERR_ENOTEMPTY},
- {WSAEUSERS, "WSAEUSERS", CC_ERR_EUSERS},
- {WSAEDQUOT, "WSAEDQUOT", CC_ERR_EDQUOT},
- {WSAESTALE, "WSAESTALE", CC_ERR_ESTALE},
- {WSAEREMOTE, "WSAEREMOTE", CC_ERR_EREMOTE},
- {WSAEINVAL, "WSAEINVAL", CC_ERR_EINVAL},
- {WSAEFAULT, "WSAEFAULT", CC_ERR_EFAULT},*/
+ * {WSAEMSGSIZE, "WSAEMSGSIZE", CC_ERR_EMSGSIZE},
+ * {WSAEPROTOTYPE, "WSAEPROTOTYPE", CC_ERR_EPROTOTYPE},
+ * {WSAENOPROTOOPT, "WSAENOPROTOOPT", CC_ERR_ENOPROTOOPT},
+ * {WSAEPROTONOSUPPORT, "WSAEPROTONOSUPPORT", CC_ERR_EPROTONOSUPPORT},
+ * {WSAESOCKTNOSUPPORT, "WSAESOCKTNOSUPPORT", CC_ERR_ESOCKTNOSUPPORT},
+ * {WSAEOPNOTSUPP, "WSAEOPNOTSUPP", CC_ERR_EOPNOTSUPP},
+ * {WSAEPFNOSUPPORT, "WSAEPFNOSUPPORT", CC_ERR_EPFNOSUPPORT},
+ * {WSAEAFNOSUPPORT, "WSAEAFNOSUPPORT", CC_ERR_EAFNOSUPPORT},
+ * {WSAEADDRINUSE, "WSAEADDRINUSE", CC_ERR_EADDRINUSE},
+ * {WSAEADDRNOTAVAIL, "WSAEADDRNOTAVAIL", CC_ERR_EADDRNOTAVAIL},
+ * {WSAENETDOWN, "WSAENETDOWN", CC_ERR_ENETDOWN},
+ * {WSAENETUNREACH, "WSAENETUNREACH", CC_ERR_ENETUNREACH},
+ * {WSAENETRESET, "WSAENETRESET", CC_ERR_ENETRESET},
+ * {WSAECONNABORTED, "WSAECONNABORTED", CC_ERR_ECONNABORTED},
+ * {WSAECONNRESET, "WSAECONNRESET", CC_ERR_ECONNRESET},
+ * {WSAENOBUFS, "WSAENOBUFS", CC_ERR_ENOBUFS},
+ * {WSAEISCONN, "WSAEISCONN", CC_ERR_EISCONN},
+ * {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},
+ * {WSAEHOSTDOWN, "WSAEHOSTDOWN", CC_ERR_EHOSTDOWN},
+ * {WSAEHOSTUNREACH, "WSAEHOSTUNREACH", CC_ERR_EHOSTUNREACH},
+ * {WSAENOTEMPTY, "WSAENOTEMPTY", CC_ERR_ENOTEMPTY},
+ * {WSAEUSERS, "WSAEUSERS", CC_ERR_EUSERS},
+ * {WSAEDQUOT, "WSAEDQUOT", CC_ERR_EDQUOT},
+ * {WSAESTALE, "WSAESTALE", CC_ERR_ESTALE},
+ * {WSAEREMOTE, "WSAEREMOTE", CC_ERR_EREMOTE},
+ * {WSAEINVAL, "WSAEINVAL", CC_ERR_EINVAL},
+ * {WSAEFAULT, "WSAEFAULT", CC_ERR_EFAULT},*/
{0, "NOERROR", CC_ERR_NONE},
{0, "UNKNOWN_ERROR", CC_ERR_INTERNAL}
};
@@ -79,41 +79,41 @@
{
#if !defined (TARGET_OS_NDSFIRMWARE)
/*
- {NO_DATA, "NO_DATA", CC_ERR_NO_DATA},
- {HOST_NOT_FOUND, "HOST_NOT_FOUND", CC_ERR_HOST_NOT_FOUND},
- {NO_RECOVERY, "NO_RECOVERY", CC_ERR_NO_RECOVERY},
- {TRY_AGAIN, "TRY_AGAIN", CC_ERR_TRY_AGAIN},
- */
+ * {NO_DATA, "NO_DATA", CC_ERR_NO_DATA},
+ * {HOST_NOT_FOUND, "HOST_NOT_FOUND", CC_ERR_HOST_NOT_FOUND},
+ * {NO_RECOVERY, "NO_RECOVERY", CC_ERR_NO_RECOVERY},
+ * {TRY_AGAIN, "TRY_AGAIN", CC_ERR_TRY_AGAIN},
+ */
#endif
{EWOULDBLOCK, "EWOULDBLOCK", CC_ERR_WOULD_BLOCK},
{EINPROGRESS, "EINPROGRESS", CC_ERR_WOULD_BLOCK},
/*
- {EADDRINUSE, "EADDRINUSE", CC_ERR_ADDR_IN_USE},
- {EADDRNOTAVAIL, "EADDRNOTAVAIL", CC_ERR_EADDRNOTAVAIL},
- {ENETDOWN, "ENETDOWN", CC_ERR_ENETDOWN},
- {ENETUNREACH, "ENETUNREACH", CC_ERR_ENETUNREACH},
- {ENETRESET, "ENETRESET", CC_ERR_ENETRESET},
- {ECONNABORTED, "ECONNABORTED", CC_ERR_ECONNABORTED},
- {ECONNRESET, "ECONNRESET", CC_ERR_ECONNRESET},
- {ENOBUFS, "ENOBUFS", CC_ERR_ENOBUFS},
- {EISCONN, "EISCONN", CC_ERR_EISCONN},
- {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},
- {EHOSTDOWN, "EHOSTDOWN", CC_ERR_EHOSTDOWN},
- {EHOSTUNREACH, "EHOSTUNREACH", CC_ERR_EHOSTUNREACH},
- {ENOTEMPTY, "ENOTEMPTY", CC_ERR_ENOTEMPTY},
- {EUSERS, "EUSERS", CC_ERR_EUSERS},
- {EDQUOT, "EDQUOT", CC_ERR_EDQUOT},
- {ESTALE, "ESTALE", CC_ERR_ESTALE},
- {EREMOTE, "EREMOTE", CC_ERR_EREMOTE},
- {EINVAL, "EINVAL", CC_ERR_EINVAL},
- {EFAULT, "EFAULT", CC_ERR_EFAULT},
- */
+ * {EADDRINUSE, "EADDRINUSE", CC_ERR_ADDR_IN_USE},
+ * {EADDRNOTAVAIL, "EADDRNOTAVAIL", CC_ERR_EADDRNOTAVAIL},
+ * {ENETDOWN, "ENETDOWN", CC_ERR_ENETDOWN},
+ * {ENETUNREACH, "ENETUNREACH", CC_ERR_ENETUNREACH},
+ * {ENETRESET, "ENETRESET", CC_ERR_ENETRESET},
+ * {ECONNABORTED, "ECONNABORTED", CC_ERR_ECONNABORTED},
+ * {ECONNRESET, "ECONNRESET", CC_ERR_ECONNRESET},
+ * {ENOBUFS, "ENOBUFS", CC_ERR_ENOBUFS},
+ * {EISCONN, "EISCONN", CC_ERR_EISCONN},
+ * {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},
+ * {EHOSTDOWN, "EHOSTDOWN", CC_ERR_EHOSTDOWN},
+ * {EHOSTUNREACH, "EHOSTUNREACH", CC_ERR_EHOSTUNREACH},
+ * {ENOTEMPTY, "ENOTEMPTY", CC_ERR_ENOTEMPTY},
+ * {EUSERS, "EUSERS", CC_ERR_EUSERS},
+ * {EDQUOT, "EDQUOT", CC_ERR_EDQUOT},
+ * {ESTALE, "ESTALE", CC_ERR_ESTALE},
+ * {EREMOTE, "EREMOTE", CC_ERR_EREMOTE},
+ * {EINVAL, "EINVAL", CC_ERR_EINVAL},
+ * {EFAULT, "EFAULT", CC_ERR_EFAULT},
+ */
{0, "NO_ERROR", CC_ERR_NONE},
{0, "UNKNOWN_ERROR", CC_ERR_INTERNAL}
};
@@ -130,10 +130,9 @@
const char *GetErrorDescription(int why)
{
static const char *unknown = "Unknown Error";
-
+
#if !defined(TARGET_OS_WINDOWS) && !defined(TARGET_COMPILER_CYGWIN)
- if (why >= 0)
- {
+ if (why >= 0) {
static char buffer[128];
memset(buffer, 0, sizeof(buffer));
strerror_r(why, buffer, 128);

Modified: trunk/source/md2.cpp
==============================================================================
--- trunk/source/md2.cpp (original)
+++ trunk/source/md2.cpp Fri Oct 17 20:19:35 2008
@@ -51,7 +51,7 @@
#endif

static void MD2Transform PROTO_LIST
-
((unsigned
char [16], unsigned char [16], const unsigned char [16]));
+
((unsigned
char [16], unsigned char [16], const unsigned char [16]));

/* Permutation of 0..255 constructed from the digits of pi. It gives a
* "random" nonlinear byte substitution operation.

Modified: trunk/source/md4.cpp
==============================================================================
--- trunk/source/md4.cpp (original)
+++ trunk/source/md4.cpp Fri Oct 17 20:19:35 2008
@@ -121,7 +121,7 @@
*/
if (inputLen >= partLen) {
memcpy
-

((POINTER)&context->buffer[index], (POINTER)input, partLen);
+

((POINTER)&context->buffer[index], (POINTER)input, partLen);
MD4Transform(context->state, context->buffer);

for (i = partLen; i + 63 < inputLen; i += 64)
@@ -133,8 +133,8 @@

/* Buffer remaining input */
memcpy
-
((POINTER)&context->buffer[index],
(POINTER)&input[i],
-
inputLen
- i);
+
((POINTER)&context->buffer[index],
(POINTER)&input[i],
+
inputLen
- i);
}

/* MD4 finalization. Ends an MD4 message-digest operation, writing the

Modified: trunk/source/tcpsocket.cpp
==============================================================================
--- trunk/source/tcpsocket.cpp (original)
+++ trunk/source/tcpsocket.cpp Fri Oct 17 20:19:35 2008
@@ -103,7 +103,7 @@
return GetError();

/* Set up the typical transmission attributes. */
- //SetAttributes ( m_sock );
+ /* SetAttributes ( m_sock ); */

#if 0
unsigned long arg = 1;
@@ -172,7 +172,7 @@

/* Set up the typical transmission attributes. */
SetAttributes(m_sock);
-
+
#if 0
unsigned long arg = 1;

@@ -229,13 +229,13 @@
err = setsockopt(_socket, SOL_SOCKET, SO_LINGER,
(char *)&linger_opts, optlen);
if (err == -1) return errno;
-
+
/* SO_REUSEADDR */
#ifndef TARGET_OS_WINDOWS
optval = 1;
optlen = sizeof(optval);
- setsockopt(_socket, SOL_SOCKET, SO_REUSEADDR,
- (char*)&optval, optlen);
+ setsockopt(_socket, SOL_SOCKET, SO_REUSEADDR,
+ (char *)&optval, optlen);
#endif

/* SO_KEEPALIVE */

Added: trunk/targets/.gitignore
==============================================================================

Added: trunk/targets/vs2008/.gitignore
==============================================================================

Added: trunk/targets/xcode/.gitignore
==============================================================================
--- (empty file)
+++ trunk/targets/xcode/.gitignore Fri Oct 17 20:19:35 2008
@@ -0,0 +1,2 @@
+build
+

Added: trunk/targets/xcode/CrissCross.xcodeproj/.gitignore
==============================================================================
--- (empty file)
+++ trunk/targets/xcode/CrissCross.xcodeproj/.gitignore Fri Oct 17 20:19:35
2008
@@ -0,0 +1,3 @@
+*.pbxuser
+*.perspectivev3
+

Added: trunk/targets/xcode/English.lproj/.gitignore
==============================================================================

Added: trunk/tools/.gitignore
==============================================================================
--- (empty file)
+++ trunk/tools/.gitignore Fri Oct 17 20:19:35 2008
@@ -0,0 +1,3 @@
+*.ilk
+*.pdb
+

Added: trunk/tools/Build/.gitignore
==============================================================================
--- (empty file)
+++ trunk/tools/Build/.gitignore Fri Oct 17 20:19:35 2008
@@ -0,0 +1,7 @@
+obj
+VTune
+*.user
+Debug
+Release
+*.plg
+

Modified: trunk/tools/Build/GenerateBuildNumber.cpp
==============================================================================
--- trunk/tools/Build/GenerateBuildNumber.cpp (original)
+++ trunk/tools/Build/GenerateBuildNumber.cpp Fri Oct 17 20:19:35 2008
@@ -7,9 +7,9 @@

#include "crc.h"

-int GetSubversionRevisionNumber ( const char *_fromFile );
+int GetSubversionRevisionNumber(const char *_fromFile);

-int main ( int argc, char **argv )
+int main(int argc, char * *argv)
{
char inputPath[2048];
char outputPath[2048];
@@ -18,67 +18,64 @@
char fileBuffer[8192];
char temp[256];

- if ( argc < 3 )
- {
- fprintf ( stderr, "Not enough parameters!\n" );
+ if (argc < 3) {
+ fprintf(stderr, "Not enough parameters!\n");
return 1;
}

- memset ( fileBuffer, 0, sizeof(fileBuffer) );
+ memset(fileBuffer, 0, sizeof(fileBuffer));

- strcpy ( inputPath, argv[1] );
- strcpy ( outputPath, argv[2] );
+ strcpy(inputPath, argv[1]);
+ strcpy(outputPath, argv[2]);

- sprintf ( buildNumberPath, "%s/build_number.h", outputPath );
- sprintf ( inputEntriesFile, "%s/.svn/entries", inputPath );
+ sprintf(buildNumberPath, "%s/build_number.h", outputPath);
+ sprintf(inputEntriesFile, "%s/.svn/entries", inputPath);

- sprintf ( fileBuffer, "#ifndef __included_build_number_h\n" );
+ sprintf(fileBuffer, "#ifndef __included_build_number_h\n");

- sprintf ( temp, "#define __included_build_number_h\n" );
- strcat ( fileBuffer, temp );
+ sprintf(temp, "#define __included_build_number_h\n");
+ strcat(fileBuffer, temp);

- sprintf ( temp, "\n#define BUILD_NUMBER %d\n\n",
- GetSubversionRevisionNumber ( inputEntriesFile ) );
- strcat ( fileBuffer, temp );
+ sprintf(temp, "\n#define BUILD_NUMBER %d\n\n",
+ GetSubversionRevisionNumber(inputEntriesFile));
+ strcat(fileBuffer, temp);

- sprintf ( temp, "#endif\n" );
- strcat ( fileBuffer, temp );
+ sprintf(temp, "#endif\n");
+ strcat(fileBuffer, temp);

CRC crcTemp, crcFinal;
- crcTemp.Process ( fileBuffer, strlen(fileBuffer) );
- crcFinal.ProcessFile ( buildNumberPath );
+ crcTemp.Process(fileBuffer, strlen(fileBuffer));
+ crcFinal.ProcessFile(buildNumberPath);

- fprintf ( stderr, "File CRC: %08x, Data CRC: %08x\n", crcTemp.GetCRC(),
crcFinal.GetCRC() );
+ fprintf(stderr, "File CRC: %08x, Data CRC: %08x\n", crcTemp.GetCRC(),
crcFinal.GetCRC());

- if ( crcTemp.GetCRC() != crcFinal.GetCRC() ) {
- FILE *outfile = fopen ( buildNumberPath, "w" );
- if ( !outfile )
- {
- fprintf ( stderr, "Output file '%s' couldn't be opened!\n",
buildNumberPath );
+ if (crcTemp.GetCRC() != crcFinal.GetCRC()) {
+ FILE *outfile = fopen(buildNumberPath, "w");
+ if (!outfile) {
+ fprintf(stderr, "Output file '%s' couldn't be opened!\n",
buildNumberPath);
return 1;
}
- fprintf ( outfile, "%s", fileBuffer );
- fclose ( outfile );
+ fprintf(outfile, "%s", fileBuffer);
+ fclose(outfile);
} else {
- fprintf ( stderr, "build_number.h is already up to date.\n" );
+ fprintf(stderr, "build_number.h is already up to date.\n");
}

return 0;
}

-int GetSubversionRevisionNumber ( const char *_fromFile )
+int GetSubversionRevisionNumber(const char *_fromFile)
{
- string line;
+ string line;
ifstream file;
- file.open ( _fromFile, ios::in );
- if ( file.is_open() )
- {
- getline ( file, line );
- getline ( file, line );
- getline ( file, line );
- getline ( file, line );
+ file.open(_fromFile, ios::in);
+ if (file.is_open()) {
+ getline(file, line);
+ getline(file, line);
+ getline(file, line);
+ getline(file, line);
file.close();
- int retval = atoi ( line.c_str() );
+ int retval = atoi(line.c_str());
return retval;
} else {
return 0;

Modified: trunk/tools/Build/crc.cpp
==============================================================================
--- trunk/tools/Build/crc.cpp (original)
+++ trunk/tools/Build/crc.cpp Fri Oct 17 20:19:35 2008
@@ -4,67 +4,66 @@

#include "crc.h"

-int crc_table[256] =
+int crc_table[256] =
{
- 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f,
0xe963a535, 0x9e6495a3,
- 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd,
0xe7b82d07, 0x90bf1d91,
- 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb,
0xf4d4b551, 0x83d385c7,
- 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9,
0xfa0f3d63, 0x8d080df5,
- 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, 0x3c03e4d1, 0x4b04d447,
0xd20d85fd, 0xa50ab56b,
- 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75,
0xdcd60dcf, 0xabd13d59,
- 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423,
0xcfba9599, 0xb8bda50f,
- 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, 0x2f6f7c87, 0x58684c11,
0xc1611dab, 0xb6662d3d,
- 0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f,
0x9fbfe4a5, 0xe8b8d433,
- 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d,
0x91646c97, 0xe6635c01,
- 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, 0x1b01a57b,
0x8208f4c1, 0xf50fc457,
- 0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49,
0x8cd37cf3, 0xfbd44c65,
- 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7,
0xa4d1c46d, 0xd3d6f4fb,
- 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5,
0xaa0a4c5f, 0xdd0d7cc9,
- 0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3,
0xb966d409, 0xce61e49f,
- 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81,
0xb7bd5c3b, 0xc0ba6cad,
- 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af,
0x04db2615, 0x73dc1683,
- 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d,
0x0a00ae27, 0x7d079eb1,
- 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb,
0x196c3671, 0x6e6b06e7,
- 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9,
0x17b7be43, 0x60b08ed5,
- 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767,
0x3fb506dd, 0x48b2364b,
- 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55,
0x316e8eef, 0x4669be79,
- 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, 0xcc0c7795, 0xbb0b4703,
0x220216b9, 0x5505262f,
- 0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31,
0x2cd99e8b, 0x5bdeae1d,
- 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f,
0x72076785, 0x05005713,
- 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, 0xe5d5be0d,
0x7cdcefb7, 0x0bdbdf21,
- 0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b,
0x6fb077e1, 0x18b74777,
- 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69,
0x616bffd3, 0x166ccf45,
- 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7,
0x4969474d, 0x3e6e77db,
- 0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5,
0x47b2cf7f, 0x30b5ffe9,
- 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693,
0x54de5729, 0x23d967bf,
+ 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f,
0xe963a535, 0x9e6495a3,
+ 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd,
0xe7b82d07, 0x90bf1d91,
+ 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb,
0xf4d4b551, 0x83d385c7,
+ 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9,
0xfa0f3d63, 0x8d080df5,
+ 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, 0x3c03e4d1, 0x4b04d447,
0xd20d85fd, 0xa50ab56b,
+ 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75,
0xdcd60dcf, 0xabd13d59,
+ 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423,
0xcfba9599, 0xb8bda50f,
+ 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, 0x2f6f7c87, 0x58684c11,
0xc1611dab, 0xb6662d3d,
+ 0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f,
0x9fbfe4a5, 0xe8b8d433,
+ 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d,
0x91646c97, 0xe6635c01,
+ 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, 0x1b01a57b,
0x8208f4c1, 0xf50fc457,
+ 0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49,
0x8cd37cf3, 0xfbd44c65,
+ 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7,
0xa4d1c46d, 0xd3d6f4fb,
+ 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5,
0xaa0a4c5f, 0xdd0d7cc9,
+ 0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3,
0xb966d409, 0xce61e49f,
+ 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81,
0xb7bd5c3b, 0xc0ba6cad,
+ 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af,
0x04db2615, 0x73dc1683,
+ 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d,
0x0a00ae27, 0x7d079eb1,
+ 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb,
0x196c3671, 0x6e6b06e7,
+ 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9,
0x17b7be43, 0x60b08ed5,
+ 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767,
0x3fb506dd, 0x48b2364b,
+ 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55,
0x316e8eef, 0x4669be79,
+ 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, 0xcc0c7795, 0xbb0b4703,
0x220216b9, 0x5505262f,
+ 0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31,
0x2cd99e8b, 0x5bdeae1d,
+ 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f,
0x72076785, 0x05005713,
+ 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, 0xe5d5be0d,
0x7cdcefb7, 0x0bdbdf21,
+ 0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b,
0x6fb077e1, 0x18b74777,
+ 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69,
0x616bffd3, 0x166ccf45,
+ 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7,
0x4969474d, 0x3e6e77db,
+ 0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5,
0x47b2cf7f, 0x30b5ffe9,
+ 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693,
0x54de5729, 0x23d967bf,
0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1,
0x5a05df1b, 0x2d02ef8d
};

-void CRC::Process ( const void *_data, size_t _size)
+void CRC::Process(const void *_data, size_t _size)
{
m_crc = 0;
- const unsigned char* r = reinterpret_cast<const unsigned char*>(_data);
+ const unsigned char * r = reinterpret_cast<const unsigned char *>(_data);
m_crc = ~m_crc;
while (_size--)
m_crc = (m_crc >> 8) ^ crc_table[*r++ ^ (m_crc & 0xff)];
m_crc = ~m_crc;
}

-void CRC::ProcessFile ( const char *_fileName )
+void CRC::ProcessFile(const char *_fileName)
{
m_crc = 0;
- if ( !_fileName ) return;
- FILE *_file = fopen ( _fileName, "r" );
- if ( !_file ) return;
-
- char buffer[8192]; size_t bytesRead = 0;
- memset ( buffer, 0, sizeof(buffer) );
- while (( bytesRead = fread ( buffer, 1, 8192, _file ) ))
- {
+ if (!_fileName) return;
+ FILE *_file = fopen(_fileName, "r");
+ if (!_file) return;
+
+ char buffer[8192]; size_t bytesRead = 0;
+ memset(buffer, 0, sizeof(buffer));
+ while ((bytesRead = fread(buffer, 1, 8192, _file))) {
buffer[bytesRead] = 0;
- Process ( buffer, bytesRead );
- if ( bytesRead != 8192 )
+ Process(buffer, bytesRead);
+ if (bytesRead != 8192)
break;
}
- fclose ( _file );
+ fclose(_file);
}

Modified: trunk/tools/Build/crc.h
==============================================================================
--- trunk/tools/Build/crc.h (original)
+++ trunk/tools/Build/crc.h Fri Oct 17 20:19:35 2008
@@ -3,16 +3,16 @@

class CRC
{
-private:
- unsigned int m_crc;
+ private:
+ unsigned int m_crc;

-public:
- void Process ( const void *_data, size_t _size );
- void ProcessFile ( const char *_fileName );
- int GetCRC () const
- {
- return m_crc;
- }
+ public:
+ void Process(const void *_data, size_t _size);
+ void ProcessFile(const char *_fileName);
+ int GetCRC() const
+ {
+ return m_crc;
+ }
};

#endif

Reply all
Reply to author
Forward
0 new messages