]> git.sesse.net Git - stockfish/blobdiff - src/search.cpp
Use type_of() to categorize the moves
[stockfish] / src / search.cpp
index 93014bd0ac8a30bcf2288092192ab38638a35cd9..9c1d0b5eca66e1e928accfaec998d3f3d426d2d1 100644 (file)
@@ -183,7 +183,7 @@ namespace {
     // Test for a capture that triggers a pawn endgame
     if (    captureOrPromotion
         &&  type_of(pos.piece_on(to_sq(m))) != PAWN
-        && !is_special(m)
+        &&  type_of(m) == NORMAL
         && (  pos.non_pawn_material(WHITE) + pos.non_pawn_material(BLACK)
             - PieceValueMidgame[pos.piece_on(to_sq(m))] == VALUE_ZERO))
         return true;
@@ -229,7 +229,7 @@ int64_t Search::perft(Position& pos, Depth depth) {
   StateInfo st;
   int64_t cnt = 0;
 
-  MoveList<MV_LEGAL> ml(pos);
+  MoveList<LEGAL> ml(pos);
 
   // At the last ply just return the number of moves (leaf nodes)
   if (depth == ONE_PLY)
@@ -661,7 +661,7 @@ namespace {
         &&  (ss-1)->eval != VALUE_NONE
         &&  ss->eval != VALUE_NONE
         && !pos.captured_piece_type()
-        && !is_special(move))
+        &&  type_of(move) == NORMAL)
     {
         Square to = to_sq(move);
         H.update_gain(pos.piece_on(to), to, -(ss-1)->eval - ss->eval);
@@ -902,7 +902,7 @@ split_point_start: // At split points actual search starts from here
           && !inCheck
           && !dangerous
           &&  move != ttMove
-          && !is_castle(move)
+          &&  type_of(move) != CASTLE
           && (bestValue > VALUE_MATED_IN_MAX_PLY || bestValue == -VALUE_INFINITE))
       {
           // Move count based pruning
@@ -961,7 +961,7 @@ split_point_start: // At split points actual search starts from here
           && !isPvMove
           && !captureOrPromotion
           && !dangerous
-          && !is_castle(move)
+          &&  type_of(move) != CASTLE
           &&  ss->killers[0] != move
           &&  ss->killers[1] != move)
       {
@@ -1226,12 +1226,12 @@ split_point_start: // At split points actual search starts from here
           && !givesCheck
           &&  move != ttMove
           &&  enoughMaterial
-          && !is_promotion(move)
+          &&  type_of(move) != PROMOTION
           && !pos.is_passed_pawn_push(move))
       {
           futilityValue =  futilityBase
                          + PieceValueEndgame[pos.piece_on(to_sq(move))]
-                         + (is_enpassant(move) ? PawnValueEndgame : VALUE_ZERO);
+                         + (type_of(move) == ENPASSANT ? PawnValueEndgame : VALUE_ZERO);
 
           if (futilityValue < beta)
           {
@@ -1259,7 +1259,7 @@ split_point_start: // At split points actual search starts from here
       if (   !PvNode
           && (!inCheck || evasionPrunable)
           &&  move != ttMove
-          && !is_promotion(move)
+          &&  type_of(move) != PROMOTION
           &&  pos.see_sign(move) < 0)
           continue;