]> git.sesse.net Git - stockfish/commitdiff
Fix compile on HP-UX 11's HP's C++
authorMarco Costalba <mcostalba@gmail.com>
Fri, 6 Jan 2012 23:04:08 +0000 (00:04 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Fri, 6 Jan 2012 23:04:08 +0000 (00:04 +0100)
On that platform non-bracketed casting are not supported.

Reported by Richard Lloyd.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/bitboard.cpp
src/material.cpp

index e4e409583bcd4b71ebc0bc853746a7c6b0062f1c..57b24e2ef61b88ce5a4785b368df05739ffbbd44 100644 (file)
@@ -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;
index 313a9cf2921dd0143e5bd73c14dedde1467f0b17..7369bca9e3c42762f778a2a75292b0c7744efd50 100644 (file)
@@ -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<WHITE>(pieceCount) - imbalance<BLACK>(pieceCount)) / 16);
+  mi->value = (int16_t)((imbalance<WHITE>(pieceCount) - imbalance<BLACK>(pieceCount)) / 16);
   return mi;
 }