Skip to content

Commit

Permalink
Fix compile on 64 bits
Browse files Browse the repository at this point in the history
Reported by Quocvuong82.

No functional change.
  • Loading branch information
mcostalba committed Sep 20, 2012
1 parent e4a0482 commit 09acdac
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/bitboard.cpp
Expand Up @@ -72,23 +72,23 @@ namespace {

void init_magics(Bitboard table[], Bitboard* attacks[], Bitboard magics[],
Bitboard masks[], unsigned shifts[], Square deltas[], Fn index);

FORCE_INLINE unsigned bsf_index(Bitboard b) {

if (Is64Bit)
return ((b & -b) * DeBruijn_64) >> 58;

// Use Matt Taylor's folding trick for 32 bit systems
b ^= (b - 1);
return ((unsigned(b) ^ unsigned(b >> 32)) * DeBruijn_32) >> 26;
}
}

/// lsb()/msb() finds the least/most significant bit in a nonzero bitboard.
/// pop_lsb() finds and clears the least significant bit in a nonzero bitboard.

#if !defined(USE_BSFQ)

FORCE_INLINE unsigned bsf_index(Bitboard b) {

if (Is64Bit)
return ((b & -b) * DeBruijn_64) >> 58;

// Use Matt Taylor's folding trick for 32 bit systems
b ^= (b - 1);
return ((unsigned(b) ^ unsigned(b >> 32)) * DeBruijn_32) >> 26;
}

Square lsb(Bitboard b) { return BSFTable[bsf_index(b)]; }

Square pop_lsb(Bitboard* b) {
Expand Down

0 comments on commit 09acdac

Please sign in to comment.