]> git.sesse.net Git - stockfish/blobdiff - src/move.h
Fix a couple of MSVC warnings
[stockfish] / src / move.h
index e9f7242696c9abf0fa477758b192c47f4ace9dcb..17ce8b430b25b933e9b4a39c996bc6816df57510 100644 (file)
@@ -62,6 +62,9 @@ struct MoveStack {
   int score;
 };
 
+// Note that operator< is set up such that std::sort() will sort in descending order
+inline bool operator<(const MoveStack& f, const MoveStack& s) { return s.score < f.score; }
+
 
 ////
 //// Inline functions
@@ -79,12 +82,12 @@ inline PieceType move_promotion(Move m) {
   return PieceType((int(m) >> 12) & 7);
 }
 
-inline bool move_is_ep(Move m) {
-  return bool((int(m) >> 15) & 1);
+inline int move_is_ep(Move m) {
+  return m & (1 << 15);
 }
 
-inline bool move_is_castle(Move m) {
-  return bool((int(m) >> 16) & 1);
+inline int move_is_castle(Move m) {
+  return m & (1 << 16);
 }
 
 inline bool move_is_short_castle(Move m) {