1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-04-30 00:33:09 +00:00

Rename getters functions removing 'get_' prefix

Follow the suggested Qt style:

http://doc.qt.nokia.com/qq/qq13-apis.html

It seems to me simpler and easier to read.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba 2011-12-25 11:50:59 +01:00
parent b5f6c2241b
commit c2d42ea833
16 changed files with 68 additions and 68 deletions

View file

@ -107,7 +107,7 @@ void benchmark(int argc, char* argv[]) {
// Ok, let's start the benchmark ! // Ok, let's start the benchmark !
totalNodes = 0; totalNodes = 0;
time = get_system_time(); time = system_time();
for (size_t i = 0; i < fenList.size(); i++) for (size_t i = 0; i < fenList.size(); i++)
{ {
@ -131,7 +131,7 @@ void benchmark(int argc, char* argv[]) {
} }
} }
time = get_system_time() - time; time = system_time() - time;
cerr << "\n===============================" cerr << "\n==============================="
<< "\nTotal time (ms) : " << time << "\nTotal time (ms) : " << time

View file

@ -349,7 +349,7 @@ namespace {
/// Book c'tor. Make random number generation less deterministic, for book moves /// Book c'tor. Make random number generation less deterministic, for book moves
Book::Book() : bookSize(0) { Book::Book() : bookSize(0) {
for (int i = abs(get_system_time() % 10000); i > 0; i--) for (int i = abs(system_time() % 10000); i > 0; i--)
RKiss.rand<unsigned>(); RKiss.rand<unsigned>();
} }

View file

@ -87,7 +87,7 @@ namespace {
fen += string(1, '0' + int(8 - keyCode.length())) + "/8/8/8/8/8/8/8 w - - 0 10"; fen += string(1, '0' + int(8 - keyCode.length())) + "/8/8/8/8/8/8/8 w - - 0 10";
// Build a Position out of the fen string and get its material key // Build a Position out of the fen string and get its material key
return Position(fen, false, 0).get_material_key(); return Position(fen, false, 0).material_key();
} }
} // namespace } // namespace

View file

@ -288,7 +288,7 @@ Value do_evaluate(const Position& pos, Value& margin) {
margins[WHITE] = margins[BLACK] = VALUE_ZERO; margins[WHITE] = margins[BLACK] = VALUE_ZERO;
// Probe the material hash table // Probe the material hash table
ei.mi = Threads[pos.thread()].materialTable.get_material_info(pos); ei.mi = Threads[pos.thread()].materialTable.material_info(pos);
score += ei.mi->material_value(); score += ei.mi->material_value();
// If we have a specialized evaluation function for the current material // If we have a specialized evaluation function for the current material
@ -300,7 +300,7 @@ Value do_evaluate(const Position& pos, Value& margin) {
} }
// Probe the pawn hash table // Probe the pawn hash table
ei.pi = Threads[pos.thread()].pawnTable.get_pawn_info(pos); ei.pi = Threads[pos.thread()].pawnTable.pawn_info(pos);
score += ei.pi->pawns_value(); score += ei.pi->pawns_value();
// Initialize attack and king safety bitboards // Initialize attack and king safety bitboards

View file

@ -90,15 +90,15 @@ void MaterialInfoTable::init() { Base::init(); if (!funcs) funcs = new Endgames(
MaterialInfoTable::~MaterialInfoTable() { delete funcs; } MaterialInfoTable::~MaterialInfoTable() { delete funcs; }
/// MaterialInfoTable::get_material_info() takes a position object as input, /// MaterialInfoTable::material_info() takes a position object as input,
/// computes or looks up a MaterialInfo object, and returns a pointer to it. /// computes or looks up a MaterialInfo object, and returns a pointer to it.
/// If the material configuration is not already present in the table, it /// If the material configuration is not already present in the table, it
/// is stored there, so we don't have to recompute everything when the /// is stored there, so we don't have to recompute everything when the
/// same material configuration occurs again. /// same material configuration occurs again.
MaterialInfo* MaterialInfoTable::get_material_info(const Position& pos) const { MaterialInfo* MaterialInfoTable::material_info(const Position& pos) const {
Key key = pos.get_material_key(); Key key = pos.material_key();
MaterialInfo* mi = probe(key); MaterialInfo* mi = probe(key);
// If mi->key matches the position's material hash key, it means that we // If mi->key matches the position's material hash key, it means that we

View file

@ -68,13 +68,13 @@ private:
/// The MaterialInfoTable class represents a pawn hash table. The most important /// The MaterialInfoTable class represents a pawn hash table. The most important
/// method is get_material_info, which returns a pointer to a MaterialInfo object. /// method is material_info(), which returns a pointer to a MaterialInfo object.
class MaterialInfoTable : public SimpleHash<MaterialInfo, MaterialTableSize> { class MaterialInfoTable : public SimpleHash<MaterialInfo, MaterialTableSize> {
public: public:
~MaterialInfoTable(); ~MaterialInfoTable();
void init(); void init();
MaterialInfo* get_material_info(const Position& pos) const; MaterialInfo* material_info(const Position& pos) const;
static Phase game_phase(const Position& pos); static Phase game_phase(const Position& pos);
private: private:

View file

@ -134,9 +134,9 @@ void dbg_before() { dbg_hit_on(false); }
void dbg_after() { dbg_hit_on(true); dbg_hit_cnt0--; } void dbg_after() { dbg_hit_on(true); dbg_hit_cnt0--; }
/// get_system_time() returns the current system time, measured in milliseconds /// system_time() returns the current system time, measured in milliseconds
int get_system_time() { int system_time() {
#if defined(_MSC_VER) #if defined(_MSC_VER)
struct _timeb t; struct _timeb t;

View file

@ -28,7 +28,7 @@
extern const std::string engine_name(); extern const std::string engine_name();
extern const std::string engine_authors(); extern const std::string engine_authors();
extern int get_system_time(); extern int system_time();
extern int cpu_count(); extern int cpu_count();
extern void timed_wait(WaitCondition*, Lock*, int); extern void timed_wait(WaitCondition*, Lock*, int);
extern void prefetch(char* addr); extern void prefetch(char* addr);

View file

@ -232,7 +232,7 @@ void MovePicker::go_next_phase() {
/// MovePicker::score_captures(), MovePicker::score_noncaptures() and /// MovePicker::score_captures(), MovePicker::score_noncaptures() and
/// MovePicker::score_evasions() assign a numerical move ordering score /// MovePicker::score_evasions() assign a numerical move ordering score
/// to each move in a move list. The moves with highest scores will be /// to each move in a move list. The moves with highest scores will be
/// picked first by get_next_move(). /// picked first by next_move().
void MovePicker::score_captures() { void MovePicker::score_captures() {
// Winning and equal captures in the main search are ordered by MVV/LVA. // Winning and equal captures in the main search are ordered by MVV/LVA.
@ -300,14 +300,14 @@ void MovePicker::score_evasions() {
} }
} }
/// MovePicker::get_next_move() is the most important method of the MovePicker /// MovePicker::next_move() is the most important method of the MovePicker class.
/// class. It returns a new pseudo legal move every time it is called, until there /// It returns a new pseudo legal move every time it is called, until there
/// are no more moves left. It picks the move with the biggest score from a list /// are no more moves left. It picks the move with the biggest score from a list
/// of generated moves taking care not to return the tt move if has already been /// of generated moves taking care not to return the tt move if has already been
/// searched previously. Note that this function is not thread safe so should be /// searched previously. Note that this function is not thread safe so should be
/// lock protected by caller when accessed through a shared MovePicker object. /// lock protected by caller when accessed through a shared MovePicker object.
Move MovePicker::get_next_move() { Move MovePicker::next_move() {
Move move; Move move;

View file

@ -28,7 +28,7 @@
/// MovePicker is a class which is used to pick one pseudo legal move at a time /// MovePicker is a class which is used to pick one pseudo legal move at a time
/// from the current position. It is initialized with a Position object and a few /// from the current position. It is initialized with a Position object and a few
/// moves we have reason to believe are good. The most important method is /// moves we have reason to believe are good. The most important method is
/// MovePicker::get_next_move(), which returns a new pseudo legal move each time /// MovePicker::next_move(), which returns a new pseudo legal move each time
/// it is called, until there are no moves left, when MOVE_NONE is returned. /// it is called, until there are no moves left, when MOVE_NONE is returned.
/// In order to improve the efficiency of the alpha beta algorithm, MovePicker /// In order to improve the efficiency of the alpha beta algorithm, MovePicker
/// attempts to return the moves which are most likely to get a cut-off first. /// attempts to return the moves which are most likely to get a cut-off first.
@ -41,7 +41,7 @@ public:
MovePicker(const Position&, Move, Depth, const History&, Search::Stack*, Value); MovePicker(const Position&, Move, Depth, const History&, Search::Stack*, Value);
MovePicker(const Position&, Move, Depth, const History&, Square recaptureSq); MovePicker(const Position&, Move, Depth, const History&, Square recaptureSq);
MovePicker(const Position&, Move, const History&, PieceType parentCapture); MovePicker(const Position&, Move, const History&, PieceType parentCapture);
Move get_next_move(); Move next_move();
private: private:
void score_captures(); void score_captures();

View file

@ -72,14 +72,14 @@ namespace {
} }
/// PawnInfoTable::get_pawn_info() takes a position object as input, computes /// PawnInfoTable::pawn_info() takes a position object as input, computes
/// a PawnInfo object, and returns a pointer to it. The result is also stored /// a PawnInfo object, and returns a pointer to it. The result is also stored
/// in an hash table, so we don't have to recompute everything when the same /// in an hash table, so we don't have to recompute everything when the same
/// pawn structure occurs again. /// pawn structure occurs again.
PawnInfo* PawnInfoTable::get_pawn_info(const Position& pos) const { PawnInfo* PawnInfoTable::pawn_info(const Position& pos) const {
Key key = pos.get_pawn_key(); Key key = pos.pawn_key();
PawnInfo* pi = probe(key); PawnInfo* pi = probe(key);
// If pi->key matches the position's pawn hash key, it means that we // If pi->key matches the position's pawn hash key, it means that we

View file

@ -29,9 +29,9 @@ const int PawnTableSize = 16384;
/// PawnInfo is a class which contains various information about a pawn /// PawnInfo is a class which contains various information about a pawn
/// structure. Currently, it only includes a middle game and an end game /// structure. Currently, it only includes a middle game and an end game
/// pawn structure evaluation, and a bitboard of passed pawns. We may want /// pawn structure evaluation, and a bitboard of passed pawns. We may want
/// to add further information in the future. A lookup to the pawn hash table /// to add further information in the future. A lookup to the pawn hash
/// (performed by calling the get_pawn_info method in a PawnInfoTable object) /// table (performed by calling the pawn_info method in a PawnInfoTable
/// returns a pointer to a PawnInfo object. /// object) returns a pointer to a PawnInfo object.
class PawnInfo { class PawnInfo {
@ -63,11 +63,11 @@ private:
/// The PawnInfoTable class represents a pawn hash table. The most important /// The PawnInfoTable class represents a pawn hash table. The most important
/// method is get_pawn_info, which returns a pointer to a PawnInfo object. /// method is pawn_info, which returns a pointer to a PawnInfo object.
class PawnInfoTable : public SimpleHash<PawnInfo, PawnTableSize> { class PawnInfoTable : public SimpleHash<PawnInfo, PawnTableSize> {
public: public:
PawnInfo* get_pawn_info(const Position& pos) const; PawnInfo* pawn_info(const Position& pos) const;
private: private:
template<Color Us> template<Color Us>

View file

@ -731,7 +731,7 @@ void Position::do_move(Move m, StateInfo& newSt, const CheckInfo& ci, bool moveI
assert(&newSt != st); assert(&newSt != st);
nodes++; nodes++;
Key key = st->key; Key k = st->key;
// Copy some fields of old state to our new StateInfo object except the ones // Copy some fields of old state to our new StateInfo object except the ones
// which are recalculated from scratch anyway, then switch our state pointer // which are recalculated from scratch anyway, then switch our state pointer
@ -750,7 +750,7 @@ void Position::do_move(Move m, StateInfo& newSt, const CheckInfo& ci, bool moveI
st = &newSt; st = &newSt;
// Update side to move // Update side to move
key ^= zobSideToMove; k ^= zobSideToMove;
// Increment the 50 moves rule draw counter. Resetting it to zero in the // Increment the 50 moves rule draw counter. Resetting it to zero in the
// case of non-reversible moves is taken care of later. // case of non-reversible moves is taken care of later.
@ -759,7 +759,7 @@ void Position::do_move(Move m, StateInfo& newSt, const CheckInfo& ci, bool moveI
if (is_castle(m)) if (is_castle(m))
{ {
st->key = key; st->key = k;
do_castle_move<true>(m); do_castle_move<true>(m);
return; return;
} }
@ -820,7 +820,7 @@ void Position::do_move(Move m, StateInfo& newSt, const CheckInfo& ci, bool moveI
pieceList[them][capture][pieceCount[them][capture]] = SQ_NONE; pieceList[them][capture][pieceCount[them][capture]] = SQ_NONE;
// Update hash keys // Update hash keys
key ^= zobrist[them][capture][capsq]; k ^= zobrist[them][capture][capsq];
st->materialKey ^= zobrist[them][capture][pieceCount[them][capture]]; st->materialKey ^= zobrist[them][capture][pieceCount[them][capture]];
// Update incremental scores // Update incremental scores
@ -831,12 +831,12 @@ void Position::do_move(Move m, StateInfo& newSt, const CheckInfo& ci, bool moveI
} }
// Update hash key // Update hash key
key ^= zobrist[us][pt][from] ^ zobrist[us][pt][to]; k ^= zobrist[us][pt][from] ^ zobrist[us][pt][to];
// Reset en passant square // Reset en passant square
if (st->epSquare != SQ_NONE) if (st->epSquare != SQ_NONE)
{ {
key ^= zobEp[st->epSquare]; k ^= zobEp[st->epSquare];
st->epSquare = SQ_NONE; st->epSquare = SQ_NONE;
} }
@ -844,13 +844,13 @@ void Position::do_move(Move m, StateInfo& newSt, const CheckInfo& ci, bool moveI
if ( st->castleRights != CASTLES_NONE if ( st->castleRights != CASTLES_NONE
&& (castleRightsMask[from] & castleRightsMask[to]) != ALL_CASTLES) && (castleRightsMask[from] & castleRightsMask[to]) != ALL_CASTLES)
{ {
key ^= zobCastle[st->castleRights]; k ^= zobCastle[st->castleRights];
st->castleRights &= castleRightsMask[from] & castleRightsMask[to]; st->castleRights &= castleRightsMask[from] & castleRightsMask[to];
key ^= zobCastle[st->castleRights]; k ^= zobCastle[st->castleRights];
} }
// Prefetch TT access as soon as we know key is updated // Prefetch TT access as soon as we know key is updated
prefetch((char*)TT.first_entry(key)); prefetch((char*)TT.first_entry(k));
// Move the piece // Move the piece
Bitboard move_bb = make_move_bb(from, to); Bitboard move_bb = make_move_bb(from, to);
@ -874,7 +874,7 @@ void Position::do_move(Move m, StateInfo& newSt, const CheckInfo& ci, bool moveI
&& (attacks_from<PAWN>(from + pawn_push(us), us) & pieces(PAWN, them))) && (attacks_from<PAWN>(from + pawn_push(us), us) & pieces(PAWN, them)))
{ {
st->epSquare = Square((from + to) / 2); st->epSquare = Square((from + to) / 2);
key ^= zobEp[st->epSquare]; k ^= zobEp[st->epSquare];
} }
if (is_promotion(m)) if (is_promotion(m))
@ -899,7 +899,7 @@ void Position::do_move(Move m, StateInfo& newSt, const CheckInfo& ci, bool moveI
pieceList[us][promotion][index[to]] = to; pieceList[us][promotion][index[to]] = to;
// Update hash keys // Update hash keys
key ^= zobrist[us][PAWN][to] ^ zobrist[us][promotion][to]; k ^= zobrist[us][PAWN][to] ^ zobrist[us][promotion][to];
st->pawnKey ^= zobrist[us][PAWN][to]; st->pawnKey ^= zobrist[us][PAWN][to];
st->materialKey ^= zobrist[us][promotion][pieceCount[us][promotion]++] st->materialKey ^= zobrist[us][promotion][pieceCount[us][promotion]++]
^ zobrist[us][PAWN][pieceCount[us][PAWN]]; ^ zobrist[us][PAWN][pieceCount[us][PAWN]];
@ -930,7 +930,7 @@ void Position::do_move(Move m, StateInfo& newSt, const CheckInfo& ci, bool moveI
st->capturedType = capture; st->capturedType = capture;
// Update the key with the final value // Update the key with the final value
st->key = key; st->key = k;
// Update checkers bitboard, piece must be already moved // Update checkers bitboard, piece must be already moved
st->checkersBB = 0; st->checkersBB = 0;

View file

@ -173,10 +173,10 @@ public:
int see_sign(Move m) const; int see_sign(Move m) const;
// Accessing hash keys // Accessing hash keys
Key get_key() const; Key key() const;
Key get_exclusion_key() const; Key exclusion_key() const;
Key get_pawn_key() const; Key pawn_key() const;
Key get_material_key() const; Key material_key() const;
// Incremental evaluation // Incremental evaluation
Score value() const; Score value() const;
@ -394,19 +394,19 @@ inline bool Position::pawn_is_passed(Color c, Square s) const {
return !(pieces(PAWN, flip(c)) & passed_pawn_mask(c, s)); return !(pieces(PAWN, flip(c)) & passed_pawn_mask(c, s));
} }
inline Key Position::get_key() const { inline Key Position::key() const {
return st->key; return st->key;
} }
inline Key Position::get_exclusion_key() const { inline Key Position::exclusion_key() const {
return st->key ^ zobExclusion; return st->key ^ zobExclusion;
} }
inline Key Position::get_pawn_key() const { inline Key Position::pawn_key() const {
return st->pawnKey; return st->pawnKey;
} }
inline Key Position::get_material_key() const { inline Key Position::material_key() const {
return st->materialKey; return st->materialKey;
} }

View file

@ -190,7 +190,7 @@ namespace {
MovePickerExt(const Position& p, Move ttm, Depth d, const History& h, Stack* ss, Value b) MovePickerExt(const Position& p, Move ttm, Depth d, const History& h, Stack* ss, Value b)
: MovePicker(p, ttm, d, h, ss, b), mp(ss->sp->mp) {} : MovePicker(p, ttm, d, h, ss, b), mp(ss->sp->mp) {}
Move get_next_move() { return mp->get_next_move(); } Move next_move() { return mp->next_move(); }
MovePicker* mp; MovePicker* mp;
}; };
@ -653,7 +653,7 @@ namespace {
// We don't want the score of a partial search to overwrite a previous full search // We don't want the score of a partial search to overwrite a previous full search
// TT value, so we use a different position key in case of an excluded move. // TT value, so we use a different position key in case of an excluded move.
excludedMove = ss->excludedMove; excludedMove = ss->excludedMove;
posKey = excludedMove ? pos.get_exclusion_key() : pos.get_key(); posKey = excludedMove ? pos.exclusion_key() : pos.key();
tte = TT.probe(posKey); tte = TT.probe(posKey);
ttMove = RootNode ? RootMoves[PVIdx].pv[0] : tte ? tte->move() : MOVE_NONE; ttMove = RootNode ? RootMoves[PVIdx].pv[0] : tte ? tte->move() : MOVE_NONE;
@ -816,7 +816,7 @@ namespace {
MovePicker mp(pos, ttMove, H, pos.captured_piece_type()); MovePicker mp(pos, ttMove, H, pos.captured_piece_type());
CheckInfo ci(pos); CheckInfo ci(pos);
while ((move = mp.get_next_move()) != MOVE_NONE) while ((move = mp.next_move()) != MOVE_NONE)
if (pos.pl_move_is_legal(move, ci.pinned)) if (pos.pl_move_is_legal(move, ci.pinned))
{ {
pos.do_move(move, st, ci, pos.move_gives_check(move, ci)); pos.do_move(move, st, ci, pos.move_gives_check(move, ci));
@ -867,7 +867,7 @@ split_point_start: // At split points actual search starts from here
// Step 11. Loop through moves // Step 11. Loop through moves
// Loop through all pseudo-legal moves until no moves remain or a beta cutoff occurs // Loop through all pseudo-legal moves until no moves remain or a beta cutoff occurs
while ( bestValue < beta while ( bestValue < beta
&& (move = mp.get_next_move()) != MOVE_NONE && (move = mp.next_move()) != MOVE_NONE
&& !thread.cutoff_occurred()) && !thread.cutoff_occurred())
{ {
assert(is_ok(move)); assert(is_ok(move));
@ -1220,7 +1220,7 @@ split_point_start: // At split points actual search starts from here
// Transposition table lookup. At PV nodes, we don't use the TT for // Transposition table lookup. At PV nodes, we don't use the TT for
// pruning, but only for move ordering. // pruning, but only for move ordering.
tte = TT.probe(pos.get_key()); tte = TT.probe(pos.key());
ttMove = (tte ? tte->move() : MOVE_NONE); ttMove = (tte ? tte->move() : MOVE_NONE);
if (!PvNode && tte && can_return_tt(tte, ttDepth, beta, ss->ply)) if (!PvNode && tte && can_return_tt(tte, ttDepth, beta, ss->ply))
@ -1252,7 +1252,7 @@ split_point_start: // At split points actual search starts from here
if (bestValue >= beta) if (bestValue >= beta)
{ {
if (!tte) if (!tte)
TT.store(pos.get_key(), value_to_tt(bestValue, ss->ply), VALUE_TYPE_LOWER, DEPTH_NONE, MOVE_NONE, ss->eval, evalMargin); TT.store(pos.key(), value_to_tt(bestValue, ss->ply), VALUE_TYPE_LOWER, DEPTH_NONE, MOVE_NONE, ss->eval, evalMargin);
return bestValue; return bestValue;
} }
@ -1273,7 +1273,7 @@ split_point_start: // At split points actual search starts from here
// Loop through the moves until no moves remain or a beta cutoff occurs // Loop through the moves until no moves remain or a beta cutoff occurs
while ( bestValue < beta while ( bestValue < beta
&& (move = mp.get_next_move()) != MOVE_NONE) && (move = mp.next_move()) != MOVE_NONE)
{ {
assert(is_ok(move)); assert(is_ok(move));
@ -1373,7 +1373,7 @@ split_point_start: // At split points actual search starts from here
vt = bestValue <= oldAlpha ? VALUE_TYPE_UPPER vt = bestValue <= oldAlpha ? VALUE_TYPE_UPPER
: bestValue >= beta ? VALUE_TYPE_LOWER : VALUE_TYPE_EXACT; : bestValue >= beta ? VALUE_TYPE_LOWER : VALUE_TYPE_EXACT;
TT.store(pos.get_key(), value_to_tt(bestValue, ss->ply), vt, ttDepth, move, ss->eval, evalMargin); TT.store(pos.key(), value_to_tt(bestValue, ss->ply), vt, ttDepth, move, ss->eval, evalMargin);
assert(bestValue > -VALUE_INFINITE && bestValue < VALUE_INFINITE); assert(bestValue > -VALUE_INFINITE && bestValue < VALUE_INFINITE);
@ -1602,9 +1602,9 @@ split_point_start: // At split points actual search starts from here
static int searchStartTime; static int searchStartTime;
if (reset) if (reset)
searchStartTime = get_system_time(); searchStartTime = system_time();
return get_system_time() - searchStartTime; return system_time() - searchStartTime;
} }
@ -1768,7 +1768,7 @@ split_point_start: // At split points actual search starts from here
static RKISS rk; static RKISS rk;
// PRNG sequence should be not deterministic // PRNG sequence should be not deterministic
for (int i = abs(get_system_time() % 50); i > 0; i--) for (int i = abs(system_time() % 50); i > 0; i--)
rk.rand<unsigned>(); rk.rand<unsigned>();
// RootMoves are already sorted by score in descending order // RootMoves are already sorted by score in descending order
@ -1821,7 +1821,7 @@ split_point_start: // At split points actual search starts from here
pv.push_back(m); pv.push_back(m);
pos.do_move(m, *st++); pos.do_move(m, *st++);
while ( (tte = TT.probe(pos.get_key())) != NULL while ( (tte = TT.probe(pos.key())) != NULL
&& tte->move() != MOVE_NONE && tte->move() != MOVE_NONE
&& pos.is_pseudo_legal(tte->move()) && pos.is_pseudo_legal(tte->move())
&& pos.pl_move_is_legal(tte->move(), pos.pinned_pieces()) && pos.pl_move_is_legal(tte->move(), pos.pinned_pieces())
@ -1853,7 +1853,7 @@ split_point_start: // At split points actual search starts from here
assert(pv[ply] != MOVE_NONE && pos.is_pseudo_legal(pv[ply])); assert(pv[ply] != MOVE_NONE && pos.is_pseudo_legal(pv[ply]));
do { do {
k = pos.get_key(); k = pos.key();
tte = TT.probe(k); tte = TT.probe(k);
// Don't overwrite existing correct entries // Don't overwrite existing correct entries
@ -1971,9 +1971,9 @@ void do_timer_event() {
static int lastInfoTime; static int lastInfoTime;
int e = elapsed_time(); int e = elapsed_time();
if (get_system_time() - lastInfoTime >= 1000 || !lastInfoTime) if (system_time() - lastInfoTime >= 1000 || !lastInfoTime)
{ {
lastInfoTime = get_system_time(); lastInfoTime = system_time();
dbg_print_mean(); dbg_print_mean();
dbg_print_hit_rate(); dbg_print_hit_rate();

View file

@ -117,9 +117,9 @@ void uci_loop() {
} }
else if (token == "key") else if (token == "key")
cout << "key: " << hex << pos.get_key() cout << "key: " << hex << pos.key()
<< "\nmaterial key: " << pos.get_material_key() << "\nmaterial key: " << pos.material_key()
<< "\npawn key: " << pos.get_pawn_key() << endl; << "\npawn key: " << pos.pawn_key() << endl;
else if (token == "uci") else if (token == "uci")
cout << "id name " << engine_name() cout << "id name " << engine_name()
@ -251,11 +251,11 @@ namespace {
if (!(is >> depth)) if (!(is >> depth))
return; return;
time = get_system_time(); time = system_time();
int64_t n = Search::perft(pos, depth * ONE_PLY); int64_t n = Search::perft(pos, depth * ONE_PLY);
time = get_system_time() - time; time = system_time() - time;
std::cout << "\nNodes " << n std::cout << "\nNodes " << n
<< "\nTime (ms) " << time << "\nTime (ms) " << time