From: Marco Costalba Date: Wed, 20 May 2009 13:11:41 +0000 (+0200) Subject: Small code style in headers X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=d3c4618b3ac0e444ce3b9dd894b87f86a50863c5;ds=sidebyside Small code style in headers No functional change. Signed-off-by: Marco Costalba --- diff --git a/src/endgame.h b/src/endgame.h index 73bfd188..011299ac 100644 --- a/src/endgame.h +++ b/src/endgame.h @@ -65,7 +65,7 @@ enum EndgameType { template class EndgameFunctionBase { public: - EndgameFunctionBase(Color c) : strongerSide(c) { weakerSide = opposite_color(strongerSide); } + EndgameFunctionBase(Color c) : strongerSide(c), weakerSide(opposite_color(c)) {} virtual ~EndgameFunctionBase() {} virtual T apply(const Position&) = 0; diff --git a/src/evaluate.h b/src/evaluate.h index c295985e..2531182a 100644 --- a/src/evaluate.h +++ b/src/evaluate.h @@ -39,7 +39,7 @@ /// arguments to the evaluation function, and the search can make use of its /// contents to make intelligent search decisions. /// -/// At the moment, this is not utilized very much: The only part of the +/// At the moment, this is not utilized very much: The only part of the /// EvalInfo object which is used by the search is futilityMargin. class Position; @@ -53,16 +53,16 @@ struct EvalInfo { PawnInfo* pi; // attackedBy[color][piece type] is a bitboard representing all squares - // attacked by a given color and piece type. attackedBy[color][0] contains + // attacked by a given color and piece type, attackedBy[color][0] contains // all squares attacked by the given color. Bitboard attackedBy[2][8]; Bitboard attacked_by(Color c) const { return attackedBy[c][0]; } Bitboard attacked_by(Color c, PieceType pt) const { return attackedBy[c][pt]; } // kingZone[color] is the zone around the enemy king which is considered - // by the king safety evaluation. This consists of the squares directly + // by the king safety evaluation. This consists of the squares directly // adjacent to the king, and the three (or two, for a king on an edge file) - // squares two ranks in front of the king. For instance, if black's king + // squares two ranks in front of the king. For instance, if black's king // is on g8, kingZone[WHITE] is a bitboard containing the squares f8, h8, // f7, g7, h7, f6, g6 and h6. Bitboard kingZone[2]; @@ -91,7 +91,7 @@ struct EvalInfo { // Middle game and endgame mobility scores. Value mgMobility, egMobility; - // Extra futility margin. This is added to the standard futility margin + // Extra futility margin. This is added to the standard futility margin // in the quiescence search. Value futilityMargin; }; diff --git a/src/lock.h b/src/lock.h index 715755d3..cd4dfa70 100644 --- a/src/lock.h +++ b/src/lock.h @@ -23,7 +23,7 @@ // x86 assembly language locks or OS spin locks may perform faster than -// mutex locks on some platforms. On my machine, mutexes seem to be the +// mutex locks on some platforms. On my machine, mutexes seem to be the // best. //#define ASM_LOCK diff --git a/src/material.h b/src/material.h index 27c93807..8b80ba1c 100644 --- a/src/material.h +++ b/src/material.h @@ -129,7 +129,7 @@ inline void MaterialInfo::clear() { /// MaterialInfo::scale_factor takes a position and a color as input, and -/// returns a scale factor for the given color. We have to provide the +/// returns a scale factor for the given color. We have to provide the /// position in addition to the color, because the scale factor need not /// to be a constant: It can also be a function which should be applied to /// the position. For instance, in KBP vs K endgames, a scaling function @@ -167,7 +167,7 @@ inline bool MaterialInfo::specialized_eval_exists() const { /// MaterialInfo::evaluate applies a specialized evaluation function -/// to a given position object. It should only be called when +/// to a given position object. It should only be called when /// specialized_eval_exists() returns 'true'. inline Value MaterialInfo::evaluate(const Position& pos) const { diff --git a/src/move.h b/src/move.h index 6a5678f0..5a58afe6 100644 --- a/src/move.h +++ b/src/move.h @@ -119,7 +119,7 @@ inline Move make_ep_move(Square from, Square to) { //// Prototypes //// -extern std::ostream &operator << (std::ostream &os, Move m); +extern std::ostream& operator<<(std::ostream &os, Move m); extern Move move_from_string(const Position &pos, const std::string &str); extern const std::string move_to_string(Move m); extern bool move_is_ok(Move m); diff --git a/src/movepick.h b/src/movepick.h index 0ac4bb6c..500ed8b9 100644 --- a/src/movepick.h +++ b/src/movepick.h @@ -40,8 +40,8 @@ struct SearchStack; extern SearchStack EmptySearchStack; /// MovePicker is a class which is used to pick one legal move at a time from -/// the current position. It is initialized with a Position object and a few -/// moves we have reason to believe are good. The most important method is +/// the current position. It is initialized with a Position object and a few +/// moves we have reason to believe are good. The most important method is /// MovePicker::pick_next_move(), which returns a new legal move each time it /// is called, until there are no legal moves left, when MOVE_NONE is returned. /// In order to improve the efficiency of the alpha beta algorithm, MovePicker @@ -49,7 +49,7 @@ extern SearchStack EmptySearchStack; class MovePicker { - MovePicker& operator=(const MovePicker&); // Silence a warning under MSVC + MovePicker& operator=(const MovePicker&); // silence a warning under MSVC public: @@ -63,15 +63,14 @@ public: PH_NONCAPTURES, // Non-captures and underpromotions PH_EVASIONS, // Check evasions PH_QCAPTURES, // Captures in quiescence search - PH_QCHECKS, // Checks in quiescence search + PH_QCHECKS, // Non-capture checks in quiescence search PH_STOP }; MovePicker(const Position& p, bool pvnode, Move ttm, const SearchStack& ss, Depth d); Move get_next_move(); - Move get_next_move(Lock &lock); + Move get_next_move(Lock& lock); int number_of_moves() const; - int current_move_score() const; Bitboard discovered_check_candidates() const; static void init_phase_table(); @@ -110,7 +109,7 @@ inline int MovePicker::number_of_moves() const { } /// MovePicker::discovered_check_candidates() returns a bitboard containing -/// all pieces which can possibly give discovered check. This bitboard is +/// all pieces which can possibly give discovered check. This bitboard is /// computed by the constructor function. inline Bitboard MovePicker::discovered_check_candidates() const { diff --git a/src/pawns.h b/src/pawns.h index 8f88b577..abf686fc 100644 --- a/src/pawns.h +++ b/src/pawns.h @@ -33,9 +33,9 @@ //// /// PawnInfo is a class which contains various information about a pawn -/// structure. Currently, it only includes a middle game and an end game -/// pawn structure evaluation, and a bitboard of passed pawns. We may want -/// to add further information in the future. A lookup to the pawn hash table +/// structure. Currently, it only includes a middle game and an end game +/// pawn structure evaluation, and a bitboard of passed pawns. We may want +/// to add further information in the future. A lookup to the pawn hash table /// (performed by calling the get_pawn_info method in a PawnInfoTable object) /// returns a pointer to a PawnInfo object. class Position;