]> git.sesse.net Git - stockfish/commitdiff
Initialize futilityMargin in EvalInfo c'tor
authorMarco Costalba <mcostalba@gmail.com>
Sun, 17 Jan 2010 12:22:09 +0000 (13:22 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Sun, 17 Jan 2010 12:24:40 +0000 (13:24 +0100)
This is less prone to bugs because now it's up to the
compiler don't forget this important initialization.

No functional change.

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

index 43c361239844584c42fa770855a5d10b18619347..f33774acea4246adc50e3e7ad3376ab6cb64b7e4 100644 (file)
@@ -47,6 +47,8 @@ class Position;
 
 struct EvalInfo {
 
 
 struct EvalInfo {
 
+  EvalInfo() : futilityMargin(Value(0)) {}
+
   // Middle game and endgame evaluations
   Score value;
 
   // Middle game and endgame evaluations
   Score value;
 
index c740b3c3ec4df3f88c8bd9ffe84f888848fbfb7b..ac90531f8c618a44c983cbbc3d4454f71163a97f 100644 (file)
@@ -1370,7 +1370,6 @@ namespace {
     }
 
     isCheck = pos.is_check();
     }
 
     isCheck = pos.is_check();
-    ei.futilityMargin = Value(0); // Manually initialize futilityMargin
 
     // Calculate depth dependant futility pruning parameters
     const int FutilityMoveCountMargin = 3 + (1 << (3 * int(depth) / 8));
 
     // Calculate depth dependant futility pruning parameters
     const int FutilityMoveCountMargin = 3 + (1 << (3 * int(depth) / 8));
@@ -1672,7 +1671,6 @@ namespace {
     }
 
     isCheck = pos.is_check();
     }
 
     isCheck = pos.is_check();
-    ei.futilityMargin = Value(0); // Manually initialize futilityMargin
 
     // Evaluate the position statically
     if (isCheck)
 
     // Evaluate the position statically
     if (isCheck)