]> git.sesse.net Git - stockfish/blobdiff - src/movegen.cpp
Rename first_1 / last_1 in lsb / msb
[stockfish] / src / movegen.cpp
index 4ae16b4b37eb71ede0d8abf96fee0695f153e3ec..c275109d4bc0e967f9ca55b4b0b9d8d629931640 100644 (file)
 
 /// Simple macro to wrap a very common while loop, no facny, no flexibility,
 /// hardcoded names 'mlist' and 'from'.
 
 /// Simple macro to wrap a very common while loop, no facny, no flexibility,
 /// hardcoded names 'mlist' and 'from'.
-#define SERIALIZE(b) while (b) (*mlist++).move = make_move(from, pop_1st_bit(&b))
+#define SERIALIZE(b) while (b) (*mlist++).move = make_move(from, pop_lsb(&b))
 
 /// Version used for pawns, where the 'from' square is given as a delta from the 'to' square
 
 /// 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); \
+#define SERIALIZE_PAWNS(b, d) while (b) { Square to = pop_lsb(&b); \
                                          (*mlist++).move = make_move(to - (d), to); }
 namespace {
 
                                          (*mlist++).move = make_move(to - (d), to); }
 namespace {
 
@@ -87,7 +87,7 @@ namespace {
 
     while (b)
     {
 
     while (b)
     {
-        Square to = pop_1st_bit(&b);
+        Square to = pop_lsb(&b);
 
         if (Type == CAPTURES || Type == EVASIONS || Type == NON_EVASIONS)
             (*mlist++).move = make<PROMOTION>(to - Delta, to, QUEEN);
 
         if (Type == CAPTURES || Type == EVASIONS || Type == NON_EVASIONS)
             (*mlist++).move = make<PROMOTION>(to - Delta, to, QUEEN);
@@ -207,7 +207,7 @@ namespace {
             assert(b1);
 
             while (b1)
             assert(b1);
 
             while (b1)
-                (*mlist++).move = make<ENPASSANT>(pop_1st_bit(&b1), pos.ep_square());
+                (*mlist++).move = make<ENPASSANT>(pop_lsb(&b1), pos.ep_square());
         }
     }
 
         }
     }
 
@@ -343,7 +343,7 @@ MoveStack* generate<QUIET_CHECKS>(const Position& pos, MoveStack* mlist) {
 
   while (dc)
   {
 
   while (dc)
   {
-     Square from = pop_1st_bit(&dc);
+     Square from = pop_lsb(&dc);
      PieceType pt = type_of(pos.piece_on(from));
 
      if (pt == PAWN)
      PieceType pt = type_of(pos.piece_on(from));
 
      if (pt == PAWN)
@@ -398,7 +398,7 @@ MoveStack* generate<EVASIONS>(const Position& pos, MoveStack* mlist) {
   do
   {
       checkersCnt++;
   do
   {
       checkersCnt++;
-      checksq = pop_1st_bit(&b);
+      checksq = pop_lsb(&b);
 
       assert(color_of(pos.piece_on(checksq)) == ~us);
 
 
       assert(color_of(pos.piece_on(checksq)) == ~us);