]> git.sesse.net Git - stockfish/commitdiff
Triviality in SERIALIZE_PAWNS() macro usage
authorMarco Costalba <mcostalba@gmail.com>
Wed, 18 Jan 2012 16:52:55 +0000 (17:52 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Wed, 18 Jan 2012 16:52:55 +0000 (17:52 +0100)
No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/movegen.cpp

index caf2bfe675b77edc05e54e4ba16d0cdd97ffd4b5..289b51adefa43e8749bd53c008e6d173bf3dad28 100644 (file)
@@ -29,7 +29,7 @@
 
 /// Version used for pawns, where the 'from' square is given as a delta from the 'to' square
 #define SERIALIZE_PAWNS(b, d) while (b) { Square to = pop_1st_bit(&b); \
 
 /// Version used for pawns, where the 'from' square is given as a delta from the 'to' square
 #define SERIALIZE_PAWNS(b, d) while (b) { Square to = pop_1st_bit(&b); \
-                                         (*mlist++).move = make_move(to + (d), to); }
+                                         (*mlist++).move = make_move(to - (d), to); }
 namespace {
 
   enum CastlingSide { KING_SIDE, QUEEN_SIDE };
 namespace {
 
   enum CastlingSide { KING_SIDE, QUEEN_SIDE };
@@ -185,8 +185,8 @@ namespace {
             }
         }
 
             }
         }
 
-        SERIALIZE_PAWNS(b1, -UP);
-        SERIALIZE_PAWNS(b2, -UP -UP);
+        SERIALIZE_PAWNS(b1, UP);
+        SERIALIZE_PAWNS(b2, UP + UP);
     }
 
     // Promotions and underpromotions
     }
 
     // Promotions and underpromotions
@@ -209,8 +209,8 @@ namespace {
         b1 = move_pawns<RIGHT>(pawnsNotOn7) & enemies;
         b2 = move_pawns<LEFT >(pawnsNotOn7) & enemies;
 
         b1 = move_pawns<RIGHT>(pawnsNotOn7) & enemies;
         b2 = move_pawns<LEFT >(pawnsNotOn7) & enemies;
 
-        SERIALIZE_PAWNS(b1, -RIGHT);
-        SERIALIZE_PAWNS(b2, -LEFT);
+        SERIALIZE_PAWNS(b1, RIGHT);
+        SERIALIZE_PAWNS(b2, LEFT);
 
         if (pos.ep_square() != SQ_NONE)
         {
 
         if (pos.ep_square() != SQ_NONE)
         {