]> git.sesse.net Git - stockfish/commitdiff
Rename NON_CAPTURE to QUIET
authorMarco Costalba <mcostalba@gmail.com>
Sat, 21 Jan 2012 17:45:18 +0000 (18:45 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Sat, 21 Jan 2012 23:42:59 +0000 (00:42 +0100)
It is a more conventional naming and is nicer.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/movegen.cpp
src/movegen.h
src/movepick.cpp
src/movepick.h

index cec98f00e3c189bb08c8c0af1ba5c3932ccb55e2..bc5b9cdebe17f0232fe77a4311c620bab66e4b4a 100644 (file)
@@ -112,7 +112,7 @@ namespace {
         if (Type == MV_CAPTURE || Type == MV_EVASION || Type == MV_NON_EVASION)
             (*mlist++).move = make_promotion(to - Delta, to, QUEEN);
 
-        if (Type == MV_NON_CAPTURE || Type == MV_EVASION || Type == MV_NON_EVASION)
+        if (Type == MV_QUIET || Type == MV_EVASION || Type == MV_NON_EVASION)
         {
             (*mlist++).move = make_promotion(to - Delta, to, ROOK);
             (*mlist++).move = make_promotion(to - Delta, to, BISHOP);
@@ -121,7 +121,7 @@ namespace {
 
         // Knight-promotion is the only one that can give a direct check not
         // already included in the queen-promotion.
-        if (Type == MV_NON_CAPTURE_CHECK && bit_is_set(StepAttacksBB[W_KNIGHT][to], ksq))
+        if (Type == MV_QUIET_CHECK && bit_is_set(StepAttacksBB[W_KNIGHT][to], ksq))
             (*mlist++).move = make_promotion(to - Delta, to, KNIGHT);
         else
             (void)ksq; // Silence a warning under MSVC
@@ -155,7 +155,7 @@ namespace {
     // Single and double pawn pushes, no promotions
     if (Type != MV_CAPTURE)
     {
-        emptySquares = (Type == MV_NON_CAPTURE ? target : pos.empty_squares());
+        emptySquares = (Type == MV_QUIET ? target : pos.empty_squares());
 
         b1 = move_pawns<UP>(pawnsNotOn7)   & emptySquares;
         b2 = move_pawns<UP>(b1 & TRank3BB) & emptySquares;
@@ -166,7 +166,7 @@ namespace {
             b2 &= target;
         }
 
-        if (Type == MV_NON_CAPTURE_CHECK)
+        if (Type == MV_QUIET_CHECK)
         {
             b1 &= pos.attacks_from<PAWN>(ksq, Them);
             b2 &= pos.attacks_from<PAWN>(ksq, Them);
@@ -302,7 +302,7 @@ namespace {
 /// generate<MV_CAPTURE> generates all pseudo-legal captures and queen
 /// promotions. Returns a pointer to the end of the move list.
 ///
-/// generate<MV_NON_CAPTURE> generates all pseudo-legal non-captures and
+/// generate<MV_QUIET> generates all pseudo-legal non-captures and
 /// underpromotions. Returns a pointer to the end of the move list.
 ///
 /// generate<MV_NON_EVASION> generates all pseudo-legal captures and
@@ -311,7 +311,7 @@ namespace {
 template<MoveType Type>
 MoveStack* generate(const Position& pos, MoveStack* mlist) {
 
-  assert(Type == MV_CAPTURE || Type == MV_NON_CAPTURE || Type == MV_NON_EVASION);
+  assert(Type == MV_CAPTURE || Type == MV_QUIET || Type == MV_NON_EVASION);
   assert(!pos.in_check());
 
   Color us = pos.side_to_move();
@@ -320,7 +320,7 @@ MoveStack* generate(const Position& pos, MoveStack* mlist) {
   if (Type == MV_CAPTURE)
       target = pos.pieces(~us);
 
-  else if (Type == MV_NON_CAPTURE)
+  else if (Type == MV_QUIET)
       target = pos.empty_squares();
 
   else if (Type == MV_NON_EVASION)
@@ -346,14 +346,14 @@ MoveStack* generate(const Position& pos, MoveStack* mlist) {
 
 // Explicit template instantiations
 template MoveStack* generate<MV_CAPTURE>(const Position& pos, MoveStack* mlist);
-template MoveStack* generate<MV_NON_CAPTURE>(const Position& pos, MoveStack* mlist);
+template MoveStack* generate<MV_QUIET>(const Position& pos, MoveStack* mlist);
 template MoveStack* generate<MV_NON_EVASION>(const Position& pos, MoveStack* mlist);
 
 
-/// generate<MV_NON_CAPTURE_CHECK> generates all pseudo-legal non-captures and knight
+/// generate<MV_QUIET_CHECK> generates all pseudo-legal non-captures and knight
 /// underpromotions that give check. Returns a pointer to the end of the move list.
 template<>
-MoveStack* generate<MV_NON_CAPTURE_CHECK>(const Position& pos, MoveStack* mlist) {
+MoveStack* generate<MV_QUIET_CHECK>(const Position& pos, MoveStack* mlist) {
 
   assert(!pos.in_check());
 
@@ -377,8 +377,8 @@ MoveStack* generate<MV_NON_CAPTURE_CHECK>(const Position& pos, MoveStack* mlist)
      SERIALIZE(b);
   }
 
-  mlist = (us == WHITE ? generate_pawn_moves<WHITE, MV_NON_CAPTURE_CHECK>(pos, mlist, ci.dcCandidates, ci.ksq)
-                       : generate_pawn_moves<BLACK, MV_NON_CAPTURE_CHECK>(pos, mlist, ci.dcCandidates, ci.ksq));
+  mlist = (us == WHITE ? generate_pawn_moves<WHITE, MV_QUIET_CHECK>(pos, mlist, ci.dcCandidates, ci.ksq)
+                       : generate_pawn_moves<BLACK, MV_QUIET_CHECK>(pos, mlist, ci.dcCandidates, ci.ksq));
 
   mlist = generate_direct_checks<KNIGHT>(pos, mlist, us, ci);
   mlist = generate_direct_checks<BISHOP>(pos, mlist, us, ci);
index c5c6e3e274726c3ecd3509a9b23902b0cfc69ee0..68ae7059d888ec77fe51431747046a946f18e0f8 100644 (file)
@@ -24,8 +24,8 @@
 
 enum MoveType {
   MV_CAPTURE,
-  MV_NON_CAPTURE,
-  MV_NON_CAPTURE_CHECK,
+  MV_QUIET,
+  MV_QUIET_CHECK,
   MV_EVASION,
   MV_NON_EVASION,
   MV_LEGAL
index e5aef10d2e9f5cd9d49f9064d1a13131620cfd30..a656cc2f86ea2b7f33025c2b09ea564a321b4598 100644 (file)
 namespace {
 
   enum Sequencer {
-    MAIN_SEARCH,         TT_MOVE_S1, GOOD_CAPTURES_S1, KILLERS_S1, NONCAPTURES_1_S1,
-                         NONCAPTURES_2_S1, BAD_CAPTURES_S1, STOP_S1,
+    MAIN_SEARCH,         TT_MOVE_S1, CAPTURES_S1, KILLERS_S1, QUIETS_1_S1,
+                         QUIETS_2_S1, BAD_CAPTURES_S1, STOP_S1,
     EVASIONS,            TT_MOVE_S2, EVASIONS_S2, STOP_S2,
-    CAPTURES_AND_CHECKS, TT_MOVE_S3, CAPTURES_S3, CHECKS_S3, STOP_S3,
+    CAPTURES_AND_CHECKS, TT_MOVE_S3, CAPTURES_S3, QUIET_CHECKS_S3, STOP_S3,
     CAPTURES,            TT_MOVE_S4, CAPTURES_S4, STOP_S4,
     PROBCUT,             TT_MOVE_S5, CAPTURES_S5, STOP_S5,
-    RECAPTURES,          RECAPTURES_S6, STOP_S6
+    RECAPTURES,          CAPTURES_S6, STOP_S6
   };
 
   // Unary predicate used by std::partition to split positive scores from remaining
@@ -121,13 +121,14 @@ MovePicker::MovePicker(const Position& p, Move ttm, Depth d, const History& h,
   phase += (ttMove == MOVE_NONE);
 }
 
-MovePicker::MovePicker(const Position& p, Move ttm, const History& h, PieceType parentCapture)
-                       : pos(p), H(h), curMove(0), lastMove(0) {
+MovePicker::MovePicker(const Position& p, Move ttm, const History& h,
+                       PieceType parentCapture) : pos(p), H(h) {
 
   assert (!pos.in_check());
 
   // In ProbCut we consider only captures better than parent's move
   captureThreshold = PieceValueMidgame[Piece(parentCapture)];
+  curMove = lastMove = 0;
   phase = PROBCUT;
 
   if (   ttm != MOVE_NONE
@@ -221,9 +222,8 @@ void MovePicker::next_phase() {
       lastMove = curMove + 1;
       return;
 
-  case GOOD_CAPTURES_S1:
-  case CAPTURES_S3: case CAPTURES_S4: case CAPTURES_S5:
-  case RECAPTURES_S6:
+  case CAPTURES_S1: case CAPTURES_S3: case CAPTURES_S4:
+  case CAPTURES_S5: case CAPTURES_S6:
       lastMove = generate<MV_CAPTURE>(pos, moves);
       score_captures();
       return;
@@ -233,16 +233,16 @@ void MovePicker::next_phase() {
       lastMove = curMove + 2;
       return;
 
-  case NONCAPTURES_1_S1:
-      lastNonCapture = lastMove = generate<MV_NON_CAPTURE>(pos, moves);
+  case QUIETS_1_S1:
+      lastQuiet = lastMove = generate<MV_QUIET>(pos, moves);
       score_noncaptures();
       lastMove = std::partition(curMove, lastMove, has_positive_score);
       sort<MoveStack>(curMove, lastMove);
       return;
 
-  case NONCAPTURES_2_S1:
+  case QUIETS_2_S1:
       curMove = lastMove;
-      lastMove = lastNonCapture;
+      lastMove = lastQuiet;
       if (depth >= 3 * ONE_PLY)
           sort<MoveStack>(curMove, lastMove);
       return;
@@ -260,8 +260,8 @@ void MovePicker::next_phase() {
       score_evasions();
       return;
 
-  case CHECKS_S3:
-      lastMove = generate<MV_NON_CAPTURE_CHECK>(pos, moves);
+  case QUIET_CHECKS_S3:
+      lastMove = generate<MV_QUIET_CHECK>(pos, moves);
       return;
 
   case STOP_S1: case STOP_S2: case STOP_S3: case STOP_S4: case STOP_S5: case STOP_S6:
@@ -297,7 +297,7 @@ Move MovePicker::next_move() {
           return ttMove;
           break;
 
-      case GOOD_CAPTURES_S1:
+      case CAPTURES_S1:
           move = pick_best(curMove++, lastMove)->move;
           if (move != ttMove)
           {
@@ -322,8 +322,8 @@ Move MovePicker::next_move() {
               return move;
           break;
 
-      case NONCAPTURES_1_S1:
-      case NONCAPTURES_2_S1:
+      case QUIETS_1_S1:
+      case QUIETS_2_S1:
           move = (curMove++)->move;
           if (   move != ttMove
               && move != killers[0].move
@@ -336,8 +336,7 @@ Move MovePicker::next_move() {
           return move;
 
       case EVASIONS_S2:
-      case CAPTURES_S3:
-      case CAPTURES_S4:
+      case CAPTURES_S3: case CAPTURES_S4:
           move = pick_best(curMove++, lastMove)->move;
           if (move != ttMove)
               return move;
@@ -350,13 +349,13 @@ Move MovePicker::next_move() {
                return move;
            break;
 
-      case RECAPTURES_S6:
+      case CAPTURES_S6:
           move = (curMove++)->move;
           if (to_sq(move) == recaptureSquare)
               return move;
           break;
 
-      case CHECKS_S3:
+      case QUIET_CHECKS_S3:
           move = (curMove++)->move;
           if (move != ttMove)
               return move;
index 317a0fc9165beed06c70d777f2f59f67fc26fc8b..9aed12e18770d56bbef7b3315ec182d16c4758eb 100644 (file)
@@ -56,7 +56,7 @@ private:
   MoveStack killers[2];
   Square recaptureSquare;
   int captureThreshold, phase;
-  MoveStack *curMove, *lastMove, *lastNonCapture, *badCaptures;
+  MoveStack *curMove, *lastMove, *lastQuiet, *badCaptures;
   MoveStack moves[MAX_MOVES];
 };