isolated = !(ourPawns & adjacent_files_bb(f));
doubled = ourPawns & forward_bb(Us, s);
opposed = theirPawns & forward_bb(Us, s);
isolated = !(ourPawns & adjacent_files_bb(f));
doubled = ourPawns & forward_bb(Us, s);
opposed = theirPawns & forward_bb(Us, s);
// backward. If there are friendly pawns behind on adjacent files
// it cannot be backward either.
if ( (passed | isolated | lever | connected)
// backward. If there are friendly pawns behind on adjacent files
// it cannot be backward either.
if ( (passed | isolated | lever | connected)
// pawn on adjacent files. We now check whether the pawn is
// backward by looking in the forward direction on the adjacent
// files, and picking the closest pawn there.
// pawn on adjacent files. We now check whether the pawn is
// backward by looking in the forward direction on the adjacent
// files, and picking the closest pawn there.
- int bonus = Seed[r] + (phalanx ? (Seed[r + 1] - Seed[r]) / 2 : 0);
- bonus >>= opposed;
- Connected[opposed][phalanx][r] = make_score( 3 * bonus / 2, bonus);
+ int v = (Seed[r] + (phalanx ? (Seed[r + 1] - Seed[r]) / 2 : 0)) >> opposed;
+ Connected[opposed][phalanx][r] = make_score( 3 * v / 2, v);