Skip to content

Commit 0949f06

Browse files
committed
Fix a warning with Intel compiler
warning #2259: non-pointer conversion from "int" to "uint8_t={unsigned char}" may lose significant bits No functional change
1 parent 012f20d commit 0949f06

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/material.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,10 +217,10 @@ Entry* probe(const Position& pos, Table& entries, Endgames& endgames) {
217217
// catches some trivial draws like KK, KBK and KNK and gives a very drawish
218218
// scale factor for cases such as KRKBP and KmmKm (except for KBBKN).
219219
if (!pos.count<PAWN>(WHITE) && npm_w - npm_b <= BishopValueMg)
220-
e->factor[WHITE] = npm_w < RookValueMg ? SCALE_FACTOR_DRAW : npm_b <= BishopValueMg ? 4 : 12;
220+
e->factor[WHITE] = uint8_t(npm_w < RookValueMg ? SCALE_FACTOR_DRAW : npm_b <= BishopValueMg ? 4 : 12);
221221

222222
if (!pos.count<PAWN>(BLACK) && npm_b - npm_w <= BishopValueMg)
223-
e->factor[BLACK] = npm_b < RookValueMg ? SCALE_FACTOR_DRAW : npm_w <= BishopValueMg ? 4 : 12;
223+
e->factor[BLACK] = uint8_t(npm_b < RookValueMg ? SCALE_FACTOR_DRAW : npm_w <= BishopValueMg ? 4 : 12);
224224

225225
if (pos.count<PAWN>(WHITE) == 1 && npm_w - npm_b <= BishopValueMg)
226226
e->factor[WHITE] = (uint8_t) SCALE_FACTOR_ONEPAWN;

0 commit comments

Comments
 (0)