]> git.sesse.net Git - stockfish/blobdiff - src/endgame.cpp
Prefer a reference to a pointer
[stockfish] / src / endgame.cpp
index f5f2074cff44469d34e86c724d812abb07a2c083..ef55119b76f811f4fb75e038000af6f7491336f5 100644 (file)
 #include <algorithm>
 #include <cassert>
 
+#include "bitboard.h"
 #include "bitcount.h"
 #include "endgame.h"
 #include "movegen.h"
 
 using std::string;
 
-extern uint32_t probe_kpk_bitbase(Square wksq, Square wpsq, Square bksq, Color stm);
-
 namespace {
 
   // Table used to drive the defending king towards the edge of the board
@@ -134,7 +133,7 @@ Value Endgame<KXK>::operator()(const Position& pos) const {
   // Stalemate detection with lone king
   if (    pos.side_to_move() == weakerSide
       && !pos.in_check()
-      && !MoveList<MV_LEGAL>(pos).size()) {
+      && !MoveList<LEGAL>(pos).size()) {
     return VALUE_DRAW;
   }
 
@@ -223,7 +222,7 @@ Value Endgame<KPK>::operator()(const Position& pos) const {
       wpsq = mirror(wpsq);
   }
 
-  if (!probe_kpk_bitbase(wksq, wpsq, bksq, stm))
+  if (!Bitbases::probe_kpk(wksq, wpsq, bksq, stm))
       return VALUE_DRAW;
 
   Value result =  VALUE_KNOWN_WIN
@@ -893,5 +892,5 @@ ScaleFactor Endgame<KPKP>::operator()(const Position& pos) const {
 
   // Probe the KPK bitbase with the weakest side's pawn removed. If it's a draw,
   // it's probably at least a draw even with the pawn.
-  return probe_kpk_bitbase(wksq, wpsq, bksq, stm) ? SCALE_FACTOR_NONE : SCALE_FACTOR_DRAW;
+  return Bitbases::probe_kpk(wksq, wpsq, bksq, stm) ? SCALE_FACTOR_NONE : SCALE_FACTOR_DRAW;
 }