]> git.sesse.net Git - stockfish/commitdiff
PawnInfo::clear() retire memset() and fix Ubuntu compile
authorMarco Costalba <mcostalba@gmail.com>
Wed, 4 Feb 2009 16:18:12 +0000 (17:18 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Wed, 4 Feb 2009 18:41:17 +0000 (19:41 +0100)
Go back to original direct assignment, this allows to
add an include in pawns.h to teach about memset()

This fix a compile error under Ubuntu.

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

index 75136c6fe6c0ed3c75f9af1daabe8b934e6029a9..7d3e92522c83b0f668cdd6262e90190609e4a27f 100644 (file)
@@ -121,9 +121,10 @@ inline bool PawnInfo::has_open_file_to_right(Color c, File f) const {
 
 inline void PawnInfo::clear() {
 
-  Key k = key;
-  memset(this, 0, sizeof(PawnInfo));
-  key = k;
+  passedPawns = EmptyBoardBB;
+  mgValue = egValue = 0;
+  ksStormValue[WHITE] = ksStormValue[BLACK] = 0;
+  qsStormValue[WHITE] = qsStormValue[BLACK] = 0;
   halfOpenFiles[WHITE] = halfOpenFiles[BLACK] = 0xFF;
 }