]> git.sesse.net Git - stockfish/blobdiff - src/movepick.cpp
Fix a warning under Intel compiler in square.h
[stockfish] / src / movepick.cpp
index d9fe8d2cf329c2cf4fe109efec6f0225f329611d..4eb842a0e3e7d9eda96a7bf1e7a1ff1c599bb013 100644 (file)
@@ -45,9 +45,7 @@ namespace {
   int MainSearchPhaseIndex;
   int EvasionsPhaseIndex;
   int QsearchWithChecksPhaseIndex;
-  int QsearchNoCapturesPhaseIndex;
   int QsearchWithoutChecksPhaseIndex;
-  int NoMovesPhaseIndex;
 
 }
 
@@ -66,7 +64,7 @@ namespace {
 /// move ordering is at the current node.
 
 MovePicker::MovePicker(const Position& p, bool pv, Move ttm,
-                       const SearchStack& ss, Depth d, EvalInfo* ei) : pos(p) {
+                       const SearchStack& ss, Depth d) : pos(p) {
   pvNode = pv;
   ttMove = ttm;
   mateKiller = (ss.mateKiller == ttm)? MOVE_NONE : ss.mateKiller;
@@ -77,24 +75,16 @@ MovePicker::MovePicker(const Position& p, bool pv, Move ttm,
   numOfMoves = 0;
   numOfBadCaptures = 0;
 
-  // With EvalInfo we are able to know how many captures are possible before
-  // generating them. So avoid generating in case we know are zero.
-  Color us = pos.side_to_move();
-  Color them = opposite_color(us);
-  bool noCaptures =    ei
-                   && (ei->attackedBy[us][0] & pos.pieces_of_color(them)) == 0
-                   && !ei->mi->specialized_eval_exists()
-                   && (pos.ep_square() == SQ_NONE)
-                   && !pos.has_pawn_on_7th(us);
-
   if (p.is_check())
       phaseIndex = EvasionsPhaseIndex;
   else if (depth > Depth(0))
       phaseIndex = MainSearchPhaseIndex;
   else if (depth == Depth(0))
-      phaseIndex = (noCaptures ? QsearchNoCapturesPhaseIndex : QsearchWithChecksPhaseIndex);
+      phaseIndex = QsearchWithChecksPhaseIndex;
   else
-      phaseIndex = (noCaptures ? NoMovesPhaseIndex : QsearchWithoutChecksPhaseIndex);
+      phaseIndex = QsearchWithoutChecksPhaseIndex;
+
+  Color us = pos.side_to_move();
 
   dc = p.discovered_check_candidates(us);
   pinned = p.pinned_pieces(us);
@@ -141,8 +131,8 @@ Move MovePicker::get_next_move() {
             assert(move_is_ok(mateKiller));
             if (move_is_legal(pos, mateKiller, pinned))
                 return mateKiller;
-       }
-       break;
+        }
+        break;
 
     case PH_GOOD_CAPTURES:
         numOfMoves = generate_captures(pos, moves);
@@ -525,17 +515,9 @@ void MovePicker::init_phase_table() {
   PhaseTable[i++] = PH_QCHECKS;
   PhaseTable[i++] = PH_STOP;
 
-  // Quiescence search with checks only and no captures
-  QsearchNoCapturesPhaseIndex = i - 1;
-  PhaseTable[i++] = PH_QCHECKS;
-  PhaseTable[i++] = PH_STOP;
-
   // Quiescence search without checks
   QsearchWithoutChecksPhaseIndex = i - 1;
   PhaseTable[i++] = PH_QCAPTURES;
   PhaseTable[i++] = PH_STOP;
 
-  // Do not generate any move
-  NoMovesPhaseIndex = i - 1;
-  PhaseTable[i++] = PH_STOP;
 }