]> git.sesse.net Git - stockfish/blobdiff - src/movegen.cpp
Remove some useless include
[stockfish] / src / movegen.cpp
index c9255f31eb4e5245b867c0694d2d358a72dc77a0..90d0135a4d0dbe246aa38daa54b94d28820d5ad4 100644 (file)
@@ -21,6 +21,7 @@
 
 #include "bitcount.h"
 #include "movegen.h"
+#include "position.h"
 
 // Simple macro to wrap a very common while loop, no facny, no flexibility,
 // hardcoded list name 'mlist' and from square 'from'.
@@ -151,7 +152,6 @@ namespace {
 template<MoveType Type>
 MoveStack* generate(const Position& pos, MoveStack* mlist) {
 
-  assert(pos.is_ok());
   assert(!pos.in_check());
 
   Color us = pos.side_to_move();
@@ -202,7 +202,6 @@ template MoveStack* generate<MV_NON_EVASION>(const Position& pos, MoveStack* mli
 template<>
 MoveStack* generate<MV_NON_CAPTURE_CHECK>(const Position& pos, MoveStack* mlist) {
 
-  assert(pos.is_ok());
   assert(!pos.in_check());
 
   Bitboard b, dc;
@@ -213,7 +212,7 @@ MoveStack* generate<MV_NON_CAPTURE_CHECK>(const Position& pos, MoveStack* mlist)
   assert(pos.piece_on(ksq) == make_piece(opposite_color(us), KING));
 
   // Discovered non-capture checks
-  b = dc = pos.discovered_check_candidates(us);
+  b = dc = pos.discovered_check_candidates();
 
   while (b)
   {
@@ -243,7 +242,6 @@ MoveStack* generate<MV_NON_CAPTURE_CHECK>(const Position& pos, MoveStack* mlist)
 template<>
 MoveStack* generate<MV_EVASION>(const Position& pos, MoveStack* mlist) {
 
-  assert(pos.is_ok());
   assert(pos.in_check());
 
   Bitboard b, target;
@@ -315,10 +313,8 @@ MoveStack* generate<MV_EVASION>(const Position& pos, MoveStack* mlist) {
 template<>
 MoveStack* generate<MV_LEGAL>(const Position& pos, MoveStack* mlist) {
 
-  assert(pos.is_ok());
-
   MoveStack *last, *cur = mlist;
-  Bitboard pinned = pos.pinned_pieces(pos.side_to_move());
+  Bitboard pinned = pos.pinned_pieces();
 
   last = pos.in_check() ? generate<MV_EVASION>(pos, mlist)
                         : generate<MV_NON_EVASION>(pos, mlist);
@@ -362,7 +358,6 @@ namespace {
   inline MoveStack* generate_promotions(const Position& pos, MoveStack* mlist, Bitboard pawnsOn7, Bitboard target) {
 
     const Bitboard TFileABB = (Delta == DELTA_NE || Delta == DELTA_SE ? FileABB : FileHBB);
-    const Color Them = (Delta > 0 ? BLACK : WHITE);
 
     Bitboard b;
     Square to;
@@ -390,7 +385,7 @@ namespace {
         // This is the only possible under promotion that can give a check
         // not already included in the queen-promotion.
         if (   Type == MV_CHECK
-            && bit_is_set(pos.attacks_from<KNIGHT>(to), pos.king_square(Them)))
+            && bit_is_set(pos.attacks_from<KNIGHT>(to), pos.king_square(Delta > 0 ? BLACK : WHITE)))
             (*mlist++).move = make_promotion_move(to - Delta, to, KNIGHT);
         else (void)pos; // Silence a warning under MSVC
     }