X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Ftt.cpp;h=4afd965b0fabb70abc106fa975a3e5c1ab469a8b;hp=248cbad96d930baebe75d7bae3536145a69ccd1a;hb=d9caede3249698440b7579e31d92aaa9984a128b;hpb=ccd823a4ffd2ed3e60cb03ab49a841742bae1994 diff --git a/src/tt.cpp b/src/tt.cpp index 248cbad9..4afd965b 100644 --- a/src/tt.cpp +++ b/src/tt.cpp @@ -30,11 +30,9 @@ TranspositionTable TT; // Our global transposition table /// measured in megabytes. Transposition table consists of a power of 2 number /// of clusters and each cluster consists of TTClusterSize number of TTEntry. -void TranspositionTable::resize(uint64_t mbSize) { +void TranspositionTable::resize(size_t mbSize) { - assert(msb((mbSize * 1024 * 1024) / sizeof(TTCluster)) < 32); - - uint32_t newClusterCount = 1 << msb((mbSize * 1024 * 1024) / sizeof(TTCluster)); + size_t newClusterCount = size_t(1) << msb((mbSize * 1024 * 1024) / sizeof(TTCluster)); if (newClusterCount == clusterCount) return; @@ -77,7 +75,7 @@ const TTEntry* TranspositionTable::probe(const Key key) const { for (unsigned i = 0; i < TTClusterSize; ++i, ++tte) if (tte->key16 == key16) { - tte->genBound8 = generation | tte->bound(); // Refresh + tte->genBound8 = uint8_t(generation | tte->bound()); // Refresh return tte; }