]> git.sesse.net Git - stockfish/commitdiff
Fix a compilation error for MSVC
authorStéphane Nicolet <cassio@free.fr>
Fri, 27 Jul 2018 13:46:13 +0000 (15:46 +0200)
committerStéphane Nicolet <cassio@free.fr>
Fri, 27 Jul 2018 13:46:13 +0000 (15:46 +0200)
The previous commit wouldn't compile on the Microsoft Virtual Studio C++ compiler. So use a more compatible style for the same idea (which we already use in numerous places of evaluate.cpp, for instance in line 563).

Under the Clang compiler, both versions generate exactly the same machine code (same md5 signatures for the two binaries).

No functional change.

src/evaluate.cpp

index 5f4a1ab1fb3c6d697b1e4a0a96791660e5d7f553..55ceadfdbf403c8a1252bc04ba8be4044c73c82a 100644 (file)
@@ -636,8 +636,8 @@ namespace {
 
         assert(!(pos.pieces(Them, PAWN) & forward_file_bb(Us, s + Up)));
 
-        bb = forward_file_bb(Us, s) & pos.pieces(Them);
-        score -= HinderPassedPawn * bool(bb);
+        if (forward_file_bb(Us, s) & pos.pieces(Them))
+            score -= HinderPassedPawn;
 
         int r = relative_rank(Us, s);
         int w = PassedDanger[r];