]> git.sesse.net Git - stockfish/commitdiff
Fix enum Value issue with gcc 4.4
authorMarco Costalba <mcostalba@gmail.com>
Tue, 19 Jan 2010 22:30:23 +0000 (23:30 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Tue, 19 Jan 2010 22:30:23 +0000 (23:30 +0100)
Louis Zulli reports a miscompile with g++-4.4 from MacPorts.

Namely enum Value is compiled as unsigned instead of signed integer
and this yields an issue in score_string() where float(v) is incorrectly
casted when Value v is negative.

This patch ensure that compiler choses a signed variable to store a Value.

No functional change.

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

index 364844555abead4ca5b79d62a819f024c6cad5a8..58fe3b6c1ae054190d6085ddd782ef1e04cdc213 100644 (file)
@@ -48,7 +48,8 @@ enum Value {
   VALUE_KNOWN_WIN = 15000,
   VALUE_MATE = 30000,
   VALUE_INFINITE = 30001,
-  VALUE_NONE = 30002
+  VALUE_NONE = 30002,
+  VALUE_ENSURE_SIGNED = -1
 };