From 806c1d87233a98d52db16e4633b92884ce68fee9 Mon Sep 17 00:00:00 2001 From: Marco Costalba Date: Tue, 19 Jan 2010 23:30:23 +0100 Subject: [PATCH] Fix enum Value issue with gcc 4.4 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 --- src/value.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/value.h b/src/value.h index 36484455..58fe3b6c 100644 --- a/src/value.h +++ b/src/value.h @@ -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 }; -- 2.39.2