Fix compile error in debug mode
authorMarco Costalba <mcostalba@gmail.com>
Sun, 16 Oct 2011 22:56:25 +0000 (23:56 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Sun, 16 Oct 2011 22:56:25 +0000 (23:56 +0100)
Build broken by commit 3141490374182551ed2
where we renamed move_is_ok() in is_ok() and this clashes
with the same named method in Position that overrides the
move's one causing compile errors.

The fix is to rename the method in Position.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>

src/position.cpp
src/position.h
src/thread.cpp

index b9acc64..8408a8a 100644 (file)
@@ -102,7 +102,7 @@ Position::Position(const Position& pos, int th) {
   threadID = th;
   nodes = 0;
 
-  assert(is_ok());
+  assert(pos_is_ok());
 }
 
 Position::Position(const string& fen, bool isChess960, int th) {
@@ -207,7 +207,7 @@ void Position::from_fen(const string& fenStr, bool isChess960) {
   st->npMaterial[WHITE] = compute_non_pawn_material(WHITE);
   st->npMaterial[BLACK] = compute_non_pawn_material(BLACK);
 
-  assert(is_ok());
+  assert(pos_is_ok());
 }
 
 
@@ -971,7 +971,7 @@ void Position::do_move(Move m, StateInfo& newSt, const CheckInfo& ci, bool moveI
   sideToMove = flip(sideToMove);
   st->value += (sideToMove == WHITE ?  TempoValue : -TempoValue);
 
-  assert(is_ok());
+  assert(pos_is_ok());
 }
 
 
@@ -1134,7 +1134,7 @@ void Position::do_castle_move(Move m) {
   sideToMove = flip(sideToMove);
   st->value += (sideToMove == WHITE ?  TempoValue : -TempoValue);
 
-  assert(is_ok());
+  assert(pos_is_ok());
 }
 
 
@@ -1235,7 +1235,7 @@ void Position::undo_move(Move m) {
   // Finally point our state pointer back to the previous state
   st = st->previous;
 
-  assert(is_ok());
+  assert(pos_is_ok());
 }
 
 
@@ -1307,7 +1307,7 @@ void Position::undo_castle_move(Move m) {
   // Finally point our state pointer back to the previous state
   st = st->previous;
 
-  assert(is_ok());
+  assert(pos_is_ok());
 }
 
 
@@ -1342,7 +1342,7 @@ void Position::do_null_move(StateInfo& backupSt) {
   st->pliesFromNull = 0;
   st->value += (sideToMove == WHITE) ?  TempoValue : -TempoValue;
 
-  assert(is_ok());
+  assert(pos_is_ok());
 }
 
 
@@ -1364,7 +1364,7 @@ void Position::undo_null_move() {
   sideToMove = flip(sideToMove);
   st->rule50--;
 
-  assert(is_ok());
+  assert(pos_is_ok());
 }
 
 
@@ -1771,14 +1771,14 @@ void Position::flip_me() {
   st->npMaterial[WHITE] = compute_non_pawn_material(WHITE);
   st->npMaterial[BLACK] = compute_non_pawn_material(BLACK);
 
-  assert(is_ok());
+  assert(pos_is_ok());
 }
 
 
-/// Position::is_ok() performs some consitency checks for the position object.
+/// Position::pos_is_ok() performs some consitency checks for the position object.
 /// This is meant to be helpful when debugging.
 
-bool Position::is_ok(int* failedStep) const {
+bool Position::pos_is_ok(int* failedStep) const {
 
   // What features of the position should be verified?
   const bool debugAll = false;
index 60f7f58..eec8ff7 100644 (file)
@@ -203,7 +203,7 @@ public:
   void set_nodes_searched(int64_t n);
 
   // Position consistency check, for debugging
-  bool is_ok(int* failedStep = NULL) const;
+  bool pos_is_ok(int* failedStep = NULL) const;
   void flip_me();
 
   // Global initialization
index d845fdf..16bda28 100644 (file)
@@ -253,7 +253,7 @@ template <bool Fake>
 Value ThreadsManager::split(Position& pos, SearchStack* ss, Value alpha, Value beta,
                             Value bestValue, Depth depth, Move threatMove,
                             int moveCount, MovePicker* mp, int nodeType) {
-  assert(pos.is_ok());
+  assert(pos.pos_is_ok());
   assert(bestValue >= -VALUE_INFINITE);
   assert(bestValue <= alpha);
   assert(alpha < beta);