From: Stéphane Nicolet Date: Sun, 25 Oct 2015 11:07:22 +0000 (+0100) Subject: Some code and comment cleanup X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=80d7556af785f57a4f90d121c57c9c2f85a2963e Some code and comment cleanup - Remove all references to split points - Some grammar and spelling fixes No Functional change Resolves #478 --- diff --git a/src/misc.cpp b/src/misc.cpp index 04c3c939..bb51cf45 100644 --- a/src/misc.cpp +++ b/src/misc.cpp @@ -39,7 +39,7 @@ const string Version = ""; /// usual I/O functionality, all without changing a single line of code! /// Idea from http://groups.google.com/group/comp.lang.c++/msg/1d941c0f26ea0d81 -struct Tie: public streambuf { // MSVC requires splitted streambuf for cin and cout +struct Tie: public streambuf { // MSVC requires split streambuf for cin and cout Tie(streambuf* b, streambuf* l) : buf(b), logBuf(l) {} diff --git a/src/position.cpp b/src/position.cpp index c221c749..c432bb90 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -84,7 +84,7 @@ PieceType min_attacker(const Bitboard*, Square, Bitboard, Bitboard&, Bitbo } // namespace -/// CheckInfo c'tor +/// CheckInfo constructor CheckInfo::CheckInfo(const Position& pos) { diff --git a/src/position.h b/src/position.h index 0b2a0cca..0d34aba4 100644 --- a/src/position.h +++ b/src/position.h @@ -37,8 +37,8 @@ namespace PSQT { void init(); } -/// CheckInfo struct is initialized at c'tor time and keeps info used to detect -/// if a move gives check. +/// CheckInfo struct is initialized at constructor time and keeps info used to +/// detect if a move gives check. struct CheckInfo { diff --git a/src/search.cpp b/src/search.cpp index 902ba0fc..77c5b2d3 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -539,12 +539,7 @@ void Thread::search(bool isMainThread) { namespace { - // search<>() is the main search function for both PV and non-PV nodes and for - // normal and SplitPoint nodes. When called just after a split point the search - // is simpler because we have already probed the hash table, done a null move - // search, and searched the first move before splitting, so we don't have to - // repeat all this work again. We also don't need to store anything to the hash - // table here: This is taken care of after we return from the split point. + // search<>() is the main search function for both PV and non-PV nodes template Value search(Position& pos, Stack* ss, Value alpha, Value beta, Depth depth, bool cutNode) { diff --git a/src/search.h b/src/search.h index 740063b9..6248cd01 100644 --- a/src/search.h +++ b/src/search.h @@ -29,8 +29,6 @@ #include "position.h" #include "types.h" -struct SplitPoint; - namespace Search { /// Stack struct keeps track of the information we need to remember from nodes @@ -38,7 +36,6 @@ namespace Search { /// its own array of Stack objects, indexed by the current ply. struct Stack { - SplitPoint* splitPoint; Move* pv; int ply; Move currentMove; diff --git a/src/thread.cpp b/src/thread.cpp index eb64f7ee..e3194a23 100644 --- a/src/thread.cpp +++ b/src/thread.cpp @@ -33,8 +33,8 @@ extern void check_time(); namespace { - // Helpers to launch a thread after creation and joining before delete. Must be - // outside Thread c'tor and d'tor because the object must be fully initialized + // Helpers to launch a thread after creation and joining before delete. Outside the + // Thread constructor and destructor because the object must be fully initialized // when start_routine (and hence virtual idle_loop) is called and when joining. template T* new_thread() { @@ -83,8 +83,8 @@ void ThreadBase::wait_while(std::atomic& condition) { } -// Thread c'tor makes some init but does not launch any execution thread that -// will be started only when c'tor returns. +// Thread constructor makes some init but does not launch any execution thread, +// which will be started only when the constructor returns. Thread::Thread() { @@ -170,9 +170,9 @@ void MainThread::join() { // ThreadPool::init() is called at startup to create and launch requested threads, -// that will go immediately to sleep. We cannot use a c'tor because Threads is a -// static object and we need a fully initialized engine at this point due to -// allocation of Endgames in Thread c'tor. +// that will go immediately to sleep. We cannot use a constructor because Threads +// is a static object and we need a fully initialized engine at this point due to +// allocation of Endgames in the Thread constructor. void ThreadPool::init() { @@ -183,7 +183,7 @@ void ThreadPool::init() { // ThreadPool::exit() terminates the threads before the program exits. Cannot be -// done in d'tor because threads must be terminated before freeing us. +// done in destructor because threads must be terminated before freeing us. void ThreadPool::exit() { diff --git a/src/thread.h b/src/thread.h index abb7a223..39753f40 100644 --- a/src/thread.h +++ b/src/thread.h @@ -57,8 +57,8 @@ struct ThreadBase : public std::thread { }; -/// Thread struct keeps together all the thread related stuff like locks, state -/// and especially split points. We also use per-thread pawn and material hash +/// Thread struct keeps together all the thread related stuff like locks, state, +/// history and countermoves tables. We also use per-thread pawn and material hash /// tables so that once we get a pointer to an entry its life time is unlimited /// and we don't have to care about someone changing the entry under our feet. @@ -106,13 +106,13 @@ struct TimerThread : public ThreadBase { /// ThreadPool struct handles all the threads related stuff like init, starting, -/// parking and, most importantly, launching a slave thread at a split point. +/// parking and, most importantly, launching a thread. /// All the access to shared thread data is done through this class. struct ThreadPool : public std::vector { - void init(); // No c'tor and d'tor, threads rely on globals that should be - void exit(); // initialized and are valid during the whole thread lifetime. + void init(); // No constructor and destructor, threads rely on globals that should + void exit(); // be initialized and valid during the whole thread lifetime. MainThread* main() { return static_cast(at(0)); } void read_uci_options();