Skip to content

Commit

Permalink
Converting from Subversion to Git.
Browse files Browse the repository at this point in the history
Signed-off-by: Steven Noonan <steven@uplinklabs.net>
  • Loading branch information
tycho committed Oct 18, 2008
0 parents commit 61f47a6
Show file tree
Hide file tree
Showing 225 changed files with 33,026 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
CMakeCache.txt
CMakeFiles
cmake_install.cmake
Makefile
159 changes: 159 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
VERSION 0.7.2 (r???)
* Old (and buggy) build system removed in favor of CMake.
* Fixed a few memory leaks in CPUID.
* Added support for DEC Alpha and Sun SPARC.
* Documentation is now more verbose and has been clarified in some areas.
* Added an optional preprocessor definition "DISABLE_DEPRECATED_CODE" to disable MD2, slow sorts, etc.
* CPUID test application now reports any oddities (such as: the processor is multicore but only 1 virtual processor was detected).
* Added 'flushArray' and 'flush' to DArray to allow for simpler deletion of contained data.
* Stopwatch::Clocks() removed because it was too platform-specific and only Windows seemed to have decent support.
* HashTable is now usable and is no longer considered experimental.
* A major AVLTree::findRecursive() bug (in which the result might not actually be found) has been corrected.
* A major RedBlackTree::findRecursive() bug (in which the result might not actually be found) has been corrected.
* A major SplayTree::findRecursive() bug (in which the result might not actually be found) has been corrected.
* Test suite is now a bit more zealous about checking everything.

VERSION 0.7.1 (r768)
* Added Objective-C support via the NSApplicationMain entry point. Define COCOA_APPLICATION in universal_include.h to use.
* In-progress connections now report EINPROGRESS instead of EWOULDBLOCK.
* TCPSockets generally overhauled after lots of practical use of them in ARC++.
* FG_YELLOW now exists as an alias of FG_BROWN | FG_INTENSITY.
* GenerateBuildNumber.exe is now statically linked.
* Stopwatch now calls Start() on initialization (largely for cases such as static instantiations of the class).
* Removed an extra semicolon which caused compiler errors on newer versions of GCC.
* Removed the largely unimplemented "ban" system in sockets.
* Renamed the internal strdup macro to cc_strdup to avoid conflicts.
* Fixed a critical bug in RedBlackTree where a null pointer is dereferenced.
* Fixed a bug in AVLTree where the size may be incorrectly reported.
* Fixed a few compiler warnings.
* Fixed ThreadSleep on Mac OS X.
* Coding style changes implemented in the uncrustify config.

VERSION 0.7.0 (r684)
* Added several checksum methods:
- MD2
- MD4
- MD5
- SHA-1
- SHA-256
- SHA-512
- Tiger
* Nintendo DS homebrew support added (compile with 'make BUILDFORNDS=1')
- Copyright changed to fit Nintendo DS screen.
- Cross-compiling is possible with devkitPro.
- Console class supports libnds console features.
* Fixed ANSI reset color code.
* GenPrime algorithm updated slightly to improve speed.
* SplayTree can't handle duplicate keys properly, so 1:1 compatibility with AVLTree/RedBlackTree has been broken to disable certain duplicate key handling functions.
* CPUID updated with December 2007 Intel CPUID specification.
* Rare bug in AVLTree corrected.
* Renamed TextReader and TextWriter to FileReader and FileWriter, respectively.

VERSION 0.6.6 (r593)
* Visual Studio 2008 support added.
* More example projects added.
* CPUID now detects AMD cache descriptors.
* ConvertToDArray and ConvertIndexToDArray functions optimized, deprecation notice removed
* Fixed Stopwatch on FreeBSD, NetBSD and OpenBSD
* Added AVLTree, SplayTree, ShellSort, InsertionSort, and BubbleSort (the last two for educational purposes only)
* Added a basic HashTable implementation.
* AVLTree, RedBlackTree, and SplayTree have close-to-identical (if not perfectly identical) APIs.
* Cleaned up some 'using namespace' statements that were causing hard-to-detect errors.
* Many, many minor fixes.
* Doxygen config updated to v1.5.4

VERSION 0.6.5 (r427)
* CrissCross::Data::Compare now can compare C-style strings.
* x64 target added for Visual Studio 2005 projects.
* New crisscross/crisscross.h added which basically includes every common CrissCross header.
* RedBlackTree now works with char* string keys.
* No longer needlessly recompiles on Mac OS X (build_number.h regeneration caused a recompile).
* QuickSort::Sort is now marked deprecated with _CC_DEPRECATE_SLOW as a warning to those who use it.
* CoreIOWriter had a few functions which had std::string passed by value rather than by reference.
* DStack::peek() function added.
* FastestSort and MemoryEfficientSort aliases added by request.
* BTree alias for RedBlackTree added.
* Cleaned data structure function names a bit (getData() is now simply get(), etc).
* Added compatibility with Tosser data structure library, allowing CrissCross to be used with the Onlink project.
* Added XCrashReports support for release builds.
* _CC_DEPRECATE_SLOW changed for Windows builds to indicate severity of the slowdown.
* Improved speed and size of CoreAssert and made it more CrissCross-like for its stderr output.
* Major time-critical Stopwatch functions are now inlined (Start/Stop functions).
* Corrected an error with ThreadSleep which caused it to sleep forever if a value less than zero was passed to it.
* crisscross/sort.h is now all that needs to be included for use of CombSort, QuickSort, and HeapSort.
* Disabled core/thread detection in CPUID, because of varying results (can't yet interpret what they mean.
* Added a few more cache descriptors to CPUID (Core 2 related ones).

VERSION 0.6.0
* CrissCross test suite added (tests a majority of the features).
* Added QuickSort and CombSort.
* Doxygen config updated to v1.5.2
* Enabled man page generation on Doxygen config.
* Documentation updated and clarified.
* Fastdep and CCDV removed.
* New build number system added (based on SVN revision number).
* Visual C++ 2003 project added.
* XCode project added.
* Visual C++ 6.0 project removed.
* Headers in all files reduced in size.
* New CoreIOReader ReadLine added.
* Flush added in CoreIOWriter::Write (some platforms wouldn't display written data until a newline).
* Winsock 2.2 is now used in Windows builds (instead of 2.0)
* CoreSocket::Close no longer attempts to close an invalid socket (which would cause errno to give an error value).
* Various UDPSocket functions no longer return false errors.
* SDL_APPLICATION preprocessor definition available for SDL applications with the SDLmain entry point.
* Windows memory leak checking improved and no longer causes weird crashes.
* Switched to STL for memory leak check file parsing.
* Stale ENABLE_DEBUGLOG #ifdefs removed.
* Option to disable C++ exception handler (decreases executable size among other things) available now.
* CrissCross::Data::Compare is now a template function.
* CoreMutex is now called Mutex.
* CoreConsole is now called Console.
* DArray, LList and RedBlackTree function calls are converted to a more standard naming system.
* A dangerous flaw in the Stopwatch class causing a crash and a bad compile was corrected.
* Platform detection improved and cleaned up.
* Made several changes for GCC 4.3.0 (SVN) compatibility.
* Gentoo ebuild is available on uplinklabs.net portage overlay.

VERSION 0.5.2
* Split CoreIO into CoreIOReader and CoreIOWriter.
* CoreConsole now accepts input.
* All unicode support removed until it is further researched.
* Several documentation errors were corrected.
* CoreIOReader and CoreIOWriter now check to see if the file is open before attempting read or write operations.
* Makefiles improved to allow 'make -j#' builds.
* Added Visual C++ 6 project files, but there's no guarantee they work perfectly.
* Moved data structures to the main include directory.
* Including CrissCross files with #include <crisscross/foo> now works properly without adding -I/usr/include/crisscross to the GCC command line.
* Fixed CCDV to say 'Compiling' rather than 'Linking' for precompiled headers.
* CPUID now detects SSSE3 (Supplemental SSE3 instructions).
* CPUID now properly detects CMP (Core Multi Processing, a.k.a. dual core)
* Sockets heavily edited, allowing for better error handling.
* TCPSocket::Accept() syntax changed.

VERSION 0.5.1
* Fixed Makefiles to work on any previously non-working platforms (OS X, mainly).
* Disabled CPUID on BSD. BSD lacks affinity control, and therefore doesn't work.

VERSION 0.5.0 ( MILESTONE 2, Codename "Loki" )
* Cleanup
Much of the existing code was disorganized, and was re-categorized into other namespaces.
* Documentation
o All namespaces
o Stopwatch class
o LList class
o RedBlackTree class
Some classes that showed up in documentation are now hidden.
o CrissCross::System::param
o CrissCross::Data::LListItem< T >
o CrissCross::Data::RedBlackTree< dataType, keyType >::nodeType
* Conventionalization
Existing code is now consistent in it's conventions.
* Bugfixes
Bugs discovered during the v0.4.x testing cycle have been corrected (details unnecessary for pre-release code).
* Examples
v0.5.0 is the first public release. Examples are now provided for reference.
* Cross-Platform Fixes
Functions in CoreConsole that previously did nothing on non-Windows platforms now do what they should.
* UTF-8 Support ( partially implemented and is untested)
WCHAR and so on need to be supported. We're working on this right now, so please don't #define ENABLE_UNICODE unless you're brave.
177 changes: 177 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
cmake_minimum_required (VERSION 2.4)

if(COMMAND cmake_policy)
cmake_policy(VERSION 2.6)
endif(COMMAND cmake_policy)

project (CrissCross)

set(CMAKE_BUILD_TYPE RelWithDebInfo)

# - Try to find precompiled headers support for GCC 3.4 and 4.x
# Once done this will define:
#
# Variable:
# PCHSupport_FOUND
#
# Macro:
# ADD_PRECOMPILED_HEADER

IF(CMAKE_COMPILER_IS_GNUCXX)
EXEC_PROGRAM(
${CMAKE_CXX_COMPILER}
ARGS --version
OUTPUT_VARIABLE _compiler_output)
STRING(REGEX REPLACE ".* ([0-9]\\.[0-9]\\.[0-9]) .*" "\\1"
gcc_compiler_version ${_compiler_output})
#MESSAGE("GCC Version: ${gcc_compiler_version}")
IF(gcc_compiler_version MATCHES "4\\.[0-9]\\.[0-9]")
SET(PCHSupport_FOUND TRUE)
ELSE(gcc_compiler_version MATCHES "4\\.[0-9]\\.[0-9]")
IF(gcc_compiler_version MATCHES "3\\.4\\.[0-9]")
SET(PCHSupport_FOUND TRUE)
ENDIF(gcc_compiler_version MATCHES "3\\.4\\.[0-9]")
ENDIF(gcc_compiler_version MATCHES "4\\.[0-9]\\.[0-9]")
ENDIF(CMAKE_COMPILER_IS_GNUCXX)

MACRO(ADD_PRECOMPILED_HEADER _targetName _header _source)
IF(MSVC)
STRING(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}/" "" _headerName "${_header}")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Yu\"${_headerName}\"")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Yu\"${_headerName}\"")
GET_FILENAME_COMPONENT(_sourceFile ${_source} NAME)
MESSAGE(STATUS "${_sourceFile}")
set_source_files_properties("${_sourceFile}"
COMPILE_FLAGS "/Yc\"${_headerName}\""
)
ENDIF(MSVC)
IF(CMAKE_COMPILER_IS_GNUCXX AND NOT XCODE)
IF(NOT CMAKE_BUILD_TYPE)
MESSAGE(FATAL_ERROR
"This is the ADD_PRECOMPILED_HEADER macro. "
"You must set CMAKE_BUILD_TYPE!"
)
ENDIF(NOT CMAKE_BUILD_TYPE)

GET_FILENAME_COMPONENT(_name ${_header} NAME)
GET_FILENAME_COMPONENT(_path ${_header} PATH)
SET(_outdir "${CMAKE_CURRENT_BINARY_DIR}/${_name}.gch")
SET(_output "${_outdir}/${CMAKE_BUILD_TYPE}.c++")

ADD_CUSTOM_COMMAND(
OUTPUT ${_outdir}
COMMAND mkdir ${_outdir} # TODO: {CMAKE_COMMAND} -E ...
)
#MAKE_DIRECTORY(${_outdir})

STRING(TOUPPER "CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE}" _flags_var_name)
SET(_compile_FLAGS ${${_flags_var_name}})
GET_DIRECTORY_PROPERTY(_directory_flags INCLUDE_DIRECTORIES)

SET(_CMAKE_CURRENT_BINARY_DIR_included_before_path FALSE)
FOREACH(item ${_directory_flags})
IF(${item} STREQUAL ${_path} AND NOT _CMAKE_CURRENT_BINARY_DIR_included_before_path )
MESSAGE(FATAL_ERROR
"This is the ADD_PRECOMPILED_HEADER macro. "
"CMAKE_CURRENT_BINARY_DIR has to mentioned at INCLUDE_DIRECTORIES's argument list before ${_path}, where ${_name} is located"
)
ENDIF(${item} STREQUAL ${_path} AND NOT _CMAKE_CURRENT_BINARY_DIR_included_before_path )

IF(${item} STREQUAL ${CMAKE_CURRENT_BINARY_DIR})
SET(_CMAKE_CURRENT_BINARY_DIR_included_before_path TRUE)
ENDIF(${item} STREQUAL ${CMAKE_CURRENT_BINARY_DIR})

LIST(APPEND _compile_FLAGS "-I${item}")
ENDFOREACH(item)

GET_DIRECTORY_PROPERTY(_directory_flags DEFINITIONS)
LIST(APPEND _compile_FLAGS ${_directory_flags})
LIST(APPEND _compile_FLAGS ${CMAKE_CXX_FLAGS} )

SEPARATE_ARGUMENTS(_compile_FLAGS)
#MESSAGE("_compiler_FLAGS: ${_compiler_FLAGS}")
#message(${_compile_FLAGS} )
#message("COMMAND ${CMAKE_CXX_COMPILER} ${_compile_FLAGS} -x c++-header -o ${_output} ${_header}")

ADD_CUSTOM_COMMAND(
OUTPUT ${_output}
COMMAND ${CMAKE_CXX_COMPILER}
${_compile_FLAGS}
-x c++-header
-o ${_output}
${_header}
DEPENDS ${_header} ${_outdir}
)
ADD_CUSTOM_TARGET(${_targetName}_gch
DEPENDS ${_output}
)
ADD_DEPENDENCIES(${_targetName} ${_targetName}_gch)
ADD_DEPENDENCIES(${_targetName}_gch BuildNumber)
SET_TARGET_PROPERTIES(${_targetName}
PROPERTIES
COMPILE_FLAGS "-include ${_header} -Winvalid-pch"
)
ENDIF(CMAKE_COMPILER_IS_GNUCXX AND NOT XCODE)
ENDMACRO(ADD_PRECOMPILED_HEADER)

MACRO(ADD_FLAG where flag)
SET(${where} "${flag} ${${where}}")
ENDMACRO(ADD_FLAG)

if(CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++98 -ggdb -fno-rtti -fno-exceptions -rdynamic -Wall -Wno-long-long -pedantic")
endif(CMAKE_COMPILER_IS_GNUCXX)

# settings for Microsoft Visual C
IF(MSVC)
IF(NOT WITH_SHARED_LIBS)
IF(CMAKE_GENERATOR STREQUAL "Visual Studio 7" OR CMAKE_GENERATOR STREQUAL "Visual Studio 7 .NET 2003")
SET(CMAKE_C_FLAGS "/nologo /W3 /Gy /Gm /G6 /GS- /Zi")
SET(CMAKE_C_FLAGS_DEBUG "/MTd /Zi /Od")
SET(CMAKE_C_FLAGS_RELEASE "/MT /O2 /Ot")
SET(CMAKE_C_FLAGS_MINSIZEREL "/MT /O2 /Os")
SET(CMAKE_C_FLAGS_RELWITHDEBINFO "/MTd /Od")
ENDIF(CMAKE_GENERATOR STREQUAL "Visual Studio 7" OR CMAKE_GENERATOR STREQUAL "Visual Studio 7 .NET 2003")
IF(CMAKE_GENERATOR STREQUAL "Visual Studio 8 2005" OR CMAKE_GENERATOR STREQUAL "Visual Studio 9 2008")
SET(CMAKE_C_FLAGS "/nologo /W3 /Gy /Gm /GS- /Zi")
SET(CMAKE_C_FLAGS_DEBUG "/MTd /Od")
SET(CMAKE_C_FLAGS_RELEASE "/MT /O2 /Ot")
SET(CMAKE_C_FLAGS_MINSIZEREL "/MT /O2 /Os")
SET(CMAKE_C_FLAGS_RELWITHDEBINFO "/MTd /Od")
ENDIF(CMAKE_GENERATOR STREQUAL "Visual Studio 8 2005" OR CMAKE_GENERATOR STREQUAL "Visual Studio 9 2008")
ENDIF(NOT WITH_SHARED_LIBS)
ENDIF(MSVC)
# settings for Microsoft Visual C++
IF(MSVC)
IF(NOT WITH_SHARED_LIBS)
IF(CMAKE_GENERATOR STREQUAL "Visual Studio 7" OR CMAKE_GENERATOR STREQUAL "Visual Studio 7 .NET 2003")
SET(CMAKE_CXX_FLAGS "/nologo /W3 /Gy /G6 /Gm /GS- /Zi /EHa")
SET(CMAKE_CXX_FLAGS_DEBUG "/MTd /Od")
SET(CMAKE_CXX_FLAGS_RELEASE "/MT /O2 /Ot")
SET(CMAKE_CXX_FLAGS_MINSIZEREL "/MT /O2 /Os")
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MTd /Od")
ENDIF(CMAKE_GENERATOR STREQUAL "Visual Studio 7" OR CMAKE_GENERATOR STREQUAL "Visual Studio 7 .NET 2003")
IF(CMAKE_GENERATOR STREQUAL "Visual Studio 8 2005" OR CMAKE_GENERATOR STREQUAL "Visual Studio 9 2008")
SET(CMAKE_CXX_FLAGS "/nologo /W3 /Gy /Gm /GS- /Zi /EHa")
SET(CMAKE_CXX_FLAGS_DEBUG "/MTd /Od")
SET(CMAKE_CXX_FLAGS_RELEASE "/MT /O2 /Ot")
SET(CMAKE_CXX_FLAGS_MINSIZEREL "/MT /O2 /Os")
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MTd /Od")
ENDIF(CMAKE_GENERATOR STREQUAL "Visual Studio 8 2005" OR CMAKE_GENERATOR STREQUAL "Visual Studio 9 2008")
ENDIF(NOT WITH_SHARED_LIBS)
ENDIF(MSVC)

include_directories (
${CrissCross_BINARY_DIR}
${CrissCross_BINARY_DIR}/source
${CrissCross_SOURCE_DIR}/source
.)

add_subdirectory (source)
add_subdirectory (TestSuite)
add_subdirectory (examples)

IF(NOT MSVC)
get_target_property (tspath TestSuite LOCATION)
add_custom_target (check COMMAND ${tspath} DEPENDS TestSuite)
ENDIF(NOT MSVC)
10 changes: 10 additions & 0 deletions COPYING
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Copyright (c) 2006-2008 Steven Noonan <steven@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:

* 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.
Loading

0 comments on commit 61f47a6

Please sign in to comment.