2424#include < iomanip>
2525#include < sstream>
2626
27- #include " bitcount .h"
27+ #include " bitboard .h"
2828#include " evaluate.h"
2929#include " material.h"
3030#include " pawns.h"
@@ -234,7 +234,7 @@ namespace {
234234 {
235235 ei.kingRing [Them] = b | shift_bb<Down>(b);
236236 b &= ei.attackedBy [Us][PAWN];
237- ei.kingAttackersCount [Us] = b ? popcount<Max15> (b) : 0 ;
237+ ei.kingAttackersCount [Us] = b ? popcount (b) : 0 ;
238238 ei.kingAdjacentZoneAttacksCount [Us] = ei.kingAttackersWeight [Us] = 0 ;
239239 }
240240 else
@@ -278,15 +278,15 @@ namespace {
278278 ei.kingAttackersWeight [Us] += KingAttackWeights[Pt];
279279 bb = b & ei.attackedBy [Them][KING];
280280 if (bb)
281- ei.kingAdjacentZoneAttacksCount [Us] += popcount<Max15> (bb);
281+ ei.kingAdjacentZoneAttacksCount [Us] += popcount (bb);
282282 }
283283
284284 if (Pt == QUEEN)
285285 b &= ~( ei.attackedBy [Them][KNIGHT]
286286 | ei.attackedBy [Them][BISHOP]
287287 | ei.attackedBy [Them][ROOK]);
288288
289- int mob = popcount<Pt == QUEEN ? Full : Max15> (b & mobilityArea[Us]);
289+ int mob = popcount (b & mobilityArea[Us]);
290290
291291 mobility[Us] += MobilityBonus[Pt][mob];
292292
@@ -334,7 +334,7 @@ namespace {
334334 {
335335 Bitboard alignedPawns = pos.pieces (Them, PAWN) & PseudoAttacks[ROOK][s];
336336 if (alignedPawns)
337- score += RookOnPawn * popcount<Max15> (alignedPawns);
337+ score += RookOnPawn * popcount (alignedPawns);
338338 }
339339
340340 // Bonus when on an open or semi-open file
@@ -399,7 +399,7 @@ namespace {
399399 // the pawn shelter (current 'score' value).
400400 attackUnits = std::min (72 , ei.kingAttackersCount [Them] * ei.kingAttackersWeight [Them])
401401 + 9 * ei.kingAdjacentZoneAttacksCount [Them]
402- + 27 * popcount<Max15> (undefended)
402+ + 27 * popcount (undefended)
403403 + 11 * !!ei.pinnedPieces [Us]
404404 - 64 * !pos.count <QUEEN>(Them)
405405 - mg_value (score) / 8 ;
@@ -415,7 +415,7 @@ namespace {
415415 | ei.attackedBy [Them][KING];
416416
417417 if (b)
418- attackUnits += QueenContactCheck * popcount<Max15> (b);
418+ attackUnits += QueenContactCheck * popcount (b);
419419 }
420420
421421 // Analyse the enemy's safe distance checks for sliders and knights
@@ -513,7 +513,7 @@ namespace {
513513
514514 b = weak & ~ei.attackedBy [Them][ALL_PIECES];
515515 if (b)
516- score += Hanging * popcount<Max15> (b);
516+ score += Hanging * popcount (b);
517517
518518 b = weak & ei.attackedBy [Us][KING];
519519 if (b)
@@ -533,7 +533,7 @@ namespace {
533533 & ~ei.attackedBy [Us][PAWN];
534534
535535 if (b)
536- score += ThreatByPawnPush * popcount<Max15> (b);
536+ score += ThreatByPawnPush * popcount (b);
537537
538538 if (DoTrace)
539539 Trace::add (THREAT, Us, score);
@@ -656,7 +656,7 @@ namespace {
656656 assert (unsigned (safe >> (Us == WHITE ? 32 : 0 )) == 0 );
657657
658658 // ...count safe + (behind & safe) with a single popcount
659- int bonus = popcount<Full> ((Us == WHITE ? safe << 32 : safe >> 32 ) | (behind & safe));
659+ int bonus = popcount ((Us == WHITE ? safe << 32 : safe >> 32 ) | (behind & safe));
660660 int weight = pos.count <KNIGHT>(Us) + pos.count <BISHOP>(Us)
661661 + pos.count <KNIGHT>(Them) + pos.count <BISHOP>(Them);
662662
0 commit comments