mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-20 00:56:39 +08:00
Consistent use of anonymous namespace
Objects that are only accessible at file-scope should be put in the anonymous namespace. This is what the C++ standard recommends, rather than using static, which is really C-style and results in static linkage. Stockfish already does this throughout the code. So let's weed out the few exceptions, because... they have no reason to be exceptional. No functional change. Resolves #84
This commit is contained in:
@@ -34,16 +34,12 @@
|
||||
|
||||
using std::string;
|
||||
|
||||
static const string PieceToChar(" PNBRQK pnbrqk");
|
||||
|
||||
CACHE_LINE_ALIGNMENT
|
||||
|
||||
Value PieceValue[PHASE_NB][PIECE_NB] = {
|
||||
{ VALUE_ZERO, PawnValueMg, KnightValueMg, BishopValueMg, RookValueMg, QueenValueMg },
|
||||
{ VALUE_ZERO, PawnValueEg, KnightValueEg, BishopValueEg, RookValueEg, QueenValueEg } };
|
||||
|
||||
static Score psq[COLOR_NB][PIECE_TYPE_NB][SQUARE_NB];
|
||||
|
||||
namespace Zobrist {
|
||||
|
||||
Key psq[COLOR_NB][PIECE_TYPE_NB][SQUARE_NB];
|
||||
@@ -57,6 +53,9 @@ Key Position::exclusion_key() const { return st->key ^ Zobrist::exclusion;}
|
||||
|
||||
namespace {
|
||||
|
||||
const string PieceToChar(" PNBRQK pnbrqk");
|
||||
Score psq[COLOR_NB][PIECE_TYPE_NB][SQUARE_NB];
|
||||
|
||||
// min_attacker() is a helper function used by see() to locate the least
|
||||
// valuable attacker for the side to move, remove the attacker we just found
|
||||
// from the bitboards and scan for new X-ray attacks behind it.
|
||||
|
||||
Reference in New Issue
Block a user