X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fmaterial.cpp;fp=src%2Fmaterial.cpp;h=921e3007d0733788de389a676da524919ab06016;hp=4cfda03e4f3dcab3ee3bfed56553ea379e775826;hb=759b3c79cf94d101163f646b1eb2a9f9c64293ab;hpb=350dff446481b9e274e54dc727141f0dbfec0b23 diff --git a/src/material.cpp b/src/material.cpp index 4cfda03e..921e3007 100644 --- a/src/material.cpp +++ b/src/material.cpp @@ -31,7 +31,7 @@ namespace { // Polynomial material imbalance parameters - const int QuadraticOurs[][PIECE_TYPE_NB] = { + constexpr int QuadraticOurs[][PIECE_TYPE_NB] = { // OUR PIECES // pair pawn knight bishop rook queen {1667 }, // Bishop pair @@ -42,7 +42,7 @@ namespace { {-189, 24, 117, 133, -134, -10 } // Queen }; - const int QuadraticTheirs[][PIECE_TYPE_NB] = { + constexpr int QuadraticTheirs[][PIECE_TYPE_NB] = { // THEIR PIECES // pair pawn knight bishop rook queen { 0 }, // Bishop pair @@ -87,7 +87,7 @@ namespace { template int imbalance(const int pieceCount[][PIECE_TYPE_NB]) { - const Color Them = (Us == WHITE ? BLACK : WHITE); + constexpr Color Them = (Us == WHITE ? BLACK : WHITE); int bonus = 0; @@ -215,13 +215,13 @@ Entry* probe(const Position& pos) { // Evaluate the material imbalance. We use PIECE_TYPE_NONE as a place holder // for the bishop pair "extended piece", which allows us to be more flexible // in defining bishop pair bonuses. - const int PieceCount[COLOR_NB][PIECE_TYPE_NB] = { + const int pieceCount[COLOR_NB][PIECE_TYPE_NB] = { { pos.count(WHITE) > 1, pos.count(WHITE), pos.count(WHITE), pos.count(WHITE) , pos.count(WHITE), pos.count(WHITE) }, { pos.count(BLACK) > 1, pos.count(BLACK), pos.count(BLACK), pos.count(BLACK) , pos.count(BLACK), pos.count(BLACK) } }; - e->value = int16_t((imbalance(PieceCount) - imbalance(PieceCount)) / 16); + e->value = int16_t((imbalance(pieceCount) - imbalance(pieceCount)) / 16); return e; }