mirror of
https://github.com/official-stockfish/Stockfish.git
synced 2026-07-22 12:47:08 +00:00
Fix one error and all warnings on MSVC 2026
The error is "C1001: Internal compiler error." in uci.cpp on line 370 of master. For some reason the compiler can't handle the std::size(hashfullAges) inside the lambda. Older MSVC versions had no problem. Most of the warnings are due to implicit type conversions "conversion from type A to type B, possible loss of data" many of which have been present for a while. closes https://github.com/official-stockfish/Stockfish/pull/6464 No functional change
This commit is contained in:
+7
-6
@@ -313,8 +313,8 @@ void UCIEngine::benchmark(std::istream& args) {
|
||||
|
||||
Benchmark::BenchmarkSetup setup = Benchmark::setup_benchmark(args);
|
||||
|
||||
const int numGoCommands = count_if(setup.commands.begin(), setup.commands.end(),
|
||||
[](const std::string& s) { return s.find("go ") == 0; });
|
||||
const auto numGoCommands = count_if(setup.commands.begin(), setup.commands.end(),
|
||||
[](const std::string& s) { return s.find("go ") == 0; });
|
||||
|
||||
TimePoint totalTime = 0;
|
||||
|
||||
@@ -361,13 +361,14 @@ void UCIEngine::benchmark(std::istream& args) {
|
||||
|
||||
int numHashfullReadings = 0;
|
||||
constexpr int hashfullAges[] = {0, 999}; // Only normal hashfull and touched hash.
|
||||
int totalHashfull[std::size(hashfullAges)] = {0};
|
||||
int maxHashfull[std::size(hashfullAges)] = {0};
|
||||
constexpr int hashfullAgeCount = std::size(hashfullAges);
|
||||
int totalHashfull[hashfullAgeCount] = {0};
|
||||
int maxHashfull[hashfullAgeCount] = {0};
|
||||
|
||||
auto updateHashfullReadings = [&]() {
|
||||
numHashfullReadings += 1;
|
||||
|
||||
for (int i = 0; i < static_cast<int>(std::size(hashfullAges)); ++i)
|
||||
for (int i = 0; i < hashfullAgeCount; ++i)
|
||||
{
|
||||
const int hashfull = engine.get_hashfull(hashfullAges[i]);
|
||||
maxHashfull[i] = std::max(maxHashfull[i], hashfull);
|
||||
@@ -554,7 +555,7 @@ int UCIEngine::to_cp(Value v, const Position& pos) {
|
||||
|
||||
auto [a, b] = win_rate_params(pos);
|
||||
|
||||
return std::round(100 * int(v) / a);
|
||||
return int(std::round(100 * int(v) / a));
|
||||
}
|
||||
|
||||
std::string UCIEngine::wdl(Value v, const Position& pos) {
|
||||
|
||||
Reference in New Issue
Block a user