mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-20 09:06:45 +08:00
Rewrite bit counting functions
Get rid of macros and use templates instead, this is safer and allows us fix the warning: ISO C++ forbids braced-groups within expressions That broke compilation with -pedantic flag under gcc and POPCNT enabled. No functional and no performance change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
@@ -357,7 +357,7 @@ Value EvaluationFunction<KBBKN>::apply(const Position& pos) const {
|
||||
result += Value(square_distance(bksq, nsq) * 32);
|
||||
|
||||
// Bonus for restricting the knight's mobility
|
||||
result += Value((8 - count_1s_max_15(pos.attacks_from<KNIGHT>(nsq))) * 8);
|
||||
result += Value((8 - count_1s<CNT32_MAX15>(pos.attacks_from<KNIGHT>(nsq))) * 8);
|
||||
|
||||
return strongerSide == pos.side_to_move() ? result : -result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user