]> git.sesse.net Git - stockfish/blobdiff - src/position.cpp
Small codestyle touches
[stockfish] / src / position.cpp
index cb63cf9537775848cdc222856a87dfdddc445ef3..74cb1f4eefef8c920ce7b1da55a70153fe9c08ca 100644 (file)
@@ -382,7 +382,7 @@ const string Position::to_fen() const {
 
 
 /// Position::print() prints an ASCII representation of the position to
-/// the standard output. If a move is given then also the san is print.
+/// the standard output. If a move is given then also the san is printed.
 
 void Position::print(Move move) const {
 
@@ -1561,7 +1561,7 @@ void Position::allow_ooo(Color c) {
 
 Key Position::compute_key() const {
 
-  Key result = Key(0ULL);
+  Key result = 0;
 
   for (Square s = SQ_A1; s <= SQ_H8; s++)
       if (square_is_occupied(s))
@@ -1586,7 +1586,7 @@ Key Position::compute_key() const {
 
 Key Position::compute_pawn_key() const {
 
-  Key result = Key(0ULL);
+  Key result = 0;
   Bitboard b;
   Square s;
 
@@ -1611,7 +1611,7 @@ Key Position::compute_pawn_key() const {
 
 Key Position::compute_material_key() const {
 
-  Key result = Key(0ULL);
+  Key result = 0;
   for (Color c = WHITE; c <= BLACK; c++)
       for (PieceType pt = PAWN; pt <= QUEEN; pt++)
       {
@@ -1703,7 +1703,7 @@ bool Position::is_draw() const {
 
 bool Position::is_mate() const {
 
-  MoveStack moves[256];
+  MoveStack moves[MOVES_MAX];
   return is_check() && (generate_moves(*this, moves) == moves);
 }
 
@@ -1713,7 +1713,7 @@ bool Position::is_mate() const {
 
 bool Position::has_mate_threat() {
 
-  MoveStack mlist[256], *last, *cur;
+  MoveStack mlist[MOVES_MAX], *last, *cur;
   StateInfo st1, st2;
   bool mateFound = false;
 
@@ -1917,7 +1917,7 @@ bool Position::is_ok(int* failedStep) const {
 
   // Is there more than 2 checkers?
   if (failedStep) (*failedStep)++;
-  if (debugCheckerCount && count_1s(st->checkersBB) > 2)
+  if (debugCheckerCount && count_1s<CNT32>(st->checkersBB) > 2)
       return false;
 
   // Bitboards OK?
@@ -1986,7 +1986,7 @@ bool Position::is_ok(int* failedStep) const {
   if (debugPieceCounts)
       for (Color c = WHITE; c <= BLACK; c++)
           for (PieceType pt = PAWN; pt <= KING; pt++)
-              if (pieceCount[c][pt] != count_1s(pieces(pt, c)))
+              if (pieceCount[c][pt] != count_1s<CNT32>(pieces(pt, c)))
                   return false;
 
   if (failedStep) (*failedStep)++;