]> git.sesse.net Git - stockfish/commitdiff
Don't need to expose namespace Zobrist
authorMarco Costalba <mcostalba@gmail.com>
Sun, 9 Jun 2013 21:24:36 +0000 (23:24 +0200)
committerMarco Costalba <mcostalba@gmail.com>
Sun, 9 Jun 2013 21:27:07 +0000 (23:27 +0200)
It can be local to position.cpp

No functional change.

src/position.cpp
src/position.h
src/types.h

index 05a02f158948e73513b33e62e24ef095377c3e4e..c5e029401ff34c2edfc78ef4e8dd3bf0e494cd12 100644 (file)
@@ -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 {
 
index c25244a6504cc27033554117ee029460a3581b7b..bebf617f4f039cc959c2a0d41799cbaf323ef234 100644 (file)
@@ -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;
 }
index 43b01bc9f6e13d8f324b2d33376b7d805a62ed76..ade9a620a47d5d70e63a71887f8310403a6f7c69 100644 (file)
@@ -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];