From a8af78c833458adaea64b8fc1035fafbdf4ba083 Mon Sep 17 00:00:00 2001 From: Jerry Donald Date: Mon, 2 Dec 2013 23:47:38 +0100 Subject: [PATCH] Another round of spelling fixes And also renamed a loop variable while there. No functional change. --- src/bitboard.cpp | 6 +++--- src/evaluate.cpp | 8 ++++---- src/movepick.cpp | 2 +- src/pawns.cpp | 2 +- src/position.cpp | 12 ++++++------ src/search.cpp | 2 +- src/thread.cpp | 4 ++-- src/thread.h | 2 +- src/timeman.cpp | 2 +- src/timeman.h | 2 +- src/types.h | 6 +++--- 11 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/bitboard.cpp b/src/bitboard.cpp index 4847fcf5..19599a51 100644 --- a/src/bitboard.cpp +++ b/src/bitboard.cpp @@ -198,9 +198,9 @@ void Bitboards::init() { for (Color c = WHITE; c <= BLACK; ++c) for (PieceType pt = PAWN; pt <= KING; ++pt) for (Square s = SQ_A1; s <= SQ_H8; ++s) - for (int k = 0; steps[pt][k]; ++k) + for (int i = 0; steps[pt][i]; ++i) { - Square to = s + Square(c == WHITE ? steps[pt][k] : -steps[pt][k]); + Square to = s + Square(c == WHITE ? steps[pt][i] : -steps[pt][i]); if (is_ok(to) && square_distance(s, to) < 3) StepAttacksBB[make_piece(c, pt)][s] |= to; @@ -256,7 +256,7 @@ namespace { Bitboard pick_random(RKISS& rk, int booster) { // Values s1 and s2 are used to rotate the candidate magic of a - // quantity known to be the optimal to quickly find the magics. + // quantity known to be optimal to quickly find the magics. int s1 = booster & 63, s2 = (booster >> 6) & 63; Bitboard m = rk.rand(); diff --git a/src/evaluate.cpp b/src/evaluate.cpp index cf033317..15fce527 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -127,8 +127,8 @@ namespace { S( 25, 41), S( 25, 41), S(25, 41), S(25, 41) } }; - // Outpost[PieceType][Square] contains bonuses of knights and bishops, indexed - // by piece type and square (from white's point of view). + // Outpost[PieceType][Square] contains bonuses for knights and bishops outposts, + // indexed by piece type and square (from white's point of view). const Value Outpost[][SQUARE_NB] = { { // A B C D E F G H @@ -445,7 +445,7 @@ Value do_evaluate(const Position& pos) { } - // evaluate_outposts() evaluates bishop and knight outposts squares + // evaluate_outposts() evaluates bishop and knight outpost squares template Score evaluate_outposts(const Position& pos, EvalInfo& ei, Square s) { @@ -764,7 +764,7 @@ Value do_evaluate(const Position& pos) { // Add bonus according to type of attacked enemy piece and to the // type of attacking piece, from knights to queens. Kings are not - // considered because are already handled in king evaluation. + // considered because they are already handled in king evaluation. if (weakEnemies) for (PieceType pt1 = KNIGHT; pt1 < KING; ++pt1) { diff --git a/src/movepick.cpp b/src/movepick.cpp index ec36edfe..e2ae7d95 100644 --- a/src/movepick.cpp +++ b/src/movepick.cpp @@ -284,7 +284,7 @@ void MovePicker::generate_next() { /// next_move() is the most important method of the MovePicker class. It returns -/// a new pseudo legal move every time is called, until there are no more moves +/// a new pseudo legal move every time it is called, until there are no more moves /// left. It picks the move with the biggest score from a list of generated moves /// taking care not returning the ttMove if has already been searched previously. template<> diff --git a/src/pawns.cpp b/src/pawns.cpp index d9cfe409..04ae0153 100644 --- a/src/pawns.cpp +++ b/src/pawns.cpp @@ -188,7 +188,7 @@ namespace { namespace Pawns { -/// init() initializes some tables by formula instead of hard-code their values +/// init() initializes some tables by formula instead of hard-coding their values void init() { diff --git a/src/position.cpp b/src/position.cpp index 6a5a5777..c4c6389d 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -56,7 +56,7 @@ Key Position::exclusion_key() const { return st->key ^ Zobrist::exclusion;} namespace { -// min_attacker() is an helper function used by see() to locate the least +// min_attacker() is a helper function used by see() to locate the least // valuable attacker for the side to move, remove the attacker we just found // from the bitboards and scan for new X-ray attacks behind it. @@ -297,7 +297,7 @@ void Position::set(const string& fenStr, bool isChess960, Thread* th) { } -/// Position::set_castling_flag() is an helper function used to set castling +/// Position::set_castling_flag() is a helper function used to set castling /// flags given the corresponding color and the rook starting square. void Position::set_castling_flag(Color c, Square rfrom) { @@ -415,9 +415,9 @@ const string Position::pretty(Move move) const { } -/// Position:hidden_checkers() returns a bitboard of all pinned / discovery check +/// Position:hidden_checkers() returns a bitboard of all pinned / discovered check /// pieces, according to the call parameters. Pinned pieces protect our king and -/// discovery check pieces attack the enemy king. +/// discovered check pieces attack the enemy king. Bitboard Position::hidden_checkers(Square ksq, Color c, Color toMove) const { @@ -536,7 +536,7 @@ bool Position::pseudo_legal(const Move m) const { return false; // We have already handled promotion moves, so destination - // cannot be on the 8/1th rank. + // cannot be on the 8th/1st rank. if (rank_of(to) == RANK_8 || rank_of(to) == RANK_1) return false; @@ -873,7 +873,7 @@ void Position::do_move(Move m, StateInfo& newSt, const CheckInfo& ci, bool moveI if (ci.checkSq[pt] & to) st->checkersBB |= to; - // Discovery checks + // Discovered checks if (ci.dcCandidates && (ci.dcCandidates & from)) { if (pt != ROOK) diff --git a/src/search.cpp b/src/search.cpp index 630c8ea2..3d154889 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -359,7 +359,7 @@ namespace { RootMoves[i].insert_pv_in_tt(pos); // If search has been stopped break immediately. Sorting and - // writing PV back to TT is safe becuase RootMoves is still + // writing PV back to TT is safe because RootMoves is still // valid, although it refers to previous iteration. if (Signals.stop) break; diff --git a/src/thread.cpp b/src/thread.cpp index dc506863..e495dc03 100644 --- a/src/thread.cpp +++ b/src/thread.cpp @@ -161,7 +161,7 @@ bool Thread::cutoff_occurred() const { // thread 'master' at a split point. An obvious requirement is that thread must // be idle. With more than two threads, this is not sufficient: If the thread is // the master of some split point, it is only available as a slave to the slaves -// which are busy searching the split point at the top of slaves split point +// which are busy searching the split point at the top of slave's split point // stack (the "helpful master concept" in YBWC terminology). bool Thread::available_to(const Thread* master) const { @@ -181,7 +181,7 @@ bool Thread::available_to(const Thread* master) const { // init() is called at startup to create and launch requested threads, that will // go immediately to sleep due to 'sleepWhileIdle' set to true. We cannot use -// a c'tor becuase Threads is a static object and we need a fully initialized +// 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. void ThreadPool::init() { diff --git a/src/thread.h b/src/thread.h index 040b8727..dc8418dc 100644 --- a/src/thread.h +++ b/src/thread.h @@ -157,7 +157,7 @@ struct TimerThread : public ThreadBase { struct ThreadPool : public std::vector { void init(); // No c'tor and d'tor, threads rely on globals that should - void exit(); // be initialized and valid during the whole thread lifetime. + void exit(); // be initialized and are valid during the whole thread lifetime. MainThread* main() { return static_cast((*this)[0]); } void read_uci_options(); diff --git a/src/timeman.cpp b/src/timeman.cpp index d624dfb2..7c3efb35 100644 --- a/src/timeman.cpp +++ b/src/timeman.cpp @@ -108,7 +108,7 @@ void TimeManager::init(const Search::LimitsType& limits, int currentPly, Color u int minThinkingTime = Options["Minimum Thinking Time"]; int slowMover = Options["Slow Mover"]; - // Initialize to maximum values but unstablePVExtraTime that is reset + // Initialize all to maximum values but unstablePVExtraTime that is reset unstablePVExtraTime = 0; optimumSearchTime = maximumSearchTime = limits.time[us]; diff --git a/src/timeman.h b/src/timeman.h index 92ab0e7b..3ee7b319 100644 --- a/src/timeman.h +++ b/src/timeman.h @@ -21,7 +21,7 @@ #define TIMEMAN_H_INCLUDED /// The TimeManager class computes the optimal time to think depending on the -/// maximum available time, the move game number and other parameters. +/// maximum available time, the game move number and other parameters. class TimeManager { public: diff --git a/src/types.h b/src/types.h index e0760ded..2766cb33 100644 --- a/src/types.h +++ b/src/types.h @@ -249,14 +249,14 @@ enum Score { inline Score make_score(int mg, int eg) { return Score((mg << 16) + eg); } -/// Extracting the signed lower and upper 16 bits it not so trivial because +/// Extracting the signed lower and upper 16 bits is not so trivial because /// according to the standard a simple cast to short is implementation defined /// and so is a right shift of a signed integer. inline Value mg_value(Score s) { return Value(((s + 0x8000) & ~0xffff) / 0x10000); } /// On Intel 64 bit we have a small speed regression with the standard conforming -/// version, so use a faster code in this case that, although not 100% standard -/// compliant it seems to work for Intel and MSVC. +/// version. Therefore, in this case we use a faster code in this case that, +/// although not 100% standard compliant it seems to work for Intel and MSVC. #if defined(IS_64BIT) && (!defined(__GNUC__) || defined(__INTEL_COMPILER)) inline Value eg_value(Score s) { return Value(int16_t(s & 0xffff)); } -- 2.39.2