]> git.sesse.net Git - stockfish/commitdiff
Silence some silly MSVC warnings
authorMarco Costalba <mcostalba@gmail.com>
Mon, 18 Jan 2010 18:50:45 +0000 (19:50 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Tue, 19 Jan 2010 10:23:00 +0000 (11:23 +0100)
Value is never used un-initialized, but MSVC is not
smart enough to detect itself :-(

No functional change.

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

index 76a4e7a9490744975b89e2c7a122801c4ac1db53..43fb7067a4692a0ca8915c68316215125e109261 100644 (file)
@@ -887,7 +887,7 @@ namespace {
   Value root_search(Position& pos, SearchStack ss[], RootMoveList& rml, Value alpha, Value beta) {
 
     Value oldAlpha = alpha;
   Value root_search(Position& pos, SearchStack ss[], RootMoveList& rml, Value alpha, Value beta) {
 
     Value oldAlpha = alpha;
-    Value value;
+    Value value = -VALUE_INFINITE;
     CheckInfo ci(pos);
 
     // Loop through all the moves in the root move list
     CheckInfo ci(pos);
 
     // Loop through all the moves in the root move list
@@ -1106,7 +1106,7 @@ namespace {
     Value oldAlpha, value;
     bool isCheck, mateThreat, singleEvasion, moveIsCheck, captureOrPromotion, dangerous;
     int moveCount = 0;
     Value oldAlpha, value;
     bool isCheck, mateThreat, singleEvasion, moveIsCheck, captureOrPromotion, dangerous;
     int moveCount = 0;
-    Value bestValue = -VALUE_INFINITE;
+    Value bestValue = value = -VALUE_INFINITE;
 
     if (depth < OnePly)
         return qsearch(pos, ss, alpha, beta, Depth(0), ply, threadID);
 
     if (depth < OnePly)
         return qsearch(pos, ss, alpha, beta, Depth(0), ply, threadID);
@@ -1332,7 +1332,7 @@ namespace {
     bool isCheck, useFutilityPruning, singleEvasion, moveIsCheck, captureOrPromotion, dangerous;
     bool mateThreat = false;
     int moveCount = 0;
     bool isCheck, useFutilityPruning, singleEvasion, moveIsCheck, captureOrPromotion, dangerous;
     bool mateThreat = false;
     int moveCount = 0;
-    futilityValue = staticValue = bestValue = -VALUE_INFINITE;
+    futilityValue = staticValue = bestValue = value = -VALUE_INFINITE;
 
     if (depth < OnePly)
         return qsearch(pos, ss, beta-1, beta, Depth(0), ply, threadID);
 
     if (depth < OnePly)
         return qsearch(pos, ss, beta-1, beta, Depth(0), ply, threadID);
@@ -1810,7 +1810,7 @@ namespace {
     Position pos = Position(sp->pos);
     CheckInfo ci(pos);
     SearchStack* ss = sp->sstack[threadID];
     Position pos = Position(sp->pos);
     CheckInfo ci(pos);
     SearchStack* ss = sp->sstack[threadID];
-    Value value;
+    Value value = -VALUE_INFINITE;
     Move move;
     bool isCheck = pos.is_check();
     bool useFutilityPruning =     sp->depth < SelectiveDepth
     Move move;
     bool isCheck = pos.is_check();
     bool useFutilityPruning =     sp->depth < SelectiveDepth
@@ -1952,7 +1952,7 @@ namespace {
     Position pos = Position(sp->pos);
     CheckInfo ci(pos);
     SearchStack* ss = sp->sstack[threadID];
     Position pos = Position(sp->pos);
     CheckInfo ci(pos);
     SearchStack* ss = sp->sstack[threadID];
-    Value value;
+    Value value = -VALUE_INFINITE;
     Move move;
 
     while (    sp->alpha < sp->beta
     Move move;
 
     while (    sp->alpha < sp->beta