]> git.sesse.net Git - stockfish/blobdiff - src/bitboard.cpp
Retire last usage of operator|(File f, Rank r)
[stockfish] / src / bitboard.cpp
index b7eed922d10b0badeb0c4580ea34b76e31adaabf..d4b8bcfdf2cabb53d59e20ff8a055688db6a54a8 100644 (file)
@@ -18,8 +18,7 @@
 */
 
 #include <algorithm>
-#include <cstring>
-#include <sstream>
+#include <cstring> // For memset
 
 #include "bitboard.h"
 #include "bitcount.h"
@@ -130,19 +129,17 @@ Square msb(Bitboard b) {
 
 const std::string Bitboards::pretty(Bitboard b) {
 
-  std::ostringstream ss;
+  std::string s = "+---+---+---+---+---+---+---+---+\n";
 
   for (Rank rank = RANK_8; rank >= RANK_1; --rank)
   {
-      ss << "+---+---+---+---+---+---+---+---+" << '\n';
-
       for (File file = FILE_A; file <= FILE_H; ++file)
-          ss << "| " << (b & (file | rank) ? "X " : "  ");
+          s.append(b & make_square(file, rank) ? "| X " : "|   ");
 
-      ss << "|\n";
+      s.append("|\n+---+---+---+---+---+---+---+---+\n");
   }
-  ss << "+---+---+---+---+---+---+---+---+";
-  return ss.str();
+
+  return s;
 }
 
 
@@ -255,7 +252,7 @@ namespace {
                    Bitboard masks[], unsigned shifts[], Square deltas[], Fn index) {
 
     int MagicBoosters[][8] = { {  969, 1976, 2850,  542, 2069, 2852, 1708,  164 },
-                               { 3101,  552, 3555,  926,  834, 4122, 2131, 1117 } };
+                               { 3101,  552, 3555,  926,  834,   26, 2131, 1117 } };
 
     RKISS rk;
     Bitboard occupancy[4096], reference[4096], edges, b;