]> git.sesse.net Git - stockfish/commitdiff
Rename squares_aligned()
authorMarco Costalba <mcostalba@gmail.com>
Sun, 10 Nov 2013 16:14:46 +0000 (17:14 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Sun, 10 Nov 2013 16:14:46 +0000 (17:14 +0100)
Rename to the shorter but still
clear aligned()

No functional change.

src/bitboard.h
src/position.cpp
src/search.cpp

index 1dc6f26d0ef8517040f6b61317e23ce9854c42e1..e95bf0d275996f0965efb36617c840408821d6f3 100644 (file)
@@ -223,10 +223,10 @@ inline Bitboard squares_of_color(Square s) {
 }
 
 
 }
 
 
-/// squares_aligned() returns true if the squares s1, s2 and s3 are aligned
+/// aligned() returns true if the squares s1, s2 and s3 are aligned
 /// either on a straight or on a diagonal line.
 
 /// either on a straight or on a diagonal line.
 
-inline bool squares_aligned(Square s1, Square s2, Square s3) {
+inline bool aligned(Square s1, Square s2, Square s3) {
   return LineBB[s1][s2] & s3;
 }
 
   return LineBB[s1][s2] & s3;
 }
 
index 52e6dd0fc5b520d1696b2987ff907e512b009526..c40b1199bd823f0f6f9268bff8ba70e42304fd21 100644 (file)
@@ -515,7 +515,7 @@ bool Position::legal(Move m, Bitboard pinned) const {
   // is moving along the ray towards or away from the king.
   return   !pinned
         || !(pinned & from)
   // is moving along the ray towards or away from the king.
   return   !pinned
         || !(pinned & from)
-        ||  squares_aligned(from, to_sq(m), king_square(us));
+        ||  aligned(from, to_sq(m), king_square(us));
 }
 
 
 }
 
 
@@ -658,7 +658,7 @@ bool Position::gives_check(Move m, const CheckInfo& ci) const {
   {
       // For pawn and king moves we need to verify also direction
       if (   (pt != PAWN && pt != KING)
   {
       // For pawn and king moves we need to verify also direction
       if (   (pt != PAWN && pt != KING)
-          || !squares_aligned(from, to, king_square(~sideToMove)))
+          || !aligned(from, to, king_square(~sideToMove)))
           return true;
   }
 
           return true;
   }
 
index ecfaaa569dfac037a0060187be323d355c37b751..02aea53827f39eff2977258b10ef175bfe49b164 100644 (file)
@@ -1331,7 +1331,7 @@ moves_loop: // When in check and at SpNode search starts from here
     // We exclude the trivial case where a sliding piece does in two moves what
     // it could do in one move: eg. Ra1a2, Ra2a3.
     if (    m2to == m1from
     // We exclude the trivial case where a sliding piece does in two moves what
     // it could do in one move: eg. Ra1a2, Ra2a3.
     if (    m2to == m1from
-        || (m1to == m2from && !squares_aligned(m1from, m2from, m2to)))
+        || (m1to == m2from && !aligned(m1from, m2from, m2to)))
         return true;
 
     // Second one moves through the square vacated by first one
         return true;
 
     // Second one moves through the square vacated by first one