From de1dc4f2de7d22c9ea1b33b9caee276651ef7c6d Mon Sep 17 00:00:00 2001 From: Marco Costalba Date: Sun, 9 Jun 2013 23:24:36 +0200 Subject: [PATCH] Don't need to expose namespace Zobrist It can be local to position.cpp No functional change. --- src/position.cpp | 15 ++++++++++----- src/position.h | 4 ---- src/types.h | 9 --------- 3 files changed, 10 insertions(+), 18 deletions(-) diff --git a/src/position.cpp b/src/position.cpp index 05a02f15..c5e02940 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -46,11 +46,16 @@ Value PieceValue[PHASE_NB][PIECE_NB] = { { VALUE_ZERO, PawnValueMg, KnightValueMg, BishopValueMg, RookValueMg, QueenValueMg }, { VALUE_ZERO, PawnValueEg, KnightValueEg, BishopValueEg, RookValueEg, QueenValueEg } }; -Key Zobrist::psq[COLOR_NB][PIECE_TYPE_NB][SQUARE_NB]; -Key Zobrist::enpassant[FILE_NB]; -Key Zobrist::castle[CASTLE_RIGHT_NB]; -Key Zobrist::side; -Key Zobrist::exclusion; +namespace Zobrist { + + Key psq[COLOR_NB][PIECE_TYPE_NB][SQUARE_NB]; + Key enpassant[FILE_NB]; + Key castle[CASTLE_RIGHT_NB]; + Key side; + Key exclusion; +} + +Key Position::exclusion_key() const { return st->key ^ Zobrist::exclusion;} namespace { diff --git a/src/position.h b/src/position.h index c25244a6..bebf617f 100644 --- a/src/position.h +++ b/src/position.h @@ -346,10 +346,6 @@ inline Key Position::key() const { return st->key; } -inline Key Position::exclusion_key() const { - return st->key ^ Zobrist::exclusion; -} - inline Key Position::pawn_key() const { return st->pawnKey; } diff --git a/src/types.h b/src/types.h index 43b01bc9..ade9a620 100644 --- a/src/types.h +++ b/src/types.h @@ -328,15 +328,6 @@ inline Score operator/(Score s, int i) { #undef ENABLE_OPERATORS_ON #undef ENABLE_SAFE_OPERATORS_ON -namespace Zobrist { - - extern Key psq[COLOR_NB][PIECE_TYPE_NB][SQUARE_NB]; - extern Key enpassant[FILE_NB]; - extern Key castle[CASTLE_RIGHT_NB]; - extern Key side; - extern Key exclusion; -} - extern Value PieceValue[PHASE_NB][PIECE_NB]; extern int SquareDistance[SQUARE_NB][SQUARE_NB]; -- 2.39.2