]> git.sesse.net Git - stockfish/commitdiff
Some code and comment cleanup
authorStéphane Nicolet <cassio@free.fr>
Sun, 25 Oct 2015 11:07:22 +0000 (12:07 +0100)
committerJoona Kiiski <joona@zoox.com>
Thu, 29 Oct 2015 15:28:59 +0000 (15:28 +0000)
- Remove all references to split points
- Some grammar and spelling fixes

No Functional change

Resolves #478

src/misc.cpp
src/position.cpp
src/position.h
src/search.cpp
src/search.h
src/thread.cpp
src/thread.h

index 04c3c939f76d98229db4c570e089f92375657d31..bb51cf453437e86fa88d3676db62da26f7192880 100644 (file)
@@ -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
 
 /// 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) {}
 
 
   Tie(streambuf* b, streambuf* l) : buf(b), logBuf(l) {}
 
index c221c749e2fba989646170b9f62e68b038457e37..c432bb90e9f51fcf93d7f246a04b98916aeb4366 100644 (file)
@@ -84,7 +84,7 @@ PieceType min_attacker<KING>(const Bitboard*, Square, Bitboard, Bitboard&, Bitbo
 } // namespace
 
 
 } // namespace
 
 
-/// CheckInfo c'tor
+/// CheckInfo constructor
 
 CheckInfo::CheckInfo(const Position& pos) {
 
 
 CheckInfo::CheckInfo(const Position& pos) {
 
index 0b2a0cca4e0f9afab86bbf667f0e4160947a6bb8..0d34aba44fe1c9e8fe74ba71dc4532e03f975cbc 100644 (file)
@@ -37,8 +37,8 @@ namespace PSQT {
   void init();
 }
 
   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 {
 
 
 struct CheckInfo {
 
index 902ba0fc6915769c157ef096f6b83340049794db..77c5b2d3b8829a42ff31e75d743f9fe282d3d919 100644 (file)
@@ -539,12 +539,7 @@ void Thread::search(bool isMainThread) {
 
 namespace {
 
 
 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 <NodeType NT>
   Value search(Position& pos, Stack* ss, Value alpha, Value beta, Depth depth, bool cutNode) {
 
   template <NodeType NT>
   Value search(Position& pos, Stack* ss, Value alpha, Value beta, Depth depth, bool cutNode) {
index 740063b9a59c5d4ff1c4db19bd18416ac4b32e58..6248cd0193310bf4c577f1bfd9d248230c4c326d 100644 (file)
@@ -29,8 +29,6 @@
 #include "position.h"
 #include "types.h"
 
 #include "position.h"
 #include "types.h"
 
-struct SplitPoint;
-
 namespace Search {
 
 /// Stack struct keeps track of the information we need to remember from nodes
 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 {
 /// its own array of Stack objects, indexed by the current ply.
 
 struct Stack {
-  SplitPoint* splitPoint;
   Move* pv;
   int ply;
   Move currentMove;
   Move* pv;
   int ply;
   Move currentMove;
index eb64f7ee372151ec5966d08477f9b9a040b3ef78..e3194a23eadbb6b210f696ce12853a850836de1c 100644 (file)
@@ -33,8 +33,8 @@ extern void check_time();
 
 namespace {
 
 
 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<typename T> T* new_thread() {
  // when start_routine (and hence virtual idle_loop) is called and when joining.
 
  template<typename T> T* new_thread() {
@@ -83,8 +83,8 @@ void ThreadBase::wait_while(std::atomic<bool>& 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() {
 
 
 Thread::Thread() {
 
@@ -170,9 +170,9 @@ void MainThread::join() {
 
 
 // ThreadPool::init() is called at startup to create and launch requested threads,
 
 
 // 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() {
 
 
 void ThreadPool::init() {
 
@@ -183,7 +183,7 @@ void ThreadPool::init() {
 
 
 // ThreadPool::exit() terminates the threads before the program exits. Cannot be
 
 
 // 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() {
 
 
 void ThreadPool::exit() {
 
index abb7a22333800f4aa2d648290640f71261e749ab..39753f40cfdfe4e2f3397bff2bca5c6c26f922e7 100644 (file)
@@ -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.
 
 /// 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,
 
 
 /// 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<Thread*> {
 
 /// All the access to shared thread data is done through this class.
 
 struct ThreadPool : public std::vector<Thread*> {
 
-  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<MainThread*>(at(0)); }
   void read_uci_options();
 
   MainThread* main() { return static_cast<MainThread*>(at(0)); }
   void read_uci_options();