From: Marco Costalba Date: Fri, 2 Nov 2012 10:41:49 +0000 (+0100) Subject: Fix a warning under MSVC X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=e3b03278129e4d7f130826aef209668b3268aa94;ds=sidebyside Fix a warning under MSVC Compiler complies that 'cnt' is initialized but unused (in !CheckThreeFold case). Moving the definition of 'cnt'out of the loop seems to do the trick. No functional change. --- diff --git a/src/position.cpp b/src/position.cpp index 50bb8e18..004d6994 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -1448,13 +1448,13 @@ bool Position::is_draw() const { if (CheckRepetition) { - int i = 4, e = std::min(st->rule50, st->pliesFromNull); + int i = 4, e = std::min(st->rule50, st->pliesFromNull), cnt; if (i <= e) { StateInfo* stp = st->previous->previous; - for (int cnt = 0; i <= e; i += 2) + for (cnt = 0; i <= e; i += 2) { stp = stp->previous->previous;