]> git.sesse.net Git - stockfish/commitdiff
Allow Position::init() to be called more than once
authorMarco Costalba <mcostalba@gmail.com>
Fri, 10 Apr 2015 06:57:35 +0000 (08:57 +0200)
committerJoona Kiiski <joona.kiiski@gmail.com>
Fri, 10 Apr 2015 19:39:15 +0000 (20:39 +0100)
Currently Zobrist::castling[] are not properly zeroed
and rely on the compiler to do this at startup, but this
makes Position::init() to set different values every time
it is called!

This is a bit odd, and although not impacting normal usage,
can yield to subtle misbehaviour, very difficult to track
down, in case we happen to call it more than once for some
reason. I found this while developing tuning support and
it took me a while to track it down.

So properly init Zobrist::castling[]

No functional change.

Resolves #329


No differences found