]> git.sesse.net Git - stockfish/commitdiff
Workaround broken function-style cast support in HP-UX
authorMarco Costalba <mcostalba@gmail.com>
Mon, 3 Jan 2011 10:36:32 +0000 (11:36 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Mon, 3 Jan 2011 10:36:32 +0000 (11:36 +0100)
It seems HP's ANSI C++ doesn't understand very well
standard function-style cast.

Reported by Richard Lloyd.

No functional change.

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

index ad594dd2dd4f84f2276e062872f3b3ebf3b19ab9..bd9d5e8a3e8d653b8d288ccc0f2dd2746e4cb41d 100644 (file)
@@ -192,7 +192,7 @@ MaterialInfo* MaterialInfoTable::get_material_info(const Position& pos) {
 
   // Clear the MaterialInfo object, and set its key
   memset(mi, 0, sizeof(MaterialInfo));
-  mi->factor[WHITE] = mi->factor[BLACK] = uint8_t(SCALE_FACTOR_NORMAL);
+  mi->factor[WHITE] = mi->factor[BLACK] = (uint8_t)SCALE_FACTOR_NORMAL;
   mi->key = key;
 
   // Store game phase
@@ -353,7 +353,7 @@ MaterialInfo* MaterialInfoTable::get_material_info(const Position& pos) {
     }
     matValue += sign * v;
   }
-  mi->value = int16_t(matValue / 16);
+  mi->value = (int16_t)(matValue / 16);
   return mi;
 }
 
index ee10b3f0d9e28bbedd0e892b13cccfb5c8a58538..778e5e81bf86dd37ad5725823967ea9ef87b4f0e 100644 (file)
--- a/src/tt.h
+++ b/src/tt.h
@@ -59,10 +59,10 @@ public:
 
       key32 = k;
       data = (m & 0x1FFFF) | (t << 21) | (g << 23);
-      value16     = int16_t(v);
-      depth16     = int16_t(d);
-      staticValue = int16_t(statV);
-      staticValueMargin  = int16_t(kd);
+      value16     = (int16_t)v;
+      depth16     = (int16_t)d;
+      staticValue = (int16_t)statV;
+      staticValueMargin  = (int16_t)kd;
   }
   void set_generation(int g) { data = move() | (type() << 21) | (g << 23); }
 
@@ -132,7 +132,7 @@ extern TranspositionTable TT;
 
 inline TTEntry* TranspositionTable::first_entry(const Key posKey) const {
 
-  return entries[uint32_t(posKey) & (size - 1)].data;
+  return entries[((uint32_t)posKey) & (size - 1)].data;
 }