mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-21 17:46:26 +08:00
Fix a few minor code style inconsistencies
No functional change.
This commit is contained in:
committed by
Stéphane Nicolet
parent
bd59560480
commit
ed26d71354
@@ -28,7 +28,7 @@ namespace {
|
|||||||
template<CastlingRight Cr, bool Checks, bool Chess960>
|
template<CastlingRight Cr, bool Checks, bool Chess960>
|
||||||
ExtMove* generate_castling(const Position& pos, ExtMove* moveList, Color us) {
|
ExtMove* generate_castling(const Position& pos, ExtMove* moveList, Color us) {
|
||||||
|
|
||||||
static constexpr bool KingSide = (Cr == WHITE_OO || Cr == BLACK_OO);
|
constexpr bool KingSide = (Cr == WHITE_OO || Cr == BLACK_OO);
|
||||||
|
|
||||||
if (pos.castling_impeded(Cr) || !pos.can_castle(Cr))
|
if (pos.castling_impeded(Cr) || !pos.can_castle(Cr))
|
||||||
return moveList;
|
return moveList;
|
||||||
|
|||||||
@@ -31,8 +31,8 @@
|
|||||||
#include "movepick.h"
|
#include "movepick.h"
|
||||||
#include "position.h"
|
#include "position.h"
|
||||||
#include "search.h"
|
#include "search.h"
|
||||||
#include "timeman.h"
|
|
||||||
#include "thread.h"
|
#include "thread.h"
|
||||||
|
#include "timeman.h"
|
||||||
#include "tt.h"
|
#include "tt.h"
|
||||||
#include "uci.h"
|
#include "uci.h"
|
||||||
#include "syzygy/tbprobe.h"
|
#include "syzygy/tbprobe.h"
|
||||||
@@ -689,12 +689,12 @@ namespace {
|
|||||||
|
|
||||||
// Step 7. Razoring (skipped when in check)
|
// Step 7. Razoring (skipped when in check)
|
||||||
if ( !PvNode
|
if ( !PvNode
|
||||||
&& depth <= 2 * ONE_PLY
|
&& depth < 3 * ONE_PLY
|
||||||
&& eval <= alpha - Value(RazorMargin[depth / ONE_PLY]))
|
&& eval <= alpha - RazorMargin[depth / ONE_PLY])
|
||||||
{
|
{
|
||||||
Value ralpha = alpha - Value((depth != ONE_PLY) * RazorMargin[depth / ONE_PLY]);
|
Value ralpha = alpha - (depth >= 2 * ONE_PLY) * RazorMargin[depth / ONE_PLY];
|
||||||
Value v = qsearch<NonPV>(pos, ss, ralpha, ralpha+1);
|
Value v = qsearch<NonPV>(pos, ss, ralpha, ralpha+1);
|
||||||
if (depth == ONE_PLY || v <= ralpha)
|
if (depth < 2 * ONE_PLY || v <= ralpha)
|
||||||
return v;
|
return v;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1148,7 +1148,6 @@ moves_loop: // When in check, search starts from here
|
|||||||
Value qsearch(Position& pos, Stack* ss, Value alpha, Value beta, Depth depth) {
|
Value qsearch(Position& pos, Stack* ss, Value alpha, Value beta, Depth depth) {
|
||||||
|
|
||||||
constexpr bool PvNode = NT == PV;
|
constexpr bool PvNode = NT == PV;
|
||||||
const bool inCheck = bool(pos.checkers());
|
|
||||||
|
|
||||||
assert(alpha >= -VALUE_INFINITE && alpha < beta && beta <= VALUE_INFINITE);
|
assert(alpha >= -VALUE_INFINITE && alpha < beta && beta <= VALUE_INFINITE);
|
||||||
assert(PvNode || (alpha == beta - 1));
|
assert(PvNode || (alpha == beta - 1));
|
||||||
@@ -1162,7 +1161,7 @@ moves_loop: // When in check, search starts from here
|
|||||||
Move ttMove, move, bestMove;
|
Move ttMove, move, bestMove;
|
||||||
Depth ttDepth;
|
Depth ttDepth;
|
||||||
Value bestValue, value, ttValue, futilityValue, futilityBase, oldAlpha;
|
Value bestValue, value, ttValue, futilityValue, futilityBase, oldAlpha;
|
||||||
bool ttHit, givesCheck, evasionPrunable;
|
bool ttHit, inCheck, givesCheck, evasionPrunable;
|
||||||
int moveCount;
|
int moveCount;
|
||||||
|
|
||||||
if (PvNode)
|
if (PvNode)
|
||||||
@@ -1174,6 +1173,7 @@ moves_loop: // When in check, search starts from here
|
|||||||
|
|
||||||
(ss+1)->ply = ss->ply + 1;
|
(ss+1)->ply = ss->ply + 1;
|
||||||
ss->currentMove = bestMove = MOVE_NONE;
|
ss->currentMove = bestMove = MOVE_NONE;
|
||||||
|
inCheck = pos.checkers();
|
||||||
moveCount = 0;
|
moveCount = 0;
|
||||||
|
|
||||||
// Check for an immediate draw or maximum ply reached
|
// Check for an immediate draw or maximum ply reached
|
||||||
|
|||||||
@@ -28,8 +28,8 @@
|
|||||||
#include "position.h"
|
#include "position.h"
|
||||||
#include "search.h"
|
#include "search.h"
|
||||||
#include "thread.h"
|
#include "thread.h"
|
||||||
#include "tt.h"
|
|
||||||
#include "timeman.h"
|
#include "timeman.h"
|
||||||
|
#include "tt.h"
|
||||||
#include "uci.h"
|
#include "uci.h"
|
||||||
#include "syzygy/tbprobe.h"
|
#include "syzygy/tbprobe.h"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user