mirror of
https://github.com/sockspls/badfish
synced 2025-04-30 08:43:09 +00:00
Retire obsolete reentrancy check in pos.print()
We dont' call MovePicker from print() anymore, so that reentrancy check in now not needed. No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
parent
9ba7f701ea
commit
188700d7f1
1 changed files with 1 additions and 21 deletions
|
@ -17,11 +17,6 @@
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
////
|
|
||||||
//// Includes
|
|
||||||
////
|
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
@ -32,7 +27,6 @@
|
||||||
|
|
||||||
#include "bitcount.h"
|
#include "bitcount.h"
|
||||||
#include "movegen.h"
|
#include "movegen.h"
|
||||||
#include "movepick.h"
|
|
||||||
#include "position.h"
|
#include "position.h"
|
||||||
#include "psqtab.h"
|
#include "psqtab.h"
|
||||||
#include "rkiss.h"
|
#include "rkiss.h"
|
||||||
|
@ -43,11 +37,6 @@ using std::string;
|
||||||
using std::cout;
|
using std::cout;
|
||||||
using std::endl;
|
using std::endl;
|
||||||
|
|
||||||
|
|
||||||
////
|
|
||||||
//// Position's static data definitions
|
|
||||||
////
|
|
||||||
|
|
||||||
Key Position::zobrist[2][8][64];
|
Key Position::zobrist[2][8][64];
|
||||||
Key Position::zobEp[64];
|
Key Position::zobEp[64];
|
||||||
Key Position::zobCastle[16];
|
Key Position::zobCastle[16];
|
||||||
|
@ -402,14 +391,6 @@ const string Position::to_fen() const {
|
||||||
void Position::print(Move move) const {
|
void Position::print(Move move) const {
|
||||||
|
|
||||||
const char* dottedLine = "\n+---+---+---+---+---+---+---+---+\n";
|
const char* dottedLine = "\n+---+---+---+---+---+---+---+---+\n";
|
||||||
static bool requestPending = false;
|
|
||||||
|
|
||||||
// Check for reentrancy, as example when called from inside
|
|
||||||
// MovePicker that is used also here in move_to_san()
|
|
||||||
if (requestPending)
|
|
||||||
return;
|
|
||||||
|
|
||||||
requestPending = true;
|
|
||||||
|
|
||||||
if (move)
|
if (move)
|
||||||
{
|
{
|
||||||
|
@ -424,17 +405,16 @@ void Position::print(Move move) const {
|
||||||
for (File file = FILE_A; file <= FILE_H; file++)
|
for (File file = FILE_A; file <= FILE_H; file++)
|
||||||
{
|
{
|
||||||
Square sq = make_square(file, rank);
|
Square sq = make_square(file, rank);
|
||||||
char c = (color_of_piece_on(sq) == BLACK ? '=' : ' ');
|
|
||||||
Piece piece = piece_on(sq);
|
Piece piece = piece_on(sq);
|
||||||
|
|
||||||
if (piece == PIECE_NONE && square_color(sq) == DARK)
|
if (piece == PIECE_NONE && square_color(sq) == DARK)
|
||||||
piece = PIECE_NONE_DARK_SQ;
|
piece = PIECE_NONE_DARK_SQ;
|
||||||
|
|
||||||
|
char c = (color_of_piece_on(sq) == BLACK ? '=' : ' ');
|
||||||
cout << c << pieceLetters.from_piece(piece) << c << '|';
|
cout << c << pieceLetters.from_piece(piece) << c << '|';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
cout << dottedLine << "Fen is: " << to_fen() << "\nKey is: " << st->key << endl;
|
cout << dottedLine << "Fen is: " << to_fen() << "\nKey is: " << st->key << endl;
|
||||||
requestPending = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue