Explicitly pass RootMoves to TB probes

Currently Search::RootMoves is accessed and even
modified by TB probing functions in a hidden
and sneaky way.

This is bad practice and makes the code tricky.
Instead explicily pass the vector as function
argument so to clarify that the vector is modified
inside the functions.

No functional change.
This commit is contained in:
Marco Costalba
2014-11-30 14:59:09 +01:00
committed by Joona Kiiski
parent eeb6d923fa
commit ba1464751d
5 changed files with 47 additions and 44 deletions

View File

@@ -68,6 +68,7 @@ struct RootMove {
std::vector<Move> pv;
};
typedef std::vector<RootMove> RootMoveVector;
/// The LimitsType struct stores information sent by GUI about available time
/// to search the current move, maximum depth/time, if we are in analysis mode
@@ -98,7 +99,7 @@ typedef std::auto_ptr<std::stack<StateInfo> > StateStackPtr;
extern volatile SignalsType Signals;
extern LimitsType Limits;
extern std::vector<RootMove> RootMoves;
extern RootMoveVector RootMoves;
extern Position RootPos;
extern Time::point SearchTime;
extern StateStackPtr SetupStates;