From: Marco Costalba Date: Fri, 6 Jan 2012 23:04:08 +0000 (+0100) Subject: Fix compile on HP-UX 11's HP's C++ X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=6482ce2bb2cb2c2450008afb58c7ef2e04d56841 Fix compile on HP-UX 11's HP's C++ On that platform non-bracketed casting are not supported. Reported by Richard Lloyd. No functional change. Signed-off-by: Marco Costalba --- diff --git a/src/bitboard.cpp b/src/bitboard.cpp index e4e40958..57b24e2e 100644 --- a/src/bitboard.cpp +++ b/src/bitboard.cpp @@ -203,7 +203,7 @@ void bitboards_init() { Bitboard b = 1ULL << i; b ^= b - 1; b ^= b >> 32; - BSFTable[uint32_t(b * 0x783A9B23) >> 26] = i; + BSFTable[(uint32_t)(b * 0x783A9B23) >> 26] = i; } else BSFTable[((1ULL << i) * 0x218A392CD3D5DBFULL) >> 58] = i; diff --git a/src/material.cpp b/src/material.cpp index 313a9cf2..7369bca9 100644 --- a/src/material.cpp +++ b/src/material.cpp @@ -203,13 +203,13 @@ MaterialInfo* MaterialInfoTable::material_info(const Position& pos) const { // No pawns makes it difficult to win, even with a material advantage if (pos.piece_count(WHITE, PAWN) == 0 && npm_w - npm_b <= BishopValueMidgame) { - mi->factor[WHITE] = uint8_t + mi->factor[WHITE] = (uint8_t) (npm_w == npm_b || npm_w < RookValueMidgame ? 0 : NoPawnsSF[std::min(pos.piece_count(WHITE, BISHOP), 2)]); } if (pos.piece_count(BLACK, PAWN) == 0 && npm_b - npm_w <= BishopValueMidgame) { - mi->factor[BLACK] = uint8_t + mi->factor[BLACK] = (uint8_t) (npm_w == npm_b || npm_b < RookValueMidgame ? 0 : NoPawnsSF[std::min(pos.piece_count(BLACK, BISHOP), 2)]); } @@ -231,7 +231,7 @@ MaterialInfo* MaterialInfoTable::material_info(const Position& pos) const { { pos.piece_count(BLACK, BISHOP) > 1, pos.piece_count(BLACK, PAWN), pos.piece_count(BLACK, KNIGHT), pos.piece_count(BLACK, BISHOP) , pos.piece_count(BLACK, ROOK), pos.piece_count(BLACK, QUEEN) } }; - mi->value = int16_t((imbalance(pieceCount) - imbalance(pieceCount)) / 16); + mi->value = (int16_t)((imbalance(pieceCount) - imbalance(pieceCount)) / 16); return mi; }