]> git.sesse.net Git - stockfish/blobdiff - src/position.h
Rework Thread hierarchy
[stockfish] / src / position.h
index d2343d10cb8507adc2d1732dbb980826edb8efb0..512313921458cae7d843214644026f2d7399fe25 100644 (file)
@@ -17,7 +17,7 @@
   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-#if !defined(POSITION_H_INCLUDED)
+#ifndef POSITION_H_INCLUDED
 #define POSITION_H_INCLUDED
 
 #include <cassert>
@@ -193,7 +193,7 @@ private:
 
   // Helper functions
   void do_castle(Square kfrom, Square kto, Square rfrom, Square rto);
-  template<bool FindPinned> Bitboard hidden_checkers() const;
+  Bitboard hidden_checkers(Square ksq, Color c) const;
 
   // Computing hash keys from scratch (for initialization and debugging)
   Key compute_key() const;
@@ -331,11 +331,11 @@ inline Bitboard Position::checkers() const {
 }
 
 inline Bitboard Position::discovered_check_candidates() const {
-  return hidden_checkers<false>();
+  return hidden_checkers(king_square(~sideToMove), sideToMove);
 }
 
 inline Bitboard Position::pinned_pieces() const {
-  return hidden_checkers<true>();
+  return hidden_checkers(king_square(sideToMove), ~sideToMove);
 }
 
 inline bool Position::pawn_is_passed(Color c, Square s) const {
@@ -414,4 +414,4 @@ inline Thread* Position::this_thread() const {
   return thisThread;
 }
 
-#endif // !defined(POSITION_H_INCLUDED)
+#endif // #ifndef POSITION_H_INCLUDED