int depth, prevBestMoveChanges;
Value bestValue, alpha, beta, delta;
- memset(ss-1, 0, 4 * sizeof(Stack));
+ std::memset(ss-1, 0, 4 * sizeof(Stack));
(ss-1)->currentMove = MOVE_NULL; // Hack to skip update gains
depth = BestMoveChanges = 0;
// Step 1. Initialize node
Thread* thisThread = pos.this_thread();
- moveCount = quietCount = 0;
inCheck = pos.checkers();
if (SpNode)
goto moves_loop;
}
+ moveCount = quietCount = 0;
bestValue = -VALUE_INFINITE;
ss->currentMove = threatMove = (ss+1)->excludedMove = bestMove = MOVE_NONE;
ss->ply = (ss-1)->ply + 1;
Key posKey;
Move ttMove, move, bestMove;
Value bestValue, value, ttValue, futilityValue, futilityBase, oldAlpha;
- bool givesCheck, enoughMaterial, evasionPrunable;
+ bool givesCheck, evasionPrunable;
Depth ttDepth;
// To flag BOUND_EXACT a node with eval above alpha and no available moves
{
ss->staticEval = ss->evalMargin = VALUE_NONE;
bestValue = futilityBase = -VALUE_INFINITE;
- enoughMaterial = false;
}
else
{
alpha = bestValue;
futilityBase = ss->staticEval + ss->evalMargin + Value(128);
- enoughMaterial = pos.non_pawn_material(pos.side_to_move()) > RookValueMg;
}
// Initialize a MovePicker object for the current position, and prepare
&& !InCheck
&& !givesCheck
&& move != ttMove
- && enoughMaterial
&& type_of(move) != PROMOTION
&& !pos.is_passed_pawn_push(move))
{
}
// Detect non-capture evasions that are candidate to be pruned
- evasionPrunable = !PvNode
- && InCheck
+ evasionPrunable = InCheck
&& bestValue > VALUE_MATED_IN_MAX_PLY
&& !pos.is_capture(move)
&& !pos.can_castle(pos.side_to_move());
Stack stack[MAX_PLY_PLUS_2], *ss = stack+1; // To allow referencing (ss-1)
Position pos(*sp->pos, this);
- memcpy(ss-1, sp->ss-1, 4 * sizeof(Stack));
+ std::memcpy(ss-1, sp->ss-1, 4 * sizeof(Stack));
ss->splitPoint = sp;
sp->mutex.lock();